For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GuidesAPI Reference
GuidesAPI Reference
  • Reference
    • Introduction
      • GETList Payments
      • POSTAuth
      • POSTCapture Full Payment
      • GETGet Payment By Order ID
      • PUTUpdate Payment by Order ID
      • POSTCapture Payment
      • PUTUpdate Shipping Courier
      • POSTCreate Refund
      • POSTVoid
      • GETGet Payment By Token
      • POSTReverse Payment By Token
LogoLogo
ReferencePayments

Update Payment by Order ID

PUT
/v2/payments/:orderId
PUT
/v2/payments/:orderId
$curl -X PUT https://global-api-sandbox.afterpay.com/v2/payments/orderId \
> -H "User-Agent: User-Agent" \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "merchantReference": "new_merchant_order_id_1234"
>}'
1{
2 "id": "string",
3 "token": "string",
4 "status": "string",
5 "created": null,
6 "originalAmount": {},
7 "openToCaptureAmount": {},
8 "paymentState": "string",
9 "merchantReference": null,
10 "refunds": {},
11 "orderDetails": {},
12 "events": {}
13}
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.
Was this page helpful?
Previous

Capture Payment

Next
Built with

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

orderIdstringRequired
The Order ID to update

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
merchantReferencestringRequiredDefaults to new_merchant_order_id_1234

The merchant’s new order ID to replace with

Response

Returns object containing the following attributes.
idstring

The unique Afterpay (merchant payment) payment ID.

tokenstring
Checkout token to be used to complete customer checkout and payment.
statusstring

“APPROVED” (update is only valid for successful orders)

createdany

The payment creation time ISO 8601 UTC/Zulu time.

originalAmountobject
Total amount for the order. See Money.
openToCaptureAmountobject
Total amount that can be captured for order. See Money.
paymentStatestring

Available states: “AUTH_APPROVED”, “CAPTURED”, “VOIDED”, “EXPIRED”, “AUTH_DECLINED”, “PARTIALLY_CAPTURED”, “CAPTURE_DECLINED""

merchantReferenceany
refundsobject
The refund details for merchant's order. See Refund.
orderDetailsobject
The order bound to the payment. See Order Details.
eventsobject
Event list for for merchant's order. See Events.

Errors

404
Not Found Error