> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/recurring-payments.md).

# Recurring Payments

Recurring Payments lets you take a payment method once on Coda’s Hosted Payment Page, keep that instrument on file with the customer’s consent, and charge it again from your own backend whenever *you* decide to bill — renewals, top-ups, or unscheduled charges — without Coda running a subscription calendar for you.

You keep control of schedule, retries, and entitlement. Coda handles the customer-present save, scheme-compliant reuse, and a secure Token Charge API so later payments complete with the shopper absent, using the same Init, notification, and Inquiry path you already know.

{% hint style="danger" %}
This product is currently available for card payments only. Support for alternative payment methods will be expanded in the future
{% endhint %}

#### Integration Assumptions

This documentation assumes that scheduling and subscription lifecycle management are handled on the client side. This includes:

* Plan creation and pricing
* Billing intervals and scheduling
* Cancellations and status management

{% hint style="info" %}
Coda does **not** schedule recurrences, manage subscriptions, or decide when to bill. Your backend decides **when** to charge. Coda provides:

1. A customer-present **Init / Hosted Payment Page** flow that can save a card for later reuse (**CIT-for-MIT**).
2. A server-to-server **Token Charge** API for later charges with the customer absent (**MIT**).
   {% endhint %}

#### Key Capabilities

The Recurring Payments product provides the following core capabilities:

* Account Binding With First Charge: Allows you to save a payment method while simultaneously completing an initial charge.
* User-Initiated & Merchant-Initiated Payments: Supports both real-time payments authorized by users (on-session) and payments initiated by the merchant for subscriptions (off-session).

### Before you start

Recurring Payments needs a few things set up by Coda before your first request. Ask your Coda account manager to complete the following for **each title (project)** and **each environment** (Sandbox and Production):

| Item                                                                       | Needed for                        | What happens if it is missing        |
| -------------------------------------------------------------------------- | --------------------------------- | ------------------------------------ |
| Off-session reuse enabled for the title                                    | Init with `offSessionReuse: true` | Init returns `103`                   |
| Token Charge enabled for the title                                         | Token Charge                      | Token Charge is rejected             |
| HMAC signing secret and `kid`                                              | Token Charge (JWT signature)      | Token Charge returns `103`           |
| Your server egress IPs on the allowlist                                    | Token Charge                      | Token Charge returns `214`           |
| Complete Notification URL configured in the Publisher Portal (per country) | Webhooks                          | You never receive `paymentMethod.id` |

> **Note:** The IP allowlist and HMAC secret are checked in Sandbox too. If you test from a developer laptop, that laptop's public IP must be on the Sandbox allowlist.

### How the flow fits together

| Step                                | Direction          | What happens                                                                          |
| ----------------------------------- | ------------------ | ------------------------------------------------------------------------------------- |
| 1. Init (account binding)           | Your server → Coda | Start a payment that saves the card for later reuse. You get a `redirectUrl`.         |
| 2. Hosted Payment Page              | Shopper → Coda     | Shopper enters card details and gives consent to save the card and to future charges. |
| 3. Webhooks                         | Coda → your server | `PAYMENT_METHOD_ADDED` and the payment result. Store `paymentMethod.id`.              |
| 4. Token Charge                     | Your server → Coda | Charge the saved card with the shopper absent. Returns `431` (processing).            |
| 5. Payment result webhook / Inquiry | Coda → your server | Final result of the charge.                                                           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coda.co/codapay/recurring-payments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
