> 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 Create Billing Agreement

> Create a Billing Agreement once it has been setup

A billing agreement is a contract between you the merchant, and the customer. The agreement authorises you to create and pay for orders. This step creates the Billing Agreement once the customer has asked for the Billing Agreement.

The process starts with the following POST:

`POST /v2/billing-agreements`

This finalises the Billing Agreement after the Billing Agreement has been approved by the customer. A sample request is:

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

Request Parameters

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

Example Request Body

```json
{
  "requestId": "259380f5-a9ac-4607-b987-d9c4baa34f83",
  "token": "ltqdpjhbqu3veqikk95g7p3fhvcchfvtlsiobah3u4l5nln8gii9",
  "merchantReference": "merchantOrderId-1234"
}
```

Responses

| Status | Meaning | Description | Schema    |
| :----- | :------ | :---------- | :-------- |
| 200    | OK      | Successful  | Agreement |

Example Responses

200 Response

```json
{
  "token": "_7IgXzApNiRoxpEb04LbAFQShsvdE_H3",
  "type": "BILLING",
  "status": "ACTIVE",
  "merchantReference": "merchant-billing-agreement-1234",
  "created": "2021-04-16T02:49:04.740Z",
  "cancelled": null,
  "expires": null
}
```

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

Now the Billing Agreement is created, the next task is to send it where it is needed. See the [Get Billing Agreement](/draft-get-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)
  * [Setup Billing Agreement Approval](/draft-setup-billing-agreement-approval)
  * [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)