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

Data Signing Rules

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details see Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

ParameterTypeRequiredRemarks
requestIdString(64)YesUnique identifier on every request
merchantIdString(20)YesUnique ID provided by payment gateway to merchant
storeIdString(30)NoIf merchant has branches and wants to create order using branch ID
paymentTypeString(20)YesPayment type
merchantTradeNoString(32)YesMerchant subscription ID

paymentType

Payment TypeCode
DANA E-Wallet (supports refund)StaticDanaSub,DynamicDanaSub

Subscription Cancellation Response Parameters

Header

Data Signing Rules

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details see Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

Error Code

ParameterTypeRequiredRemarks
requestIdString(64)YesUnique ID for each request
errCodeString(32)No0 means success, otherwise see Error Code
errCodeDesString(128)NoError description
merchantIdString(20)YesUnique merchant ID
storeIdString(30)NoIf using branch ID
paymentTypeString(20)YesPayment type
requestAmountDecimal(12,2)NoPayment amount
amountdecimal(12,2)YesAmount in IDR, two decimals
merchantTradeNoString(32)YesMerchant subscription ID
createTimeString(16)NoyyyyMMddHHmmss
statusString(32)No01: Subscription created 02: Payment successful 06: Subscription canceled 09: Subscription creation failed
expiredTimeString(v)NoyyyyMMddHHmmss (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"
}