Skip to content

Set Shipping / Billing Address

Set the shipping or Billing address for a cart.

Authentication

This query supports both authenticated customers and guest users:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
  • Guest users: Provide the Guest Cart Token cartToken obtained from the Create Cart mutation.
Authorization: Bearer <accessToken>

Arguments

NameTypeRequiredDescription
billingFirstNameString✅ YesBilling first name
billingLastNameString✅ YesBilling last name
billingEmailString✅ YesBilling email address
billingAddressString✅ YesBilling street address
billingCityString✅ YesBilling city
billingCountryString✅ YesBilling country code (ISO 3166-1 alpha-2)
billingStateString✅ YesBilling state/province
billingPostcodeString✅ YesBilling postal/zip code
billingPhoneNumberString✅ YesBilling phone number
useForShippingBoolean❌ NoUse billing address for shipping (default: false)

Response

FieldTypeDescription
_idIntegerInternal address identifier
idStringAddress ID
successBooleanSuccess status
messageStringSuccess or error message
cartTokenStringCart token
billingFirstNameStringBilling first name
billingLastNameStringBilling last name
billingAddressStringBilling street address
billingCityStringBilling city
billingStateStringBilling state/province
billingPostcodeStringBilling postal/zip code
billingPhoneNumberStringBilling phone number
shippingFirstNameStringShipping first name (if useForShipping is true)
shippingLastNameStringShipping last name (if useForShipping is true)
shippingCityStringShipping city (if useForShipping is true)

Validation Rules

  • All required billing address fields must be provided
  • Country code must be valid (ISO 3166-1 alpha-2)
  • Email format must be valid
  • Phone number should be in valid format
  • Postal code format depends on country
  • When useForShipping is true, billing address is also used for shipping

Error Responses

json
{
  "errors": {
    "billingFirstName": ["The billing first name field is required."],
    "billingEmail": ["The billing email must be a valid email address."],
    "billingCountry": ["Invalid country code."]
  }
}

Released under the MIT License.