Skip to content
Danh sách APIsTrả hàng
Danh sách APIs

Api Trả hàng

Api tạo yêu cầu trả hàng

Tạo yêu cầu trả hàng sau khi đơn hàng đã thành công

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 yêu cầu trả hàng, 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ý yêu cầu nào

orderId - required

string orderId của SimplifyTrip, bạn nhận được sau khi tạo đơn hàng thành công.

reason

string Lý do bạn trả hàng (không bắt buộc)

returnType - requiredFULL | PARTIAL

Trả lại toàn bộ đơn hàng hoặc chỉ trả một phần. Nếu là dạng trả toàn bộ đơn hàng, bạn sẽ không cần cung cấp items

items

Item[] Danh sách các mặt hàng trong đơn hàng bạn muốn trả lại

sku - required

string SKU của mặt hàng trong đơn hàng của bạn

quantity - required

number Số lượng hàng sẽ trả (phải bé hơn hoặc bằng với số lượng đã mua)

Responses
200 OK
application/json
Success
id

string Id của yêu cầu trả hàng

orderId

string Id của đơn hàng bạn đã mua

trackId

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

createdAtdatetime
reason

string Lý do trả hàng

statusREQUESTED
returnTypeFULL | PARTIAL
refundAmount

number Số tiền sẽ được nhận lại khi trả hàng thành công

itemsItem[]
productNamestring
skustring
quantitynumber
typeeSIM | SIM
4xx/5xx Error
application/json
Error
timestamptimestamp
statusCodenumber
errorCodestring
messagestring
POST
/api/v1/return-requests
Sample Request
Try it on Swagger
Nodejs
PHP
C#
Java
Go
Curl

_61
// Using axios
_61
import axios from 'axios';
_61
_61
const options = {
_61
method: 'POST',
_61
url: 'https://merchant.simplifytrip.com/api/v1/return-requests',
_61
headers: {
_61
accept: 'application/json',
_61
'content-type': 'application/json',
_61
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_61
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_61
'x-signature': '412e915d2871504ed31be63c8f62a149a4410d34c4c42affc9006ef9917eaa03',
_61
}
_61
data: {
_61
'trackId': 'b4b08205-836e-4296-a054-52462089edf6',
_61
"orderId": "52462089edf6",
_61
"returnType": "PARTIAL",
_61
"reason": "",
_61
'items': [
_61
{
_61
'sku': 'E23XY06GB08DFX',
_61
'quantity': 2
_61
}
_61
]
_61
}
_61
};
_61
_61
axios
_61
.request(options)
_61
.then(res => console.log(res.data))
_61
.catch(err => console.error(err));
_61
_61
// Using fetch api
_61
const url = 'https://merchant.simplifytrip.com/api/v1/return-requests';
_61
const options = {
_61
method: 'POST',
_61
headers: {
_61
accept: 'application/json',
_61
'content-type': 'application/json',
_61
authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxxxx',
_61
'x-api-key': 'pk_live_xxxxxxxxxxxxxxxxxx',
_61
'x-signature': '412e915d2871504ed31be63c8f62a149a4410d34c4c42affc9006ef9917eaa03',
_61
}
_61
body: JSON.stringify({
_61
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_61
"orderId": "52462089edf6",
_61
"returnType": "PARTIAL",
_61
"reason": "",
_61
"items": [
_61
{
_61
"sku": "E23XY06GB08DFX",
_61
"quantity": 2
_61
}
_61
]
_61
}),
_61
};
_61
_61
fetch(url, options)
_61
.then(res => res.json())
_61
.then(json => console.log(json))
_61
.catch(err => console.error(err));

Sample Response
Success
Error

_18
{
_18
"id": "52462089edf6",
_18
"createdAt": "2025-12-01 09:25:03",
_18
"reason": "",
_18
"status": "REQUESTED",
_18
"returnType": "PARTIAL",
_18
"refundAmount": 100000,
_18
"orderId": "658441501843542",
_18
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_18
"items": [
_18
{
_18
"productName": "SIM Đông Nam Á (7 nước) chỉ có data (Unlimited Data/ngày - 3 ngày)",
_18
"sku": "AS7BCUNL03DPY",
_18
"quantity": 2,
_18
"type": "SIM"
_18
}
_18
]
_18
}

Api huỷ yêu cầu hoàn tiền

Huỷ của một yêu cầu hoàn tiền theo ID được cung cấp

Path Parameters
id - requiredstring

Id hoặc trrackId của yêu cầu trả 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 yêu cầu trả hàng do SimplifyTrip tạo ra

trackIdstring

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

createdAtdatetime
returnType FULL | PARTIAL
statusCANCELED
reasonstring
refundAmountnumber
itemsItem[]
productNamestring
skustring
quantitynumber
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/return-requests/:id/cancel
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: 'POST',
_35
url: 'https://merchant.simplifytrip.com/api/v1/return-requests/658441501843542/cancel',
_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/return-requests/658441501843542/cancel';
_35
const options = {
_35
method: 'POST',
_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

_17
{
_17
"id": "6740ce7f9d04259159bc6401",
_17
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_17
"createdAt": "2024-11-22T18:33:35.127Z",
_17
"status": "CANCELED",
_17
"returnType": "PARTIAL",
_17
"refundAmount": 840000,
_17
"reason": null,
_17
"items": [
_17
{
_17
"productName": "SIM Đông Nam Á (7 nước) chỉ có data (Unlimited Data/ngày - 3 ngày)",
_17
"quantity": 2,
_17
"sku": "E23XY06GB08DFX",
_17
"type": "eSIM"
_17
}
_17
]
_17
}

Api chi tiết yêu cầu hoàn tiền

Trả về thông tin chi tiết của một yêu cầu hoàn tiền theo ID được cung cấp

Path Parameters
id - requiredstring

Id hoặc trrackId của yêu cầu trả 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 yêu cầu trả hàng do SimplifyTrip tạo ra

trackIdstring

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

createdAtdatetime
returnType FULL | PARTIAL
status

REQUESTED | REVIEWING | APPROVED | REJECTED | CANCELED Trạng thái cầu trả hàng

reasonstring
refundAmountnumber
itemsItem[]
productNamestring
skustring
quantitynumber
typeeSIM | SIM

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

4xx/5xx Error
application/json
Error
timestamptimestamp
statusCodenumber
errorCodestring
messagestring
GET
/api/v1/return-requests/: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/return-requests/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/return-requests/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

_17
{
_17
"id": "6740ce7f9d04259159bc6401",
_17
"trackId": "b4b08205-836e-4296-a054-52462089edf6",
_17
"createdAt": "2024-11-22T18:33:35.127Z",
_17
"status": "REQUESTED",
_17
"returnType": "PARTIAL",
_17
"refundAmount": 840000,
_17
"reason": null,
_17
"items": [
_17
{
_17
"productName": "SIM Đông Nam Á (7 nước) chỉ có data (Unlimited Data/ngày - 3 ngày)",
_17
"quantity": 2,
_17
"sku": "E23XY06GB08DFX",
_17
"type": "eSIM"
_17
}
_17
]
_17
}