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 Grant Approval
      • POSTCreate Grant
      • GETRetrieve Grant
      • POSTRevoke Grant
      • POSTCreate Grant Alias
      • POSTStart Grant Link Flow
      • POSTGrant status updated
LogoLogo
ReferenceGrants

Create Grant Approval

POST
/v2/grants/approvals
POST
/v2/grants/approvals
$curl -X POST https://global-api-sandbox.afterpay.com/v2/grants/approvals \
> -H "User-Agent: User-Agent" \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "grants": [
> {
> "type": "ON_FILE"
> }
> ],
> "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 grant.
Was this page helpful?
Previous

Create Grant

Next
Built with

Authentication

AuthorizationBasic

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

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
grantslist of objectsRequired

Grant type for approval (only single grant is supported)

merchantobjectRequired
merchantReferencestringOptional<=128 characters
Merchant's unique reference for this grant
consumerobjectOptional
Consumer details for the grant

Response

OK
tokenstring
Token identifying this grant 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