Checkout Billing Address

Checkout Billing Address

Add Checkout Billing Address

POST /checkouts/{checkoutId}/billing-address

Request

Adds a billing address to an existing checkout.

Required Fields

  • email
  • country_code

To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • checkoutId in path - string
    required
    ID of the checkout; the same as the cart ID.
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.

Body

object | application/json
  • first_name
    string

  • last_name
    string

  • company
    string

  • address1
    string

  • address2
    string

  • city
    string

  • state_or_province
    string

    Represents state or province.
  • state_or_province_code
    string

  • country_code
    string
    required

  • postal_code
    string

  • phone
    string

  • custom_fields
    array[object]

    You can retrieve custom fields from the Get Form Fields endpoint.
  • version
    integer

    The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.
    Example: 1

example

{
"first_name": "string",
"last_name": "string",
"email": "string",
"company": "string",
"address1": "string",
"address2": "string",
"city": "string",
"state_or_province": "string",
"state_or_province_code": "string",
"country_code": "string",
"postal_code": "string",
"phone": "string",
"custom_fields": [
{
"field_id": "string",
"field_value": "string"
}
],
"version": 1
}

Response

Body

object | application/json
  • data
    object

  • meta
    object

    Response metadata.

example

{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"cart": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"customer_id": 1,
"email": "user@example.com",
"currency": {
"code": "USD"
},
"base_amount": 5,
"channel_id": 0,
"discount_amount": 0.5,
"cart_amount_inc_tax": 4.14,
"cart_amount_ex_tax": 3.6,
"coupons": [
{
"code": "SHOPNOW",
"id": 1,
"coupon_type": "percentage_discount",
"discounted_amount": 0.9,
"display_name": "20% Off"
}
],
"discounts": [
{
"id": "5eba1f1e-0ec5-40f7-8058-f7b452c7237d",

Update Checkout Billing Address

PUT /checkouts/{checkoutId}/billing-address/{addressId}

Request

Updates an existing billing address on a checkout.

To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • checkoutId in path - string
    required
    ID of the checkout; the same as the cart ID.
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.
  • addressId in path - integer
    required

Body

object | application/json
  • first_name
    string

  • last_name
    string

  • company
    string

  • address1
    string

  • address2
    string

  • city
    string

  • state_or_province
    string

    Represents state or province.
  • state_or_province_code
    string

  • country_code
    string
    required

  • postal_code
    string

  • phone
    string

  • custom_fields
    array[object]

    You can retrieve custom fields from the Get Form Fields endpoint.
  • version
    integer

    The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.
    Example: 1

example

{
"first_name": "string",
"last_name": "string",
"email": "string",
"company": "string",
"address1": "string",
"address2": "string",
"city": "string",
"state_or_province": "string",
"state_or_province_code": "string",
"country_code": "string",
"postal_code": "string",
"phone": "string",
"custom_fields": [
{
"field_id": "string",
"field_value": "string"
}
],
"version": 1
}

Response

Body

object | application/json
  • data
    object

  • meta
    object

    Response metadata.

example

{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"cart": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"customer_id": 1,
"email": "user@example.com",
"currency": {
"code": "USD"
},
"base_amount": 5,
"channel_id": 0,
"discount_amount": 0.5,
"cart_amount_inc_tax": 4.14,
"cart_amount_ex_tax": 3.6,
"coupons": [
{
"code": "SHOPNOW",
"id": 1,
"coupon_type": "percentage_discount",
"discounted_amount": 0.9,
"display_name": "20% Off"
}
],
"discounts": [
{
"id": "5eba1f1e-0ec5-40f7-8058-f7b452c7237d",
Did you find what you were looking for?