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.
Creates a new billing agreement from an order token.
*Deprecated. For new integrations, see [Grants](https://afterpay.docs.buildwithfern.com/afterpay-online-developer/api-reference/reference/grants/start-grant-approval).*
Creates a new billing agreement from an order token.
Basic authentication of the form Basic <base64(username:password)>.
Headers
User-AgentstringRequired
AcceptstringOptionalDefaults to application/json
Request
The request containing the details needed to create a billing agreement
tokenstringRequired
The token returned from the create approval request.
requestIdstringOptional<=64 characters
A unique request ID, required for idempotent retries. It is recommended that the merchant generate a UUID for each unique request.
merchantReferencestringOptional
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
Unique token identifying the agreement
typeenum
Type of agreement
Allowed values:
statusenum
Current status of the agreement
Allowed values:
createdstringformat: "date-time"
Timestamp when the agreement was created
merchantReferencestring or null
Merchant's reference for this agreement
cancelledstringformat: "date-time"
If present, indicates when the agreement was cancelled
expiresstringformat: "date-time"
If present, indicates when the agreement's status will become EXPIRED, preventing a client from using it to create payments