Order
Berikut ini adalah list endpoint API untuk mendapatkan informasi tentang Order.
POST/api/v3/checkout
Create Order
Digunakan untuk melakukan proses checkout product.
Untuk order produk type voucher, inputs tidak perlu diisi
Headers
- Name
Authorization
- Type
- Bearer {API_KEY}
- Description
Api Key dari BANGJEFF.
- Name
Content-Type
- Type
- application/json
- Description
Content type JSON.
Body
- Name
code
- Type
- string
- Description
Code bisa didapatkan dari Variant List atau Variant Detail.
- Name
referenceNumber
- Type
- string
- Description
Transaction ID dari Buyer (optional).
- Name
qty
- Type
- number
- Description
Quantity. Default 1 (optional).
- Name
inputs
- Type
- Array<{ name: string; value: string }>
- Description
ID Tujuan.
{
"code": "string",
"referenceNumber": "string",
"qty": 1,
"inputs": [
{
"name": "string",
"value": "string"
}
]
}
Request
POST
/api/v3/checkoutcurl -X POST "https://api.bangjeff.com/api/v3/checkout" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d "{ \"code\": \"string\", \"referenceNumber\": \"string\", \"qty\": 0, \"inputs\": [ { \"name\": \"string\", \"value\": \"string\" } ]}"
Response
{
"error": false,
"code": 200,
"message": "string",
"data": {
"invoiceNumber": "string",
"totalAmount": 0
}
}
POST/api/v3/order/{invoiceNumber}
Check Status Order
Digunakan untuk melakukan check status order yang telah di buat.
Headers
- Name
Authorization
- Type
- Bearer {API_KEY}
- Description
Api Key dari BANGJEFF.
- Name
Content-Type
- Type
- application/json
- Description
Content type JSON.
Required Params
- Name
invoiceNumber
- Type
- string
- Description
Invoice Number dari BANGJEFF.
Request
POST
/api/v3/order/{invoiceNumber}curl -X POST "https://api.bangjeff.com/api/v3/order/{invoiceNumber}" \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json"
Response
{
"error": false,
"code": 200,
"message": "string",
"data": {
"invoiceNumber": "string",
"productName": "string",
"variantName": "string",
"inputs": "string",
"statusCode": "string",
"statusDesc": "string",
"qty": 0,
"totalAmount": 0,
"voucher": "string",
"createdAt": "string",
"updatedAt": "string"
}
}
Response Error
Berikut ini adalah list Response error pada endpoint api order.
HTTP Code | Error Message | Description |
---|---|---|
403 | Access Token is required | Wrong API Key |
403 | Access Token is not valid | Wrong API Key |
400 | This reference number already exists with Invoice Number XXXXXX | Duplicate Reference Number |
400 | Couldn't find product variant with code XXXXXX | Product Variant Not Found |
400 | Product variant currently not available | Product Variant Is Not Active |
400 | Insufficient funds | Insufficient funds |
400 | Product currently not available | Product Is Not Active |
400 | Input is not valid | Input Array Length Is Not Valid |
400 | Failed when validate user account | Failed when validate user account |
400 | Stock currently unavailable | Stock currently unavailable |