Create Stock Transfer

API tạo mới 1 phiếu luân chuyển (ST)

1. API endpoint

https://api.tikinow.vn/business/v1/stock-transfer

2. Header request

Content-Type: application/json

Authorization: Bearer + access_token: access_token lấy từ API get token, hoặc login từ app public, app in-house hoặc token từ TikiNOW Center, Seller Center.

3. CURL Example

curl --location 'https://api.tikinow.vn/business/v1/stock-transfer' \
--header 'Content-Type: application/json' \
--header 'Authorization: xxx' \
--data '{
    "src_warehouse_code": "sgn",
    "ref_code": "EXT0001",
    "dest_warehouse_code": "hn5",
    "note": "Note cho phiếu luân chuyển",
    "delivery_method": "TIKI_DELIVERY_METHOD",
    "items": [
        {
            "sku": "8687868342164",
            "quantity": 2,
            "note": "Note cho từng sản phẩm trong phiếu luân chuyển"
        }
    ]
}'

4. Params

FieldLoạiBắt buộcMô tả
ref_codeStringNoMã luân chuyển của đối tác, mã là duy nhất không được trùng. Không nhập hệ thống sẽ tự gen random.
itemsArrayYesDanh sách sản phẩm cần luân chuyển.
items[].skuStringYesSKU của sản phẩm trên hệ thống TNSL.
items[].quantityIntYesSố lượng tương ứng với SKU cần luân chuyển.
items[].noteStringNoGhi chú cho sản phẩm trong phiếu luân chuyển.
src_warehouse_codeStringYesMã kho nguồn (rút hàng luân chuyển) trên hệ thống TNSL.
dest_warehouse_codeStringYesMã kho đích (nhập hàng luân chuyển) trên hệ thống TNSL.
noteStringNoGhi chú cho phiếu luân chuyển.
delivery_methodStringYesPhương thức vận chuyển cho phiếu luân chuyển. Hiện tại chỉ chấp nhận giá trị TIKI_DELIVERY_METHOD, tương lai sẽ mở thêm.

5. Response

Error

{
    "success": false,
    "error": {
        "status_code": 401,
        "message": "Unauthorized",
        "message_code": "INVALID_TOKEN"
    },
    "meta_data": {
        "request_id": "3fe74a7f26c806ed27f80851fba6ad87"
    }
}

Success

{
    "success": true,
    "data": {
        "stock_transfer_code": "ST/2024/05/22776"
    },
    "meta_data": {
        "request_id": "06425bcba76c24a63aa997274fb4f8ab"
    }
}

Description

FieldLoạiMô tả
successBoolTrả về true/false tương ứng với thành công / thất bại.
dataArrayData trả về khi tạo thành công.
stock_transfer_codeStringMã phiếu luân chuyển (ST) trên hệ thống TNSL

Leave a Reply

Your email address will not be published.