Skip to main content

Create Order

Create a new payment order using the Legacy (UTpay-compatible) API.

Endpoint

POST /api/order/create

Authentication

Authenticated via SHA-512 signature in the request body. See Authentication for the signing formula.

Request Body

FieldTypeRequiredDescription
clientIdstringYesYour legacy_client_id
orderIdstringYesYour unique order ID (idempotency key)
totalAmountintegerYesOrder amount in full IDR (NOT minor units). IDR 50,000 = 50000
paymentTypestringYesPayment channel: QRIS or BANK_TRANSFER
signaturestringYesSHA-512 signature — see Authentication
customerNamestringNoCustomer's full name
customerEmailstringNoCustomer's email
customerPhonestringNoCustomer's phone number
notifyUrlstringNoCallback URL for status updates
returnUrlstringNoRedirect URL after payment
Amount Units

totalAmount is in full IDR. For IDR 50,000, send 50000 — not 5000000. This is the opposite of the V1 API.

Signature Computation

PHP
$signature = hash('sha512',
$clientId . '|' . $orderId . '|' . $totalAmount . '|' . $clientSecret
);

Example

cURL
# Step 1: compute signature
SIG=$(echo -n "TEST_CLIENT_001|INV-2026-00123|50000|TEST_SECRET_001" | sha512sum | awk '{print $1}')

# Step 2: send request
curl -X POST https://api.nusio-saka.com/api/order/create \
-H "Content-Type: application/json" \
-d "{
\"clientId\": \"TEST_CLIENT_001\",
\"orderId\": \"INV-2026-00123\",
\"totalAmount\": 50000,
\"paymentType\": \"QRIS\",
\"signature\": \"$SIG\",
\"customerName\": \"Budi Santoso\",
\"notifyUrl\": \"https://your-site.com/callbacks/payment\"
}"
PHP
$clientId     = 'TEST_CLIENT_001';
$orderId = 'INV-2026-00123';
$totalAmount = 50000;
$clientSecret = 'TEST_SECRET_001';

$signature = hash('sha512', "$clientId|$orderId|$totalAmount|$clientSecret");

$payload = compact('clientId', 'orderId', 'totalAmount', 'signature') + [
'paymentType' => 'QRIS',
'customerName' => 'Budi Santoso',
'notifyUrl' => 'https://your-site.com/callbacks/payment',
];

$ch = curl_init('https://api.nusio-saka.com/api/order/create');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);

Response

HTTP 200 OK

{
"code": 200,
"message": "Success",
"data": {
"refCode": "ORD-260601103045-A1B2",
"transactionTime": "2026-06-01 10:30:45",
"orderId": "INV-2026-00123",
"totalAmount": 50000,
"customerName": "Budi Santoso",
"customerEmail": null,
"customerPhone": null,
"notifyUrl": "https://your-site.com/callbacks/payment",
"returnUrl": null,
"status": "PENDING",
"paidAt": null,
"qrString": "00020101021226..."
}
}

Response Fields

FieldDescription
refCodePGA internal reference — use for status queries
transactionTimeWIB timestamp of order creation ("YYYY-MM-DD HH:MM:SS")
totalAmountFull IDR integer (same value you sent)
statusPENDING on creation
qrStringQRIS data string; render as QR code in your UI
paidAtnull until paid; WIB format when filled

Idempotency

Submitting the same orderId again returns the existing order with its current status — no duplicate order is created.

Error Responses

MessageDescription
Invalid Client IDclientId not found or merchant inactive
Invalid request parametersMissing required field or invalid value
Invalid SignatureSHA-512 hash does not match
Merchant setting is not ValidNo gateway configured for paymentType
Order ID already usedorderId exists but is not retrievable (internal conflict)