> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.clearpay.co.uk/v-2/llms.txt
> - v1: https://developers.clearpay.co.uk/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.clearpay.co.uk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server.

# Draft Setup Billing Agreement Approval

> Set up a Billing Agreement ready for creation

A billing agreement is a contract between the merchant and the customer. Clearpay sets the agreement that authorises the merchant to create and pay for orders. This step sets up the Billing Agreement ready for it to be created.

The process starts with the following POST:

`POST /v2/billing-agreements/approvals`

This offers billing agreement terms to the customer for them to accept or reject. Assuming they accept the billing agreement terms, the flow continues. A sample request is:

```http
POST https://api-sandbox.afterpay.com/v2/billing-agreements/approvals HTTP/1.1
Host: api-sandbox.afterpay.com
Content-Type: application/json
Accept: application/json
```

Request Parameters

| Name | In   | Type                            | Required | Description |
| :--- | :--- | :------------------------------ | :------- | :---------- |
| body | body | BillingAgreementApprovalRequest | No       |             |

Example Request Body

```json
{
  "consumer": {
    "phoneNumber": "0400 000 000",
    "givenNames": "Joe",
    "surname": "Customer",
    "email": "test@example.com"
  },
  "agreements": [
    {
      "type": "BILLING",
      "merchantReference": "merchant-billing-agreement-1234",
      "pageUrl": "https://merchant.com/payment-methods"
    }
  ],
  "merchantReference": "merchant-payment-method-registration-1234",
  "merchant": {
    "redirectConfirmUrl": "http://merchant.com/confirm",
    "redirectCancelUrl": "http://merchant.com/cancel"
  }
}
```

Responses

| Status | Meaning | Description | Schema                |
| :----- | :------ | :---------- | :-------------------- |
| 200    | OK      | Sucessful   | CheckoutTokenResponse |

Example Responses

200 Response

```json
{
  "expires": "2019-08-24T14:15:22Z",
  "token": "003._7IgXzApNiRoxpEb04LbAFQShsvdE_H3",
  "redirectCheckoutUrl": "https://afterpay.com/checkout"
}
```

> **Warning - tokens**
>
> Recurring Payments needs two tokens. The token above is the Billing Agreement token. There is also a Checkout token. Do not confuse the two tokens.

> **Note**
>
> To handle the response, you must be authenticated by MerchantAuthentication.

Now the Billing Agreement is setup, you must create the Billing Agreement itself. See the [Create Billing Agreement](/draft-create-billing-agreement) topic for that information.

## Recurring Payments - More Information

* [Recurring Payments](/recurring-payments)
  * [Store Clearpay as a Payment Method](/store-clearpay-as-a-payment-method)
  * [Checkout and Store Clearpay as Payment Method](/checkout-and-store-clearpay-as-payment-method)
  * [Create Recurring Payment](/create-recurring-payment)
  * [Recurring Payments Flow](/draft-recurring-payments-flow)
  * [Create Billing Agreement](/draft-create-billing-agreement)
  * [Get Billing Agreement](/draft-get-billing-agreement)
  * [Cancel Billing Agreement](/draft-cancel-billing-agreement)
  * [Create Recurring Payment (Immediate Capture)](/draft-create-recurring-payment-immediate-capture)
  * [Authorise Recurring Payment (Deferred Capture)](/draft-authorise-recurring-payment-deferred-capture)