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

Callbacks (Webhooks)

Triyakom uses an outbound callback mechanism to notify partners of asynchronous transaction results. Partners must provide a reachable HTTPS endpoint to receive these notifications.

General Specifications#

ItemValue
DirectionTriyakom → Partner
HTTP MethodPOST
Content-Typeapplication/json
AcknowledgmentPartner must return HTTP 200
RetryExponential backoff (outbox-based) on non-2xx or timeout

Security & Signature Verification#

Every callback request from Triyakom includes a digital signature to ensure data integrity and authenticity. Partners must verify this signature before processing the payload.

Headers Sent by Triyakom#

HeaderDescription
X-TimestampSending time in ISO-8601 format
X-NonceUnique UUID per request to prevent replay attacks
X-SignatureHMAC-SHA256 signature encoded in Base64

Signature Verification Steps#

Step 1 — Hash the raw request body with SHA256 (lowercase hex):
SHA256(RawBody)
Step 2 — Assemble the StringToSign (fields joined by \n newline):
METHOD + "\n" + PATH + "\n" + X-Timestamp + "\n" + X-Nonce + "\n" + SHA256(RawBody)
Step 3 — Compute HMAC-SHA256 using the HmacSecret provided by Triyakom:
ExpectedSignature = Base64(HMAC-SHA256(HmacSecret, StringToSign))
Step 4 — Compare ExpectedSignature with the X-Signature header value. If they do not match, reject the request with HTTP 401.
⚠️ The raw body used for hashing must be byte-for-byte identical to the received HTTP body (same encoding, same whitespace). Both SHA256(RawBody) and the final signature must be computed over the exact bytes received.

1. Recurring Subscription Callback#

Callback URL#

Default callback URL configured for the partner during onboarding.

Event Types & Payloads#

There are 5 event types that may be delivered via this callback.

A. Subscription Success#

Triggered when a new subscription is successfully activated.
{
  "event_type": "Subscription",
  "status": "Success",
  "payment_method": "XL",
  "amount": 1110.0,
  "startDate": "2024-07-19T19:35:00+07:00",
  "nextRenewalDate": "2024-07-20T00:00:00+07:00",
  "msisdn": "6287800000000",
  "product_id": "DAILY_BASIC",
  "subscription_id": 1025,
  "transaction_id": "f7b199e3-178f-46fb-a9da-aff1b45c346e",
  "timestamp": "2024-07-19T19:35:05+07:00"
}

B. Renewal Success#

Triggered when a recurring renewal charge is successfully completed.
{
  "event_type": "Renewal",
  "status": "Success",
  "payment_method": "XL",
  "amount": 1110.0,
  "nextRenewalDate": "2024-07-21T00:00:00+07:00",
  "msisdn": "6287800000000",
  "product_id": "DAILY_BASIC",
  "subscription_id": 1025,
  "transaction_id": "e8032d61-7f4d-4b7b-a3e5-bd708c0bae7e",
  "timestamp": "2024-07-20T00:05:00+07:00"
}

C. Renewal Failed#

Triggered when a renewal charge fails (e.g. insufficient balance, grace period, or block).
{
  "event_type": "Renewal",
  "status": "Failed",
  "payment_method": "XL",
  "msisdn": "6287800000000",
  "product_id": "DAILY_BASIC",
  "subscription_id": 1025,
  "timestamp": "2024-07-20T00:05:00+07:00"
}

D. Unsubscribe Success#

Triggered when a subscription is successfully cancelled.
{
  "event_type": "Unsubscribe",
  "status": "Success",
  "payment_method": "XL",
  "msisdn": "6287800000000",
  "product_id": "DAILY_BASIC",
  "subscription_id": 1025,
  "transaction_id": "60e476f9-baf0-4426-b1c3-5c5b494e4fd2",
  "timestamp": "2024-07-25T14:10:00+07:00"
}

E. Subscription Failed#

Triggered when a new subscription activation fails.
{
  "event_type": "Subscription",
  "status": "Failed",
  "payment_method": "XL",
  "msisdn": "6287800000000",
  "product_id": "DAILY_BASIC",
  "timestamp": "2024-07-25T14:10:00+07:00"
}

Payload Field Reference#

FieldTypePresent WhenDescription
event_typestringAlwaysSubscription, Renewal, or Unsubscribe
statusstringAlwaysSuccess or Failed
payment_methodstringAlwayse.g. XL
amountfloatSuccess onlyCharged amount in IDR
msisdnstringAlwaysCustomer mobile number
product_idstringAlwaysProduct identifier
subscription_idintegerAlwaysInternal subscription ID from Triyakom
transaction_idstring (uuid)Success onlyTransaction ID for reconciliation
startDatestring (ISO-8601)Subscription SuccessSubscription start date
nextRenewalDatestring (ISO-8601)Subscription/Renewal SuccessScheduled next renewal date
timestampstring (ISO-8601)AlwaysTime the event was recorded

2. On-Demand Charge Result Callback#

Callback URL#

Provided per request via callback_url field in the Create Charge request body, or a default callback URL configured for the partner during onboarding if not specified.

Possible status Values#

StatusDescription
PaidCharge was successful
FailedCharge failed
CanceledCharge was cancelled
Insufficient BalanceCustomer does not have sufficient balance

Payload#

{
  "status": "Paid",
  "failure_reason": "",
  "failure_message": "",
  "event_type": "OneTimePurchase",
  "payment_method": "XL",
  "amount": 3330.0,
  "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"
}

Payload Field Reference#

FieldTypeDescription
statusstringPaid, Failed, Canceled, or Insufficient Balance
failure_reasonstringShort failure code. Empty string if successful.
failure_messagestringDetailed failure description. Empty string if successful.
event_typestringAlways OneTimePurchase
payment_methodstringe.g. XL
amountfloatCharged amount in IDR
msisdnstringCustomer mobile number
transaction_datestring (ISO-8601)Date and time of the charge
item_idstringItem identifier
item_namestringItem name
item_descriptionstringItem description
partner_ref_idstring (uuid)Echo of partner_ref_id from Create Charge request
transaction_idstring (uuid)Triyakom transaction ID for reconciliation

Partner Response Requirements#

Regardless of callback type, partners must respond as follows:

Success Response (HTTP 200)#

{
  "status": "SUCCESS",
  "message": "Notification received"
}
FieldDescription
statusMust be SUCCESS
messageFreeform text for logging or audit purposes. Recommended: "Notification received" or "Already processed (duplicate)"

Error Response (HTTP 4xx / 5xx)#

{
  "status": "FAILED",
  "message": "Invalid signature / Database error"
}
FieldDescription
statusAnything other than SUCCESS. Recommended: FAILED or ERROR
messageDetailed failure reason to facilitate debugging
⚠️ If the partner returns a non-2xx response or times out, Triyakom will retry delivery using an outbox-based exponential backoff mechanism.
Modified at 2026-05-13 04:40:42
Previous
On-Demand (One-Time Charge)
Next
Errors & Response Codes
Built with