{"openapi":"3.1.0","info":{"title":"Payments","version":"1.0.0"},"paths":{"/v2/payments":{"get":{"operationId":"list-payments","summary":"List Payments","description":"This endpoint retrieves a collection of payments along with their order details.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 20 |\n","tags":[""],"parameters":[{"name":"toCreatedDate","in":"query","description":"An inclusive end date and time to search, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.","required":false,"schema":{"type":"string","default":"2020-12-30"}},{"name":"fromCreatedDate","in":"query","description":"An inclusive start date and time to search, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.","required":false,"schema":{"type":"string","default":"2020-01-01"}},{"name":"tokens","in":"query","description":"One or more order tokens to search for.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"includeNextLink","in":"query","description":"Returns a modified pagination object which includes a URL to return the next page. The default value is false.","required":false,"schema":{"type":"boolean","default":false}},{"name":"ids","in":"query","description":"One or more Afterpay Order IDs to search for.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"merchantReferences","in":"query","description":"One or more Merchant Reference IDs to search for.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"statuses","in":"query","description":"One or more Afterpay Order Statuses to search for. Possible values include \"APPROVED\" and \"DECLINED\".","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"orderBy","in":"query","description":"A field to order results by. If provided, must be one of \"createdAt\", \"id\", \"totalAmount\", \"merchantReference\" or \"email\".","required":false,"schema":{"type":"string","default":"createdAt"}},{"name":"ascending","in":"query","description":"`true` to order results in ascending order, or `false` for descending order.","required":false,"schema":{"type":"boolean","default":false}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Returns the matching Payment objects, enclosed in a Pagination object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/list-payments_Response_200"}}}},"422":{"description":"An invalid query parameter was provided. For example, a value for `limit` was provided, but was less than 1 or more than 250. Error code `error`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"500":{"description":"This is usually caused by sending a `fromCreatedDate` or `toCreatedDate` in an invalid format. Please ensure the dash and colon characters are included, and any plus characters are URL-encoded. Also, for the array parameters (`ids`, `tokens`, `merchantReferences` and `statuses`), do not use comma-separated values or square brackets. Instead, include each parameter multiple times, as needed.","content":{"application/json":{"schema":{"description":"Any type"}}}}}}},"/v2/payments/auth":{"post":{"operationId":"auth","summary":"Auth","description":"This endpoint requests a payment auth, which determines the order approval status. If approved, the auth has an expiration date and time, which is returned in the events list for the \"AUTH_APPROVED\" payment event. Authorization expires after 13 days.\n\nThis operation is idempotent based on the `requestId` (if provided), which allows for the safe retry of multiple requests, guaranteeing the payment operation is only made once.\n\nThe customer's payment plan starts at the time of auth approval.\n\n**Note:** Authorization expires after 13 days and then the transaction is automatically voided. Voided transactions are frozen and cannot be reopened or changed in any way. In this case, use the `v2/checkouts` endpoint to create a new order.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"If the payment is approved by Afterpay, a Payment object is returned with a `status` of **APPROVED** and a `paymentState` of **AUTH_APPROVED**.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAuth"}}}},"402":{"description":"If payment is declined by Afterpay, for example, if invalid card details were entered, returns a Payment object in response, with a `status` of \"DECLINED\" and a `paymentState` of \"AUTH_DECLINED\". advise the customer to contact the Afterpay Customer Service team for more information.\n\nAs well, the following errorCodes are possible:\n| errorCode | Description |\n| --- | --- |\n| invalid_token | The checkout token is invalid, expired, or does not exist.\n","content":{"application/json":{"schema":{"description":"Any type"}}}},"412":{"description":"The customer has not confirmed their payment for the order associated with this token. Error code `invalid_order_transaction_status`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"The checkout token was missing or empty. Error code `invalid_object`.","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizePayment"}}}}}},"/v2/payments/capture":{"post":{"operationId":"capture-full-payment","summary":"Capture Full Payment","description":"This endpoint makes a payment capture for the full value of the payment plan.\n\nThis operation is idempotent based on the token, which allows for the safe retry of requests, guaranteeing the payment operation is only made once.\n\nSince the idempotency of this endpoint is based on the token, the inclusion of a `requestId` is not required.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"| Status | Description |\n| ----- | ----- |\n| `APPROVED` | If payment is approved by Afterpay, returns a Payment object in response, with a status of \"APPROVED\". |\n| `DECLINED` | If payment is declined by Afterpay, for example, if invalid card details were entered, returns a Payment object in response, with a status of \"DECLINED\". Please advise the customer to contact the Afterpay Customer Service team for more information. |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"402":{"description":"The checkout token is invalid, expired, or does not exist. Error code `invalid_token`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"412":{"description":"The Consumer has not confirmed their payment for the order associated with this token. Error code `invalid_order_transaction_status`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"The checkout token was missing or empty. Error code `invalid_object`.","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The token returned in the Create Checkout request."},"merchantReference":{"type":"string","description":"The merchant’s order id/reference that this payment corresponds to. This updates any value previously provided in the Create Checkout request."},"amount":{"$ref":"#/components/schemas/Money","description":"**Required for express checkout only.** Amount to be checked against the value in the create checkout request. If the amounts do not match, then the request is rejected and an error specific to this scenario is returned. "},"isCheckoutAdjusted":{"type":"boolean","description":"**Express checkout only.** The isCheckoutAdjusted field can be used to allow the order amount to be changed after the checkout flow."},"paymentScheduleChecksum":{"type":"string","description":"**Express checkout only.** A unique value representing the payment schedule that must be provided when there have been changes since the initial order creation (retrieved from checkout widget)."},"items":{"$ref":"#/components/schemas/Item","description":"**Express checkout only.** An array of order items that have been updated. Provide if it has changed since the initial order creation."},"shipping":{"$ref":"#/components/schemas/Contact","description":"**Express checkout only.** The shipping address if it has changed since the initial order creation. "},"enrichments":{"$ref":"#/components/schemas/Enrichments"},"grantId":{"type":"string","description":"The Afterpay or Cash App Pay on-file grant ID. Required when processing a payment using a previously stored on-file grant."}},"required":["token"]}}}}}},"/v2/payments/{orderId}":{"get":{"operationId":"get-payment-by-order-id","summary":"Get Payment By Order ID","description":"This endpoint retrieves an individual payment along with its order details.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 20 |\n","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The unique ID of the Afterpay Order, for which a Payment event has been completed.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Returns a Payment object in response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"404":{"description":"No Afterpay Order was found matching the `orderId` provided. Error code `not_found`.","content":{"application/json":{"schema":{"description":"Any type"}}}}}},"put":{"operationId":"update-payment-by-order-id","summary":"Update Payment by Order ID","description":"This endpoint is to create merchant side order ID's following the Afterpay order ID creation. Call the endpoint immediately after the Afterpay order is created.","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The Order ID to update","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"Returns object containing the following attributes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/update-payment-by-order-id_Response_201"}}}},"404":{"description":"The Afterpay payment ID to update was not found. Error code `not_found`.","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"merchantReference":{"type":"string","default":"new_merchant_order_id_1234","description":"The merchant’s new order ID to replace with"}},"required":["merchantReference"]}}}}}},"/v2/payments/{orderId}/capture":{"post":{"operationId":"capture-payment","summary":"Capture Payment","description":"This endpoint captures a full or partial payment. Any amounts successfully captured are settled from Afterpay to the merchant's nominated bank account on the following day. Records of all payments captured against an order are returned in the events list as events of type, \"CAPTURED\".\n\n**Note:** Authorization expires after 13 days and then the transaction is automatically voided. Voided transactions are frozen and cannot be captured, reopened or changed in any way. In this case your only option is to use the v2/checkouts endpoint to create a new order.\n\nThis operation is idempotent based on the `requestId` (if provided), which allows the safe retry of multiple requests. This safe retry guarantees the payment operation only occurs once.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The unique ID of the Afterpay Order, returned as the `id` property of the Auth response.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"If successful, returns an updated copy of the Payment object, with the newly captured payment appended to the `events` array as a Payment Event object with a `type` of \"CAPTURED\".","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"404":{"description":"No numeric `orderId` was provided, or an invalid string was provided. Error code `not_found`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"410":{"description":"Payment has already been fully captured for this order, or partially captured with the remainder voided. Error code `payment_captured`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"412":{"description":"| errorCode | Description |\n| --- | --- |\n| error | A numeric `orderId` was provided, but did not match any valid order. |\n| invalid_state | The order was declined by Afterpay; no payment can be captured for this order. |\n| payment_voided | The auth for this order has already been completely voided. |\n| payment_expired | The auth for this order has expired; no further payment can be captured. |\n","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"| errorCode | Description |\n| --- | --- |\n| invalid_object | The `amount` was missing or invalid, or the `paymentEventMerchantReference` exceeded 128 characters. |\n| invalid_amount | The `amount` was less than the minimum capture amount, or more than the `openToCaptureAmount`. |\n","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapturePayment"}}}}}},"/v2/payments/{orderId}/courier":{"put":{"operationId":"update-shipping-courier","summary":"Update Shipping Courier","description":"This endpoint updates an order with shipping courier information. The Afterpay team may use this information when providing support.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 20 |\n","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The unique Afterpay Order ID to update.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"$ref":"#/components/schemas/V2PaymentsOrderIdCourierPutParametersAccept"}}],"responses":{"200":{"description":"Returns a Payment object in response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"412":{"description":"No Afterpay Order was found matching the `orderId` provided. Error code `precondition_failed`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"A value for shippedAt was provided, but not a valid [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date. Or, a value for priority was provided, but wasn't one of \"STANDARD\" or \"EXPRESS\". Error code `invalid_object`.","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipping-Courier"}}}}}},"/v2/payments/{orderId}/refund":{"post":{"operationId":"create-refund","summary":"Create Refund","description":"This endpoint performs a full or partial refund. The refund operation is idempotent if a unique `requestId` and `merchantReference` are provided.\n\nIf using the Deferred Payment Flow, be aware that only captured funds can be refunded. Do not create refunds after 120 days from the date of purchase.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The unique Afterpay Order ID to apply the refund to.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"Returns a Refund object in response. All request parameters are echoed in the response. In addition, the response includes the following:\n| Attribute | Type | Description |\n| --- | --- | --- |\n| `refundId` | string | The unique, permanent, Afterpay-generated Refund ID. |\n| `refundedAt` | string | The UTC timestamp of when the refund was completed, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. |\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}}},"412":{"description":"The `orderId` is invalid, does not exist, or is not eligible for a refund. For example, the order was declined. Error code `precondition_failed`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"| errorCode | Description |\n| --- | --- |\n| invalid_object | The `refundMerchantReference` exceeded 128 characters. |\n| invalid_amount | The `amount` requested exceeded the amount available. |\n| invalid_object | The currency of the refund does not match the currency of the order (and the Merchant account). |\n| refund_timelimit_exceeded | The refund exceeds the time limit of 120 days. |\n","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefund"}}}}}},"/v2/payments/{orderId}/void":{"post":{"operationId":"void-payment","summary":"Void","description":"This endpoint voids the remaining `openToCapture` amount of the payment auth, and refunds the customer.\n\n\n To make a partial void, specify an amount in the request body.\n\n\nThis operation is idempotent based on the `requestId` (if provided), which allows for the safe retry of multiple requests, guaranteeing the payment operation is only made once.\n\n\n\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"orderId","in":"path","description":"The unique ID of the Afterpay Order, returned as the `id` property of the Auth response.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"201":{"description":"If successful, returns an updated copy of the Payment object.\n- A new Payment Event object is appended to the events array, with a type of \"VOIDED\".\n- A new Refund object is prepended to the refunds array.\n- If the openToCapture amount is reduced to zero as a result of this Void request, the paymentState is updated as follows:\n - from \"AUTH_APPROVED\" to \"VOIDED\", or\n - from \"PARTIALLY_CAPTURED\" to \"CAPTURED\".\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"404":{"description":"The `orderId` string provided was empty or did not match a valid order. Error code `not_found`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"The amount in USD has exceeded the open-to-capture amount in USD. Example message: \"Void amount USD 999.00 exceeded open to capture amount USD 40.00.\" Error code `invalid_amount`.\n","content":{"application/json":{"schema":{"description":"Any type"}}}}},"requestBody":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Money","description":"The amount to void. Must be less than or equal to the open to capture amount."},"requestId":{"type":"string","description":"A unique request ID, required for safe retries. It is recommended that the merchant generate a UUID for each unique void."},"reason":{"type":"string","description":"Can be passed in void requests to conditionally modify wording of the corresponding customer refund email. This can be set to 1 of 3 values, `cancelledItems`, `amountAdjustment` or `null`"}}}}}}}},"/v2/payments/token:{token}":{"get":{"operationId":"get-payment-by-token","summary":"Get Payment By Token","description":"This endpoint retrieves an individual payment along with its order details.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 20 |\n","tags":[""],"parameters":[{"name":"token","in":"path","description":"Order token that was used to complete payment.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Returns a Payment object in response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"404":{"description":"No Afterpay Order was found matching the `token` provided. Error code `not_found`.","content":{"application/json":{"schema":{"description":"Any type"}}}}}}},"/v2/payments/token:{token}/reversal":{"post":{"operationId":"reverse-payment-by-token","summary":"Reverse Payment By Token","description":"This endpoint makes a reversal of the checkout that is used to start the Afterpay payment process. This cancels the order asynchronously as soon as it is created without the need of an additional call to the void endpoint. For a payment to be eligible, the order must be in an Auth-Approved or Captured state, and it must be issued within 10 minutes of the order being created.\n\n**Connection Timeouts**\n| Timeout | Time (Seconds) |\n|---------|----------------|\n| Open | 10 |\n| Read | 70 |\n","tags":[""],"parameters":[{"name":"token","in":"path","description":"The token of the checkout to be reversed (voided).","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Basic authentication","required":true,"schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":false,"schema":{"type":"string","default":"application/json"}}],"responses":{"204":{"description":"The Reversal endpoint indicates a successful response with a 204 status code response. Returns no content in the response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reverse-payment-by-token_Response_204"}}}},"402":{"description":"Invalid Token. Error code `invalid_token`.","content":{"application/json":{"schema":{"description":"Any type"}}}},"412":{"description":"| errorCode | Description |\n| --- | --- |\n| precondition_failed | Payment reversal previously processed |\n| precondition_failed | Payment not eligible for a reversal |\n| precondition_failed | Order outside reversal window |\n| precondition_failed | Order in pending reversal, no captures/auth accepted |\n","content":{"application/json":{"schema":{"description":"Any type"}}}}}}}},"servers":[{"url":"https://global-api-sandbox.afterpay.com","description":"Sandbox"},{"url":"https://global-api.afterpay.com","description":"Production"}],"components":{"schemas":{"PaymentStatus":{"type":"string","enum":["APPROVED","DECLINED"],"description":"represents the status of the order","title":"PaymentStatus"},"MoneyCurrency":{"type":"string","enum":["AUD","NZD","USD","CAD","GBP"],"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"}},"required":["amount","currency"],"description":"Object containing amount and currency","title":"Money"},"PaymentPaymentState":{"type":"string","enum":["AUTH_APPROVED","AUTH_DECLINED","PARTIALLY_CAPTURED","CAPTURED","CAPTURE_DECLINED","VOIDED"],"description":"is the current state for capturing payments","title":"PaymentPaymentState"},"Refund":{"type":"object","properties":{"requestId":{"type":"string","description":"Unique ID required for safe retries. Max length 64 (varchar)."},"amount":{"$ref":"#/components/schemas/Money"},"merchantReference":{"type":"string","description":"The merchant’s internal refund id/reference. This must be included along with the `requestId` to utilise idempotency. Max length 85 (varchar)."},"refundMerchantReference":{"type":"string","description":"A unique reference for the individual refund event. Max length 128 (varchar)."},"refundId":{"type":"string","description":"The unique, permanent, Afterpay-generated Refund ID."},"refundedAt":{"type":"string"}},"description":"To guarantee safe retries, the merchant should offer their refund ID or reference, aligning with their internal records\n\nUnique values for the `requestID` and `merchantReference` are required to guarantee safe retries. It is recommended that the merchant generates a UUID for each unique refund request.\n\nThe `refundMerchantReference` is a unique reference that when provided, will appear in the daily settlement file as \"Payment Event Id\". In most cases, this would hold the same value as the `merchantReference`.\n","title":"Refund"},"Consumer":{"type":"object","properties":{"email":{"type":"string","format":"email"},"givenNames":{"type":"string","description":"The consumer's first name"},"surname":{"type":"string","description":"The consumer's last name"},"phoneNumber":{"type":"string"}},"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 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"},"line1":{"type":"string","description":"First line of the address"},"line2":{"type":"string","description":"Second line of the address "},"area1":{"type":"string","description":"- AU: Suburb\n- NZ: Town or City\n- UK: Postal Town\n- US: City\n- Canada: City"},"area2":{"type":"string","description":"- NZ: suburb\n- UK: village or local area."},"region":{"type":"string","description":"- AU: State \n- NZ: Region\n- UK: County\n- US: State\n- CA: Province or Territory"},"postcode":{"type":"string"},"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. \n\nThe `line2` and `area2` fields provide additional space for extended addresses, while `phoneNumber` can be used to store the user's contact number.\n\n\n\n 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 \n\n","title":"Contact"},"ShippingCourierPriority":{"type":"string","enum":["STANDARD","EXPRESS"],"title":"ShippingCourierPriority"},"Shipping-Courier":{"type":"object","properties":{"shippedAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"tracking":{"type":"string"},"priority":{"$ref":"#/components/schemas/ShippingCourierPriority"}},"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](https://www.iso.org/iso-8601-date-and-time-format.html) for date and time representations.\n\nThe `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.\n\nThe `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.\n\nThe `priority` field tracks the shipping speed or service level associated with the delivery. ","title":"Shipping-Courier"},"Item":{"type":"object","properties":{"name":{"type":"string"},"sku":{"type":"string"},"pageUrl":{"type":"string"},"imageUrl":{"type":"string"},"quantity":{"type":"integer"},"price":{"$ref":"#/components/schemas/Money"},"categories":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"estimatedShipmentDate":{"type":"string","format":"date"},"preorder":{"type":"boolean","default":false}},"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.\n\n It is crucial that the `price.amount` represents the unit price of the individual item.\n **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.\n\n","title":"Item"},"Discount":{"type":"object","properties":{"displayName":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"}},"description":"Discount applied to an order","title":"Discount"},"Order-Details":{"type":"object","properties":{"consumer":{"$ref":"#/components/schemas/Consumer"},"billing":{"$ref":"#/components/schemas/Contact"},"courier":{"$ref":"#/components/schemas/Shipping-Courier"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/Discount"}},"taxAmount":{"$ref":"#/components/schemas/Money"},"shippingAmount":{"$ref":"#/components/schemas/Money"}},"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"},"PaymentEventType":{"type":"string","enum":["AUTH_APPROVED","AUTH_DECLINED","CAPTURED","CAPTURE_DECLINED","VOIDED","EXPIRED"],"title":"PaymentEventType"},"Payment-Event":{"type":"object","properties":{"id":{"type":"string"},"created":{"type":"string"},"expires":{"type":"string"},"type":{"$ref":"#/components/schemas/PaymentEventType"},"amount":{"$ref":"#/components/schemas/Money"},"paymentEventMerchantReference":{"type":"string"}},"description":"Each payment event has a unique ID, creation timestamp, and type (e.g., \"AUTH_APPROVED\", \"AUTH_DECLINED\"). For \"AUTH_APPROVED\" events, an expiration timestamp is provided. The \"payment event merchant reference\" field, which can be used for payment capture events","title":"Payment-Event"},"Payment":{"type":"object","properties":{"id":{"type":"string","description":"The unique, permanent, Afterpay generated Order ID."},"token":{"type":"string","description":"The token obtained from the checkout call"},"status":{"$ref":"#/components/schemas/PaymentStatus","description":"represents the status of the order"},"created":{"type":"string","description":" is the UTC timestamp of when the payment was completed."},"originalAmount":{"$ref":"#/components/schemas/Money"},"openToCaptureAmount":{"$ref":"#/components/schemas/Money"},"paymentState":{"$ref":"#/components/schemas/PaymentPaymentState","description":"is the current state for capturing payments"},"merchantReference":{"type":"string","description":"is the merchant's order id/reference that the payment corresponds to."},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}},"orderDetails":{"$ref":"#/components/schemas/Order-Details"},"events":{"type":"array","items":{"$ref":"#/components/schemas/Payment-Event"}}},"description":"Describes the schema for a (read-only) payment object","title":"Payment"},"list-payments_Response_200":{"type":"object","properties":{"totalResults":{"type":"integer","description":"Total number of results"},"offset":{"type":"integer","description":"The offer of the pagination"},"limit":{"type":"integer","description":"The number of payments to include in the results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}},"title":"list-payments_Response_200"},"InitiationActor":{"type":"string","enum":["CUSTOMER","MERCHANT"],"description":"The party who initiated the order","title":"InitiationActor"},"Initiation":{"type":"object","properties":{"actor":{"$ref":"#/components/schemas/InitiationActor","description":"The party who initiated the order"}},"required":["actor"],"title":"Initiation"},"SubscriptionType":{"type":"string","enum":["FIXED","VARIABLE"],"title":"SubscriptionType"},"SubscriptionInterval":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"title":"SubscriptionInterval"},"Subscription":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/SubscriptionType"},"interval":{"$ref":"#/components/schemas/SubscriptionInterval"},"intervalCount":{"type":"integer"}},"title":"Subscription"},"Enrichments":{"type":"object","properties":{"initiation":{"$ref":"#/components/schemas/Initiation","description":"Who initiated the order"},"subscription":{"$ref":"#/components/schemas/Subscription","description":"Metadata on the subscription details"}},"required":["initiation"],"title":"Enrichments"},"AuthorizePayment":{"type":"object","properties":{"requestid":{"type":"string","format":"uuid","description":"A unique request ID, required for idempotent retries. We recommend that merchants generate a Universally Unique Identifier (UUID) for each unique request."},"token":{"type":"string"},"merchantReference":{"type":"string","description":"The reference/order ID that this payment corresponds to in the merchant's system.\n\n**Note:** Providing a new value updates any value previously set in the Create Checkout request."},"amount":{"$ref":"#/components/schemas/Money","description":"**Required for express checkout only.** Amount to be checked against the value in the create checkout request. If the amounts do not match, then the request is rejected and an error specific to this scenario is returned."},"isCheckoutAdjusted":{"type":"boolean","description":"**Express checkout only.** The isCheckoutAdjusted field can be used to allow the order amount to be changed after the checkout flow. Used for express checkout."},"paymentScheduleChecksum":{"type":"string","description":"**Express checkout only.** A unique value representing the payment schedule that must be provided when there has been changes since the initial order creation (retrieved from checkout widget)."},"items":{"type":"array","items":{"description":"Any type"},"description":"**Express checkout only.** An array of order items that have been updated to be provided if it has changed since the initial order creation."},"shipping":{"$ref":"#/components/schemas/Contact","description":"**Express checkout only.** The shipping address if it has changed since the initial order creation."},"enrichments":{"$ref":"#/components/schemas/Enrichments"},"grantId":{"type":"string","description":"The Afterpay or Cash App Pay on-file grant ID. Required when processing a payment using a previously stored on-file grant."}},"required":["token"],"title":"AuthorizePayment"},"PaymentAuthStatus":{"type":"string","enum":["APPROVED","DECLINED"],"description":"represents the status of the order","title":"PaymentAuthStatus"},"PaymentAuthPaymentState":{"type":"string","enum":["AUTH_APPROVED","AUTH_DECLINED","PARTIALLY_CAPTURED","CAPTURED","CAPTURE_DECLINED","VOIDED"],"description":"is the current state for capturing payments","title":"PaymentAuthPaymentState"},"PaymentAuth":{"type":"object","properties":{"id":{"type":"string","description":"The unique, permanent, Afterpay generated Order ID."},"token":{"type":"string","description":"The token obtained from the checkout call"},"status":{"$ref":"#/components/schemas/PaymentAuthStatus","description":"represents the status of the order"},"created":{"type":"string","description":" is the UTC timestamp of when the payment was completed."},"originalAmount":{"$ref":"#/components/schemas/Money"},"openToCaptureAmount":{"$ref":"#/components/schemas/Money"},"paymentState":{"$ref":"#/components/schemas/PaymentAuthPaymentState","description":"is the current state for capturing payments"},"merchantReference":{"type":"string","description":"is the merchant's order id/reference that the payment corresponds to."},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}},"orderDetails":{"$ref":"#/components/schemas/Order-Details"},"events":{"type":"array","items":{"$ref":"#/components/schemas/Payment-Event"}}},"description":"Describes the schema for a (read-only) payment object","title":"PaymentAuth"},"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOriginalAmount":{"type":"object","properties":{},"description":"Total amount for the order. See Money.","title":"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOriginalAmount"},"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOpenToCaptureAmount":{"type":"object","properties":{},"description":"Total amount that can be captured for order. See Money.","title":"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOpenToCaptureAmount"},"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaRefunds":{"type":"object","properties":{},"description":"The refund details for merchant's order. See Refund.","title":"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaRefunds"},"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOrderDetails":{"type":"object","properties":{},"description":"The order bound to the payment. See Order Details.","title":"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOrderDetails"},"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaEvents":{"type":"object","properties":{},"description":"Event list for for merchant's order. See Events.","title":"V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaEvents"},"update-payment-by-order-id_Response_201":{"type":"object","properties":{"id":{"type":"string","description":"The unique Afterpay (merchant payment) payment ID."},"token":{"type":"string","description":"Checkout token to be used to complete customer checkout and payment."},"status":{"type":"string","description":"\\\"APPROVED\" (update is only valid for successful orders)"},"created":{"description":"The payment creation time [ISO 8601 UTC/Zulu time](https://www.iso.org/iso-8601-date-and-time-format.html)."},"originalAmount":{"$ref":"#/components/schemas/V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOriginalAmount","description":"Total amount for the order. See Money."},"openToCaptureAmount":{"$ref":"#/components/schemas/V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOpenToCaptureAmount","description":"Total amount that can be captured for order. See Money."},"paymentState":{"type":"string","description":"Available states: \"AUTH_APPROVED\", \"CAPTURED\", \"VOIDED\", \"EXPIRED\", \"AUTH_DECLINED\", \"PARTIALLY_CAPTURED\", \"CAPTURE_DECLINED\"\""},"merchantReference":{"description":"Any type"},"refunds":{"$ref":"#/components/schemas/V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaRefunds","description":"The refund details for merchant's order. See Refund."},"orderDetails":{"$ref":"#/components/schemas/V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaOrderDetails","description":"The order bound to the payment. See Order Details."},"events":{"$ref":"#/components/schemas/V2PaymentsOrderIdPutResponsesContentApplicationJsonSchemaEvents","description":"Event list for for merchant's order. See Events."}},"title":"update-payment-by-order-id_Response_201"},"CapturePayment":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","description":"A unique request ID, required for idempotent retries."},"merchantReference":{"type":"string","description":"The reference/order ID that this payment corresponds to in the merchant's system.\n\nNote: Providing a new value updates any value previously set in the Create Checkout request."},"amount":{"$ref":"#/components/schemas/Money"},"paymentEventMerchantReference":{"type":"string","description":"A unique reference for the individual payment capture event. If provided, the value appears in the daily settlement file as \"Payment Event ID\"\n"}},"title":"CapturePayment"},"V2PaymentsOrderIdCourierPutParametersAccept":{"type":"string","enum":["application/json"],"title":"V2PaymentsOrderIdCourierPutParametersAccept"},"CreateRefund":{"type":"object","properties":{"requestId":{"type":"string","description":"Unique ID required for safe retries. Max length 64 (varchar)."},"amount":{"$ref":"#/components/schemas/Money"},"merchantReference":{"type":"string","description":"The merchant’s internal refund id/reference. This must be included along with the `requestId` to utilise idempotency. Max length 85 (varchar)."},"refundMerchantReference":{"type":"string","description":"A unique reference for the individual refund event. Max length 128 (varchar)."}},"description":"To guarantee safe retries, the merchant should offer their refund ID or reference, aligning with their internal records\n\nUnique values for the `requestID` and `merchantReference` are required to guarantee safe retries. It is recommended that the merchant generates a UUID for each unique refund request. \n\nThe `refundMerchantReference` is a unique reference that when provided, will appear in the daily settlement file as \"Payment Event Id\". In most cases, this would hold the same value as the `merchantReference`.\n","title":"CreateRefund"},"reverse-payment-by-token_Response_204":{"type":"object","properties":{},"description":"Empty response body","title":"reverse-payment-by-token_Response_204"}},"securitySchemes":{"sec0":{"type":"http","scheme":"basic"}}}}