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.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Online API
    • API Environments
    • Direct Payment Flow
    • REST
    • HTTPS
    • Dates
    • Pagination
    • Authentication
    • Idempotent Requests
    • Timeouts
    • API Simulator
  • Models
    • Introduction
    • Contact Object
    • Consumer Object
    • Discount Object
    • Item Object
    • Money Object
    • Order Details Object
    • Payment Object
    • Refund Object
    • Shipping Courier Object
  • Service Status
    • GETPing
  • Configuration
    • GETGet Configuration
  • Orders
    • Introduction
    • GETGet Order
    • POSTCreate Order
  • Javascript afterpay.js
    • Information
    • Redirect Method
  • Payments
    • Introduction
    • POSTCapture Payment
    • PUTUpdate Shipping Courier
    • GETGet Payment By Order ID
    • GETGet Payment By Token
    • GETList Payment(s)
    • POSTCreate Refund
    • PUTUpdate Payment by Order ID
    • POSTReverse Payment By Token
  • Errors
    • Introduction
    • Get Errors
    • Put/Post Errors
  • Reference
      • POSTCapture Payment
      • POSTCreate Refund
      • GETGet Payment By Order ID
      • GETGet Payment By Token
      • GETList Payments
      • POSTReverse Payment
      • PUTUpdate Courier
      • PUTUpdate Payment
LogoLogo
ReferencePayments

Update Payment

PUT
https://global-api-sandbox.afterpay.com/v1/payments/:orderID/environment::environment
PUT
/v1/payments/:orderID/environment::environment
$curl -X PUT https://global-api-sandbox.afterpay.com/v1/payments/orderID/environment:environment \
> -H "User-Agent: User-Agent" \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "merchantReference": "new_merchan_order_id_1234"
>}'
1{}
This end point is for merchants that creates merchant side's order id after AfterPay order id creation. Merchants should call immediately after the AfterPay order is created in order to properly update with their order id that can be tracked.
Was this page helpful?
Previous

Create Order

Next
Built with

Authentication

AuthorizationBasic

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

Path parameters

environmentstringRequired

Use api-sandbox for AU/NZ, or api.us-sandbox for US.

orderIDstringRequired
The Order ID to update

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
merchantReferencestringRequiredDefaults to new_merchan_order_id_1234

The merchant’s new order id to replace with

Response

Returns object containing the following attributes:

AttributeTypeDescription
idstringThe unique Afterpay (merchant payment) payment Id
tokenstringCheckout token to be used to complete consumer checkout and payment.
statusstringAPPROVED (update is only valid for successful orders)
createdstring (ISO-8601)The payment creation time (ISO 8601 UTC/Zulu time).
originalAmountMoney objectTotal amount for the order.
openToCaptureAmountMoney objectTotal amount that can be captured for order.
paymentStatestringAvailable states: AUTH_APPROVED, CAPTURED, VOIDED, EXPIRED, AUTH_DECLINED, PARTIALLY_CAPTURED, CAPTURE_DECLINED`
merchantReferencestringThe merchant’s order id/reference that this payment corresponds to.
refundsRefund objectThe refund details for merchant’s order
orderDetailsOrder Details objectThe order bound to the payment.
eventsEvents objectEvent list for for merchant’s order.

Errors

404
Not Found Error