> This page is for Afterpay Online Developer, version Main (default).
> For other versions, use one of these documentation indexes:
> - Main (default): https://developers.afterpay.com/afterpay-online-developer/main/llms.txt
> - v1: https://developers.afterpay.com/afterpay-online-developer/v-1/llms.txt
> - Chinese: https://developers.afterpay.com/afterpay-online-developer/chinese/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.afterpay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.afterpay.com/_mcp/server.

### Schema (`response.body`)

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /checkout-request-schema-test:
    get:
      operationId: subpackageSchemas_get-checkout-request-schema-test
      summary: Get Checkout-Request Schema Test
      description: Schema for creating a checkout request
      tags:
        - subpackage_schemas
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Schemas_get-checkout-request-schema-test_Response_200
tags:
  - name: subpackage_schemas
servers:
  - url: https://global-api-sandbox.afterpay.com
    description: Sandbox
  - url: https://global-api.afterpay.com
    description: Production
components:
  schemas:
    MoneyCurrency:
      type: string
      enum:
        - AUD
        - NZD
        - USD
        - CAD
        - GBP
      description: >-
        The currency in ISO 4217 format. The value provided must correspond to
        the currency of the merchant account making the request.
      title: MoneyCurrency
    Money:
      type: object
      properties:
        amount:
          type: string
          description: >-
            The amount as a string representation of a decimal number, rounded
            to 2 decimal places.
        currency:
          $ref: '#/components/schemas/MoneyCurrency'
          description: >-
            The currency in ISO 4217 format. The value provided must correspond
            to the currency of the merchant account making the request.
      required:
        - amount
        - currency
      description: "Object containing amount and currency.\n\nWhere a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a **422 Unprocessable Entity response**. The following is a list of common examples:\n\n|Example|\terrorCode|\tmessage|\n|---|---|---|\n|`amount` is omitted or null\t|invalid_object\t|{Money object}.amount Amount field required|\n|`amount` has more than 2 decimal places\t| invalid_object\tamount| must be a valid ISO 4217 format value|\n|`amount` includes a thousands separator comma, for example: \"1,000\"\t|invalid_amount\t|Amount must be a valid ISO 4217 format value|\n|`amount` is not a decimal number, for example: \"FREE\", \"$2\" or an empty string\t|invalid_object|\t{Money object}.amount Amount field must be a valid ISO 4217 format value|\n|`currency` is omitted or null\t|invalid_object|\t{Money object}.currency Currency field required|\n|`currency` is not a valid currency code, not all uppercase or an empty string\t|invalid_object|\t{Money object}.currency Currency not supported for this merchant|\n|`currency` is supported by Afterpay, but not valid for the Merchant account\t|unsupported_currency\t|An error occurred|"
      title: Money
    Consumer:
      type: object
      properties:
        email:
          type: string
          format: email
          maxLength: 128
        givenNames:
          type: string
          maxLength: 128
          description: The consumer's first name
        surname:
          type: string
          maxLength: 128
          description: The consumer's last name
        phoneNumber:
          type: string
          maxLength: 32
      required:
        - email
      description: >-
        The consumer data model is used for gathering essential user
        information. It captures details such as the individual's first name,
        represented by `givenNames`, and their last name, captured under
        `surname`. In addition, it stores the user's contact number under
        `phoneNumber` and their email address under `email`. These fields
        collectively provide indispensable contact and identification details
        for a user.
      title: Consumer
    ContactCountryCode:
      type: string
      enum:
        - AU
        - NZ
        - US
        - CA
        - GB
      title: ContactCountryCode
    Contact:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        line1:
          type: string
          maxLength: 128
          description: First line of the address
        line2:
          type: string
          maxLength: 128
          description: 'Second line of the address '
        area1:
          type: string
          maxLength: 128
          description: |-
            - AU: Suburb
            - NZ: Town or City
            - UK: Postal Town
            - US: City
            - Canada: City
        area2:
          type: string
          maxLength: 128
          description: |-
            - NZ: suburb
            - UK: village or local area.
        region:
          type: string
          maxLength: 128
          description: |-
            - AU: State 
            - NZ: Region
            - UK: County
            - US: State
            - CA: Province or Territory
        postcode:
          type: string
          maxLength: 128
        countryCode:
          $ref: '#/components/schemas/ContactCountryCode'
        phoneNumber:
          type: string
          description: >-
            The phone number, in [E.123](https://en.wikipedia.org/wiki/E.123)
            format.
      required:
        - name
        - line1
        - area1
        - region
        - postcode
        - countryCode
      description: >
        This data model is used for storing an individual's contact information.
        Mandatory fields such as **name**, **line1**, **area1**, **region**,
        **postcode**, and **countryCode** help in capturing vital information
        about a user's location. 


        The `line2` and `area2` fields provide additional space for extended
        addresses, while `phoneNumber` can be used to store the user's contact
        number.


        <Warning title="Important Note">
          The `area1`, `area2` and `region` properties feature localized terminology based on country. Refer to the property descriptions for insights on each country's specific usage 
        </Warning>
      title: Contact
    CheckoutRequestMerchant:
      type: object
      properties:
        redirectConfirmUrl:
          type: string
          description: >-
            The URL the consumer is redirected to after confirming payment.
            Required for redirect.
        redirectCancelUrl:
          type: string
          description: >-
            The URL the consumer is redirected to after cancelling payment.
            Required for redirect.
        popupOriginUrl:
          type: string
          description: >-
            The URL location from which Afterpay is initiated. Required for
            popup, including Express Checkout.
        name:
          type: string
          description: >-
            The merchant name displayed in the Afterpay checkout flow,
            confirmation & refund emails, and the consumer portal
      description: >-
        The URLs required depend on the checkout flow:

        - To use popup, `merchant.popupOriginUrl` must be provided.

        - To use redirect, `merchant.redirectConfirmUrl` and
        `merchant.redirectCancelUrl` must be provided.
      title: CheckoutRequestMerchant
    Item:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          description: Product name
        sku:
          type: string
          description: Product SKU. Limited to 128 characters.
        pageUrl:
          type: string
          maxLength: 2048
        imageUrl:
          type: string
          maxLength: 2048
          description: >-
            A URL for a web-optimized photo of the item, suitable for use
            directly as the src attribute of an img tag.
        quantity:
          type: integer
        price:
          $ref: '#/components/schemas/Money'
        categories:
          type: array
          items:
            type: array
            items:
              type: string
          description: >-
            An array of arrays to accommodate multiple categories that apply to
            the item. Each array represents a hierarchical path to a category,
            with the left-most category being the top-level parent category.
        estimatedShipmentDate:
          type: string
          format: date
          description: >-
            The estimated date when the order will be shipped, in YYYY-MM or
            YYYY-MM-DD format.
        preorder:
          type: boolean
          default: false
          description: >-
            If this item is not expected to be fulfilled immediately, and
            therefore should be marked as a preorder at checkout, set to `true`.
            Set to `false` otherwise.
      required:
        - name
        - quantity
        - price
      description: >
        This data model is used to store crucial product details. The
        `price.amount` field represents the unit price of the individual item.
        The `quantity` field shows the number of units of the item. The `name`
        field denotes the name of the product, while `sku` holds the Stock
        Keeping Unit identifier. 100 is the maximum number of item objects in
        the items array.

        <Warning title="Important Note">

          It is crucial that the `price.amount` represents the unit price of the individual item.
          **Never** populate the `price.amount` by multiplying the quantity by the unit cost. Always enter the price for a single unit to maintain data accuracy.
        </Warning>
      title: Item
    ShippingCourierPriority:
      type: string
      enum:
        - STANDARD
        - EXPRESS
      description: The shipping priority.
      title: ShippingCourierPriority
    Shipping-Courier:
      type: object
      properties:
        shippedAt:
          type: string
          format: date-time
          description: The date and time when the order was shipped, in ISO 8601 format.
        name:
          type: string
          maxLength: 128
          description: 'The name of the courier. '
        tracking:
          type: string
          maxLength: 128
          description: The tracking number provided by the courier.
        priority:
          $ref: '#/components/schemas/ShippingCourierPriority'
          description: The shipping priority.
      description: >-
        Essential information for tracking a shipment. The `shippedAt` key
        represents the date and time when the item was shipped. This value
        follows the ISO 8601 standard format for date and time representations.


        The `name` field indicates the courier service employed to handle the
        shipment (e.g. FEDEX, UPS). For orders that are picked up in-store (also
        known as Buy-Online-Pickup-Instore), please use "INSTORE_PICKUP" as the
        `name` field value.


        The `tracking` key represents a unique tracking number provided by the
        courier service to monitor the shipment's progress. It's a valuable tool
        for customers and businesses to track and trace their packages.


        The `priority` field tracks the shipping speed or service level
        associated with the delivery. 
      title: Shipping-Courier
    Discount:
      type: object
      properties:
        displayName:
          type: string
          description: A display name for the discount. Limited to 128 characters.
        amount:
          $ref: '#/components/schemas/Money'
          description: The discount amount.
      description: A discount applied to an order.
      title: Discount
    AgreementType:
      type: string
      enum:
        - BILLING
      description: The type of agreement. Currently supports "BILLING".
      title: AgreementType
    Agreement:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AgreementType'
          description: The type of agreement. Currently supports "BILLING".
        merchantReference:
          type:
            - string
            - 'null'
          maxLength: 255
          description: A merchant-provided reference for the agreement.
      required:
        - type
      description: List of agreements to create at checkout
      title: Agreement
    CheckoutRequestCustom:
      type: object
      properties: {}
      description: >-
        Additional data depending on the goods and services you provide to
        customers.
      title: CheckoutRequestCustom
    CheckoutRequestMode:
      type: string
      enum:
        - express
        - standard
      default: standard
      description: 'Must be set to `express` to enable express checkout. '
      title: CheckoutRequestMode
    Checkout-Request:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/Money'
        consumer:
          $ref: '#/components/schemas/Consumer'
        merchantReference:
          type: string
        billing:
          $ref: '#/components/schemas/Contact'
        shipping:
          $ref: '#/components/schemas/Contact'
        merchant:
          $ref: '#/components/schemas/CheckoutRequestMerchant'
          description: >-
            The URLs required depend on the checkout flow:

            - To use popup, `merchant.popupOriginUrl` must be provided.

            - To use redirect, `merchant.redirectConfirmUrl` and
            `merchant.redirectCancelUrl` must be provided.
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        courier:
          $ref: '#/components/schemas/Shipping-Courier'
        taxAmount:
          $ref: '#/components/schemas/Money'
        shippingAmount:
          $ref: '#/components/schemas/Money'
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/Discount'
        agreements:
          type: array
          items:
            $ref: '#/components/schemas/Agreement'
          description: List of agreements
        custom:
          $ref: '#/components/schemas/CheckoutRequestCustom'
          description: >-
            Additional data depending on the goods and services you provide to
            customers.
        mode:
          $ref: '#/components/schemas/CheckoutRequestMode'
          description: 'Must be set to `express` to enable express checkout. '
        description:
          type: string
          deprecated: true
      required:
        - amount
        - consumer
        - merchant
      description: Individual Checkout
      title: Checkout-Request
    Schemas_get-checkout-request-schema-test_Response_200:
      type: object
      properties:
        checkout_request:
          $ref: '#/components/schemas/Checkout-Request'
      required:
        - checkout_request
      title: Schemas_get-checkout-request-schema-test_Response_200

```

**`Example`**

```json Example
{
  "amount": {
    "amount": "100.00",
    "currency": "AUD"
  },
  "consumer": {
    "email": "test@example.com",
    "givenNames": "Joe",
    "surname": "Consumer",
    "phoneNumber": "0400 000 000"
  },
  "merchantReference": "string",
  "billing": {
    "name": "Joe Consumer",
    "line1": "Level 5",
    "line2": "390 Collins Street",
    "area1": "Melbourne",
    "region": "VIC",
    "postcode": "3000",
    "countryCode": "AU",
    "phoneNumber": "0400 000 000"
  },
  "shipping": {
    "name": "Joe Consumer",
    "line1": "Level 5",
    "line2": "390 Collins Street",
    "area1": "Melbourne",
    "region": "VIC",
    "postcode": "3000",
    "countryCode": "AU",
    "phoneNumber": "0400 000 000"
  },
  "merchant": {
    "redirectConfirmUrl": "https://example.com/checkout/confirm",
    "redirectCancelUrl": "https://example.com/checkout/cancel",
    "popupOriginUrl": "https://merchant.com/cart",
    "name": "string"
  },
  "items": [
    {
      "name": "Blue Carabiner",
      "sku": "12341234",
      "quantity": 1,
      "pageUrl": "https://merchant.example.com/carabiner-354193.html",
      "imageUrl": "https://merchant.example.com/carabiner-7378-391453-1.jpg",
      "price": {
        "amount": "40.00",
        "currency": "AUD"
      },
      "categories": [
        [
          "Sporting Goods",
          "Climbing Equipment",
          "Climbing",
          "Climbing Carabiners"
        ],
        [
          "Sale",
          "Climbing"
        ]
      ],
      "estimatedShipmentDate": "2023-08-01"
    }
  ],
  "courier": {
    "shippedAt": "2023-08-24T14:15:22Z",
    "name": "Australia Post",
    "tracking": "AA0000000000000",
    "priority": "STANDARD"
  },
  "taxAmount": {
    "amount": "100.00",
    "currency": "AUD"
  },
  "shippingAmount": {
    "amount": "100.00",
    "currency": "AUD"
  },
  "discounts": [
    {
      "displayName": "New Customer Coupon",
      "amount": {}
    }
  ],
  "agreements": [
    {
      "type": "BILLING",
      "merchantReference": "merchant-order-12345"
    }
  ],
  "custom": {},
  "mode": "standard",
  "description": "string"
}
```