Skip to main content

Create Subscription First Payment

POST/dana/recurring/subscription/createsubscription.htm

This API is used to initiate a new subscription

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

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.recurring.openapi.subscription.createSubscription
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)

subscriptionVersion
string
1 charactersConditional
Auto deduction mode version, with value: 1 for auto deduct version trigger by merchant.
Conditional Info
Y:= Trigger auto deduct from DANA
Note

If empty, will be assign as version 1 (auto deduct trigger by merchant)

recurringType
string
13 charactersRequired
Recurring type. The value must be filled with AUTODEDUCTION
bizType
string
8 charactersRequired
Subscription biz type. The value must be filled with USER_BIZ
merchantId
string
21 characters
Merchant identifier that is unique per each merchant
merchantTransId
string
1 - 64 charactersRequired
Merchant unique identifier for each transaction. This value is generated by merchant
subMerchantId
string
1 - 64 characters
Sub merchant identifier, known as externalDivisionId must be registered in the DANA system before use. To register a new externalDivisionId, use the Create Division API
envInfo
json object
Required
Environment information. The envInfo include the parameter of:
  • sourcePlatform: The value must be IPG
  • terminalType: The value must be APP
extInfo
json object
Conditional
Extended information. The extInfo includes the parameter of:
  • TIMEZONE: The timezone, in format GMT+value
  • PAY_MODE: The value must be DIRECT, which means this is a first payment
  • PERIOD: If subscription is subscribe for certain time, need to filled the period value. e.g., 3 times
Conditional Info
Y:= Need to fill the extended information
Note

For PERIOD: Count start from 1 but when create must larger than 0

subscriptionInfo
json object
Required
Define the detail of subscription information. Refer to subscriptionInfo
subscriptionTitle
string
1 - 128 charactersRequired
Subscription title, the value must be the same with goodsName
subscriptionMessage
string
1 - 256 characters
Detail of subscription title
subscriptionIntervalInfo
json object
Required
Define the detail of subscription interval information. Refer to subscriptionIntervalInfo
type
string
1 - 7 charactersRequired
Interval type. The possible values are:
MONTHLY
WEEKLY
DAILY
For now, this value only support MONTHLY
value
integer
Required
Subscription interval value. E.g., 2 means the subscription is made for every 2 months
goodsInfo
json object
Required
Define the detail of goods information goodsInfo
extGoodsId
string
1 - 64 charactersRequired
Merchant goods/product identifier
goodsId
string
1 - 64 characters
Merchant goods/product identifier
goodsName
string
1 - 64 charactersRequired
Merchant goods name
goodsType
string
17 charactersRequired
General goods type for merchant which determined by DANA. The value must be filled with EXTERNAL_MERCHANT
goodsDesc
string
1 - 1024 characters
Merchant goods description
minPrice
json object
Required
Define the detail of minimum price, which use as an estimation of minimal subscription price. Contains two sub-fields:
  • cent: Amount, including the cents
  • currencyValue: Currency code based on ISO
Refer to multiCurrencyMoney
cent
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)
currencyValue
string
1 - 3 charactersRequired
The code of currency, for IDR is 360
maxPrice
json object
Required
Define the detail of maximum price, which use as an estimation of maximal subscription price. Contains two sub-fields:
  • cent: Amount, including the cents
  • currencyValue: Currency code based on ISO
Refer to multiCurrencyMoney
cent
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)
currencyValue
string
1 - 3 charactersRequired
The code of currency, for IDR is 360
extInfo
array of string
1 - 4096 characters
Extended information
Note

For PERIOD: Count start from 1 but when create must larger than 0

currency
string
1 - 3 charactersRequired
The currency
payReturnUrl
string
1 - 2048 characters
Pay return URL. The returned URL if user close button after payment clicked
Note
  • Fill with null if use pay return that have been set from back office or merchant configuration
  • The URL must use prefix https:// or http://
{
"request":{
"head":{
"version":"1.0",
"function":"dana.recurring.openapi.subscription.createSubscription",
"clientId":"2014000014442",
"clientSecret":"2014000014442",
"reqTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"xxxxx",
"reserve":"{}"
},
"body":{
"subscriptionVersion":"1",
"recurringType":"AUTODEDUCTION",
"bizType":"USER_BIZ",
"merchantId":"216620000000464757705",
"merchantTransId":"21661898222278266108982222782",
"subMerchantId":"310928924949487",
"envInfo":{
"sourcePlatform":"IPG",
"terminalType":"APP"
},
"extInfo":{
"TIMEZONE":"GMT+3",
"PAY_MODE":"DIRECT"
},
"subscriptionInfo":{
"subscriptionTitle":"goods sample",
"subscriptionMessage":"This is a goods sample",
"subscriptionIntervalInfo":{
"type":"MONTHLY",
"value":"1"
},
"goodsInfo":{
"extGoodsId":"sample-goods-123",
"goodsId":"goods sample",
"goodsName":"goods sample",
"goodsType":"EXTERNAL_MERCHANT",
"goodsDesc":"This is a goods description",
"currency":"IDR",
"minPrice":{
"cent":"1000000",
"currencyValue":"360"
},
"maxPrice":{
"cent":"1000000",
"currencyValue":"360"
},
"extInfo":{

}
}
},
"payReturnUrl":"http://merchantsite.com"
},
"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.recurring.openapi.subscription.createSubscription
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 ResultStatus. The 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
subscriptionId
string
1 - 64 charactersRequired
Subscription identifier
checkoutUrl
string
1 - 2048 charactersRequired
Checkout URL that direct to DANA page
{
"response":{
"head":{
"version":"1.0",
"function":"dana.recurring.openapi.subscription.createSubscription",
"clientId":"2014000014442",
"clientSecret":"2014000014442",
"respTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"xxxxx",
"reserve":"{}"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"subscriptionId":"2020051822120680020021DANAW3ID166689841885076",
"checkoutUrl":"http://dana_url/i/dana-my-bills/ipg-subscription?subscriptionId=20200815111315800000DANAW3ID560200290143&merchantId=216620000090572743732&ott="
}
},
"signature":"signature string"
}

ResultStatusResultCodeIdResultCodeResultMessageSolution
S 00000000SUCCESSsuccess
Mark Create Subscription First Payment process as Success
F 00000004PARAM_ILLEGALparameter illegal
Mark Create Subscription First Payment process as Failed. Retry request with proper parameter
U 00000900SYSTEM_ERRORsystem error
Mark Create Subscription First Payment process as Failed. Retry request periodically. If error is raising, can contact to DANA to check the process
F 00000900PARTNER_SYSTEM_ERRORsystem error
Mark Create Subscription First Payment process as Failed. Retry request periodically. If error is raising, can contact to DANA to check the process
F 12015901USER_NOT_EXISTDANA user not exist
Mark Create Subscription First Payment process as Failed. Retry request with proper parameter or can contact to DANA to check the user/account status
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.