Create Order
curl -X POST "https://sandbox-api.aparatech.io/v1/public/orders" \
-H "Content-Type: application/json" \
-H "MID: example_string" \
-d '{
"cxOrderId": "customerOrderId12",
"userId": "OCUX-17787550145567248",
"purposeCode": "company_expenses",
"orderType": "payin",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://www.google.com/",
"headlessMode": true,
"settlementPreference": "settlement",
"source": {
"currency": "IDR",
"amount": 3.14,
"paymentCode": "shopeepay",
"paymentType": "local_wallet"
}
}'
import requests
import json
url = "https://sandbox-api.aparatech.io/v1/public/orders"
headers = {
"Content-Type": "application/json",
"MID": "example_string"
}
data = {
"cxOrderId": "customerOrderId12",
"userId": "OCUX-17787550145567248",
"purposeCode": "company_expenses",
"orderType": "payin",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://www.google.com/",
"headlessMode": true,
"settlementPreference": "settlement",
"source": {
"currency": "IDR",
"amount": 3.14,
"paymentCode": "shopeepay",
"paymentType": "local_wallet"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://sandbox-api.aparatech.io/v1/public/orders", {
method: "POST",
headers: {
"Content-Type": "application/json",
"MID": "example_string"
},
body: JSON.stringify({
"cxOrderId": "customerOrderId12",
"userId": "OCUX-17787550145567248",
"purposeCode": "company_expenses",
"orderType": "payin",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://www.google.com/",
"headlessMode": true,
"settlementPreference": "settlement",
"source": {
"currency": "IDR",
"amount": 3.14,
"paymentCode": "shopeepay",
"paymentType": "local_wallet"
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"cxOrderId": "customerOrderId12",
"userId": "OCUX-17787550145567248",
"purposeCode": "company_expenses",
"orderType": "payin",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://www.google.com/",
"headlessMode": true,
"settlementPreference": "settlement",
"source": {
"currency": "IDR",
"amount": 3.14,
"paymentCode": "shopeepay",
"paymentType": "local_wallet"
}
}`)
req, err := http.NewRequest("POST", "https://sandbox-api.aparatech.io/v1/public/orders", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("MID", "example_string")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://sandbox-api.aparatech.io/v1/public/orders')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['MID'] = 'example_string'
request.body = '{
"cxOrderId": "customerOrderId12",
"userId": "OCUX-17787550145567248",
"purposeCode": "company_expenses",
"orderType": "payin",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://www.google.com/",
"headlessMode": true,
"settlementPreference": "settlement",
"source": {
"currency": "IDR",
"amount": 3.14,
"paymentCode": "shopeepay",
"paymentType": "local_wallet"
}
}'
response = http.request(request)
puts response.body
{
"status": "success",
"data": {
"flow": "FIAT_PAYIN",
"orderId": "OR-2605011419019599696",
"amount": 150000,
"payUrl": "https://sandbox-checkout.aparatech.io/7mg51OPD-"
}
}
/v1/public/orders
Target server for requests. Edit to use your own host.
The media type of the request body
Merchant ID for authentication.
Optional customer order identifier.
ID of the user associated with the order.
Purpose code for the transaction.
Type of order — payin, payout, or fiat_prefund.
URL to redirect the user on successful payment.
URL to redirect the user on failed payment.
If true, the response returns a payUrl for headless checkout; if false, a hosted checkout page is used.
Settlement preference — settlement or prefund.
Request Preview
Response
Response will appear here after sending the request
Headers
Merchant ID for authentication.
Body
Type of order — payin, payout, or fiat_prefund.
payinpayoutfiat_prefundURL to redirect the user on successful payment.
https://www.google.com/URL to redirect the user on failed payment.
https://www.google.com/If true, the response returns a payUrl for headless checkout; if false, a hosted checkout page is used.
trueSettlement preference — settlement or prefund.
settlementprefund