Dana Subscription
Dana Subscription Cancellation API
Cancel DANA subscription via Paylabs API.
Request URL
URL: ${ROOT_URL}/dana/v1/sub/removesub
HTTPMethod: POST
EndpointUrl: /dana/v1/sub/removesub
Subscription Cancellation Request Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details see Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| requestId | String(64) | Yes | Unique identifier on every request |
| merchantId | String(20) | Yes | Unique ID provided by payment gateway to merchant |
| storeId | String(30) | No | If merchant has branches and wants to create order using branch ID |
| paymentType | String(20) | Yes | Payment type |
| merchantTradeNo | String(32) | Yes | Merchant subscription ID |
paymentType
| Payment Type | Code |
|---|---|
| DANA E-Wallet (supports refund) | StaticDanaSub,DynamicDanaSub |
Subscription Cancellation Response Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details see Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| requestId | String(64) | Yes | Unique ID for each request |
| errCode | String(32) | No | 0 means success, otherwise see Error Code |
| errCodeDes | String(128) | No | Error description |
| merchantId | String(20) | Yes | Unique merchant ID |
| storeId | String(30) | No | If using branch ID |
| paymentType | String(20) | Yes | Payment type |
| requestAmount | Decimal(12,2) | No | Payment amount |
| amount | decimal(12,2) | Yes | Amount in IDR, two decimals |
| merchantTradeNo | String(32) | Yes | Merchant subscription ID |
| createTime | String(16) | No | yyyyMMddHHmmss |
| status | String(32) | No | 01: Subscription created 02: Payment successful 06: Subscription canceled 09: Subscription creation failed |
| expiredTime | String(v) | No | yyyyMMddHHmmss (checkoutUrl unusable after expiry) |
Example
Request
POST /dana/v1/sub/removesub
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"requestId": "PY16eca666-f599-4ffd-b5f3-e581be81954b",
"merchantId": "010001",
"paymentType": "StaticDanaSub",
"merchantSubId": "PY-1761114620.5313134"
}Response
POST /dana/v1/sub/removesub
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"merchantId": "010001",
"requestId": "PY16eca666-f599-4ffd-b5f3-e581be81954b",
"errCode": "channelError",
"paymentType": "StaticDanaSub",
"amount": 15000.0,
"merchantSubId": "PY-1761114620.5313134"
}