1. Getting Started
XL DCB API for Partner
  • Getting Started
    • Introduction
    • Authentication
    • Headers
    • Recurring (Subscription)
    • On-Demand (One-Time Charge)
    • Callbacks (Webhooks)
    • Errors & Response Codes
    • Notes (Partner Guidance)
  • Subscriptions
    • Create Subscription (Initiate)
      POST
    • Confirm OTP
      POST
    • Unsubscribe
      POST
  • OnDemand
    • Create one-time charge (OTP flow)
      POST
    • Confirm OTP (execute charge)
      POST
    • Check transaction status
      GET
  1. Getting Started

On-Demand (One-Time Charge)

20 - On-Demand (One-Time Charge)#

On-Demand Charging Flow Overview
AdobeExpressPhotos_1c7c5c52b8ba4c4ba49175449bd39977_CopyEdited.png
The on-demand charging flow is used for one-time purchases where the user is charged immediately for a specific product or service. The process starts when the partner sends a charge request to the API. The XL DCB system then attempts to charge the user in real time. If the charge is successful, the system sends a callback notification to the partner confirming the successful transaction so the service or content can be delivered to the user.
The partner may also check the transaction status using the status endpoint to ensure the final result.

20.1 Create Charge (OTP Flow)#

AdobeExpressPhotos_260f59b5f77d4c6591f02337f11fd958_CopyEdited.png
POST /partner-dcb/v1/on-demand/charges

Request Body#

{
  "payment_method": "XL",
  "transaction_details": {
    "partner_ref_id": "8d7f32bc-21fe-4eb3-b16c-ec549f4b06c9",
    "amount": 2220,
    "currency": "IDR"
  },
  "customer_details": {
    "msisdn": "6287800000000"
  },
  "item_details": {
    "id": "IM0001",
    "name": "OD 2000",
    "description": "On-demand purchase"
  }
}

Response (202) - OTP Required#

{
  "success": true,
  "correlation_id": "8002d952-0007-2400-b63f-84710c7967bb",
  "code": "CHARGE_CREATED",
  "message": "Charge created successfully",
  "data": {
    "transaction_id": "213390B1-FB19-4E14-BE24-34D377984025",
    "partner_ref_id": "8d7f32bc-21fe-4eb3-b16c-ec549f4b06c9"
  }
}

20.2 Confirm OTP (Execute Charge)#

AdobeExpressPhotos_a8f42b64acb94cf69bb727a7550c04f8_CopyEdited.png
POST /partner-dcb/v1/on-demand/charges/{transaction_id}/otp/confirm

Request Body#

{
  "payment_method": "XL",
  "transaction_details": {
    "otp": "123456"
  }
}

Response (200)#

{
  "success": true,
  "correlation_id": "8004b951-0804-e900-b63f-84710c7967bb",
  "code": "OTP_CONFIRMED",
  "message": "OTP Confirmed Successfully",
  "data": {
    "transaction_id": "213390B1-FB19-4E14-BE24-34D377984025"
  }
}

20.3 Check Transaction#

AdobeExpressPhotos_8944f1a811bf44fcbe9e2e1fbbf299a2_CopyEdited.png
GET /partner-dcb/v1/on-demand/charges/check?transaction_id={transaction_id}&payment_method=XL

Query#

transaction_id=...

Response (200)#

{
  "success": true,
  "correlation_id": "8005c7c8-0800-e200-b63f-84710c7967bb",
  "code": "TRANSACTION_FOUND",
  "message": "Transaction found",
  "data": {
    "status": "Success",
    "failure_reason": "",
    "failure_message": "",
    "event_type": "OneTimePurchase",
    "payment_method": "XL",
    "amount": 3330,
    "msisdn": "6287800000000",
    "transaction_date": "2026-05-08T10:01:42+07:00",
    "item_id": "IM0002",
    "item_name": "MIA 3330",
    "item_description": "MIA 3330",
    "partner_ref_id": "0b5efb01-3ee5-491c-95ee-088316ca67b0",
    "transaction_id": "E01A7B3F-2B0C-42E7-9918-FA3333F41797",
    "timestamp": "2026-05-11T13:44:34+07:00"
  }
}
Modified at 2026-05-13 04:47:09
Previous
Recurring (Subscription)
Next
Callbacks (Webhooks)
Built with