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
  • Reference
    • Introduction
      • POSTCreate Billing Agreement
      • POSTCreate Billing Agreement Alias
      • POSTStart Billing Agreement Approval Process
      • PUTCancel Billing Agreement (Alternative)
      • POSTRetrieve Billing Agreement Offers
      • POSTRetrieve Billing Agreement
      • POSTStart Billing Agreement Link Flow
      • GETGet Billing Agreement Details
      • DELCancel Billing Agreement
      • POSTCapture Full Recurring Payment
      • POSTAuthorize Recurring Payment
LogoLogo
ReferenceBilling Agreements (Deprecated)

Start Billing Agreement Approval Process

POST
/v2/billing-agreements/approvals
POST
/v2/billing-agreements/approvals
$curl -X POST https://global-api-sandbox.afterpay.com/v2/billing-agreements/approvals \
> -H "User-Agent: User-Agent" \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "merchant": {
> "redirectConfirmUrl": "https://example.com/approval/confirm",
> "redirectCancelUrl": "https://example.com/approval/cancel"
> }
>}'
1{
2 "token": "ba_approval_xyz789abc123",
3 "expires": "2024-03-05T22:13:45Z",
4 "redirectCheckoutUrl": "https://portal.afterpay.com/us/checkout/ba-approval?token=ba_approval_xyz789abc123"
5}
Initiates the approval process for a new billing agreement. *Deprecated. For new integrations, see [Grants](https://afterpay.docs.buildwithfern.com/afterpay-online-developer/api-reference/reference/grants/start-grant-approval).*
Was this page helpful?
Previous

Cancel Billing Agreement (Alternative)

Next
Built with

Initiates the approval process for a new billing agreement.

Deprecated. For new integrations, see Grants.

Authentication

AuthorizationBasic

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

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

The billing agreement approval request details
merchantobjectRequired
consumerobjectOptional
Consumer details for the billing agreement
merchantReferencestringOptional<=128 characters
Merchant's unique reference for this billing agreement
agreementslist of objectsOptional

Agreement type for approval (only single agreement is supported)

Response

The consumer approved the billing agreement
tokenstring
Token identifying this billing agreement approval request
expiresstringformat: "date-time"
When this approval request expires
redirectCheckoutUrlstringformat: "uri"
URL where the consumer should be redirected to complete approval

Errors

401
Unauthorized Error
403
Forbidden Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error