Create Order
POST/payment-gateway/v1.0/debit/payment-host-to-host.htm
This API allows merchants to create orders on the DANA for Payment Gateway functionality.
API Type
SNAP API
Expected Timeout
8 second
SNAP Service Code
54
Accept
application/json
Content Type
applciation/json
This API is used for the following solution:
This solution provides the APIs of the Payment Gateway core system. It is specifically designed for merchants who wants to use their own checkout pages to display payment methods, such as virtual account or QRIS.
This solution offers a DANA-hosted checkout page designed for easy merchant integration. DANA handles the order creation and processing on behalf of merchants. This solution is ideal for merchants seeking faster integration since they don't need to develop their own checkout page.
Idempotent Key & Usage Rules
Idempotent is controlled by Idempotent Key ( merchantId + partnerReferenceNo)
- If Idempotent Key has been created and the key information is consistent, then Response code 2005400 (success) will be returned.
- If Idempotent Key has been created but the key information isn’t consistent, then Response code 4045418 (inconsistent request) will be returned.
Content-Type
string
1 - 127 charactersRequiredContent type, value always
application/json
X-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
X-SIGNATURE
string
RequiredSignature need to be generated with
asymmetricSignature
methodORIGIN
string
Origin domain
X-PARTNER-ID
string
1 - 36 charactersRequiredUnique identifier for partner was generated by DANA, or known as clientId
X-EXTERNAL-ID
string
1 - 36 charactersRequiredUnique messaging reference identifier generated by merchant and should be unique within the same day
CHANNEL-ID
string
1 - 5 charactersRequiredDevice identification on which the API services is currently being accessed by the end user (customer)
partnerReferenceNo
string
1 - 64 charactersRequiredTransaction identifier on partner system
merchantId
string
1 - 64 charactersRequiredMerchant identifier that is unique per each merchant
subMerchantId
string
1 - 32 charactersInformation of sub merchant identifier
amount
money
RequiredAmount. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
externalStoreId
string
1 - 64 charactersStore identifier to indicate to which store this payment belongs to
validUpTo
string
25 charactersThe time when the payment will be automatically expired, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
disabledPayMethods
string
1 - 64 charactersPayment method(s) that cannot be used for this
urlParams
array of json object
RequiredNotify URL that DANA must send the payment notification to
url
string
1 - 512 charactersRequiredURL link
type
string
1 - 32 charactersRequiredURL type with values:
•
•
•
NOTIFICATION
: When finish payment, DANA will notify to the URL that has been defined by partner •
PAY_RETURN
: After the payment, the user will be redirected to merchant page, this is mandatoryisDeeplink
string
1 charactersRequiredDeeplink URL or not
payOptionDetails
json object
ConditionalPayment option that will be used for this payment; Only use for Gapura Custom Checkout service
Conditional Info
Y:= Gapura Custom Checkout
payMethod
string
1 - 64 charactersRequiredPayment method e.g.,
NETWORK_PAY
, refer to PayMethodEnumBALANCE
Payment method with balance
COUPON
Payment method with coupon
NET_BANKING
Payment method with internet banking
CREDIT_CARD
Payment method with credit card
DEBIT_CARD
Payment method with debit card
VIRTUAL_ACCOUNT
Payment method with virtual account
OTC
Payment method with OTC
DIRECT_DEBIT_CREDIT_CARD
Payment method with direct debit of credit card
DIRECT_DEBIT_DEBIT_CARD
Payment method with direct debit of debit card
ONLINE_CREDIT
Payment method with online credit
LOAN_CREDIT
Payment method with DANA Cicil
NETWORK_PAY
Payment method with e-wallet
VIRTUAL_ACCOUNT
Payment method with virtual account
payOption
string
1 - 64 charactersRequiredPayment option which shows the provider of this payment, refer to PayOptionEnum
NETWORK_PAY_PG_SPAY
Payment method with ShopeePay e-wallet
NETWORK_PAY_PG_OVO
Payment method with OVO e-wallet
NETWORK_PAY_PG_GOPAY
Payment method with Gopay e-wallet
NETWORK_PAY_PG_LINKAJA
Payment method with LinkAja e-wallet
NETWORK_PAY_PG_CARD
Payment method with Card
VIRTUAL_ACCOUNT_BCA
Payment method with BCA virtual account
VIRTUAL_ACCOUNT_BNI
Payment method with BNI virtual account
VIRTUAL_ACCOUNT_MANDIRI
Payment method with Mandiri virtual account
VIRTUAL_ACCOUNT_BRI
Payment method with BRI virtual account
VIRTUAL_ACCOUNT_BTPN
Payment method with BTPN virtual account
VIRTUAL_ACCOUNT_CIMB
Payment method with CIMB virtual account
VIRTUAL_ACCOUNT_PERMATA
Payment method with Permata virtual account
transAmount
money
RequiredTrans amount. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
feeAmount
money
Fee amount. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
cardToken
string
1 - 64 charactersConditionalToken that used for payment with card
Conditional Info
Y:= Card Payment
merchantToken
string
1 - 64 charactersMerchant token used for this payment
additionalInfo
json object
Additional information
phoneNumber
string
1 - 15 charactersConditionalUser’s phone number
Conditional Info
Y:= Card and e-wallet Payment
paymentCode
string
1 - 64 charactersConditionalPayment code that used for payment with virtual account
Conditional Info
Y:= Virtual account Payment
additionalInfo.promoInfos
array of json object
ConditionalAdditional Information of promotion
Conditional Info
Y:= Want to apply the promo
promoAmount
money
RequiredFee amount. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
promoId
string
1 - 64 charactersRequiredPromo identifier
promoType
string
1 - 32 charactersRequiredType’s of promo, value always
DIRECT_DISCOUNT
additionalInfo
json object
Additional information
additionalInfo.order.orderTitle
string
1 - 64 charactersRequiredAdditional information of order title
additionalInfo.order.scenario
string
1 - 64 charactersRequiredAdditional information of order scenario. Refer to ScenarioEnum.; For Gapura Hosted Checkout scenario, need to fill it as `REDIRECT`; For Gapura Custom Checkout scenario, need to fill it as `API`
REDIRECT
string
Merchant will be redirected to DANA checkout page
API
string
Merchant can implement own User interface
additionalInfo.order.merchantTransType
string
1 - 64 charactersAdditional information of merchant transaction type
additionalInfo.order.buyer
json object
RequiredAdditional information of buyer
externalUserType
string
1 - 32 charactersConditionalType of external user
Conditional Info
Y:= externalUserId is filled
nickname
string
1 - 64 charactersNickname, user’s nick name in DANA’s
externalUserId
string
1 - 32 charactersConditionalExternal user identifier
Conditional Info
Y:= externalUserType is filled
userId
string
1 - 32 charactersDANA’s user identifier
additionalInfo.order.goods
array of json object
Additional information of goods
unit
string
1 - 64 charactersGoods unit
category
string
1 - 64 charactersRequiredGoods category
price
money
RequiredGoods price. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
merchantShippingId
string
1 - 64 charactersShipment identifier provided by merchant
merchantGoodsId
string
1 - 64 charactersRequiredGoods identifier provided by merchant
description
string
1 - 1024 charactersRequiredGoods description
snapshotUrl
string
1 - 512 charactersThe URL of good’s snapshot web page
quantity
string
1 - 16 charactersRequiredCount of items
extendInfo
string
1 - 4096 charactersExtend information
additionalInfo.order.shippingInfo
json object
Additional information of shipping info
chargeAmount
money
Charge amount. Contains two sub-fields:
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Amount, including the cents
2. Currency: Currency code based on ISO
lastName
string
1 - 64 charactersRequiredLast name
trackingNo
string
1 - 64 charactersNumber of tracking
countryName
string
1 - 64 charactersRequiredName of country
merchantShippingId
string
1 - 64 charactersRequiredMerchant shipping identifier
cityName
string
1 - 64 charactersRequiredName of city
address1
string
1 - 256 charactersRequiredInformation of address 1
address2
string
1 - 256 charactersInformation of address 2
phoneNo
string
1 - 32 charactersPhone number
areaName
string
1 - 64 charactersName of area
email
string
1 - 128 charactersEmail
zipCode
string
1 - 32 charactersRequiredZip code
stateName
string
1 - 64 charactersRequiredName of state
faxNo
string
1 - 32 charactersFax number
carrier
string
1 - 64 charactersInformation of carrier
firstName
string
1 - 64 charactersRequiredFirst name
mobileNo
string
1 - 32 charactersMobile number
additionalInfo.order.extendInfo
string
1 - 4096 charactersAdditional information of extend
additionalInfo.mcc
string
1 - 64 charactersRequiredAdditional information of merchant category code. This parameter is used to identify the type of business in which a merchant is engaged. Refer to Details of Merchant Category Code
additionalInfo.extendInfo
string
1 - 4096 charactersAdditional information of extend such as partner passthrough and risk information
additionalInfo.envInfo
json object
RequiredAdditional information of environment info
sessionId
string
1 - 128 charactersSession identifier
tokenId
string
1 - 128 charactersToken identifier
websiteLanguage
string
1 - 16 charactersWebsite language
clientIp
string
1 - 32 charactersClient IP address
osType
string
1 - 128 charactersOperating system type
appVersion
string
1 - 128 charactersApp version
sdkVersion
string
1 - 128 charactersSDK version
sourcePlatform
string
1 - 32 charactersRequiredSource platform, refer to SourcePlatformEnum
IPG
The source platform is independent payment gateway
clientKey
string
1 - 64 charactersUnique identifier for partner was generated by DANA
orderTerminalType
string
1 - 32 charactersRequiredOrder terminal type, refer to OrderTerminalTypeEnum
APP
Mobile Application
WEB
Browser Web
WAP
Mobile Wap
SYSTEM
System Call
terminalType
string
1 - 32 charactersRequiredTerminal type, refer to TerminalTypeEnum
APP
Mobile Application
WEB
Browser Web
WAP
Mobile Wap
SYSTEM
System Call
orderOsType
string
1 - 128 charactersOrder operating system type
merchantAppVersion
string
1 - 128 charactersMerchant App version
extendInfo
string
1 - 4096 charactersExtend information
Request Sample Payment Gateway
POST .../payment-gateway/v1.0/debit/payment-host-to-host.htm
Content-Type: application/json
X-TIMESTAMP: 2024-12-23T09:10:11+07:00
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
ORIGIN: www.hostname.com
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221
{
"partnerReferenceNo": "2020102900000000000001",
"merchantId": "23489182303312",
"subMerchantId": "310928924949487",
"amount": {
"value": "12345678.00",
"currency": "IDR"
},
"urlParams": [
{
"url": "https://test.bi.go.id/v1/test",
"type": "PAY_RETURN",
"isDeeplink": "Y"
},
{
"url": "https://test.bi.go.id/v1/test",
"type": "NOTIFICATION",
"isDeeplink": "Y"
}
],
"externalStoreId": "239840198240795109",
"validUpTo": "2020-12-23T07:44:11+07:00",
"payOptionDetails": [
{
"payMethod": "NETWORK_PAY",
"payOption": "NETWORK_PAY_PG_OVO",
"transAmount": {
"value": "12345678.00",
"currency": "IDR"
},
"feeAmount": {
"value": "12345678.00",
"currency": "IDR"
},
"cardToken": "",
"merchantToken": "",
"additionalInfo": {
"phoneNumber": "XXXXXXXXXX",
"paymentCode": "2837182378123",
"promoInfos": [
{
"promoAmount": {
"value": "12345678.00",
"currency": "IDR"
},
"promoId": "prm_372183721837213",
"promoType": "DIRECT_DISCOUNT"
}
]
}
}
],
"additionalInfo": {
"order": {
"orderTitle": "Payment Gateway Order",
"scenario": "API",
"merchantTransType": "SPECIAL_MOVIE",
"buyer": {
"externalUserType": "",
"nickname": "",
"externalUserId": "8392183912832913821",
"userId": ""
},
"goods": [
{
"unit": "Kg",
"category": "travelling/subway",
"price": {
"value": "10.00",
"currency": "IDR"
},
"merchantShippingId": "564314314574327545",
"merchantGoodsId": "24525635625623",
"description": "Women Summer Dress New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas",
"snapshotUrl": "[http://snap.url.com]",
"quantity": "",
"extendInfo": ""
}
],
"shippingInfo": [
{
"chargeAmount": {
"value": "20.00",
"currency": "IDR"
},
"lastName": "Li",
"trackingNo": "646431431322332133",
"countryName": "JP",
"merchantShippingId": "564314314574327545",
"cityName": "Atlanta",
"address1": "137 W San Bernardino",
"address2": "4114 Sepulveda",
"phoneNo": "2423-2322342",
"areaName": "Rd",
"email": "abc@gmail.com",
"zipCode": "310001",
"stateName": "GA",
"faxNo": "2123-11113",
"carrier": "Federal Express",
"firstName": "Jim",
"mobileNo": "13765443223"
}
]
},
"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",
"orderOsType": "IOS",
"merchantAppVersion": "1.0",
"terminalType": "SYSTEM",
"orderTerminalType": "WEB",
"extendInfo": "{\"deviceId\":\"CV19A56370e8a00d54293aab8001e4794\"}"
},
"extendInfo": "{\"key\":\"value\"}"
}
}
Content-Type
string
1 - 127 charactersRequiredContent type, value always
application/json
X-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
responseCode
string
7 charactersRequiredRefer to response code list
responseMessage
string
1 - 150 charactersRequiredRefer to response code list
referenceNo
string
1 - 64 charactersConditionalTransaction identifier on DANA system
Conditional Info
Y:= Successfully processed
partnerReferenceNo
string
1 - 64 charactersRequiredTransaction identifier on partner system
webRedirectUrl
string
1 - 2048 charactersConditionalCheckout URLs
Conditional Info
Y:= Successfully processed if the payment method is not OVO/Virtual Account/QRIS
additionalInfo.paymentCode
string
1 - 64 charactersConditionalAdditional information of payment code.
Conditional Info
Y:= Payment using Virtual Account/QRIS
Response Sample Payment Gateway
Content-Type: application/json
X-TIMESTAMP: 2024-12-23T09:10:11+07:00
{
"responseCode": "2005400",
"responseMessage": "Successful",
"referenceNo": "2020102977770000000009",
"partnerReferenceNo": "2020102900000000000001",
"webRedirectUrl": "https://pjsp.com/universal?bizNo=REF993883&...",
"additionalInfo": {
"paymentCode": "086262535263233"
}
}
Response | Cause | Solution |
---|---|---|
2005400Successful | Success to be processed | Mark Create Order process as Success |
4005400Bad Request | General request failed error | Mark Create Order process as Failed. Retry request with proper parameter |
4005401Invalid Field Format | Invalid format for certain field | Mark Create Order process as Failed. Retry request with proper parameter |
4005402Invalid Mandatory Field | Missing or invalid format on mandatory field | Mark Payment Create Order as Failed. Retry request with proper parameter |
4015400Unauthorized.; Invalid Signature | Signature is invalid | Mark Create Order process as Failed. Retry request with proper parameter |
4035402Exceeds Transaction Amount Limit | Exceeds transaction amount limit | Mark Create Order process as Failed. Try to adjust the order amount |
4035405Do Not Honor | Account or user status is abnormal | Mark Create Order process as Failed. Retry request with proper parameter or can contact DANA to check the user/account status |
4035415Transaction Not Permitted | Transaction not permitted | Mark Create Order process as Failed. Retry request periodically or consult to DANA |
4045408Invalid Merchant | Merchant does not exist or status abnormal | Mark Create Order process as Failed. Retry request with proper parameter |
4045418Inconsistent Request | Inconsistent request parameter found for the same partner reference number/transaction identifier | Mark Create Order process as Failed. Retry with proper parameter |
4295400Too Many Requests | Maximum transaction limit exceeded | Mark Create Order process as Pending. Retry request periodically by sending same request payload |
5005400General Error | General error | Mark Create Order process as Failed. Retry request periodically |
5005401Internal Server Error | Unknown internal server failure, please retry the process again | Mark Create Order process as Pending. Retry request periodically by sending same request payload |
Total timeout | Total timeout, the client side does not get any responses from the server side (Can be due to network issue, server slowing down, and so on) | Do a retry maximum 3 attempts by sending same request payload, if still fails mark Create Order process as Pending |
Unexpected response (Empty field/field does not exist/undefined response code) | The server does not produce expected responses (Can be due to hardware failure, bugs, and so on) |
|