Assigns a specified billing address to a specified cart

POST /V1/carts/mine/billing-address

Assigns a specified billing address to a specified cart.

Body

  • address object Required

    Interface AddressInterface

    Hide address attributes Show address attributes object
    • id integer

      Id

    • region string Required

      Region name

    • region_id integer Required

      Region id

    • region_code string Required

      Region code

    • country_id string Required

      Country id

    • street array[string] Required

      Street

    • company string

      Company

    • telephone string Required

      Telephone number

    • fax string

      Fax number

    • postcode string Required

      Postcode

    • city string Required

      City name

    • firstname string Required

      First name

    • lastname string Required

      Last name

    • middlename string

      Middle name

    • prefix string

      Prefix

    • suffix string

      Suffix

    • vat_id string

      Vat id

    • customer_id integer

      Customer id

    • email string Required

      Billing/shipping email

    • same_as_billing integer

      Same as billing flag

    • customer_address_id integer

      Customer address id

    • save_in_address_book integer

      Save in address book flag

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\AddressInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • discounts array[object]

        Rule discount Interface

        Rule discount Interface

        Hide discounts attributes Show discounts attributes object
        • discount_data object Required

          Discount Data Interface

          Hide discount_data attributes Show discount_data attributes object
          • amount number Required

            Amount

          • base_amount number Required

            Base Amount

          • original_amount number Required

            Original Amount

          • base_original_amount number Required

            Base Original Amount

        • rule_label string Required

          Rule Label

        • rule_i_d integer Required

          Rule ID

      • gift_registry_id integer
      • pickup_location_code string
    • custom_attributes array[object]

      Interface for custom attribute value.

      Interface for custom attribute value.

      Hide custom_attributes attributes Show custom_attributes attributes object
      • attribute_code string Required

        Attribute code

      • value string Required

        Attribute value

  • useForShipping boolean

Responses

  • 200

    200 Success.

    Address ID.

  • 401

    401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • 400

    400 Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/carts/mine/billing-address
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/carts/mine/billing-address' \
 --data '{"address":{"id":42,"region":"string","region_id":42,"region_code":"string","country_id":"string","street":["string"],"company":"string","telephone":"string","fax":"string","postcode":"string","city":"string","firstname":"string","lastname":"string","middlename":"string","prefix":"string","suffix":"string","vat_id":"string","customer_id":42,"email":"string","same_as_billing":42,"customer_address_id":42,"save_in_address_book":42,"extension_attributes":{"discounts":[{"discount_data":{"amount":42.0,"base_amount":42.0,"original_amount":42.0,"base_original_amount":42.0},"rule_label":"string","rule_i_d":42}],"gift_registry_id":42,"pickup_location_code":"string"},"custom_attributes":[{"attribute_code":"string","value":"string"}]},"useForShipping":true}'
Request examples
{
  "address": {
    "id": 42,
    "region": "string",
    "region_id": 42,
    "region_code": "string",
    "country_id": "string",
    "street": [
      "string"
    ],
    "company": "string",
    "telephone": "string",
    "fax": "string",
    "postcode": "string",
    "city": "string",
    "firstname": "string",
    "lastname": "string",
    "middlename": "string",
    "prefix": "string",
    "suffix": "string",
    "vat_id": "string",
    "customer_id": 42,
    "email": "string",
    "same_as_billing": 42,
    "customer_address_id": 42,
    "save_in_address_book": 42,
    "extension_attributes": {
      "discounts": [
        {
          "discount_data": {
            "amount": 42.0,
            "base_amount": 42.0,
            "original_amount": 42.0,
            "base_original_amount": 42.0
          },
          "rule_label": "string",
          "rule_i_d": 42
        }
      ],
      "gift_registry_id": 42,
      "pickup_location_code": "string"
    },
    "custom_attributes": [
      {
        "attribute_code": "string",
        "value": "string"
      }
    ]
  },
  "useForShipping": true
}
Response examples (200)
42
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (400)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}