Create Order
curl -X POST "https://sandbox-api.aparatech.io/v1/public/orders" \
-H "Content-Type: application/json" \
-H "MID: example_string" \
-d '{
"userId": "OCUX-17784812248037343",
"orderType": "payin",
"purposeCode": "company_expenses",
"successRedirectUrl": "https://yourapp.com/success",
"failureRedirectUrl": "https://yourapp.com/failure",
"headlessMode": true,
"source": {
"currency": "VND",
"amount": "170010",
"paymentType": "bank_transfer",
"paymentCode": "techcom_bank"
}
}'
import requests
import json
url = "https://sandbox-api.aparatech.io/v1/public/orders"
headers = {
"Content-Type": "application/json",
"MID": "example_string"
}
data = {
"userId": "OCUX-17784812248037343",
"orderType": "payin",
"purposeCode": "company_expenses",
"successRedirectUrl": "https://yourapp.com/success",
"failureRedirectUrl": "https://yourapp.com/failure",
"headlessMode": true,
"source": {
"currency": "VND",
"amount": "170010",
"paymentType": "bank_transfer",
"paymentCode": "techcom_bank"
}
}
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({
"userId": "OCUX-17784812248037343",
"orderType": "payin",
"purposeCode": "company_expenses",
"successRedirectUrl": "https://yourapp.com/success",
"failureRedirectUrl": "https://yourapp.com/failure",
"headlessMode": true,
"source": {
"currency": "VND",
"amount": "170010",
"paymentType": "bank_transfer",
"paymentCode": "techcom_bank"
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"userId": "OCUX-17784812248037343",
"orderType": "payin",
"purposeCode": "company_expenses",
"successRedirectUrl": "https://yourapp.com/success",
"failureRedirectUrl": "https://yourapp.com/failure",
"headlessMode": true,
"source": {
"currency": "VND",
"amount": "170010",
"paymentType": "bank_transfer",
"paymentCode": "techcom_bank"
}
}`)
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 = '{
"userId": "OCUX-17784812248037343",
"orderType": "payin",
"purposeCode": "company_expenses",
"successRedirectUrl": "https://yourapp.com/success",
"failureRedirectUrl": "https://yourapp.com/failure",
"headlessMode": true,
"source": {
"currency": "VND",
"amount": "170010",
"paymentType": "bank_transfer",
"paymentCode": "techcom_bank"
}
}'
response = http.request(request)
puts response.body
{
"status": "success",
"data": {
"flow": "FIAT_PAYIN",
"orderId": "OR-2605141118506969532",
"amount": 170010,
"payUrl": "https://sandbox-checkout.aparatech.io/MwKOTDPp8"
}
}
POST
/v1/public/orders
POST
Base URLstring
Target server for requests. Edit to use your own host.
Content-Typestring
RequiredThe media type of the request body
Options: application/json
Request Preview
Response
Response will appear here after sending the request
Headers
Body
application/json
orderTypestring
RequiredAllowed values:
payingamingsourceobject
Requiredcurrencystring
RequiredSource currency code
paymentTypestring
RequiredAllowed values:
bank_transferlocal_walletcardResponses
statusstring
dataobject
flowstring
orderIdstring
amountnumber
payUrlstring
Was this page helpful?