Get one order
curl --request GET \
--url https://api.kawan.digital/v1/orders/{order_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kawan.digital/v1/orders/{order_id}', 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.kawan.digital/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"payment_reference": "<string>",
"amount": 123,
"subtotal": 123,
"currency": "IDR",
"settlement_channel": "<string>",
"payment_provider": "<string>",
"payment_method": "<string>",
"buyer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"items": [
{
"type": "product",
"title": "<string>",
"quantity": 123,
"unit_price": 123,
"line_total": 123,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bundle_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"payment_url": "<string>",
"requires_payment": true
},
"payment": {
"kind": "none",
"amount": 123,
"currency": "IDR",
"checkout_url": "<string>",
"payment_url": "<string>",
"provider": "<string>",
"method": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"seller_bank": {
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>",
"account_holder": "<string>",
"payment_reference": "<string>",
"unique_amount_code": 123,
"transfer_amount": 123
},
"snap": {
"token": "<string>",
"client_key": "<string>",
"snap_script_url": "<string>"
}
},
"redirect": {
"success_url": "<string>",
"return_url": "<string>",
"error_url": "<string>"
}
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Authorization header."
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded."
}
}Orders
Get one order
Returns the order plus payment and redirect. For unpaid gateway
orders this prepares (or reuses) the payment session so payment_url
is the current Duitku payment page. List endpoint does not start a
gateway session.
GET
/
orders
/
{order_id}
Get one order
curl --request GET \
--url https://api.kawan.digital/v1/orders/{order_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kawan.digital/v1/orders/{order_id}', 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.kawan.digital/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"payment_reference": "<string>",
"amount": 123,
"subtotal": 123,
"currency": "IDR",
"settlement_channel": "<string>",
"payment_provider": "<string>",
"payment_method": "<string>",
"buyer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"items": [
{
"type": "product",
"title": "<string>",
"quantity": 123,
"unit_price": 123,
"line_total": 123,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bundle_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"checkout_url": "<string>",
"payment_url": "<string>",
"requires_payment": true
},
"payment": {
"kind": "none",
"amount": 123,
"currency": "IDR",
"checkout_url": "<string>",
"payment_url": "<string>",
"provider": "<string>",
"method": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"seller_bank": {
"bank_name": "<string>",
"bank_code": "<string>",
"account_number": "<string>",
"account_holder": "<string>",
"payment_reference": "<string>",
"unique_amount_code": 123,
"transfer_amount": 123
},
"snap": {
"token": "<string>",
"client_key": "<string>",
"snap_script_url": "<string>"
}
},
"redirect": {
"success_url": "<string>",
"return_url": "<string>",
"error_url": "<string>"
}
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Authorization header."
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded."
}
}