Capture Full Payment

This endpoint performs a payment capture for the full value of the payment plan.

<Note title="Note">

This operation is idempotent based on the token, which allows for the safe retry of requests, guaranteeing the payment operation is only performed once.

Since the idempotency of this endpoint is based on the token, the inclusion of a requestId is not required. </Note>

Approved Response (201)

If payment is approved by Clearpay, returns a Payment object in response, with a status of "APPROVED".

Declined Response (201)

If payment is declined by Clearpay, for example, if invalid card details were entered, returns a Payment object in response, with a status of "DECLINED".

Please advise the consumer to contact the Clearpay Customer Service team for more information.

Connection Timeouts

  • Open timeout: 10 seconds
  • Read timeout: 70 seconds

Errors

In addition to the PUT/POST Errors applicable to all POST endpoints, the following errors are specific to Capture Full Payment:

HTTP Status CodeerrorCodeDescription
402 <br />Payment Requiredinvalid_tokenThe checkout token is invalid, expired, or does not exist.
412 <br />Precondition Failedinvalid_order_transaction_statusThe Consumer has not confirmed their payment for the order associated with this token.
422 <br />Unprocessable Entityinvalid_objectThe checkout token was missing or empty.
post/v2/payments/capture

Request

  • Base URL: https://global-api-sandbox.afterpay.com
  • URL: https://global-api-sandbox.afterpay.com/v2/payments/capture
  • Auth: HTTP basic

Headers

User-Agentstring required
Acceptstring

Request body

tokenstring required

The token returned in the Create Checkout request.

merchantReferencestring

The merchant’s order id/reference that this payment corresponds to. This will update any value previously provided in the Create Checkout request.

Response

Payment Approved or Declined - Returns a Payment object

idstring required

The unique, permanent, Clearpay-generated Order ID.

tokenstring required

Checkout token that was used to complete payment.

status'APPROVED' | 'DECLINED' required

An order status of "APPROVED" or "DECLINED".

createdstring date-time required

The UTC timestamp of when the payment was completed, in ISO 8601 format.

paymentState'AUTH_APPROVED' | 'AUTH_DECLINED' | 'PARTIALLY_CAPTURED' | 'CAPTURED' | 'CAPTURE_DECLINED' | 'VOIDED' required

Current state for capturing payments.

merchantReferencestring required

The merchant's order id/reference that this payment corresponds to.

Changes

No recorded changes to this operation across all 1 revision of this API.