> 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:
  /order-details-model-test:
    get:
      operationId: subpackageModels_get-order-details-model-test
      summary: Get Order-Details Model Test
      description: Order details schema
      tags:
        - subpackage_models
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Models_get-order-details-model-test_Response_200
tags:
  - name: subpackage_models
servers:
  - url: https://global-api-sandbox.afterpay.com
    description: Sandbox
  - url: https://global-api.afterpay.com
    description: Production
components:
  schemas:
    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
    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
    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
    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
    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
    Order-Details:
      type: object
      properties:
        consumer:
          $ref: '#/components/schemas/Consumer'
          description: The customer who placed or is placing the order.
        billing:
          $ref: '#/components/schemas/Contact'
          description: The customer's billing address.
        courier:
          $ref: '#/components/schemas/Shipping-Courier'
          description: The customer's chosen shipping courier.
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
          description: An array of order items.
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/Discount'
          description: An array of discounts.
        taxAmount:
          $ref: '#/components/schemas/Money'
          description: The included tax amount, after applying all discounts.
        shippingAmount:
          $ref: '#/components/schemas/Money'
          description: The shipping price charged to the customer.
      description: >-
        This comprehensive schema is designed to store an entire transaction's
        detail, covering crucial aspects like consumer information, billing and
        shipping details, courier particulars, item list, discounts, tax, and
        shipping amount.
      title: Order-Details
    Models_get-order-details-model-test_Response_200:
      type: object
      properties:
        order_details:
          $ref: '#/components/schemas/Order-Details'
      required:
        - order_details
      title: Models_get-order-details-model-test_Response_200

```

**`Example`**

```json Example
{
  "consumer": {
    "email": "test@example.com",
    "givenNames": "Joe",
    "surname": "Consumer",
    "phoneNumber": "0400 000 000"
  },
  "billing": {
    "name": "Joe Consumer",
    "line1": "Level 5",
    "line2": "390 Collins Street",
    "area1": "Melbourne",
    "region": "VIC",
    "postcode": "3000",
    "countryCode": "AU",
    "phoneNumber": "0400 000 000"
  },
  "courier": {
    "shippedAt": "2023-08-24T14:15:22Z",
    "name": "Australia Post",
    "tracking": "AA0000000000000",
    "priority": "STANDARD"
  },
  "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"
    }
  ],
  "discounts": [
    {
      "displayName": "New Customer Coupon",
      "amount": {}
    }
  ],
  "taxAmount": {
    "amount": "100.00",
    "currency": "AUD"
  },
  "shippingAmount": {
    "amount": "100.00",
    "currency": "AUD"
  }
}
```