Create Billing Agreement

Creates a new billing agreement from an order token.

Deprecated. For new integrations, see Grants.

post/v2/billing-agreements

Request

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

Headers

User-Agentstring required
Accept'application/json' required

Request body

requestIdstring

A unique request ID, required for idempotent retries. It is recommended that the merchant generate a UUID for each unique request.

tokenstring required

The token returned from the create approval request.

merchantReferencestring

The reference order id that this payment corresponds to in the merchant's system. Note: Providing a new value will update any value previously set in the Create Checkout request.

Response

Billing agreement created successfully

tokenstring required

Unique token identifying the agreement

type'BILLING' required

Type of agreement

status'ACTIVE' | 'CANCELLED' | 'EXPIRED' | 'PENDING_RENEWAL' | 'PENDING_RENEWAL_EXPIRED' required

Current status of the agreement

merchantReferencestring

Merchant's reference for this agreement

createdstring date-time required

Timestamp when the agreement was created

cancelledstring date-time

If present, indicates when the agreement was cancelled

expiresstring date-time

If present, indicates when the agreement's status will become EXPIRED, preventing a client from using it to create payments

requestIdstring

Unique identifier for the request

consumerReferencestring

Reference identifier for the consumer

emailstring

Masked email address of the consumer

Changes

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