> For the complete documentation index, see [llms.txt](https://developers.doku.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.doku.com/flexibill/account-billing/billing-recurring-registration.md). Agents can also search and read this documentation through its [MCP server](https://developers.doku.com/~gitbook/mcp).

# Billing Recurring Registration

The Recurring Registration API enables merchants to onboard customers into automated recurring billing cycles (e.g., subscriptions, utility bills, or memberships).

<figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FB6ECaLI3KMQcUZ7MnUzx%2Fimage.png?alt=media&amp;token=d701708d-e590-4fb7-8038-44f9f087bc8b" alt=""><figcaption></figcaption></figure>

#### Workflow Breakdown

1. **Registration & Schedule Setup**: The merchant server sends a `POST` request containing order parameters, customer details, and recurring schedule rules (`executeType`, `executeDate`, `executeMonth`) to DOKU.
2. **Checkout Page Generation**: Upon successful validation, DOKU returns a unique `paymentLink`.
3. **Customer Binding & Verification**: The merchant redirects the customer to `paymentLink` to select a payment method (Credit Card or Direct Debit) and authorize the initial binding/payment.
   * If `useOrderAmount: true`, the initial checkout processes the first actual cycle payment.
   * If `useOrderAmount: false`, DOKU conducts a minimal verification transaction (e.g., Rp 10,000 / RM 2.00) that is immediately refunded to validate the Source of Fund (SoF).
4. **Execution & Webhooks**: Depending on `billType` and schedule, DOKU executes subsequent charges automatically or queries the merchant for updated amounts. After each attempt, DOKU sends an asynchronous HTTP POST webhook to notify the merchant's system.

### 1. Overview & Endpoint

| **Parameter**       | **Details**                                                        |
| ------------------- | ------------------------------------------------------------------ |
| HTTP Method         | `POST`                                                             |
| Sandbox Endpoint    | <https://api-sandbox.doku.com/ab-core-api/v1/billing-registration> |
| Production Endpoint | <https://api-doku.doku.com/ab-core-api/v1/billing-registration>    |
| Content-Type        | `application/json`                                                 |
| Authentication      | Bearer Token / HMAC Signature                                      |

#### Header Requirements

Header signatures must follow the DOKU standard as  bellow:

<https://developers.doku.com/get-started-with-doku-api/signature-component/non-snap/signature-component-from-request-header>

```
Client-Id: MCH-0001-XXXXXXXXXXXXXXXX
Request-Id: cc682442-6c22-493e-8121-b9ef6b3fa728
Request-Timestamp: 2026-08-11T08:45:42Z
Request-Target: /ab-core-api/v1/billing-registration
Digest: 5WIYK2TJg6iiZ****************zJIma3Ufli5s=
```

### 2. Request Payload Specification

#### Request Example

JSON

```json
{
  "order": {
    "amount": 10000,
    "invoiceNumber": "INV20260800001",
    "currency": "IDR",
    "language": "ID",
    "disableRetryPayment": true,
    "lineItems": [
      {
        "id": "TAGBAAS",
        "name": "Subscription Plan",
        "quantity": 1,
        "price": 10000,
        "category": "Services",
        "url": "https://example.com/item",
        "imageUrl": "https://example.com/item.png",
        "type": "Digital"
      }
    ],
    "additionalData": {
      "billInvoiceNumber": "BILLLAGI020"
    }
  },
  "payment": {
    "paymentDueDate": 1140,
    "useOrderAmount": true
  },
  "customer": {
    "id": "CID0002",
    "name": "Tester",
    "lastName": "Customer",
    "phone": "0812345670000",
    "email": "testerbiller@dokutest.com"
  },
  "recurring": {
    "billNumber": "0212540000",
    "billDetail": "Monthly Subscription",
    "billType": "BILLING_PAYMENT",
    "startDate": "2026-08-31T00:00:00Z",
    "endDate": "2026-12-31T07:23:00Z",
    "executeType": "DATE",
    "executeDate": "01,06,14,21,28",
    "executeMonth": "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC",
    "flatStatus": true
  },
  "url": {
    "redirectPageSuccess": "https://merchant.com/success",
    "redirectPageFail": "https://merchant.com/error",
    "autoredirectPage": false
  }
}
```

#### Parameter Reference

**`order` Object**

| **Field**             | **Type** | **Required** | **Description**                                                  |
| --------------------- | -------- | ------------ | ---------------------------------------------------------------- |
| `amount`              | Number   | Mandatory    | Total transaction amount.                                        |
| `invoiceNumber`       | String   | Mandatory    | Unique merchant transaction ID.                                  |
| `currency`            | String   | Mandatory    | ISO 4217 currency code (e.g., `IDR`).                            |
| `language`            | String   | Optional     | Language code (`ID`, `EN`).                                      |
| `disableRetryPayment` | Boolean  | Optional     | Disables automatic retry on payment failure.                     |
| `lineItems`           | Array    | Optional     | List of itemized transaction line items.                         |
| `additionalData`      | Object   | Mandatory    | Additional merchant metadata (must contain `billInvoiceNumber`). |

**`payment` Object**

| **Field**        | **Type** | **Required** | **Description**                                                                                                                                                                                     |
| ---------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `paymentDueDate` | Number   | Mandatory    | Due duration in minutes/days.                                                                                                                                                                       |
| `useOrderAmount` | Boolean  | Mandatory    | <p><code>true</code>: Charges the actual <code>order.amount</code> for the initial payment.</p><p><br></p><p><code>false</code>: Charges Rp 10,000 for verification and immediately refunds it.</p> |

**`customer` Object**

| **Field**  | **Type** | **Required** | **Description**                |
| ---------- | -------- | ------------ | ------------------------------ |
| `id`       | String   | Mandatory    | Merchant's unique customer ID. |
| `name`     | String   | Mandatory    | First name.                    |
| `lastName` | String   | Optional     | Last name.                     |
| `phone`    | String   | Mandatory    | Mobile phone number.           |
| `email`    | String   | Mandatory    | Active email address.          |

**`recurring` Object**

| **Field**      | **Type**   | **Required** | **Description**                                                                                                                                                                                                              |
| -------------- | ---------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `billNumber`   | String(32) | Mandatory    | Merchant's unique bill identifier.                                                                                                                                                                                           |
| `billDetail`   | String     | Optional     | Bill description.                                                                                                                                                                                                            |
| `billType`     | String     | Mandatory    | `BILLING_PAYMENT` (uses FLEXIBILL inquiry) or `PAYMENT` (merchant inquiry/no inquiry).                                                                                                                                       |
| `startDate`    | ISO 8601   | Mandatory    | Recurring schedule start date (`YYYY-MM-DDTHH:mm:ssZ`).                                                                                                                                                                      |
| `endDate`      | ISO 8601   | Mandatory    | Recurring schedule end date.                                                                                                                                                                                                 |
| `executeType`  | String     | Mandatory    | `FULLDATE`, `DATE`, or `DAY`.                                                                                                                                                                                                |
| `executeDate`  | String     | Mandatory    | <p>Rules depending on <code>executeType</code>:</p><p>• <code>FULLDATE</code>: Format <code>YYYYMMDD</code></p><p>• <code>DATE</code>: Ex. <code>"01,15"</code></p><p>• <code>DAY</code>: Ex. <code>"SUN,MON,TUE"</code></p> |
| `executeMonth` | String     | Conditional  | Mandatory if `executeType` is `DATE` or `DAY` (e.g., `"JAN,FEB,MAR"`). Null for `FULLDATE`.                                                                                                                                  |
| `flatStatus`   | Boolean    | Mandatory    | <p>(For <code>billType = PAYMENT</code>):<br></p><p><code>true</code>: Fixed amount from request.</p><p></p><p><code>false</code>: Dynamic amount fetched via merchant inquiry.</p>                                          |

**`url` Object**

| **Field**             | **Type** | **Required** | **Description**                                                               |
| --------------------- | -------- | ------------ | ----------------------------------------------------------------------------- |
| `redirectPageSuccess` | String   | Mandatory    | Merchant URL for successful payment.                                          |
| `redirectPageFail`    | String   | Mandatory    | Merchant URL for failed payment.                                              |
| `autoredirectPage`    | Boolean  | Mandatory    | `true` to automatically redirect after payment; `false` to stay on DOKU page. |

### 3. Response Specifications

#### Success Response (`200 OK`)

JSON

```
{
  "code": "success",
  "type": "success",
  "message": "Success",
  "paymentLink": "https://api-uat.doku.com/checkout-link-v2/da919a1716964d6e923e45756bc3be0d20264702164708419"
}
```

#### Error Response

JSON

```
{
  "error": {
    "code": "invalid_request_error",
    "type": "invalid_request_error",
    "message": "Bill Number already registered"
  }
}
```

### 4. Webhook Notification

DOKU sends an `HTTP POST` request formatted as `application/x-www-form-urlencoded` to notify the merchant upon payment completion.

#### Webhook Configuration

1. Log in to the DOKU Merchant Dashboard.<br>

   <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FvOkgZHKvewb2nfqOdcZw%2Fimage.png?alt=media&amp;token=63349cb1-39c3-48d9-a6d6-fe71b407ee28" alt=""><figcaption></figcaption></figure>
2. Navigate to Bill Details Setting.<br>

   <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FXGpXMC1jnUsSRM8u6m0F%2Fimage.png?alt=media&amp;token=309de9ef-32f9-41cf-8aee-449aafaed882" alt=""><figcaption></figcaption></figure>
3. Click "Edit".<br>

   <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FVaKEuIfXUrKMuObPgXWP%2Fimage.png?alt=media&amp;token=e3aa4d20-ec0a-4acb-9aea-9c8ac1d8163d" alt=""><figcaption></figcaption></figure>
4. Input your webhook endpoint URL on the "URL Notification" field, and click "Save".<br>

   ![](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2Frw7JSzWXjxoJREKmUEBn%2FPasted%20image%202026-11-11%2008.34.01.png?alt=media\&token=2ea302fa-1a09-40b6-bc52-fb1f05339d55)

#### Sample Webhook Request

Bash

```json
curl -X POST "https://example-merchant.com/payment/notify" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "RESULTMSG=SUCCESS" \
  -d "MALLID=1092" \
  -d "CHAINMERCHANT=0" \
  -d "WORDS=d474b88bc11425e40e61ec27ee2ec15e9ebd1234" \
  -d "CUSTOMERID=CUST-00123" \
  -d "TOKENID=TOK987654321" \
  -d "CARDNUMBER=411111XXXXXX1111" \
  -d "BILLNUMBER=BILL-202610-001" \
  -d "TRANSIDMERCHANT=INV-REC-20261009-001" \
  -d "AMOUNT=150000.00" \
  -d "CURRENCY=360" \
  -d "RESPONSECODE=00" \
  -d "APPROVALCODE=123456" \
  -d "VERIFYID=VER-882910" \
  -d "VERIFYSCORE=0" \
  -d "VERIFYSTATUS=APPROVE" \
  -d "PAYMENTDATETIME=20261009110500" \
  -d "BANK=BCA"
```

#### Signature Verification (`WORDS`)

To verify the integrity of the webhook payload, calculate the SHA-1 digest as follows:

**WORDS** = SHA1(TRANSIDMERCHANT + MALLID + SharedKey + CUSTOMERID + Code + BILLNUMBER + RESPONSECODE + VERIFYSTATUS)

### 5. Dashboard Reports

Merchants can verify recurring registrations and transactions in the DOKU Dashboard:

* **Billing Report**: View initial billing registrations via Account Billing -> Register Report.\ <br>

  <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FdolcICO0BvrlEMbKIcvG%2Fimage.png?alt=media&amp;token=5e4c8cd4-2a07-4cea-98d3-e9c51686f5cb" alt=""><figcaption></figcaption></figure>
* **Customer Report**: Manage registered customer profiles via Account Billing -> Manage Recurring.<br>

  <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2F93eFpOvPh00lVcwzHtPZ%2Fimage.png?alt=media&amp;token=6989eba5-c567-4d3e-a818-8e66b7199d22" alt=""><figcaption></figcaption></figure>
* **Payment Report**: Review executed recurring transactions under Reports -> Transactions.<br>

  <figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2Fj3tPI26IegqSa7BKiRZn%2Fimage.png?alt=media&amp;token=47f0dfac-a88f-4909-b25e-e84494953bfd" alt=""><figcaption></figcaption></figure>
