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 charactersRequiredAPI version. As per the respective API reference
function
string
1 - 128 charactersRequiredAccording to specifications defined by each business domain.
Value:
Value:
dana.recurring.openapi.subscription.createSubscriptionclientId
string
1 - 36 charactersRequiredClient identifier which provided by DANA and used to identify partner and application system
clientSecret
string
1 - 64 charactersRequiredAs a secret key of client. Assigned client secret during registration
reqTime
string
25 charactersRequiredRequest time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
reqMsgId
string
1 - 64 charactersRequiredIdentify an unique system request. Each request will be assigned with a unique identifier (UUID)
accessToken
string
1 - 512 charactersRequiredContains customer token, which has been obtained from binding process
reserve
string
1 - 256 charactersReserved for future implementation (Key/Value)
subscriptionVersion
string
1 charactersConditionalAuto deduction mode version, with value:
2 for auto deduct version trigger by DANA.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 charactersRequiredRecurring type. The value must be filled with
AUTODEDUCTIONbizType
string
8 charactersRequiredSubscription biz type. The value must be filled with
USER_BIZmerchantId
string
21 charactersMerchant identifier that is unique per each merchant
merchantTransId
string
1 - 64 charactersRequiredMerchant unique identifier for each transaction. This value is generated by merchant
subMerchantId
string
1 - 64 charactersSub 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
RequiredEnvironment information. The envInfo include the parameter of:
- sourcePlatform: The value must be
IPG - terminalType: The value must be
APP
extInfo
json object
ConditionalExtended 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.,
3times
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
RequiredDefine the detail of subscription information. Refer to subscriptionInfo
subscriptionTitle
string
1 - 128 charactersRequiredSubscription title, the value must be the same with goodsName
subscriptionMessage
string
1 - 256 charactersDetail of subscription title
subscriptionIntervalInfo
json object
RequiredDefine the detail of subscription interval information. Refer to subscriptionIntervalInfo
type
string
1 - 7 charactersRequiredInterval type. The possible values are:
•
•
•
For now, this value only support
•
MONTHLY •
WEEKLY •
DAILY For now, this value only support
MONTHLYvalue
integer
RequiredSubscription interval value. E.g.,
2 means the subscription is made for every 2 monthsgoodsInfo
json object
RequiredDefine the detail of goods information goodsInfo
extGoodsId
string
1 - 64 charactersRequiredMerchant goods/product identifier
goodsId
string
1 - 64 charactersMerchant goods/product identifier
goodsName
string
1 - 64 charactersRequiredMerchant goods name
goodsType
string
17 charactersRequiredGeneral goods type for merchant which determined by DANA. The value must be filled with
EXTERNAL_MERCHANTgoodsDesc
string
1 - 1024 charactersMerchant goods description
minPrice
json object
RequiredDefine 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
cent
string
1 - 19 charactersRequiredValue 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)
For example: To create a charge for $1.00, set amount=100 (100 cents)
currencyValue
string
1 - 3 charactersRequiredThe code of currency, for IDR is
360maxPrice
json object
RequiredDefine 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
cent
string
1 - 19 charactersRequiredValue 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)
For example: To create a charge for $1.00, set amount=100 (100 cents)
currencyValue
string
1 - 3 charactersRequiredThe code of currency, for IDR is
360extInfo
array of string
1 - 4096 charactersExtended information
Note
For PERIOD: Count start from 1 but when create must larger than 0
currency
string
1 - 3 charactersRequiredThe currency
payReturnUrl
string
1 - 2048 charactersPay 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":"2",
"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",
"goodsName":"goods sample",
"goodsType":"EXTERNAL_MERCHANT",
"goodsDesc":"goods desc",
"currency":"IDR",
"minPrice":{
"cent":"1000000",
"currencyValue":"360"
},
"maxPrice":{
"cent":"1000000",
"currencyValue":"360"
},
"extInfo":{
}
}
},
"payReturnUrl":"http://merchantsite.com"
},
"signature":"signature string"
}
}
version
string
1 - 8 charactersRequiredAPI version. As per the respective API reference
function
string
1 - 128 charactersRequiredAccording to specifications defined by each business domain.
Value:
Value:
dana.recurring.openapi.subscription.createSubscriptionclientId
string
1 - 36 charactersRequiredClient identifier which provided by DANA and used to identify partner and application system
clientSecret
string
1 - 64 charactersRequiredAs a secret key of client. Assigned client secret during registration
respTime
string
25 charactersRequiredResponse time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
reqMsgId
string
1 - 64 charactersRequiredIdentify an unique system request. Each request will be assigned with a unique identifier (UUID)
accessToken
string
1 - 512 charactersRequiredContains customer token, which has been obtained from binding process
reserve
string
1 - 256 charactersReserved for future implementation (Key/Value)
resultInfo
json object
RequiredDefine the detail of result information
resultStatus
string
1 charactersRequiredResult status, refer to result code list ResultStatus. The status of the request can be:
S: SuccessF: FailureU: Unknown
resultCodeId
string
1 - 16 charactersRequiredResult code identifier, refer to result code list ResultCodeId
resultCode
string
1 - 64 charactersRequiredResult code string, refer to ResultCode
resultMsg
string
1 - 256 charactersResult message, refer to result code list ResultMsg
subscriptionId
string
1 - 64 charactersRequiredSubscription identifier
checkoutUrl
string
1 - 2048 charactersRequiredCheckout 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"
}
| ResultStatus | ResultCodeId | ResultCode | ResultMessage | Solution |
|---|---|---|---|---|
| S | 00000000 | SUCCESS | success | Mark Create Subscription First Payment process as Success |
| F | 00000004 | PARAM_ILLEGAL | parameter illegal | Mark Create Subscription First Payment process as Failed. Retry request with proper parameter |
| U | 00000900 | SYSTEM_ERROR | system 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 | 00000900 | PARTNER_SYSTEM_ERROR | system 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 | 12015901 | USER_NOT_EXIST | DANA 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 |