Skip to Content

Duitku compatibility mode

Move from Duitku API v2 by changing only the base URL, merchantCode and apiKey.

If your system already uses Duitku API v2, including Duitku's plugins, you don't need to rewrite your integration. Turn on Duitku mode for an app, change the base URL, merchantCode and apiKey, and your code keeps working. The paths stay the same, and callbacks still go to the callbackUrl of each transaction.

Turning it on

Open the Kompatibilitas tab

In the dashboard, pick test or live mode. Open Developer, pick the app, then the Kompatibilitas tab. Live mode opens once your business verification is approved.

Turn on Duitku mode

In the Mode Duitku panel, click Aktifkan mode Duitku. No URL is needed: Duitku sends callbackUrl with each transaction.

Save the credentials

merchantCodeD followed by 7 characters, for example DXXXXXXX. Stays visible on the Kompatibilitas tab.
apiKey32 hex characters. Shown once.

Each mode has its own merchantCode. The merchantCode decides whether a transaction is in test or live mode.

Change the base URL and credentials

.env
# Before
DUITKU_BASE_URL=https://sandbox.duitku.com     # or https://passport.duitku.com
DUITKU_MERCHANT_CODE=Dxxxxxxx
DUITKU_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Now
DUITKU_BASE_URL=https://pay.piti.id
DUITKU_MERCHANT_CODE=DXXXXXXX                   # from us
DUITKU_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  # from us

Replaces the app's webhook

While Duitku mode is on for an app and mode, that app's normal webhooks are not sent. An app can use only one compatibility mode: turning Duitku on turns Xendit mode off, and the other way round.

Making a new apiKey

Click Buat apiKey baru. We make a new apiKey and the old one stops working at once. Your merchantCode, transactions and callbacks stay the same; later callbacks are signed with the new apiKey.

Turning Duitku mode off and on again gives a new merchantCode.

Turning it off

Click Matikan mode Duitku. The credentials are revoked and callbacks stop. Payments already made stay recorded. The normal webhook doesn't come back by itself: save the webhook URL again on the Webhook tab.

Signatures

We accept two signature schemes on every request:

  • MD5: older integrations, such as Duitku's PHP SDK. MD5 of the joined fields followed by the apiKey.
  • HMAC-SHA256: current integrations, such as Duitku's WooCommerce plugin since October 2026. Keyed with the apiKey, over the joined fields.

All signatures are hex. A callback is signed the same way as that transaction's inquiry.

RequestMD5HMAC-SHA256 (key: apiKey)
v2/inquirymd5(merchantCode + merchantOrderId + paymentAmount + apiKey)merchantCode + merchantOrderId + paymentAmount
transactionStatusmd5(merchantCode + merchantOrderId + apiKey)merchantCode + merchantOrderId
getpaymentmethodsha256(merchantcode + amount + datetime + apiKey)merchantcode + amount + datetime
Callbackmd5(merchantCode + amount + merchantOrderId + apiKey)merchantCode + amount + merchantOrderId

For getpaymentmethod, the older scheme is plain SHA-256, not MD5, as in Duitku.

Supported endpoints

All are POST with a JSON body, on https://pay.piti.id.

EndpointWhat it does
/webapi/api/merchant/v2/inquiryCreate a transaction. The VA or QRIS is made at once.
/webapi/api/merchant/transactionStatusCheck a transaction's status.
/webapi/api/merchant/paymentmethod/getpaymentmethodList the switched-on methods for an amount.

Inquiry

POST /webapi/api/merchant/v2/inquiry
{
  "merchantCode": "DXXXXXXX",
  "paymentAmount": 150000,
  "paymentMethod": "M2",
  "merchantOrderId": "ORD-1042",
  "productDetails": "Order 1042",
  "customerVaName": "Budi Santoso",
  "email": "budi@example.com",
  "phoneNumber": "0812xxxxxxx",
  "callbackUrl": "https://your-shop.id/duitku/callback",
  "returnUrl": "https://your-shop.id/orders/1042",
  "expiryPeriod": 60,
  "signature": "..."
}
FieldRules
paymentAmountWhole rupiah, a number or a numeric string. The method's amount limits apply (a VA from Rp10,000, QRIS up to Rp10,000,000).
paymentMethodSee payment codes.
merchantOrderIdRequired, up to 64 characters, unique per merchantCode.
callbackUrlRequired. https and a public address (http allowed in test mode).
expiryPeriodMinutes, 1 to 1,440 (24 hours). Default 24 hours.
productDetails, additionalParam, merchantUserInfo, customerVaName, email, phoneNumber, returnUrlOptional.

itemDetails, customerDetail and accountLink are ignored.

Answer
{
  "merchantCode": "DXXXXXXX",
  "reference": "pay_xxxxxxxx",
  "paymentUrl": "https://pay.piti.id/pay/pay_xxxxxxxx",
  "vaNumber": "8xxxxxxxxxxxxxxx",
  "qrString": "",
  "amount": "150000",
  "statusCode": "00",
  "statusMessage": "SUCCESS"
}
  • reference is our payment id. paymentUrl is our payment page.
  • For a VA, vaNumber is set. For QRIS, qrString is set.
  • The QRIS code in qrString works for only a few minutes. The paymentUrl page renews it by itself. If you show qrString yourself, send the customer to paymentUrl once the code expires.
  • amount is always your paymentAmount. When the VA fee is charged to the customer, the customer transfers the total (amount plus fee) shown on the payment page and the VA, but amount in the answer, the status and the callback stays paymentAmount.

transactionStatus

POST /webapi/api/merchant/transactionStatus
{ "merchantCode": "DXXXXXXX", "merchantOrderId": "ORD-1042", "signature": "..." }
Answer
{
  "merchantOrderId": "ORD-1042",
  "reference": "pay_xxxxxxxx",
  "amount": "150000",
  "fee": "...",
  "statusCode": "01",
  "statusMessage": "PROCESS"
}
statusCodestatusMessageMeaning
00SUCCESSPaid. Stays 00 after a refund.
01PROCESSWaiting for payment.
02EXPIREDExpired or failed.

getpaymentmethod

POST /webapi/api/merchant/paymentmethod/getpaymentmethod
{ "merchantcode": "DXXXXXXX", "amount": 150000, "datetime": "2026-11-30 10:00:00", "signature": "..." }

Answers {"paymentFee": [...], "responseCode": "00", "responseMessage": "SUCCESS"}. Each row has paymentMethod, paymentName, paymentImage and totalFee. Only the methods switched on for your app that take the amount are listed. QRIS is listed as SP.

Payment codes

CodeResult
M2Mandiri VA
BRBRI VA
BVBSI VA
B1CIMB Niaga VA
BTPermata VA
I1BNI VA
VAMaybank VA
DMDanamon VA
SP NQ DQ GQ SQ LQ OV SA DA LA LF SL OLQRIS. Payable from any bank or e-wallet app.

Any other code is refused with 400 "Payment channel XX is not available.", never switched to another method. That includes VA banks we don't support yet (BC, NC, A1, AG, S1), retail (FT, IR, A2), cards (VC, MG), paylater (DN, AT), BK, JP and T1 to T3.

A method switched off in Metode bayar for that app is refused too.

Callbacks

When a transaction is paid, we send a POST to that transaction's callbackUrl, with Content-Type: application/x-www-form-urlencoded.

Field
merchantCodeYour merchantCode.
amountThe transaction's paymentAmount.
merchantOrderIdYour order id.
productDetailFrom productDetails.
additionalParamFrom the inquiry.
paymentCodeThe method code from the inquiry, for example M2.
resultCode00.
merchantUserIdFrom merchantUserInfo.
reference, publisherOrderIdOur payment id.
spUserHashEmpty.
signatureSee Signatures.
callback.php
<?php
$apiKey = getenv('DUITKU_API_KEY');
$merchantCode = $_POST['merchantCode'] ?? '';
$amount = $_POST['amount'] ?? '';
$merchantOrderId = $_POST['merchantOrderId'] ?? '';
$signature = $_POST['signature'] ?? '';

// Older integrations (MD5):
$expected = md5($merchantCode . $amount . $merchantOrderId . $apiKey);
// Current integrations (HMAC-SHA256):
// $expected = hash_hmac('sha256', $merchantCode . $amount . $merchantOrderId, $apiKey);

if (!hash_equals($expected, $signature)) {
    http_response_code(400);
    exit('bad signature');
}
if (($_POST['resultCode'] ?? '') === '00') {
    // Mark order $merchantOrderId paid (skip if it already is).
}
http_response_code(200);
  • Answer 2xx. Delivery uses the same machinery as webhooks: in order, retried on failure (1 minute up to 24 hours), never to private addresses, and listed in the dashboard's Webhook log with a resend button.
  • Delivery is at least once. The same callback can arrive more than once, so handle an order that is already paid safely.
  • There is no callback for an expired or failed transaction. Check with transactionStatus.

Errors

The shape is {"Message": "...", "statusMessage": "..."}.

StatusWhen
400Invalid fields, a refused method code, a merchantOrderId already used, or an amount outside the method's limits.
401Unknown merchantCode or a wrong signature.
403The app is switched off, the business is suspended, or live is not enabled.
404merchantOrderId not found.
429Too many requests. See Retry-After.
500Our error.

Not supported

  • Duitku endpoints other than the three above.
  • Method codes other than those in the table.
  • Callbacks for expired or failed transactions.
  • A merchantOrderId over 64 characters, and an expiryPeriod over 1,440 minutes.
  • itemDetails, customerDetail and accountLink (ignored).
  • Test events. Use test mode and pay the transaction at its paymentUrl. See Testing.

A Duitku-mode transaction is an ordinary payment with source: "duitku". It shows in Pembayaran (Payments) in the dashboard, and can be read through /v1 with an lbp_ key of the same app.