curl --request POST \
--url https://api.example.com/api/v1/order/create \
--header 'Content-Type: application/json' \
--data '
{
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"orderCurrency": "IDR",
"orderAmount": 10,
"orderDescription": "replace order desc...,",
"orderRequestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant-notify-url.com",
"merchantInfo": {
"merchantId": 1000000201,
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "0001",
"userEmail": "test@email.com",
"userTerminal": "WEB",
"userCreatedAt": "2021-05-16T08:00:00.000Z",
"userPhone": "<string>",
"userCountryCode": "<string>",
"userFirstName": "<string>",
"userLastName": "<string>",
"userBrowserIp": "<string>",
"userAgent": "<string>",
"userReceiptUrl": "<string>"
},
"paymentInfo": {
"productName": "ONE_TIME_PAYMENT",
"payMethodType": "EWALLET",
"payMethodName": "DANA",
"payMethodProperties": "<string>",
"userPaymentAccessToken": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccountType": "<string>",
"cashierLanguage": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"captureMode": "<string>",
"merchantInitiatedMode": "<string>"
},
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "IDR",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"successRedirectUrl": "https://merchant-success-redirecturl.com",
"failedRedirectUrl": "https://merchant-failed-redirecturl.com",
"cancelRedirectUrl": "https://merchant-cancel-url.com",
"extendInfo": "<string>",
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"cardInfo": null,
"paymentTokenData": "<string>",
"riskData": {
"userType": "Individual",
"userCategory": "Member",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "252.13.13.26",
"userLastSeenIp": "252.10.10.20",
"userIsNew": "No",
"userIsFirstPurchase": "No"
},
"x402Info": {
"x402Request": true,
"paymentSignatureHeader": "<string>"
},
"addressInfo": {
"address": "street 123 ...",
"city": "city123",
"region": "region or state or province 123",
"postcode": 112233,
"addressCountryCode": "IDN"
}
}
'import requests
url = "https://api.example.com/api/v1/order/create"
payload = {
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"orderCurrency": "IDR",
"orderAmount": 10,
"orderDescription": "replace order desc...,",
"orderRequestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant-notify-url.com",
"merchantInfo": {
"merchantId": 1000000201,
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "0001",
"userEmail": "test@email.com",
"userTerminal": "WEB",
"userCreatedAt": "2021-05-16T08:00:00.000Z",
"userPhone": "<string>",
"userCountryCode": "<string>",
"userFirstName": "<string>",
"userLastName": "<string>",
"userBrowserIp": "<string>",
"userAgent": "<string>",
"userReceiptUrl": "<string>"
},
"paymentInfo": {
"productName": "ONE_TIME_PAYMENT",
"payMethodType": "EWALLET",
"payMethodName": "DANA",
"payMethodProperties": "<string>",
"userPaymentAccessToken": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccountType": "<string>",
"cashierLanguage": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"captureMode": "<string>",
"merchantInitiatedMode": "<string>"
},
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "IDR",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"successRedirectUrl": "https://merchant-success-redirecturl.com",
"failedRedirectUrl": "https://merchant-failed-redirecturl.com",
"cancelRedirectUrl": "https://merchant-cancel-url.com",
"extendInfo": "<string>",
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"cardInfo": None,
"paymentTokenData": "<string>",
"riskData": {
"userType": "Individual",
"userCategory": "Member",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "252.13.13.26",
"userLastSeenIp": "252.10.10.20",
"userIsNew": "No",
"userIsFirstPurchase": "No"
},
"x402Info": {
"x402Request": True,
"paymentSignatureHeader": "<string>"
},
"addressInfo": {
"address": "street 123 ...",
"city": "city123",
"region": "region or state or province 123",
"postcode": 112233,
"addressCountryCode": "IDN"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
paymentRequestId: '<string>',
merchantOrderId: '<string>',
orderCurrency: 'IDR',
orderAmount: 10,
orderDescription: 'replace order desc...,',
orderRequestedAt: '2023-11-07T05:31:56Z',
notifyUrl: 'https://merchant-notify-url.com',
merchantInfo: {merchantId: 1000000201, subMerchantId: '<string>'},
userInfo: {
userId: '0001',
userEmail: 'test@email.com',
userTerminal: 'WEB',
userCreatedAt: '2021-05-16T08:00:00.000Z',
userPhone: '<string>',
userCountryCode: '<string>',
userFirstName: '<string>',
userLastName: '<string>',
userBrowserIp: '<string>',
userAgent: '<string>',
userReceiptUrl: '<string>'
},
paymentInfo: {
productName: 'ONE_TIME_PAYMENT',
payMethodType: 'EWALLET',
payMethodName: 'DANA',
payMethodProperties: '<string>',
userPaymentAccessToken: '<string>',
payMethodUserAccountNo: '<string>',
payMethodUserAccountType: '<string>',
cashierLanguage: '<string>',
cashierAppearance: '<string>',
payMethodCountry: '<string>',
captureMode: '<string>',
merchantInitiatedMode: '<string>'
},
promotionInfo: {promotionCode: '<string>', couponId: '<string>'},
userCurrency: 'IDR',
orderExpiredAt: '2023-11-07T05:31:56Z',
successRedirectUrl: 'https://merchant-success-redirecturl.com',
failedRedirectUrl: 'https://merchant-failed-redirecturl.com',
cancelRedirectUrl: 'https://merchant-cancel-url.com',
extendInfo: '<string>',
brandInfo: {
cashierLogoUrl: '<string>',
cashierDisplayName: '<string>',
cashierProductImageUrl: '<string>'
},
cardInfo: null,
paymentTokenData: '<string>',
riskData: {
userType: 'Individual',
userCategory: 'Member',
userLegalName: '<string>',
userDisplayName: '<string>',
userRegistrationIp: '252.13.13.26',
userLastSeenIp: '252.10.10.20',
userIsNew: 'No',
userIsFirstPurchase: 'No'
},
x402Info: {x402Request: true, paymentSignatureHeader: '<string>'},
addressInfo: {
address: 'street 123 ...',
city: 'city123',
region: 'region or state or province 123',
postcode: 112233,
addressCountryCode: 'IDN'
}
})
};
fetch('https://api.example.com/api/v1/order/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/order/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentRequestId' => '<string>',
'merchantOrderId' => '<string>',
'orderCurrency' => 'IDR',
'orderAmount' => 10,
'orderDescription' => 'replace order desc...,',
'orderRequestedAt' => '2023-11-07T05:31:56Z',
'notifyUrl' => 'https://merchant-notify-url.com',
'merchantInfo' => [
'merchantId' => 1000000201,
'subMerchantId' => '<string>'
],
'userInfo' => [
'userId' => '0001',
'userEmail' => 'test@email.com',
'userTerminal' => 'WEB',
'userCreatedAt' => '2021-05-16T08:00:00.000Z',
'userPhone' => '<string>',
'userCountryCode' => '<string>',
'userFirstName' => '<string>',
'userLastName' => '<string>',
'userBrowserIp' => '<string>',
'userAgent' => '<string>',
'userReceiptUrl' => '<string>'
],
'paymentInfo' => [
'productName' => 'ONE_TIME_PAYMENT',
'payMethodType' => 'EWALLET',
'payMethodName' => 'DANA',
'payMethodProperties' => '<string>',
'userPaymentAccessToken' => '<string>',
'payMethodUserAccountNo' => '<string>',
'payMethodUserAccountType' => '<string>',
'cashierLanguage' => '<string>',
'cashierAppearance' => '<string>',
'payMethodCountry' => '<string>',
'captureMode' => '<string>',
'merchantInitiatedMode' => '<string>'
],
'promotionInfo' => [
'promotionCode' => '<string>',
'couponId' => '<string>'
],
'userCurrency' => 'IDR',
'orderExpiredAt' => '2023-11-07T05:31:56Z',
'successRedirectUrl' => 'https://merchant-success-redirecturl.com',
'failedRedirectUrl' => 'https://merchant-failed-redirecturl.com',
'cancelRedirectUrl' => 'https://merchant-cancel-url.com',
'extendInfo' => '<string>',
'brandInfo' => [
'cashierLogoUrl' => '<string>',
'cashierDisplayName' => '<string>',
'cashierProductImageUrl' => '<string>'
],
'cardInfo' => null,
'paymentTokenData' => '<string>',
'riskData' => [
'userType' => 'Individual',
'userCategory' => 'Member',
'userLegalName' => '<string>',
'userDisplayName' => '<string>',
'userRegistrationIp' => '252.13.13.26',
'userLastSeenIp' => '252.10.10.20',
'userIsNew' => 'No',
'userIsFirstPurchase' => 'No'
],
'x402Info' => [
'x402Request' => true,
'paymentSignatureHeader' => '<string>'
],
'addressInfo' => [
'address' => 'street 123 ...',
'city' => 'city123',
'region' => 'region or state or province 123',
'postcode' => 112233,
'addressCountryCode' => 'IDN'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/order/create"
payload := strings.NewReader("{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/order/create")
.header("Content-Type", "application/json")
.body("{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/order/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"acquiringOrderId": "<string>",
"orderStatus": "<string>",
"orderAction": "<string>",
"x402Info": {
"x402Request": true,
"paymentSignatureHeader": "<string>",
"x402Response": "<string>"
}
}
}Create new order
Note: For certain Pay Methods, some optional fields are required. Kindly refer to Section Specific Pay Method Requirement
curl --request POST \
--url https://api.example.com/api/v1/order/create \
--header 'Content-Type: application/json' \
--data '
{
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"orderCurrency": "IDR",
"orderAmount": 10,
"orderDescription": "replace order desc...,",
"orderRequestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant-notify-url.com",
"merchantInfo": {
"merchantId": 1000000201,
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "0001",
"userEmail": "test@email.com",
"userTerminal": "WEB",
"userCreatedAt": "2021-05-16T08:00:00.000Z",
"userPhone": "<string>",
"userCountryCode": "<string>",
"userFirstName": "<string>",
"userLastName": "<string>",
"userBrowserIp": "<string>",
"userAgent": "<string>",
"userReceiptUrl": "<string>"
},
"paymentInfo": {
"productName": "ONE_TIME_PAYMENT",
"payMethodType": "EWALLET",
"payMethodName": "DANA",
"payMethodProperties": "<string>",
"userPaymentAccessToken": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccountType": "<string>",
"cashierLanguage": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"captureMode": "<string>",
"merchantInitiatedMode": "<string>"
},
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "IDR",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"successRedirectUrl": "https://merchant-success-redirecturl.com",
"failedRedirectUrl": "https://merchant-failed-redirecturl.com",
"cancelRedirectUrl": "https://merchant-cancel-url.com",
"extendInfo": "<string>",
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"cardInfo": null,
"paymentTokenData": "<string>",
"riskData": {
"userType": "Individual",
"userCategory": "Member",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "252.13.13.26",
"userLastSeenIp": "252.10.10.20",
"userIsNew": "No",
"userIsFirstPurchase": "No"
},
"x402Info": {
"x402Request": true,
"paymentSignatureHeader": "<string>"
},
"addressInfo": {
"address": "street 123 ...",
"city": "city123",
"region": "region or state or province 123",
"postcode": 112233,
"addressCountryCode": "IDN"
}
}
'import requests
url = "https://api.example.com/api/v1/order/create"
payload = {
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"orderCurrency": "IDR",
"orderAmount": 10,
"orderDescription": "replace order desc...,",
"orderRequestedAt": "2023-11-07T05:31:56Z",
"notifyUrl": "https://merchant-notify-url.com",
"merchantInfo": {
"merchantId": 1000000201,
"subMerchantId": "<string>"
},
"userInfo": {
"userId": "0001",
"userEmail": "test@email.com",
"userTerminal": "WEB",
"userCreatedAt": "2021-05-16T08:00:00.000Z",
"userPhone": "<string>",
"userCountryCode": "<string>",
"userFirstName": "<string>",
"userLastName": "<string>",
"userBrowserIp": "<string>",
"userAgent": "<string>",
"userReceiptUrl": "<string>"
},
"paymentInfo": {
"productName": "ONE_TIME_PAYMENT",
"payMethodType": "EWALLET",
"payMethodName": "DANA",
"payMethodProperties": "<string>",
"userPaymentAccessToken": "<string>",
"payMethodUserAccountNo": "<string>",
"payMethodUserAccountType": "<string>",
"cashierLanguage": "<string>",
"cashierAppearance": "<string>",
"payMethodCountry": "<string>",
"captureMode": "<string>",
"merchantInitiatedMode": "<string>"
},
"promotionInfo": {
"promotionCode": "<string>",
"couponId": "<string>"
},
"userCurrency": "IDR",
"orderExpiredAt": "2023-11-07T05:31:56Z",
"successRedirectUrl": "https://merchant-success-redirecturl.com",
"failedRedirectUrl": "https://merchant-failed-redirecturl.com",
"cancelRedirectUrl": "https://merchant-cancel-url.com",
"extendInfo": "<string>",
"brandInfo": {
"cashierLogoUrl": "<string>",
"cashierDisplayName": "<string>",
"cashierProductImageUrl": "<string>"
},
"cardInfo": None,
"paymentTokenData": "<string>",
"riskData": {
"userType": "Individual",
"userCategory": "Member",
"userLegalName": "<string>",
"userDisplayName": "<string>",
"userRegistrationIp": "252.13.13.26",
"userLastSeenIp": "252.10.10.20",
"userIsNew": "No",
"userIsFirstPurchase": "No"
},
"x402Info": {
"x402Request": True,
"paymentSignatureHeader": "<string>"
},
"addressInfo": {
"address": "street 123 ...",
"city": "city123",
"region": "region or state or province 123",
"postcode": 112233,
"addressCountryCode": "IDN"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
paymentRequestId: '<string>',
merchantOrderId: '<string>',
orderCurrency: 'IDR',
orderAmount: 10,
orderDescription: 'replace order desc...,',
orderRequestedAt: '2023-11-07T05:31:56Z',
notifyUrl: 'https://merchant-notify-url.com',
merchantInfo: {merchantId: 1000000201, subMerchantId: '<string>'},
userInfo: {
userId: '0001',
userEmail: 'test@email.com',
userTerminal: 'WEB',
userCreatedAt: '2021-05-16T08:00:00.000Z',
userPhone: '<string>',
userCountryCode: '<string>',
userFirstName: '<string>',
userLastName: '<string>',
userBrowserIp: '<string>',
userAgent: '<string>',
userReceiptUrl: '<string>'
},
paymentInfo: {
productName: 'ONE_TIME_PAYMENT',
payMethodType: 'EWALLET',
payMethodName: 'DANA',
payMethodProperties: '<string>',
userPaymentAccessToken: '<string>',
payMethodUserAccountNo: '<string>',
payMethodUserAccountType: '<string>',
cashierLanguage: '<string>',
cashierAppearance: '<string>',
payMethodCountry: '<string>',
captureMode: '<string>',
merchantInitiatedMode: '<string>'
},
promotionInfo: {promotionCode: '<string>', couponId: '<string>'},
userCurrency: 'IDR',
orderExpiredAt: '2023-11-07T05:31:56Z',
successRedirectUrl: 'https://merchant-success-redirecturl.com',
failedRedirectUrl: 'https://merchant-failed-redirecturl.com',
cancelRedirectUrl: 'https://merchant-cancel-url.com',
extendInfo: '<string>',
brandInfo: {
cashierLogoUrl: '<string>',
cashierDisplayName: '<string>',
cashierProductImageUrl: '<string>'
},
cardInfo: null,
paymentTokenData: '<string>',
riskData: {
userType: 'Individual',
userCategory: 'Member',
userLegalName: '<string>',
userDisplayName: '<string>',
userRegistrationIp: '252.13.13.26',
userLastSeenIp: '252.10.10.20',
userIsNew: 'No',
userIsFirstPurchase: 'No'
},
x402Info: {x402Request: true, paymentSignatureHeader: '<string>'},
addressInfo: {
address: 'street 123 ...',
city: 'city123',
region: 'region or state or province 123',
postcode: 112233,
addressCountryCode: 'IDN'
}
})
};
fetch('https://api.example.com/api/v1/order/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/order/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentRequestId' => '<string>',
'merchantOrderId' => '<string>',
'orderCurrency' => 'IDR',
'orderAmount' => 10,
'orderDescription' => 'replace order desc...,',
'orderRequestedAt' => '2023-11-07T05:31:56Z',
'notifyUrl' => 'https://merchant-notify-url.com',
'merchantInfo' => [
'merchantId' => 1000000201,
'subMerchantId' => '<string>'
],
'userInfo' => [
'userId' => '0001',
'userEmail' => 'test@email.com',
'userTerminal' => 'WEB',
'userCreatedAt' => '2021-05-16T08:00:00.000Z',
'userPhone' => '<string>',
'userCountryCode' => '<string>',
'userFirstName' => '<string>',
'userLastName' => '<string>',
'userBrowserIp' => '<string>',
'userAgent' => '<string>',
'userReceiptUrl' => '<string>'
],
'paymentInfo' => [
'productName' => 'ONE_TIME_PAYMENT',
'payMethodType' => 'EWALLET',
'payMethodName' => 'DANA',
'payMethodProperties' => '<string>',
'userPaymentAccessToken' => '<string>',
'payMethodUserAccountNo' => '<string>',
'payMethodUserAccountType' => '<string>',
'cashierLanguage' => '<string>',
'cashierAppearance' => '<string>',
'payMethodCountry' => '<string>',
'captureMode' => '<string>',
'merchantInitiatedMode' => '<string>'
],
'promotionInfo' => [
'promotionCode' => '<string>',
'couponId' => '<string>'
],
'userCurrency' => 'IDR',
'orderExpiredAt' => '2023-11-07T05:31:56Z',
'successRedirectUrl' => 'https://merchant-success-redirecturl.com',
'failedRedirectUrl' => 'https://merchant-failed-redirecturl.com',
'cancelRedirectUrl' => 'https://merchant-cancel-url.com',
'extendInfo' => '<string>',
'brandInfo' => [
'cashierLogoUrl' => '<string>',
'cashierDisplayName' => '<string>',
'cashierProductImageUrl' => '<string>'
],
'cardInfo' => null,
'paymentTokenData' => '<string>',
'riskData' => [
'userType' => 'Individual',
'userCategory' => 'Member',
'userLegalName' => '<string>',
'userDisplayName' => '<string>',
'userRegistrationIp' => '252.13.13.26',
'userLastSeenIp' => '252.10.10.20',
'userIsNew' => 'No',
'userIsFirstPurchase' => 'No'
],
'x402Info' => [
'x402Request' => true,
'paymentSignatureHeader' => '<string>'
],
'addressInfo' => [
'address' => 'street 123 ...',
'city' => 'city123',
'region' => 'region or state or province 123',
'postcode' => 112233,
'addressCountryCode' => 'IDN'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/order/create"
payload := strings.NewReader("{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/order/create")
.header("Content-Type", "application/json")
.body("{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/order/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentRequestId\": \"<string>\",\n \"merchantOrderId\": \"<string>\",\n \"orderCurrency\": \"IDR\",\n \"orderAmount\": 10,\n \"orderDescription\": \"replace order desc...,\",\n \"orderRequestedAt\": \"2023-11-07T05:31:56Z\",\n \"notifyUrl\": \"https://merchant-notify-url.com\",\n \"merchantInfo\": {\n \"merchantId\": 1000000201,\n \"subMerchantId\": \"<string>\"\n },\n \"userInfo\": {\n \"userId\": \"0001\",\n \"userEmail\": \"test@email.com\",\n \"userTerminal\": \"WEB\",\n \"userCreatedAt\": \"2021-05-16T08:00:00.000Z\",\n \"userPhone\": \"<string>\",\n \"userCountryCode\": \"<string>\",\n \"userFirstName\": \"<string>\",\n \"userLastName\": \"<string>\",\n \"userBrowserIp\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userReceiptUrl\": \"<string>\"\n },\n \"paymentInfo\": {\n \"productName\": \"ONE_TIME_PAYMENT\",\n \"payMethodType\": \"EWALLET\",\n \"payMethodName\": \"DANA\",\n \"payMethodProperties\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"payMethodUserAccountNo\": \"<string>\",\n \"payMethodUserAccountType\": \"<string>\",\n \"cashierLanguage\": \"<string>\",\n \"cashierAppearance\": \"<string>\",\n \"payMethodCountry\": \"<string>\",\n \"captureMode\": \"<string>\",\n \"merchantInitiatedMode\": \"<string>\"\n },\n \"promotionInfo\": {\n \"promotionCode\": \"<string>\",\n \"couponId\": \"<string>\"\n },\n \"userCurrency\": \"IDR\",\n \"orderExpiredAt\": \"2023-11-07T05:31:56Z\",\n \"successRedirectUrl\": \"https://merchant-success-redirecturl.com\",\n \"failedRedirectUrl\": \"https://merchant-failed-redirecturl.com\",\n \"cancelRedirectUrl\": \"https://merchant-cancel-url.com\",\n \"extendInfo\": \"<string>\",\n \"brandInfo\": {\n \"cashierLogoUrl\": \"<string>\",\n \"cashierDisplayName\": \"<string>\",\n \"cashierProductImageUrl\": \"<string>\"\n },\n \"cardInfo\": null,\n \"paymentTokenData\": \"<string>\",\n \"riskData\": {\n \"userType\": \"Individual\",\n \"userCategory\": \"Member\",\n \"userLegalName\": \"<string>\",\n \"userDisplayName\": \"<string>\",\n \"userRegistrationIp\": \"252.13.13.26\",\n \"userLastSeenIp\": \"252.10.10.20\",\n \"userIsNew\": \"No\",\n \"userIsFirstPurchase\": \"No\"\n },\n \"x402Info\": {\n \"x402Request\": true,\n \"paymentSignatureHeader\": \"<string>\"\n },\n \"addressInfo\": {\n \"address\": \"street 123 ...\",\n \"city\": \"city123\",\n \"region\": \"region or state or province 123\",\n \"postcode\": 112233,\n \"addressCountryCode\": \"IDN\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"paymentRequestId": "<string>",
"merchantOrderId": "<string>",
"acquiringOrderId": "<string>",
"orderStatus": "<string>",
"orderAction": "<string>",
"x402Info": {
"x402Request": true,
"paymentSignatureHeader": "<string>",
"x402Response": "<string>"
}
}
}Body
Payment request id sent from Merchant. It will also be used for idempotent check.
32Merchant order id
64Merchant order currency
12"IDR"
Merchant order amount
2410
Order description information
128"replace order desc...,"
Merchant-side request time
The callback address to notify the merchant after the payment is completed / failed
1024"https://merchant-notify-url.com"
Merchant info
Show child attributes
Show child attributes
User info
Show child attributes
Show child attributes
Payment information
Show child attributes
Show child attributes
Promotion info for coupon marketing and internal amount adjustment
Show child attributes
Show child attributes
User payment currency. This is needed when merchant order currency is NOT the same as user payment currency
12"IDR"
The order expiry time set by merchant. If not set, the default merchant contract expiry time will be used
The address of the merchant page to redirect to after successful payment. If no value is provided, it will stay on the cashier page after successful payment.
1024"https://merchant-success-redirecturl.com"
The address of the merchant page to which the payment pre-verification fails, or the redirection after the payment fails. If no value is provided, it will stay on the cashier page after the payment fails
1024"https://merchant-failed-redirecturl.com"
The address of the merchant page to redirect to when user cancels the payment
512"https://merchant-cancel-url.com"
Reserved. Json format e.g. {"key1":"value1", "key2":"value2"}
128Merchant goods information
Show child attributes
Show child attributes
Brand display information for cashier
Show child attributes
Show child attributes
Card data info. It is only required when Merchant wants to pass in card data directly in API (note: Merchant needs to have PCI DSS certification)
Show child attributes
Show child attributes
null
User's ApplePay / GooglePay payment token. It is only required when Merchant choose to integrate with ApplePay / GooglePay frontend directly and pass in the encrypted payment token for Waffo to process the payment
8192riskData
Show child attributes
Show child attributes
x402 stablecoin payment info. x402Info.x402Request=true marks an x402 payin; mode① carries the Agent signature in x402Info.paymentSignatureHeader.
Show child attributes
Show child attributes
Address Information
Show child attributes
Show child attributes