canonical: https://jentic.com/apis/afterpay.com/afterpay

# Afterpay API

Jentic publishes the only available OpenAPI specification for Afterpay API, keeping it validated and agent-ready. Afterpay (also branded Clearpay in the UK) is a buy-now-pay-later checkout service that splits a purchase into four interest-free instalments. The API covers the full BNPL flow: creating checkouts, authorising and capturing orders, processing refunds, exchanging configuration data with the merchant platform, handling disputes, and managing post-purchase grants and adjustments.

## For AI agents

Create Afterpay/Clearpay checkouts, capture and refund BNPL orders, manage disputes, and exchange merchant configuration for buy-now-pay-later commerce.

## Scope

Does not handle traditional card processing, recurring subscriptions, or general invoicing - use for buy-now-pay-later checkout, capture, refund, and dispute flows only.

## Capabilities

- Create a BNPL checkout token redeemable on the Afterpay-hosted payment page
- Authorise and capture an Afterpay order against a completed checkout
- Issue full or partial refunds on a captured Afterpay order
- Submit and track dispute responses including evidence files
- Exchange merchant configuration and product mapping data with the Afterpay platform
- Manage post-purchase grants for retroactive credits and adjustments
- Look up the current Afterpay service status before kicking off high-volume checkouts

## Use cases

### BNPL Checkout for E-Commerce

Online retailers add Afterpay as a checkout option so shoppers can split a purchase into four interest-free instalments. The merchant calls POST /v2/checkouts with the cart total and shopper details, redirects the buyer to the Afterpay-hosted page, then captures the order on completion. Typical conversion lift on eligible carts is in the 10-20% range and integration takes a few days.

Example prompt: Create an Afterpay checkout for a $249 USD cart with the shopper's billing details and return the redirect URL for the hosted page

### Order Capture and Refund Operations

Once a shopper completes the Afterpay checkout, the merchant captures the order to take the funds, and later issues partial or full refunds when goods are returned. The Orders and Payments endpoints expose the same lifecycle a card processor does - authorise, capture, refund - but settled against Afterpay's instalment ledger rather than a card network.

Example prompt: Capture an authorised Afterpay order by token and then issue a $50 partial refund when the customer returns one item

### Dispute Handling Automation

Afterpay merchants face chargebacks and customer disputes that require evidence submission within tight windows. The Disputes endpoints let an integration list open cases, fetch the response template, and submit evidence (proof of delivery, communications) programmatically - replacing manual portal work that often misses deadlines.

Example prompt: List all Afterpay disputes opened in the last 14 days and submit standard delivery-proof evidence on each one before the response deadline

### AI Agent BNPL Operations

Through Jentic, an agent can manage Afterpay operations - quoting checkouts, capturing orders, issuing refunds, and watching disputes - without holding the merchant's basic auth credentials directly. Jentic isolates the credential per call, returning a structured response the agent can reason over.

Example prompt: Search Jentic for 'create afterpay checkout', load the schema for POST /v2/checkouts, and execute it for a $99 USD test cart

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v2/checkouts | Create a checkout token for the BNPL flow |
| GET | /v2/checkouts/{token} | Retrieve the status of a checkout |
| GET | /v2/configuration | Fetch merchant configuration |
| GET | /v2/configuration/mappings | List merchant product mappings |

## Key resources

- **Checkouts** — Create and look up BNPL checkout tokens
- **Orders** — Authorise, capture, and inspect Afterpay orders
- **Payments** — Capture funds and issue refunds against orders
- **Disputes** — Manage chargebacks and dispute evidence
- **Configuration** — Merchant configuration and product mappings
- **Grants** — Post-purchase credits and adjustments
- **Service Status** — Real-time service availability

## Why Jentic

- **Setup:** Wiring the Afterpay API by hand means setting up its basic-auth scheme, choosing the live or sandbox host, and coding your own logic across the buy-now-pay-later checkout flow. Through Jentic you install once, import the Afterpay API from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** Afterpay puts the checkout token in the URL path for reads (/v2/checkouts/{token}), so a rule can pin the agent to reading a specific checkout, while creation takes its input in the body. You choose which operations are in the allowed set, so checkout creation is not included unless you add it.
- **Credential handling:** Your Afterpay merchant id and secret are stored once, encrypted, by your own Jentic One instance as basic-auth credentials and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a buy-now-pay-later checkout', and Jentic returns the matching Afterpay operation with its parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Affirm API** — US-focused BNPL provider with longer-term financing options alongside split-pay.
- **Stripe API** — General-purpose payments platform that can route Afterpay alongside cards and wallets.
- **PayPal Invoicing API** — PayPal offers Pay Later as part of its checkout for merchants already on PayPal.
- **Shopify Admin API** — Storefront platform that often hosts the cart Afterpay is checking out.

## FAQ

### Why is there no official OpenAPI spec for Afterpay API?

Afterpay does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Afterpay API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Afterpay API use?

Afterpay uses HTTP Basic authentication with a merchant ID as the username and a secret as the password, encoded into the Authorization header. Through Jentic, the basic credential is stored encrypted in the vault and injected at execution time.

### Can I issue refunds with the Afterpay API?

Yes. After capturing an order, use the Payments endpoints to issue a full or partial refund on the captured amount. Refunds settle against the original instalment plan rather than going back to a card.

### What are the rate limits for the Afterpay API?

Afterpay's public spec does not include hard rate limits. Plan for a few requests per second per merchant in steady state and back off on HTTP 429. Spike traffic for sale events is best paced with a queue in front of /v2/checkouts.

### How do I create a checkout through Jentic?

Search Jentic for 'create afterpay checkout', load the schema for POST /v2/checkouts, and execute the call with the cart total and shopper details. Jentic returns the checkout token so your storefront can redirect the buyer to the Afterpay-hosted page.

### Is the Afterpay API free to use?

The API itself is free for merchants under contract with Afterpay/Clearpay. The cost model is a per-transaction merchant fee, set in the merchant agreement, plus regional VAT where applicable.

### Can I limit what my agent is allowed to do with the Afterpay API?

Yes. Because you run Jentic One yourself, your own rules decide which Afterpay operations and credentials the agent may use, and you choose which operations are in the allowed set. Since checkout reads put the token in the URL path at /v2/checkouts/{token}, a rule can pin the agent to reading one specific checkout while checkout creation, which takes its input in the request body, stays out of the allowed set unless you add it. That lets you grant capture, refund, and dispute operations to the agent without ever exposing checkout creation.
