Deprecated APIs

APIs

Check quantity

POST {API-HOST}/merchant-integration/v1/loyalty/gift-code/quantity

API để kiểm tra số lượng giftcode còn lại trong kho của merchant.

Request Body

NameTypeDescription

store_code

string

Mã cửa hàng của merchant tại VinID.

pos_code

string

Mã máy POS của merchant tại VinID.

card_type

array

Danh sách mệnh giá giftcode cần kiểm tra. Đơn vị: nghìn đồng. Ví dụ: [“10”, "50", "100"]

{
  "meta": {
    "code": 200,
    "message": "OK"
  },
  "data": [
    {
      "card_type": "string",
      "quantity": 0
    }
  ]
}

Withdraw Giftcode

POST {API-HOST}/merchant-integration/v1/loyalty/gift-code/orders

API để lấy giftcode ra khỏi kho

Request Body

NameTypeDescription

store_code

string

Mã cửa hàng của merchant tại VinID

pos_code

string

Mã máy pos của merchant tại VinID

merchant_order_id

string

Mã order unique phía merchant tự sinh

order_info

array

Thông tin của lệnh lấy giftcode.

card_type

string

Mệnh giá giftcode cần lấy. Đơn vị: nghìn đồng.

quantity

integer

Số lượng giftcode cần lấy

extra_data

string

Thông tin bổ sung của order. Merchant có thể truyền thêm các dữ liệu cần thiết cho nghiệp vụ của mình theo string dạng JSON trong phần này

{
  "meta": {
    "code": int,
    "message": "string"
  },
  "data": {
    "created_at": 0,
    "extra_data: "string"
    "merchant_order_id": "string",
    "order_info": [
      {
        "card_type": "string", //Mệnh giá giftcode
        "cards": [
          {
            "code": "string", //Mã nạp của giftcode
            "expire_date": "string", //Ngày hết hạn
            "serial": "string" //Mã tra soát
          }
        ]
      }
    ]
  }
REQUEST TEMPLATE
{
  "store_code": "string",
  "pos_code": "string",
  "merchant_order_id": "string",
  "order_info": [
    {
      "card_type": "string",
      "quantity": 10
    }
  ],
  "extra_data": "string"
}

Check giftcode

POST {API-HOST}/merchant-integration/v1/loyalty/gift-code/check

API để kiểm tra trạng thái của giftcode

Request Body

NameTypeDescription

store_code

string

Mã cửa hàng của merchant tại VinID

pos_code

string

Mã máy pos của merchant tại VinID

serial

string

Mã serial của giftcode cần kiểm tra

{
  "meta": {
    "code": int,
    "message": "string"
  },
  "data": {
    "status": "USED", //“USED” hoặc “ACTIVE”
    "expire_date": "yyyy-MM-dd" //Hạn sử dụng
  }
}

Get order detail

GET {API-HOST}/merchant-integration/v1/loyalty/gift-code/orders?{parameters}

API để yêu cầu lấy thông tin của đơn hàng đã thực hiện

Path Parameters

NameTypeDescription

store_code

string

Mã cửa hàng của merchant tại VinID

pos_code

string

Mã máy pos của merchant tại VinID

merchant_order_id

string

Mã order muốn kiểm tra. (Là mã order merchant đã sử dụng khi tạo order)

{
  "meta": {
    "code": int,
    "message": "string"
  },
  "data": {
    "created_at": 0,
    "extra_data": "string",
    "merchant_order_id": "string",
    "order_info": [
      {
        "card_type": "string",
        "cards": [
          {
            "code": "string", //Mã nạp của giftcode
            "expire_date": "string", //Ngày hết hạn
            "serial": "string" //Mã tra soát
          }
        ]
      }
    ]   
  }
REQUEST TEMPLATE
{API-HOST}/merchant-integration/v1/loyalty/giftcode/orders?merchant_order_id=string&store_code=string&pos_code=string

Mã lỗi

Code

Message

4000001

Dữ liệu không hợp lệ

4000301

Số lượng giftcode trong kho không đủ

4000302

Mã order đã tồn tại

5000001

Hệ thống xảy ra lỗi khi xử lý yêu cầu

Tham khảo bảng Mã lỗi chung

Xem thêm:

Last updated