Skip to main content

Create Subscription Scheduled Payment

POSTdana/acquiring/order/subscription/apply.htm

This API is used to create a schedule payment with dynamic amount.

API Type
DANA Open API
Expected Timeout
8 second
SNAP Service Code
-
Accept
application/json
Content Type
application/json

Idempotent Key and Rule*

Idempotent is controlled by merchantId, merchantTransId, and transactionId.

  • If merchantId and merchantTransId have been created and the key information is consistent, then current payment results will be returned.
  • If merchantId and merchantTransId have been created but the key information isn’t consistent, then REPEAT_REQ_INCONSISTENT will be returned.
  • The key information includes: merchantId, clientId, orderAmount, buyer, seller, and productCode.

Notes

When a merchant call this API occurs some system error/network error or get PAYMENT_IN_PROCESS/SYSTEM_ERROR in return, that means the merchant doesn’t get the accurate result. Merchant should do the retry logic and call this API with the same parameters again, or call Query Payment API to get order status. DANA does not give any notification to the merchant. So, the retry should be done by merchant. If when retrying the parameters are not the same, then DANA will treat as two different transactions and merchant must pay both of them.


version
string
1 - 8 charactersRequired
API version. As per the respective API reference
function
string
1 - 128 charactersRequired
According to specifications defined by each business domain
Value: dana.acquiring.order.subscription.apply
clientId
string
1 - 36 charactersRequired
Client identifier which provided by DANA and used to identify partner and application system
clientSecret
string
1 - 64 charactersRequired
As a secret key of client. Assigned client secret during registration
reqTime
string
25 charactersRequired
Request time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
reqMsgId
string
1 - 64 charactersRequired
Identify an unique system request. Each request will be assigned with a unique identifier (UUID)
accessToken
string
1 - 512 charactersRequired
Contains customer token, which has been obtained from binding process
reserve
string
1 - 256 characters
Reserved for future implementation (Key/Value)

productCode
string
1 - 32 charactersRequired
Product code
merchantId
string
21 charactersRequired
Merchant identifier that is unique per each merchant
transactionId
string
1 - 64 charactersRequired
Transaction identifier
paymentMode
string
1 - 32 charactersRequired
Payment mode. The value must be filled with AUTO_DEBIT
Note

AUTO_DEBIT, means this mode for 2nd/scheduled payment, the system will run agreement pay to create and pay the order.
IPG solution should use this mode

subscriptionId
string
1 - 64 charactersRequired
Subscription identifier
order
json object
Required
Define the detail of order information. Refer to order
orderTitle
string
1 - 64 charactersRequired
Order title
orderAmount
json object
Required
Order amount. Contains two sub-fields:
  1. Value: Order amount, including the cents
  2. Currency: Currency code based on ISO
value
string
1 - 19 charactersRequired
Value of amount. Need to provide the amount in the smallest common currency unit. For most, this is the amount in cents (or pence, or similarly named unit).
For example: To create a charge for $1.00, set amount=100 (100 cents)
currency
string
1 - 3 charactersRequired
Currency
merchantTransId
string
1 - 64 charactersRequired
Merchant transaction identifier per each order
merchantTransType
string
1 - 64 characters
Merchant transaction type
orderMemo
string
1 - 64 charactersRequired
Order memo
createdTime
string
25 characters
Order created time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
expiryTime
string
25 characters
Order expiry time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
goods
array of json object
Define the detail of good information. Refer to order.goods
merchantGoodsId
string
1 - 64 charactersRequired
Goods identifier provided by merchant
description
string
1 - 1024 charactersRequired
Goods description
category
string
1 - 64 charactersRequired
Goods category
price
json object
Required
Goods price. Contains two sub-fields:
  1. Value: Amount, including the cents
  2. Currency: Currency code based on ISO
value
string
1 - 19 charactersRequired
Value of amount. Need to provide the amount in the smallest common currency unit. For most, this is the amount in cents (or pence, or similarly named unit).
For example: To create a charge for $1.00, set amount=100 (100 cents)
currency
string
1 - 3 charactersRequired
Currency
unit
string
1 - 64 characters
Goods unit
quantity
string
1 - 16 charactersRequired
Count of items
merchantShippingId
string
1 - 64 characters
Shipment identifier provided by merchant
snapshotUrl
string
1 - 512 characters
The URL of good’s snapshot web page
extendInfo
string
1 - 4096 characters
Extend information
notificationUrls
array of json object
Notify URL that merchant must send the payment notification to. Refer to notificationUrls
url
string
1 - 512 charactersRequired
URL link
type
string
1 - 32 charactersRequired
URL type with values:
  • PAY_RETURN
  • NOTIFICATION
mcc
string
1 - 64 characters
Merchant category code. This parameter is used to identify the type of business in which a merchant is engaged. Refer to MCC
envInfo
json object
Required
Environment information. Refer to envInfo
sessionId
string
1 - 128 characters
Session identifier
tokenId
string
1 - 128 characters
Token identifier
websiteLanguage
string
1 - 16 characters
Website language
clientIp
string
1 - 32 characters
Client IP address
osType
string
1 - 128 characters
Operating system type
appVersion
string
1 - 128 characters
App version
sdkVersion
string
1 - 128 characters
SDK version
sourcePlatform
string
1 - 32 charactersRequired
Source platform, refer to SourcePlatformEnum
IPG
string
The source platform is independent payment gateway
orderTerminalType
string
1 - 32 characters
Order terminal type, refer to OrderTerminalTypeEnum
APP
string
Mobile Application
WEB
string
Browser Web
WAP
string
Mobile Wap
SYSTEM
string
System Call
terminalType
string
1 - 32 charactersRequired
Terminal type, refer to TerminalTypeEnum
APP
string
Mobile Application
WEB
string
Browser Web
WAP
string
Mobile Wap
SYSTEM
string
System Call
clientKey
string
1 - 128 characters
Client key
orderOsType
string
1 - 128 characters
Order operating system type
merchantAppVersion
string
1 - 128 characters
Merchant App version
extendInfo
string
1 - 4096 characters
Extend information
extendInfo
string
1 - 4096 characters
Extend information
{
"request":{
"head":{
"version":"1.0",
"function":"dana.acquiring.order.subscription.apply",
"clientId":"1343415315",
"clientSecret":"67asdf",
"reqTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"123456",
"reserve":"{ \"attr1\":\"val1\" }"
},
"body":{
"productCode":"51051000101000100052",
"merchantId":"21414135325252323",
"transactionId":"trxId",
"paymentMode":"AUTO_DEBIT",
"subscriptionId":"subId",
"order":{
"orderTitle":"Women Summer Dress New White Lace",
"orderAmount":{
"currency":"IDR",
"value":"239"
},
"merchantTransId":"201505080001",
"merchantTransType":"This is a sample",
"orderMemo":"Memo",
"createdTime":"2001-07-04T12:08:56-07:00",
"expiryTime":"2017-07-04T12:08:56-07:00",
"goods":[
{
"merchantGoodsId":"24525635625623",
"description":"Women Summer Dress New White Lace",
"category":"travelling/subway",
"price":{
"currency":"IDR",
"value":"239"
},
"unit":"Kg",
"quantity":"3.2",
"merchantShippingId":"564314314574327545",
"snapshotUrl":"[http://snap.url.com]",
"extendInfo":"{ \"objectId\": \"87884393857\",\"objectCode\": \"62\"}"
}
]
},
"notificationUrls":[
{
"url":"http://notify.com",
"type":"NOTIFICATION"
}
],
"mcc":"5732",
"envInfo":{
"sessionId":"8EU6mLl5mUpUBgyRFT4v7DjfQ3fcauthcenter",
"tokenId":"a8d359d6-ca3d-4048-9295-bbea5f6715a6",
"websiteLanguage":"en_US",
"clientIp":"10.15.8.189",
"osType":"Windows.PC",
"appVersion":"1.0",
"sdkVersion":"1.0",
"sourcePlatform":"IPG",
"orderTerminalType":"WEB",
"terminalType":"APP",
"orderOsType":"IOS",
"merchantAppVersion":"1.0",
"extendInfo":"{\"deviceId\":\"CV19A56370e8a00d54293aab8001e4794\"}"
},
"extendInfo":"{\"memo\":\"memo\"}"
}
},
"signature":"signature string"
}

version
string
1 - 8 charactersRequired
API version. As per the respective API reference
function
string
1 - 128 charactersRequired
According to specifications defined by each business domain
Value: dana.acquiring.order.subscription.apply
clientId
string
1 - 36 charactersRequired
Client identifier which provided by DANA and used to identify partner and application system
clientSecret
string
1 - 64 charactersRequired
As a secret key of client. Assigned client secret during registration
respTime
string
25 charactersRequired
Response time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
reqMsgId
string
1 - 64 charactersRequired
Identify an unique system request. Each request will be assigned with a unique identifier (UUID)
accessToken
string
1 - 512 charactersRequired
Contains customer token, which has been obtained from binding process
reserve
string
1 - 256 characters
Reserved for future implementation (Key/Value)

resultInfo
json object
Required
Define the detail of result information
resultStatus
string
1 charactersRequired
Result status, refer to result code list ResultStatusThe status of the request can be:
  • S: Success
  • F: Failure
  • U: Unknown
Can be added if these 3 statuses are insufficient for business requirements
resultCodeId
string
1 - 16 charactersRequired
Result code identifier, refer to result code list ResultCodeId
resultCode
string
1 - 64 charactersRequired
Result code string, refer to ResultCode
resultMsg
string
1 - 256 characters
Result message, refer to result code list ResultMsg
merchantTransId
string
1 - 64 charactersRequired
Merchant unique identifier for each transaction. This value is generated by merchant
acquirementId
string
1 - 64 charactersConditional
Transaction identifier on DANA system
Conditional Info
Y:= resultCode is SUCCESS
subscriptionId
string
1 - 64 charactersRequired
Subscription identifier
orderAmount
json object
Required
Order amount. Contains two sub-fields:
  1. Value: Order amount, including the cents
  2. Currency: Currency code based on ISO
value
string
1 - 19 charactersRequired
Value of amount. Need to provide the amount in the smallest common currency unit. For most, this is the amount in cents (or pence, or similarly named unit).
For example: To create a charge for $1.00, set amount=100 (100 cents)
currency
string
1 - 3 charactersRequired
Currency
createdTime
string
25 charactersConditional
Transaction created time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
Conditional Info
Y:= resultCode is SUCCESS
paidTime
string
25 charactersConditional
Transaction paid time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
Conditional Info
Y:= resultCode is SUCCESS
checkoutUrl
string
1 - 2048 charactersConditional
Checkout URL that direct to DANA page
Conditional Info
Y:= Payment Mode is DIRECT
{
"response":{
"head":{
"version":"1.0",
"function":"dana.acquiring.order.subscription.apply",
"clientId":"1343415315",
"clientSecret":"67asdf",
"respTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"123456",
"reserve":"reserve"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"merchantTransId":"51051001000000000002",
"acquirementId":"231241241241412412",
"subscriptionId":"2015032412007101547201352747sub",
"orderAmount":{
"currency":"IDR",
"value":"239"
},
"createdTime":"2001-07-04T12:08:56+07:00",
"paidTime":"2001-07-04T12:08:56+07:00",
"checkoutUrl":null
}
},
"signature":"signature string"
}

ResultStatusResultCodeIdResultCodeResultMessageSolution
S 00000SUCCESSSUCCESS
Mark Create Subscription Scheduled Payment process as Success
U 00000900SYSTEM_ERRORSYSTEM_ERROR
Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload
F 12005129SYSTEM_ERRORSYSTEM_ERROR
Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload
F 12005131SUBSCRIPTION_NOT_EXISTSUBSCRIPTION_NOT_EXIST
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12005132INVALID_SUBSCRIPTION_SCHEDULEINVALID_SUBSCRIPTION_SCHEDULE
Mark Create Subscription Scheduled Payment process as Failed. Retry request when already in the period of scheduled payment or can contact DANA
F 12005133AMOUNT_IS_NOT_CORRECTAMOUNT_IS_NOT_CORRECT
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12005134USER_NOT_EXISTUSER_NOT_EXIST
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
U 12005135PAYMENT_IN_PROCESSPAYMENT_IN_PROCESS
Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload
F 12005136PAYMENT_FAILEDPAYMENT_FAILED
Mark Create Subscription Scheduled Payment process as Failed. Create an order with new merchantTransId
F 12005136SUBSCRIPTION_SCHEDULE_NOT_EXISTSUBSCRIPTION_SCHEDULE_NOT_EXIST
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12005140PARAM_MISSINGPARAM_MISSING
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015134USER_NOT_EXISTUSER_NOT_EXIST
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015144PARAM_ILLEGALPARAM_ILLEGAL
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015147SUBSCRIPTION_PAYMENT_NOT_READYSUBSCRIPTION_PAYMENT_NOT_READY
Mark Create Subscription Scheduled Payment process as Failed. Retry request when already in the period of scheduled payment
F 12015148ORDER_NOT_CONSISTENTrepeat order create request, but the 'orderAmount' is not consistent
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015149INVALID_USER_INFOinvalid user info
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015150USER_STATUS_IS_FROZENUSER_STATUS_IS_FROZEN
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter or can contact DANA to check the user/account status
F 12015152WITHOUT_AVAILABLE_PAY_METHODwithout available pay method
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015153UNKNOWN_EXCEPTIONunknown exception
Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload
F 12015161BALANCE_NOT_ENOUGHbalance not enough
Mark Create Subscription Scheduled Payment process as Failed. Check source of funds availability
F 12015170TRX_ID_EMPTYTRX_ID in extInfo cannot be empty
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015171REJECT_BY_RISK_CTLreject by risk
Mark Create Subscription Scheduled Payment process as Failed. Retry request periodically or contact DANA to consult
F 12015172INVALID_SUBSCRIPTION_AMOUNTinvalid subscription amount
Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter
F 12015173ORDER_IS_CLOSEDorder is closed
Mark Create Subscription Scheduled Payment process as Failed. Create an order with new merchantTransId
ask AIAI Assistant
Need help with our documentation?
Start from our frequently asked questions or feel free to ask anything else.

AI generated responses may contain mistakes.