Skip to content
Danh sách APIsĐơn hàng
Danh sách APIs

Api Đơn hàng

Api tạo đơn hàng

Tạo đơn hàng mua eSim từ SimplifyTrip

Request Headers
X-Signature - requiredstring

Signature là một chuỗi ký tự dùng để kiểm tra tính toàn vẹn dữ liệu trong việc truyền dữ liệu giữa hệ thống của bạn và SimplifyTrip. Bạn cần dùng checksumKey từ Api Key và HMAC_SHA256 để tạo signature với data theo định dạng được sort theo alphabet. Tham khảo Kiểm tra dữ liệu với signature.

Request Body
trackId - requiredstring

Id hệ thống của bạn tạo ra, dùng để định danh order, ví dụ trong trường hợp nhận được dữ liệu từ webhook, trackId sẽ giúp bạn nhận ra hệ thống cần xử lý đơn hàng nào

items - requiredItem[]
subTrackId - requiredstring

Id của item

sku - requiredstring

SKU của mặt hàng lấy từ Api danh sách Products

quantity - requirednumber

Số lượng sim cần mua

Responses
200 OK
application/json
Success
successboolean
orderIdstring

Id SimplifyTrip tạo ra, bạn có thể dùng nó để tra cứu thông tin của đơn hàng trên SimplifyTrip

trackIdstring

Id hệ thống của bạn đã truyền lên

itemsItem[]
subOrderIdstring

Id của item SimplifyTrip tạo ra

subTrackIdstring

Id của item hệ thống của bạn đã truyền lên

skustring

SKU của mặt hàng lấy từ Api danh sách Products

quantitynumber

Số lượng sim cần mua

typeeSIM | SIM

Chủng loại của sản phẩm

4xx/5xx Error
application/json
Error
timestamptimestamp
statusCodenumber
errorCodestring
messagestring
POST
/api/v1/orders
Sample Request
Try it on Swagger
Nodejs
PHP
C#
Java
Go
Curl

_57
// Using axios
_57
import axios from 'axios';
_57
_57
const options = {
_57
method: 'POST',
_57
url: 'https://merchant.simplifytrip.com/api/v1/orders',
_57
headers: {
_57
accept: 'application/json',
_57
'content-type': 'application/json',
_57
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_57
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_57
'x-signature': '412e915d2871504ed31be63c8f62a149a4410d34c4c42affc9006ef9917eaa03',
_57
}
_57
data: {
_57
'trackId': 'b4b08205-836e-4296-a054-52462089edf6',
_57
'items': [
_57
{
_57
'subTrackId': '958acd57-182f-4b5c-b408-5e93f646ddde',
_57
'sku': 'E23XY06GB08DFX',
_57
'quantity': 2
_57
}
_57
]
_57
}
_57
};
_57
_57
axios
_57
.request(options)
_57
.then(res => console.log(res.data))
_57
.catch(err => console.error(err));
_57
_57
// Using fetch api
_57
const url = 'https://merchant.simplifytrip.com/api/v1/orders';
_57
const options = {
_57
method: 'POST',
_57
headers: {
_57
accept: 'application/json',
_57
'content-type': 'application/json',
_57
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_57
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_57
'x-signature': '412e915d2871504ed31be63c8f62a149a4410d34c4c42affc9006ef9917eaa03',
_57
}
_57
body: JSON.stringify({
_57
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_57
"items": [
_57
{
_57
"subTrackId": "958acd57-182f-4b5c-b408-5e93f646ddde",
_57
"sku": "E23XY06GB08DFX",
_57
"quantity": 2
_57
}
_57
]
_57
}),
_57
};
_57
_57
fetch(url, options)
_57
.then(res => res.json())
_57
.then(json => console.log(json))
_57
.catch(err => console.error(err));

Sample Response
Success
Error

_14
{
_14
"success": true,
_14
"orderId": "658441501843542",
_14
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_14
"items": [
_14
{
_14
"subOrderId": "6740ce7f9d04259159bc6401",
_14
"subTrackId": "958acd57-182f-4b5c-b408-5e93f646ddde",
_14
"sku": "E23XY06GB08DFX",
_14
"quantity": 2,
_14
"type": "eSIM"
_14
}
_14
]
_14
}

Api chi tiết đơn hàng

Trả về thông tin chi tiết của một đơn hàng theo ID được cung cấp

Path Parameters
id - requiredstring

Id hoặc trrackId của đơn hàng muốn tra cứu - Hãy đảm bảo bạn dùng trackId không bị trùng lặp

Responses
200 OK
application/json
Success
idstring

Id đơn hàng do SimplifyTrip tạo ra

trackIdstring

Id hệ thống của bạn tạo

createdAtdatetime
updatedAtdatetime
statusDONE | ERROR | PROCESSING

Trạng thái đơn hàng

errorstring

Nguyên nhân đơn hàng bị lỗi, xuất hiện khi status = ERROR

totalnumber

Tổng giá trị đơn hàng

itemsItem[]
idstring

Id của item

subTrackIdstring

Track Id của item

statusSUCCESS | ERROR | PROCESSING

Trạng thái của item

skustring

SKU của mặt hàng lấy từ Api danh sách product

quantitynumber

Số lượng sim cần mua

pricenumber

Đơn giá của sim sau khi đã trừ các ưu đãi tương ứng

typeeSIM | SIM

Chủng loại của sản phẩm

eSims
4xx/5xx Error
application/json
Error
timestamptimestamp
statusCodenumber
errorCodestring
messagestring
GET
/api/v1/orders/:id
Sample Request
Try it on Swagger
Nodejs
PHP
C#
Java
Go
Curl

_35
// Using axios
_35
import axios from 'axios';
_35
_35
const options = {
_35
method: 'GET',
_35
url: 'https://merchant.simplifytrip.com/api/v1/orders/658441501843542',
_35
headers: {
_35
accept: 'application/json',
_35
'content-type': 'application/json',
_35
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_35
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_35
}
_35
};
_35
_35
axios
_35
.request(options)
_35
.then(res => console.log(res.data))
_35
.catch(err => console.error(err));
_35
_35
// Using fetch api
_35
const url = 'https://merchant.simplifytrip.com/api/v1/orders/658441501843542';
_35
const options = {
_35
method: 'GET',
_35
headers: {
_35
accept: 'application/json',
_35
'content-type': 'application/json',
_35
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_35
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_35
}
_35
};
_35
_35
fetch(url, options)
_35
.then(res => res.json())
_35
.then(json => console.log(json))
_35
.catch(err => console.error(err));

Sample Response
Success
Error

_42
{
_42
"id": "658441501843542",
_42
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_42
"createdAt": "2024-11-22T18:33:35.127Z",
_42
"updatedAt": "2024-11-22T18:33:35.577Z",
_42
"status": "DONE",
_42
"total": 840000,
_42
"error": null,
_42
"items": [
_42
{
_42
"id": "6740ce7f9d04259159bc6401",
_42
"subTrackId": "958acd57-182f-4b5c-b408-5e93f646ddde",
_42
"status": "SUCCESS",
_42
"quantity": 2,
_42
"price": 420000,
_42
"sku": "E23XY06GB08DFX",
_42
"type": "eSIM",
_42
"eSims": [
_42
{
_42
"qrCodeContent": "LPA:1$SECSMSMINIAPP.EASTCOMPEACE.COM$502F97EF09144E0C9D62FD781E259916",
_42
"qrCodeImg": "https://simplify-trip.s3.ap-southeast-1.amazonaws.com/a11dd3c438f38f5383fa17c8ea2de3ef.png",
_42
"iccid": "89812003916820397854",
_42
"planAPN": "plus.4g",
_42
"smdpAddress": "SECSMSMINIAPP.EASTCOMPEACE.COM",
_42
"pin": "1234",
_42
"puk": "15095300",
_42
"activationCode": "502F97EF09144E0C9D62FD781E259916"
_42
},
_42
{
_42
"qrCodeContent": "LPA:1$SECSMSMINIAPP.EASTCOMPEACE.COM$502F97EF09144E0C9D62FD781E255011",
_42
"qrCodeImg": "https://simplify-trip.s3.ap-southeast-1.amazonaws.com/a11dd3c438f38f5383fa17c8ea2de3ef.png",
_42
"iccid": "89812003916820392108",
_42
"planAPN": "plus.4g",
_42
"smdpAddress": "SECSMSMINIAPP.EASTCOMPEACE.COM",
_42
"pin": "1234",
_42
"puk": "15095300",
_42
"activationCode": "502F97EF09144E0C9D62FD781E255011"
_42
}
_42
]
_42
}
_42
]
_42
}