NAV Navbar
http

INTRODUCTION

Welcome to the Pancake Pos API! You can use our API to access Pancake Pos API endpoints that can get information about orders in our database.

COMMON CONFIGURATION

ENVIRONMENT

ACCOUNT AUTHENTICATION

api_key

CREATE API KEY

Go website Setting -> Application
On frame API KEY, click Create

Create api

Shop

Shop information

GET /shops?api_key=<api_key> HTTP/1.1

Response

{
  "shops": [
    {
      "avatar_url": "https://statics.pancake.vn/user-content-dev2.pancake.vn/2022/7/6/8678250807b2285e2752ac2cbbf43925f19a677c.jpeg",
      "name": "Shop thời trang",
      "pages": [
        {
          "id": "104438181227821",
          "name": "Quần áo",
          "platform": "facebook",
          "settings": {
            "auto_create_order": true
          },
          "shop_id": 20,
        }
      ]
    }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
avatar_url string Avatar image link
name string Shop name
pages array Pages information in shop

Address

List of provinces and cities

GET /geo/provinces HTTP/1.1

Response

{
    "data": [
        {
            "id": "101",
            "name": "Hà Nội",
            "name_en": "ha noi"
        },
        {
            "id": "701",
            "name": "Hồ Chí Minh",
            "name_en": "ho chi minh"
        },
        {
            "id": "221",
            "name": "Bắc Giang",
            "name_en": "bac giang"
        },
        {
            "id": "207",
            "name": "Bắc Kạn",
            "name_en": "bac kan"
        },
        {
            "id": "821",
            "name": "Bạc Liêu",
            "name_en": "bac lieu"
        },
        ...
    ]
}

HTTP Request

GET /geo/provinces

Query Parameters

Parameter Required Type Default Description
country_code true string 84 Country code (for example, Vietnam country code is 84)

List of districts

GET /geo/districts HTTP/1.1

Response

{
    "data": [
        {
            "id": "10101",
            "name": "Quận Ba Đình",
            "name_en": "ba dinh"
        },
        {
            "id": "10129",
            "name": "Huyện Ba Vì",
            "name_en": "ba vi"
        },
        {
            "id": "10155",
            "name": "Quận Bắc Từ Liêm",
            "name_en": "bac tu liem"
        },
        {
            "id": "10113",
            "name": "Quận Cầu Giấy",
            "name_en": "cau giay"
        },
        {
            "id": "10141",
            "name": "Huyện Chương Mỹ",
            "name_en": "chuong my"
        },
        ...
    ]
}

HTTP Request

GET /geo/districts

Query Parameters

Parameter Required Type Default Description
province_id true string Province id of districts you want to retrieve. Get province id in api GET /geo/provinces

List of communes

GET /geo/communes HTTP/1.1

Response

{
    "data": [
        {
            "id": "1010115",
            "name": "Phường Cống Vị",
            "name_en": "cong vi"
        },
        {
            "id": "1010109",
            "name": "Phường Điện Biên",
            "name_en": "dien bien"
        },
        {
            "id": "1010113",
            "name": "Phường Đội Cấn",
            "name_en": "doi can"
        },
        {
            "id": "1010119",
            "name": "Phường Giảng Võ",
            "name_en": "giang vo"
        },
        {
            "id": "1010111",
            "name": "Phường Kim Mã",
            "name_en": "kim ma"
        },
        ...
    ]
}

HTTP Request

GET /geo/communes

Query Parameters

Parameter Required Type Default Description
district_id true string District id of communes you want to retrieve. Get district id in api GET /geo/districts

Order

List of orders

GET /shops/<SHOP_ID>/orders?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "activated_combo_products": {
        "combo_product_id": 430000823,
        "combo_product_info": {
          "combo_product_variations": [
            {
              "count": 1,
              "product_id": "e258399e-792a-43f7-b379-da99712f82f1",
              "variation_id": "74592bc7-e3d9-4734-82b0-246d79784602"
            }
          ],
          "discount_amount": 10000,
          "discount_by_percent": 0,
          "name": "combo mẫu mã"
        },
        "quantity_combo_activated": 1
      },
      "bill_full_name": "hoang anh ",
      "bill_phone_number": "0999999999",
      "page_id": "256469571178082",
      "creator": {
        "avatar_url": null,
        "fb_id": "2042723249341651",
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "name": "Hoang Anh"
      },
      "id": 1418,
      "inserted_at": "2020-05-12T04:51:42",
      "updated_at": "2020-05-12T04:51:54",
      "is_free_shipping": false,
      "received_at_shop": false,
      "partner_fee": 28000,
      "customer_pay_fee": false,
      "items": [
        {
          "discount_each_product": 0,
          "is_bonus_product": false,
          "is_discount_percent": false,
          "is_wholesale": false,
          "measure_group_id": 860000034,
          "one_time_product": false,
          "quantity": 1,
          "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
          "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "variation_info": {
            "detail": null,
            "fields": null,
            "display_id": null,
            "name": "aaaaaa",
            "product_display_id": null,
            "retail_price": 100000,
            "weight": 100,
            "measure_info": {
              "exchange_value": 30,
              "measure_id": 61
            }
          }
        }
      ],
      "note": "",
      "note_print": null,
      "returned_reason": 1,
      "partner": {
        "cod": 0,
        "custom_partner_id": null,
        "extend_code": "S58824.MB25.C3.500020713",
        "extend_update": [],
        "is_returned": null,
        "order_number_vtp": null,
        "paid_at": null,
        "partner_id": 1,
        "sort_code": null,
        "system_created": true,
        "total_fee": 0,
        "updated_at": "2020-05-12T05:18:16"
      },
      "warehouse_id": "630744ef-4614-4a70-988c-52e6d78c953c",
      "shipping_address": {
        "address": "aaaaa",
        "commune_id": "2210941",
        "country_code": null,
        "district_id": "22109",
        "full_address": "aaaaa, Xã Bắc Lý, Huyện Hiệp Hòa, Bắc Giang",
        "full_name": "hoang anh ",
        "phone_number": "0999999999",
        "post_code": null,
        "province_id": "221"
      },
      "shipping_fee": 0,
      "shop_id": 4,
      "status": 0,
      "status_name": "new",
      "tags": [
        {
          "id": 2,
          "name": "Chờ cọc"
        },
        {
          "id": 3,
          "name": "Nhập hàng"
        },
        {
          "id": 13,
          "name": "Delay lấy hàng"
        }
      ],
      "total_discount": 0,
      "warehouse_info": {
        "district_id": "10111",
        "full_address": "kakakaka, Phường Khương Trung, Quận Thanh Xuân, Hà Nội",
        "name": "snappy",
        "phone_number": "0999999999",
        "province_id": "101"
      },
      "shopify_abandon_checkout_id": 30120904851641,
      "link_confirm_order": "https://order.pke.gg/tracking?id=RyvKXPdNWkGlh2Wk8g70Juca8F03N8O"
    },
    ...
  ],
  "page_number": 1,
  "page_size": 100,
  "success": true,
  "total_entries": 1418,
  "total_pages": 15
}

Query Parameters

Parameter Required Type Default Description Example
page_size false int 30
page_number false int 1
search false string null Phone number, name of customer, note, ....
status false int null Order status
updateStatus false string / int inserted_at Filter orders by time
startDateTime false unix timestamp null Start date 1699635600
endDateTime false unix timestamp null End date 1699635600
order_sources false array null [Order source ID, Order source account id] [-1, 314]
updateStatus Filter orders by time
inserted_at Create order
updated_at Last update
partner_inserted_at Send request to courier
paid_at Reconciliation
estimate_delivery_date Estimated delivery time
picked_up_at Picked up by courier at
first_delivery_at First delivery
transfer_proof Transfer proof
time_assign_seller Assign seller
time_assign_care Time assign care
time_assign_marketer Time assign marketer
-1 Last status update
0 New
11 Waiting for order
20 Ordered
1 Confirmed
12 Waiting for goods
13 Printed
8 Packing
9 Waiting for delivery
2 Sent
3 Received
16 Paid
4 Returning
15 Partial return
5 Returned

Get information of specific order

Get order information

GET /shops/<SHOP_ID>/orders/<ORDER_ID>?api_key=<api_key> HTTP/1.1

Response

  {
    "activated_combo_products": {
      "combo_product_id": 430000823,
      "combo_product_info": {
        "combo_product_variations": [
          {
            "count": 1,
            "product_id": "e258399e-792a-43f7-b379-da99712f82f1",
            "variation_id": "74592bc7-e3d9-4734-82b0-246d79784602"
          }
        ],
        "discount_amount": 10000,
        "discount_by_percent": 0,
        "name": "combo mẫu mã"
      },
      "quantity_combo_activated": 1
    },
    "bill_full_name": "hoang anh ",
    "bill_phone_number": "0999999999",
    "page_id": "256469571178082",
    "creator": {
      "avatar_url": null,
      "fb_id": "2042723249341651",
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "name": "Hoang Anh"
    },
    "id": 1418,
    "inserted_at": "2020-05-12T04:51:42",
    "updated_at": "2020-05-12T04:51:54",
    "is_free_shipping": false,
    "received_at_shop": false,
    "partner_fee": 28000,
    "fee_marketplace": 4000,
    "customer_pay_fee": false,
    "items": [
      {
        "discount_each_product": 0,
        "is_bonus_product": false,
        "is_discount_percent": false,
        "is_wholesale": false,
        "measure_group_id": 860000034,
        "one_time_product": false,
        "quantity": 1,
        "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "variation_info": {
          "detail": null,
          "fields": null,
          "display_id": null,
          "name": "aaaaaa",
          "product_display_id": null,
          "retail_price": 100000,
          "weight": 100,
          "measure_info": {
            "exchange_value": 30,
            "measure_id": 61
          }
        }
      }
    ],
    "note": "",
    "note_print": null,
    "returned_reason": 1,
    "partner": {
      "cod": 0,
      "custom_partner_id": null,
      "extend_code": "S58824.MB25.C3.500020713",
      "extend_update": [],
      "is_returned": null,
      "order_number_vtp": null,
      "paid_at": null,
      "partner_id": 1,
      "sort_code": null,
      "system_created": true,
      "total_fee": 0,
      "updated_at": "2020-05-12T05:18:16"
    },
    "warehouse_id": "630744ef-4614-4a70-988c-52e6d78c953c",
    "shipping_address": {
      "address": "aaaaa",
      "commune_id": "2210941",
      "country_code": null,
      "district_id": "22109",
      "full_address": "aaaaa, Xã Bắc Lý, Huyện Hiệp Hòa, Bắc Giang",
      "full_name": "hoang anh ",
      "phone_number": "0999999999",
      "post_code": null,
      "province_id": "221"
    },
    "shipping_fee": 0,
    "shop_id": 4,
    "status": 0,
    "status_name": "new",
    "tags": [
      {
        "id": 2,
        "name": "Chờ cọc"
      },
      {
        "id": 3,
        "name": "Nhập hàng"
      },
      {
        "id": 13,
        "name": "Delay lấy hàng"
      }
    ],
    "total_discount": 0,
    "warehouse_info": {
      "district_id": "10111",
      "full_address": "kakakaka, Phường Khương Trung, Quận Thanh Xuân, Hà Nội",
      "name": "snappy",
      "phone_number": "0999999999",
      "province_id": "101"
    },
    "shopify_abandon_checkout_id": 30120904851641,
    "link_confirm_order": "https://order.pke.gg/tracking?id=RyvKXPdNWkGlh2Wk8g70Juca8F03N8O"
  }

Create order

POST /shops/<SHOP_ID>/orders?api_key=<api_key> HTTP/1.1

Request

{
  "bill_full_name": "hoang anh ",
  "bill_phone_number": "0999999999",
  "is_free_shipping": false,
  "received_at_shop": false,
  "page_id": "256469571178082",
  "account": 4,
  "account_name": "facebook321",
  "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
  "items": [
    {
      "discount_each_product": 0,
      "is_bonus_product": false,
      "is_discount_percent": false,
      "is_wholesale": false,
      "one_time_product": false,
      "quantity": 1,
      "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
      "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
      "variation_info": {
        "detail": null,
        "fields": null,
        "display_id": null,
        "name": "aaaaaa",
        "product_display_id": null,
        "retail_price": 100000,
        "weight": 100
      }
    }
  ],
  "note": "",
  "note_print": null,
  "returned_reason": 1,
  "warehouse_id": "630744ef-4614-4a70-988c-52e6d78c953c",
  "shipping_address": {
    "address": "aaaaa",
    "commune_id": "2210941",
    "country_code": null,
    "district_id": "22109",
    "full_address": "aaaaa, Xã Bắc Lý, Huyện Hiệp Hòa, Bắc Giang",
    "full_name": "hoang anh ",
    "phone_number": "0999999999",
    "post_code": null,
    "province_id": "221"
  },
  "shipping_fee": 0,
  "shop_id": 4,
  "total_discount": 0,
  "warehouse_info": {
    "district_id": "10111",
    "full_address": "kakakaka, Phường Khương Trung, Quận Thanh Xuân, Hà Nội",
    "name": "snappy",
    "phone_number": "0999999999",
    "province_id": "101"
  },
  "custom_id": "Ma0001"
}

Query Parameters

Parameter Required Type Default
bill_full_name false string null
bill_phone_number false string null
is_free_shipping false boolean false
items true array []
note false string null
note_print false string null
warehouse_id true uid
shipping_address true json
shipping_fee false int 0
shop_id true int
total_discount false int 0
warehouse_info false json
custom_id false string null
account false int null
assigning_seller_id false uid null

Item

Parameter Type Default
discount_each_product int 0
is_bonus_product boolean false
is_discount_percent boolean false
is_wholesale boolean false
one_time_product boolean false
quantity int 0
variation_id uid
product_id uid
variation_info json

Update order

PUT /shops/<SHOP_ID>/orders/<ORDER_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "bill_full_name": "hoang anh ",
  "bill_phone_number": "0999999999",
  "creator": {
    "avatar_url": null,
    "fb_id": "2042723249341651",
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "name": "Hoang Anh"
  },
  "account": 4,
  "account_name": "facebook321",
  "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
  "id": 1418,
  "inserted_at": "2020-05-12T04:51:42",
  "updated_at": "2020-05-12T04:51:54",
  "is_free_shipping": false,
  "received_at_shop": false,
  "cod": 110000,
  "discount": 20000,
  "total_price": 100000,
  "total_price_after_sub_discount": 110000,
  "page_id": "256469571178082",
  "charged_by_card": 0,
  "charged_by_momo": 0,
  "charged_by_qrpay": 0,
  "transfer_money": 0,
  "partner_fee": 28000,
  "fee_marketplace": 4000,
  "customer_pay_fee": false,
  "items": [
    {
      "discount_each_product": 0,
      "is_bonus_product": false,
      "is_discount_percent": false,
      "is_wholesale": false,
      "one_time_product": false,
      "quantity": 1,
      "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
      "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
      "variation_info": {
        "detail": null,
        "fields": null,
        "display_id": null,
        "name": "aaaaaa",
        "product_display_id": null,
        "retail_price": 100000,
        "weight": 100
      }
    }
  ],
  "note": "",
  "note_print": null,
  "returned_reason": 1,
  "partner": {
    "cod": 0,
    "custom_partner_id": null,
    "extend_code": "S58824.MB25.C3.500020713",
    "extend_update": [],
    "is_returned": null,
    "order_number_vtp": null,
    "paid_at": null,
    "partner_id": 1,
    "sort_code": null,
    "system_created": true,
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16"
  },
  "warehouse_id": "630744ef-4614-4a70-988c-52e6d78c953c",
  "shipping_address": {
    "address": "aaaaa",
    "commune_id": "2210941",
    "country_code": null,
    "district_id": "22109",
    "full_address": "aaaaa, Xã Bắc Lý, Huyện Hiệp Hòa, Bắc Giang",
    "full_name": "hoang anh ",
    "phone_number": "0999999999",
    "post_code": null,
    "province_id": "221"
  },
  "shipping_fee": 10000,
  "shop_id": 4,
  "status": 0,
  "status_name": "new",
  "tags": [
    {
      "id": 2,
      "name": "Chờ cọc"
    },
    {
      "id": 3,
      "name": "Nhập hàng"
    },
    {
      "id": 13,
      "name": "Delay lấy hàng"
    }
  ],
  "warehouse_info": {
    "district_id": "10111",
    "full_address": "kakakaka, Phường Khương Trung, Quận Thanh Xuân, Hà Nội",
    "name": "snappy",
    "phone_number": "0999999999",
    "province_id": "101"
  },
  "arrange_shipment_marketplace": true,
  "pick_up_method": "pick_up",
  "picking_shif_marketplace": "closest"
}
Parameter Type Description Note
shop_id int Shop ID
bill_phone_number string Phone number of customer
bill_full_name string Customer name
id string Order ID
warehouse_id uid Warehouse ID. Get by api GET /warehouses
is_free_shipping boolean Free shipping
shipping_fee int Shipping fee
received_at_shop boolean true: Sale at the counter
false: Sale online
note_print string Note
items array List of products
item.discount_each_product int Discount ech product
item.is_discount_percent boolean Discount ech product by percent
item.is_bonus_product boolean Bonus product
item.quantity int Product quantity
item.one_time_product boolean Quickly added product
item.variation_info json Variation information
item.variation_id uid Variation ID. Get by api GET /variations
item.product_id uid Product ID. Get by api GET /variations
province_id string Province ID. Get by api GET /geo/provinces
district_id string District ID. Get by api GET /geo/districts
commune_id string Commune ID. Get by api GET/ geo/communes
shipping_address json Delivery information
shipping_address.address string Detailed delivery address (house number, street name, ....)
shipping_address.full_address string Full address
shipping_address.full_name string Full name of customer
shipping_address.phone_number string Phone number, name of customer, note, ....
warehouse_info json Warehouse information
note string Internal note
discount int Order discount
is_wholesale boolean Wholesale
inserted_at time Creation time
updated_at time Status update time
creator json Order creator
creator.fb_id string Facebook ID of creator
creator.name string Creator name
last_editor json Last editor updated order
status int Order status
partner.partner_id int Partner ID
partner.extend_code string Shipping order ID on partner system
tags array List of order tags
tag.id string Tag ID
tag.name string Tag name
cod int Cash on delivery
total_price int Total price
total_price_after_sub_discount int Total price after sub discount
charged_by_momo int Charged by MOMO
charged_by_qrpay int Charged by QRPAY
charged_by_card int Charged by card
transfer_money int Transfer money
page_id string Facebook page ID
partner_fee int Fee from shipping partner
fee_marketplace int Fees from e-commerce platforms
customer_pay_fee boolean false: Shop paid shipping fee
true: Customer paid shipping fee
account int Order source ID
account_name string Order source name
assigning_seller_id uid Assigning seller ID
arrange_shipment_marketplace boolean Prepare goods with orders from E-commerce platform Shopee, Lazada, TikTok
pick_up_method (1.1) string Pickup method Shopee, Tiktok
picking_shif_marketplace (1.2) string Pickup shift Shopee
(1.1) pick_up_method Pickup method
pick_up Courier to pickup
drop_off Take goods to post office
(1.2) picking_shif_marketplace Pickup shift
closest Closest
farthest Farthest

List of order sources

GET /shops/<SHOP_ID>/order_source?api_key=<api_key> HTTP/1.1

Response

{
    "data": [
      {
        "id": -3,
        "inserted_at": "2020-06-10T11:50:07",
        "name": "Shopee",
        "parent_id": null,
        "shop_id": 7,
        "updated_at": "2020-06-10T11:50:07"
      },
      {
        "id": 4,
        "inserted_at": "2020-06-17T08:41:54",
        "name": "40999897",
        "parent_id": -3,
        "shop_id": 7,
        "updated_at": "2020-06-17T08:41:54"
      },
      {
        "id": "1471242102982974",
        "inserted_at": "2021-04-22T08:33:15",
        "name": "Pancake.vn",
        "parent_id": -1,
        "shop_id": 20,
        "updated_at": "2024-04-08T03:11:25"
      }
    ],
    "success": true
}

Response Parameters

Parameter Type Description Example
shop_id int Shop ID
id int / string Order sources ID / Page ID
name string Order sources name / Page name
parent_id int Parent's order source ID
POST /shops/<SHOP_ID>/products/get_logistics_shipping_document?api_key=<api_key> HTTP/1.1

Request

{
  "params": [
    {
      "order_id": "576551803772635228"
    }
  ]
}

Response

{
  "data": [
    "https://www.africau.edu/images/default/sample.pdf"
  ],
  "success": true
}

Query Parameters

Parameter Required Type Example
document_type (1.1) true string SL_PL

Request Parameters

Parameter Required Type Description
order_id true string Order ID
(1.1) document_type Print type
SL_PL Shipping label + Packing slips
SHIPPING_LABEL Shipping label
PICK_LIST Packing slips
POST /shops/<SHOP_ID>/orders/get_tracking_url?api_key=<api_key> HTTP/1.1

Response

{
  "url": "https://pke.gg/99gjy3r",
  "success": true
}

Response Parameters

Parameter Type Description
url string Order confirm link

Order information

Response

{
  "advanced_platform_fee": {
    "affiliate_commission": 1,
    "diff_shipping_fee": 100,
    "marketplace_voucher": 100,
    "payment_fee": 7225,
    "platform_commission": 100,
    "seller_transaction_fee": 100,
    "service_fee": 100,
    "sfp_service_fee": 100
  },
  "printing_count": 1,
  "updated_at": "2023-11-02T09:14:32.661282",
  "money_to_collect": 430000,
  "total_price": 430000,
  "shop_customer_address_id": "d306bedc-9b35-4c7e-b3b1-26815c207dc9",
  "customer": {
    "fb_id": null,
    "id": "691ce908-bc13-4282-a87a-7d3f7e64a5cf",
    "name": "C Loan",
    "page_id": null,
  },
  "status": 9,
  "bill_phone_number": "0941902893",
  "total_quantity": 2,
  "time_assign_marketer": "2023-11-02T09:14:32",
  "is_locked": false,
  "note_print": "Giao tận tay khách",
  "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "status_history": [
    {
      "avatar_url": null,
      "editor": {
        "avatar_url": null,
        "email": "vuson897654@gmail.com",
        "fb_id": "377936050731194",
        "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "name": "Vũ Sơn",
        "phone_number": null
      },
      "editor_fb": "377936050731194",
      "editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "name": "Vũ Sơn",
      "old_status": null,
      "status": 0,
      "updated_at": "2023-11-02T08:48:28"
    }
  ],
  "duplicated_phone": true,
  "order_currency": "VND",
  "note": "Giao tận tay khách",
  "warehouse_info": {
    "address": "190 La Thành",
    "affiliate_id": null,
    "commune_id": "1012957",
    "custom_id": null,
    "district_id": "10129",
    "ffm_id": null,
    "full_address": "190 La Thành, Xã Ba Trại, Huyện Ba Vì, Hà Nội",
    "has_snappy_service": false,
    "name": "Kho mặc định",
    "phone_number": "0366452565",
    "province_id": "101"
  },
  "is_free_shipping": false,
  "tags": [61],
  "charged_by_vnpay": 0,
  "charged_by_qrpay": 0,
  "partner_fee": 27000,
  "custom_id": "SOICUN-12049-10",
  "last_editor": {
    "avatar_url": null,
    "email": "vuson897654@gmail.com",
    "fb_id": "377936050731194",
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Vũ Sơn",
    "phone_number": null
  },
  "charged_by_momo": 0,
  "bank_transfer_images": null,
  "partner": {
    "delivery_name": null,
    "delivery_tel": null,
    "extend_code": "LMP0224531356VNA",
    "paid_at": null,
    "partner_id": 57,
    "picked_up_at": null,
    "sort_code": "H-THL-1B",
    "system_created": true,
    "total_fee": 0,
    "updated_at": "2023-11-02T09:13:28"
  },
  "id": 103973,
  "page_id": "104438181227821",
  "inserted_at": "2023-11-02T08:48:29.136481",
  "shop_id": 20,
  "transfer_money": 0,
  "lock_order_by_user": null,
  "received_at_shop": false,
  "assigning_care": {
    "avatar_url": null,
    "email": "vuson897654@gmail.com",
    "fb_id": "377936050731194",
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Vũ Sơn",
    "phone_number": null
  },
  "assigning_seller_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "total_discount": 0,
  "einvoices": [],
  "shop_customer_id": "1442ab20-ab99-4c16-ab17-c7ebd4158a00",
  "charged_by_card": 0,
  "time_assign_seller": "2023-11-02T08:48:28",
  "sub_status_history": [],
  "items": [
    {
      "returned_count": 0,
      "note": "sp dễ vỡ",
      "id": 37956,
      "inserted_at": "2023-11-02T09:13:23.245866",
      "measure_group_id": 58,
      "variation_info": {
        "name": "Áo thời trang Nam Pari",
        "custom_id": "Nam Pari TX",
        "shop_warranty_policy_id": null,
        "inserted_at": "2023-05-17T08:46:39",
        "product_id": "Áo thời trang Nam Pari",
        "detail": "mau: trang, size: X",
        "weight": 700,
        "images": [
          "https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"
        ],
        "is_accessory": false,
        "measure_info": {
          "exchange_value": 30,
          "measure_id": 61
        },
        "barcode": "12392-4",
        "price_at_counter": 0,
        "retail_price": 200000,
      },
      "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
      "assigning_seller_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd",
      "quantity_by_combo_products": [],
      "discount_each_product": 0,
      "is_bonus_product": false,
      "quantity": 2
    }
  ],
  "estimate_delivery_date": "2023-11-03T08:47:00",
  "display_id": 12049,
  "order_sources": "-1",
  "charged_by_fundiin": 0,
  "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
  "surcharge": 0,
  "returned_reason": null,
  "last_editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "is_linked_partner": true,
  "shipping_fee": 30000,
  "call_laters": [],
  "last_update_status_at": "2023-11-02T09:13:28",
  "discount_by_customer_level": null,
  "shop_partner_id": 137,
  "viewing": [],
  "creator": {
    "avatar_url": null,
    "email": "vuson897654@gmail.com",
    "fb_id": "377936050731194",
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Vũ Sơn",
    "phone_number": null
  },
  "bill_full_name": "C Loan",
  "order_returned_ids": null,
  "activated_combo_products": [],
  "cost_surcharge": 0,
  "marketer": {
    "avatar_url": "https://statics.pancake.vn/user-content-dev2.pancake.vn/2022/1/4/a913bfe540a71b2a2bdf45429f91074cdcfdb170.png",
    "email": "thanglong96hust@gmail.com",
    "fb_id": "1137015309792644",
    "id": "316dcba2-e4ef-4787-b2d2-b02e83c8522c",
    "name": "Lê Thăng Long",
    "phone_number": null
  },
  "time_send_partner": "2023-11-02T09:13:28",
  "charged_by_kredivo": 0,
  "shipping_address": {
    "address": "Sn 18 ngách 91 ngõ 9 bãi muối",
    "commnue_name": "Phường Cao Thắng",
    "commune_id": "2250115",
    "country_code": "84",
    "district_id": "22501",
    "district_name": "Thành phố Hạ Long",
    "full_address": "Sn 18 ngách 91 ngõ 9 bãi muối, Phường Cao Thắng, Thành phố Hạ Long, Quảng Ninh",
    "full_name": "C Loan",
    "phone_number": "0941902893",
    "post_code": null,
    "province_id": "225",
    "province_name": "Quảng Ninh"
  },
  "discount": 0,
  "pke_mkter": "316dcba2-e4ef-4787-b2d2-b02e83c8522c",
  "histories": [
    {
      "bank_payments": {
        "new": {},
        "old": null
      },
      "editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "items": [
        {
          "new": {
            "discount_each_product": 0,
            "is_discount_percent": false,
            "quantity": 2,
            "variation_info": {
              "fields": [
                {
                  "id": "56e0ac18-3bd0-47ac-91ba-0f4056326c1d",
                  "keyValue": "TRANG",
                  "name": "mau",
                  "value": "trang"
                }
              ],
              "measure_info": {
                "exchange_value": 2,
                "measure_id": 1959
              },
              "name": "Áo thời trang Nam Pari",
              "retail_price": 200000,
              "weight": 700
            }
          },
          "old": null,
          "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd"
        }
      ],
      "total_quantity": {
        "new": 2,
        "old": 0
      },
      "updated_at": "2023-11-02T09:13:24"
    }
  ],
  "duplicated_customer": true,
  "bill_email": "dfadf@gmail.com",
  "customer_referral_code": null,
  "assigning_seller": {
    "avatar_url": null,
    "email": "vuson897654@gmail.com",
    "fb_id": "377936050731194",
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Vũ Sơn",
    "phone_number": null
  },
  "tax": 0,
  "time_assign_care": "2023-11-02T09:14:32",
  "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "cod": 430000,
  "customer_pay_fee": false,
  "cash": 0,
  "is_from_ecommerce": null,
  "account": "104438181227821",
  "note_image": null,
  "customer_needs": [],
  "shopify_abandon_checkout_id": 30120904851641,
  "link_confirm_order": "https://order.pke.gg/tracking?id=RyvKXPdNWkGlh2Wk8g70Juca8F03N8O"
}
Parameter Type Description
advanced_platform_fee (1.0) json Fees from e-commerce platforms
printing_count int Printing count
updated_at time Status update time
money_to_collect int Amount to collect
total_price int Total price
shop_customer_address_id uid Customer address id
customer (1.1) json Customer information
status int Order status
bill_phone_number string Phone number of customer
total_quantity int Total quantity
time_assign_marketer time Time assign marketer
is_locked boolean Order lock
note_print string Note
creator_id uid Creator id
status_history array Status update history
duplicated_phone boolean Duplicate phone number
order_currency string Currency unit
note string Internal note
warehouse_info json Warehouse information
is_free_shipping boolean Free shipping
tags (1.2) array List of order tags
charged_by_vnpay int Amount paid by VNPAY
charged_by_qrpay int Charged by QRPAY
partner_fee int Fee from shipping partner
custom_id string Order ID
last_editor json Last editor updated order
charged_by_momo int Charged by MOMO
bank_transfer_images array Bank transfer image link
id string Order ID
partner (1.3) json Shipping information
page_id string Facebook page ID
inserted_at time Creation time
shop_id int Shop ID
transfer_money int Transfer money
lock_order_by_user uid Order lock user id
received_at_shop boolean true: Sale at the counter
false: Sale online
assigning_care json Care
assigning_seller_id uid Assigning seller ID
total_discount int Discount total
einvoices array E-invoice information
shop_customer_id uid Customer ID
charged_by_card int Charged by card
items (1.4) array List of products
estimate_delivery_date time Estimated delivery date
order_sources string Order source ID
charged_by_fundiin int Amount paid by Fundiin
warehouse_id uid Warehouse ID. Get by api GET /warehouses
surcharge int Surcharge
returned_reason string Return reason
last_editor_id uid Last editor code
is_linked_partner boolean Linked delivery partner
shipping_fee int Shipping fee
call_laters array Call back
last_update_status_at time Last status update time
discount_by_customer_level int Discount by customer level
viewing array Currently viewing employee
creator json Order creator
creator.fb_id string Facebook ID of creator
creator.name string Creator name
bill_full_name string Customer name
order_returned_ids uid Return order id
activated_combo_products array Activated combo information
cost_surcharge int Cost surcharge
marketer json Marketer
time_send_partner time Time send partner
charged_by_kredivo int Amount paid by Kredivo
shipping_address (1.5) json Delivery information
discount int Discount
pke_mkter uid Marketer id
histories array History
duplicated_customer boolean Duplicate customer
bill_email string Customer email
customer_referral_code json Customer referral code
assigning_seller json Seller
tax int Tax
time_assign_care time Time assign care
assigning_care_id uid Assigning care id
cod int Cash on delivery
customer_pay_fee boolean false: Shop paid shipping fee
true: Customer paid shipping fee
cash int Cash
is_from_ecommerce boolean Order from e-commerce
account int Order source ID
note_image array Link note image
shopify_abandon_checkout_id int Uncompleted payment ID from Shopify
link_confirm_order string Link confirm order

advanced_platform_fee (1.0)

Parameter Type Description
affiliate_commission int Affiliate Commission (E-commerce)
diff_shipping_fee int Shipping fee different (E-commerce)
marketplace_voucher int E-Commerce voucher (E-commerce)
payment_fee int Platform fee (E-commerce)
platform_commission int Platform commission (E-commerce)
seller_transaction_fee int Payment Fee (E-commerce)
service_fee int Service fee (E-commerce)
sfp_service_fee int SFP fee (E-commerce)

customer (1.1)

Parameter Type Description
fb_id string Customer Facebook ID
id uid Customer ID
name string Full name of customer
page_id string Facebook page ID

tags (1.2)

Parameter Type Description
id string Tag ID
name string Tag name

partner (1.3)

Parameter Type Description
delivery_name string Delivery
delivery_tel string Delivery phone number
extend_code string Shipping order ID on partner system
partner_id int Partner ID
picked_up_at time Picked up at
sort_code string Shortened transportation code
total_fee int Total fee
updated_at time Updated at

items (1.4)

Parameter Type Description
note string Note
inserted_at time Creation time
measure_group_id int Measure group id
discount_each_product int Discount ech product
is_bonus_product boolean Bonus product
is_discount_percent boolean Discount ech product by percent
is_wholesale boolean Wholesale
variation_id uid Variation ID. Get by api GET /variations
product_id uid Product ID. Get by api GET /variations
quantity int Product quantity
measure_group_id int Measure group id
variation_info json Variation information
variation_info.measure_info json Measure information
variation_info.measure_info.measure_id int Measure id
variation_info.measure_info.exchange_value int Exchange value

shipping_address (1.5)

Parameter Type Description
address string Detailed delivery address (house number, street name, ....)
commnue_name string Commune
commune_id string Commune ID. Get by api GET/ geo/communes
country_code string Country code (for example, Vietnam country code is 84)
district_id string District ID. Get by api GET /geo/districts
district_name string District
full_address string Full address
full_name string Full name of customer
phone_number string Phone number, name of customer, note, ....
province_id string Province ID. Get by api GET /geo/provinces
province_name string Province / City
Status Status name
0 New
17 Wait submit
11 Waiting for order
12 Waiting for goods
13 Printed
20 Ordered
1 Confirmed
8 Packing
9 Waiting for delivery
2 Sent
3 Received
16 Paid
4 Returning
15 Partial return
5 Returned
6 Canceled
7 Deleted
10 From Webcake
21 From Storecake
Partner Status Status name
request_received New
delay_pickup Delay pick up
picking_up Picking up
picked_up Picked up
on_the_way In transit warehouse
delay_delivery Delay delivery
out_for_delivery On delivery
undeliverable Undeliverable
waiting_for_return Waiting for return
delivered Delivered
delivered_cod Delivery and paid
returning Returning
returned Returned
returned_cod Returned and paid
canceled Canceled
PartnerId Shipping partner name
0 Snappy
1 Giao hàng tiết kiệm
2 EMS
3 Viettel Post
4 247
5 Giao hàng nhanh
17 Vnpost(Bưu điện)
15 J&T
16 Best Inc
9 DHL
19 Ninja Van
36 Nhất Tín Express
39 Hola Ship
11 Ahamove
37 Grab Express
38 Vạn Phúc Express
32 SuperShip
33 ZTO Express
10 J&T Phi
12 LBC Express
13 Lazada Express
42 Shopee Express
31 Ninja van Phi
35 Byaheros
20 Kerry express
21 Flash express
22 Lalamove
23 J&T Thai
24 Nim express
25 Thailand post
26 Thai parcel
27 DHL Thai
28 CJ logistics
29 Best Express Thai
30 Ninja van Tha
40 LWE
Returned reason Returned reason description
1 By customer
2 By staff
3 By product
4 Due to shipping partner
5 Due to returning

Return order

List return order

GET /shops/<SHOP_ID>/orders_returned?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "bill_full_name": "HUy",
      "bill_phone_number": "0377666434",
      "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "custom_id": null,
      "discount": 0,
      "discount_from_order_to_returned": 0,
      "display_id": 636,
      "id": 1403,
      "inserted_at": "2024-04-25T08:34:50.000000",
      "order": {
        "prepaid_by_point": {
          "money": 0,
          "point": 0
        },
        "surcharge": 0,
        "money_to_collect": -80000,
        "system_id": 14856,
        "shipping_address": {
          "address": "Ha nội",
          "commnue_name": "Phường Nghĩa Đô",
          "commune_id": "1011301",
          "country_code": "84",
          "district_id": "10113",
          "district_name": "Quận Cầu Giấy",
          "full_address": "Ha nội, Phường Nghĩa Đô, Quận Cầu Giấy, Hà Nội",
          "full_name": "HUy",
          "phone_number": "0377666434",
          "post_code": null,
          "province_id": "101",
          "province_name": "Hà Nội"
        },
        "total_discount": 0,
        "status": 0,
        "items": [
          {
            "added_to_cart_quantity": 2,
            "discount_each_product": 0,
            "exchange_count": 0,
            "id": 45373,
            "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
            "quantity": 2,
            "return_quantity": 0,
            "returned_count": 0,
            "returning_quantity": 0,
            "variation_id": "23f91ea1-5cb8-46a1-a8a6-e3819af9abad",
            "variation_info": {
              "barcode": "12392-2",
              "detail": "mau: xanh, size: X",
              "display_id": "Nam Pari XX",
              "exact_price": 200000,
              "fields": [
                {
                  "id": "283d9e1d-c254-4bad-8d69-19be477f2512",
                  "keyValue": "XANH",
                  "name": "mau",
                  "value": "xanh"
                },
                {
                  "id": "968f5f28-d043-4937-911a-9334efede2f1",
                  "keyValue": "X",
                  "name": "size",
                  "value": "X"
                }
              ],
              "last_imported_price": 100000,
              "name": "Áo thời trang Nam Pari",
              "product_display_id": "Áo thời trang Nam Pari",
              "retail_price": 200000,
              "weight": 700
            }
          }
        ],
        "cash": 0,
        "account_name": "wa_c.us@6282288988901",
        "charged_by_qrpay": 0,
        "total_quantity": 2,
        "account": "46",
        "shipping_fee": 20000,
        "time_assign_seller": "2024-04-25T08:34:47",
        "id": "1485614856",
        "total_price": 400000,
        "inserted_at": "2024-04-25T08:32:53.064777",
        "charged_by_momo": 0,
        "prepaid": 0,
        "bill_phone_number": "0377666434",
        "fee_marketplace": 0,
        "total_price_after_sub_discount": 420000,
        "order_sources": "-1",
        "assigning_seller_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "bill_full_name": "HUy",
        "order_currency": "VND",
        "shop_id": 20,
        "updated_at": "2024-04-25T08:34:52.471988",
        "return_fee": false,
        "order_link": "https://pos.pages.fm/shop/20/order?order_id=109503",
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
        "cod": -80000,
        "is_exchange_order": false,
        "exchange_payment": 500000,
        "items_length": 1,
        "transfer_money": 0,
        "estimate_delivery_date": null,
        "received_at_shop": false,
        "customer_pay_fee": false,
        "partner_fee": 0,
        "charged_by_card": 0,
        "status_name": "new",
      },
      "order_id": 109503,
      "order_id_to_returned": 109502,
      "order_to_returned": {
        "prepaid_by_point": {
          "money": 0,
          "point": 0
        },
        "surcharge": 0,
        "money_to_collect": 1020000,
        "system_id": 14855,
        "shipping_address": {
          "address": "Ha nội",
          "commnue_name": "Phường Nghĩa Đô",
          "commune_code_sicepat": null,
          "commune_id": "1011301",
          "country_code": "84",
          "district_id": "10113",
          "district_name": "Quận Cầu Giấy",
          "full_address": "Ha nội, Phường Nghĩa Đô, Quận Cầu Giấy, Hà Nội",
          "full_name": "HUy",
          "phone_number": "0377666434",
          "post_code": null,
          "province_id": "101",
          "province_name": "Hà Nội"
        },
        "total_discount": 0,
        "status": 3,
        "time_assign_care": null,
        "items": [
          {
            "added_to_cart_quantity": 2,
            "discount_each_product": 0,
            "exchange_count": 0,
            "id": 45372,
            "one_time_product": false,
            "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
            "quantity": 2,
            "return_quantity": 1,
            "returned_count": 0,
            "returning_quantity": 1,
            "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd",
            "variation_info": {
              "barcode": "12392-4",
              "detail": "mau: trang, size: X",
              "display_id": "Nam Pari TX",
              "exact_price": 200000,
              "fields": [
                {
                  "id": "56e0ac18-3bd0-47ac-91ba-0f4056326c1d",
                  "keyValue": "TRANG",
                  "name": "mau",
                  "value": "trang"
                },
                {
                  "id": "50c8ba70-db9a-40e0-8198-af2237335bf2",
                  "keyValue": "X",
                  "name": "size",
                  "value": "X"
                }
              ],
              "last_imported_price": 100000,
              "name": "Áo thời trang Nam Pari",
              "product_display_id": "Áo thời trang Nam Pari",
              "retail_price": 500000,
              "weight": 700
            }
          }
        ],
        "cash": 0,
        "account_name": "wa_c.us@6282288988901",
        "charged_by_qrpay": 0,
        "total_quantity": 2,
        "account": "46",
        "shipping_fee": 20000,
        "time_assign_seller": "2024-04-25T08:33:47",
        "id": "1485514855",
        "order_sources_name": "Facebook",
        "note": "",
        "total_price": 1000000,
        "inserted_at": "2024-04-25T08:32:53.064777",
        "change_by_orders": [
          {
            "bill_full_name": "HUy",
            "bill_phone_number": "0377666434",
            "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
            "custom_id": null,
            "discount": 0,
            "discount_from_order_to_returned": 0,
            "display_id": 636,
            "id": 1403,
            "inserted_at": "2024-04-25T08:34:50.000000",
            "order": {
              "prepaid_by_point": {
                "money": 0,
                "point": 0
              },
              "surcharge": 0,
              "money_to_collect": -80000,
              "p_utm_term": null,
              "system_id": 14856,
              "shipping_address": {
                "address": "Ha nội",
                "commnue_name": "Phường Nghĩa Đô",
                "commune_code_sicepat": null,
                "commune_id": "1011301",
                "country_code": "84",
                "district_id": "10113",
                "district_name": "Quận Cầu Giấy",
                "full_address": "Ha nội, Phường Nghĩa Đô, Quận Cầu Giấy, Hà Nội",
                "full_name": "HUy",
                "phone_number": "0377666434",
                "post_code": null,
                "province_id": "101",
                "province_name": "Hà Nội"
              },
              "total_discount": 0,
              "status": 0,
              "cash": 0,
              "account_name": "wa_c.us@6282288988901",
              "charged_by_qrpay": 0,
              "total_quantity": 2,
              "account": "46",
              "shipping_fee": 20000,
              "time_assign_seller": "2024-04-25T08:34:47",
              "id": "1485614856",
              "order_sources_name": "Facebook",
              "total_price": 420000,
              "inserted_at": "2024-04-25T08:32:53.064777",
              "charged_by_momo": 0,
              "prepaid": 0,
              "bill_phone_number": "0377666434",
              "fee_marketplace": 0,
              "order_sources": "-1",
              "assigning_seller_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
              "bill_full_name": "HUy",
              "order_currency": "VND",
              "shop_id": 20,
              "updated_at": "2024-04-25T08:34:52.471988",
              "return_fee": false,
              "order_link": "https://pos.pages.fm/shop/20/order?order_id=109503",
              "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
              "cod": -80000,
              "is_exchange_order": false,
              "exchange_payment": 500000,
              "transfer_money": 0,
              "is_free_shipping": false,
              "levera_point": 0,
              "received_at_shop": false,
              "customer_pay_fee": false,
              "partner_fee": 0,
              "charged_by_card": 0,
              "status_name": "new",
            },
            "order_id": 109503,
            "order_id_to_returned": 109502,
            "order_to_returned": {},
            "returned_fee": 0,
            "returned_items": [
              {
                "discount_each_product": 0,
                "id": 1423,
                "is_discount_percent": false,
                "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
                "returned_quantity": 1,
                "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd",
                "variation_info": {
                  "barcode": "12392-4",
                  "detail": "mau: trang, size: X",
                  "id": "Nam Pari TX",
                  "images": [
                    "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/9/29/d05f44dcf2b9f96312d88b718da35aa5317242d6.jpg",
                  ],
                  "name": "Áo thời trang Nam Pari",
                  "product_id": "Áo thời trang Nam Pari",
                  "retail_price": 500000,
                  "weight": 700,
                  "wholesale_price": 0,
                }
              }
            ],
            "shop_customer_id": "fd3388d9-d6a6-4fca-8ef5-9e7647395cf0",
            "shop_id": 20,
            "status": 0,
            "updated_at": "2024-04-25T08:34:50.000000",
            "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
          }
        ],
        "charged_by_momo": 0,
        "prepaid": 0,
        "bill_phone_number": "0377666434",
        "fee_marketplace": 0,
        "post_id": null,
        "total_price_after_sub_discount": 1020000,
        "order_sources": "-1",
        "assigning_seller_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "bill_full_name": "HUy",
        "activated_promotion_advances": [],
        "order_currency": "VND",
        "shop_id": 20,
        "updated_at": "2024-04-25T08:34:52.680954",
        "order_link": "https://pos.pages.fm/shop/20/order?order_id=109502",
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
        "cod": 1020000,
        "is_exchange_order": true,
        "exchange_payment": 0,
        "items_length": 1,
        "transfer_money": 0,
        "levera_point": 0,
        "received_at_shop": false,
        "creator": {
          "email": "vuson897654@gmail.com",
          "fb_id": "377936050731194",
          "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "name": "Vũ Sơn",
          "phone_number": null
        },
        "assigning_care_id": null,
        "partner_fee": 0,
        "charged_by_card": 0,
        "status_name": "delivered",
        "sub_status": null,
        "assigning_care": null,
        "note_print": null
      },
      "returned_fee": 0,
      "returned_items": [
        {
          "discount_each_product": 0,
          "id": 1423,
          "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
          "returned_quantity": 1,
          "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd",
          "variation_info": {
            "barcode": "12392-4",
            "detail": "mau: trang, size: X",
            "id": "Nam Pari TX",
            "images": [
              "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/9/29/d05f44dcf2b9f96312d88b718da35aa5317242d6.jpg",
            ],
            "name": "Áo thời trang Nam Pari",
            "one_time_product_id": null,
            "product_id": "Áo thời trang Nam Pari",
            "retail_price": 500000,
            "retail_price_by_currency": [
              {
                "currency": "USD",
                "retailPriceByCurrency": "100"
              },
              {
                "currency": "VND",
                "retailPriceByCurrency": "200000"
              }
            ],
            "weight": 700,
          }
        }
      ],
      "shop_customer_id": "fd3388d9-d6a6-4fca-8ef5-9e7647395cf0",
      "shop_id": 20,
      "status": 0,
      "status_histories": [
        {
          "editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "id": "71d9ecce-986f-4cbe-90be-ddaefb0b4c5a",
          "inserted_at": "2024-04-25T08:34:52.000000",
          "old_status": null,
          "status": 0,
          "updated_at": "2024-04-25T08:34:52.000000"
        }
      ],
      "tags": [],
      "updated_at": "2024-04-25T08:34:50.000000",
      "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 636
}

Query Parameters

Parameter Required Type Default Description Example
page false int 1
page_size false int 30
status false int -1 Status
update_status false string / int inserted_at Filter orders by time
start_time false unix timestamp null Start date 1699635600
end_time false unix timestamp null End date 1699635600
update_status Filter orders by time
inserted_at Create order
0 New
2 Sent
1 Completed
4 Canceled

Warehouse

Create warehouses

POST /shops/<SHOP_ID>/warehouses?api_key=<api_key> HTTP/1.1

Request

{
  "address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội",
  "batch_config": {
    "col": "0",
    "line": "3",
    "row": "3"
  },
  "commune_id": "1010735",
  "custom_batch_config": {
    "custom_config": {
      "0": "lô 1"
    }
  },
  "custom_shelf_config": {
    "custom_config": {
      "0": "1.1",
      "1": "1.2",
      "2": "1.3",
      "3": "1.4"
    }
  },
  "country_code": "84",
  "district_id": "10107",
  "hide_config_batch_shelf": false,
  "name": "kho 2",
  "phone_number": "098765432",
  "province_id": "101",
  "shelf_config": {
    "col": "3"
  }
}

Query Parameters

Parameter Required Type Default
address false string Details dddress of warehouse (number of houses, roads, ...)
batch_config false json Batch config
country_code false string Country code
commune_id false string Commune ID. Get by api GET/ geo/communes
custom_batch_config false json Custom batch config
custom_shelf_config false json Custom shelf config
district_id false string District ID. Get by api GET /geo/districts
hide_config_batch_shelf false boolean Open custom batch shelf config
province_id false string Province ID. Get by api GET /geo/provinces
phone_number false string Warehouse phone number
name true string Warehouse name
shelf_config true json Shelf config

Update warehouse

PUT /shops/<SHOP_ID>/warehouses/<WAREHOUSE_ID>/?api_key=<api_key> HTTP/1.1

Request

{
  "address": "190 La Thành",
  "batch_config": {
    "col": "0",
    "line": "3",
    "row": "3"
  },
  "commune_id": "1011309",
  "custom_batch_config": {
    "custom_config": {
      "0": "lô 1"
    }
  },
  "custom_shelf_config": {
    "custom_config": {
      "0": "1.1",
      "1": "1.2",
      "2": "1.3",
      "3": "1.4"
    }
  },
  "district_id": "10113",
  "hide_config_batch_shelf": false,
  "name": "Kho mặc định",
  "phone_number": "0366452565",
  "province_id": "101",
  "shelf_config": {
    "col": "3"
  }
}

Query Parameters

Parameter Required Type Default
address false string Details dddress of warehouse (number of houses, roads, ...)
batch_config false json Batch config
country_code false string Country code
commune_id false string Commune ID. Get by api GET/ geo/communes
custom_batch_config false json Custom batch config
custom_shelf_config false json Custom shelf config
district_id false string District ID. Get by api GET /geo/districts
hide_config_batch_shelf false boolean Open custom batch shelf config
province_id false string Province ID. Get by api GET /geo/provinces
phone_number false string Warehouse phone number
name true string Warehouse name
shelf_config true json Shelf config

List of warehouses

GET /shops/<SHOP_ID>/warehouses?api_key=<api_key> HTTP/1.1

Response

{
    "data": [
      {
        "address": "hâhhha",
        "allow_create_order": true,
        "commune_id": "7170510",
        "country_code": "84",
        "custom_id": null,
        "district_id": "71705",
        "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
        "id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
        "name": "kho test ecod",
        "phone_number": "0999999999",
        "province_id": "717",
        "shop_id": 26290
      },
      {
        "address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội",
        "allow_create_order": false,
        "commune_id": "1010735",
        "country_code": "84",
        "custom_id": null,
        "district_id": "10107",
        "full_address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội, Phường Minh Khai, Quận Hai Bà Trưng, Hà Nội",
        "id": "644b0063-e9a8-43cd-ba08-66a8066d462e",
        "name": "kho 2",
        "phone_number": "01655809949",
        "province_id": "101",
        "shop_id": 26290
      }
    ]
}

Response Parameters

Parameter Type Description
address string Details dddress of warehouse (number of houses, roads, ...)
allow_create_order boolean Warehouse can create orders
commune_id string Commune ID
district_id string District ID
province_id string Province ID
country_code string Country code
custom_id string Warehouse custom code
id uid Warehouse ID
full_address string Full address warehouse
name string Warehouse name
phone_number string Warehouse phone number

List of employee

GET /shops/<SHOP_ID>/users?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "shop_id": 7,
      "user": {
        "email": "2042723249341651@facebook.com",
        "fb_id": "2042723249341651",
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "name": "Hoang Anh",
        "phone_number": null
      },
      "user_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "sale_group": {
        "id": 30,
        "name": "Ca sáng"
      }
    }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
shop_id int Shop ID
user_id uid Employee code
user json Employee information
user.email string Employee email
user.fb_id string Employee facebook ID
user.name string Employee name
user.phone_number string Employee phone number
sale_group json Sale group information
sale_group.id int Sale group ID
sale_group.name string Sale group name

Call later & Reminder

List of call later & reminders

GET /shops/<SHOP_ID>/order_call_laters?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "called_at": "2024-01-30T01:54:17",
      "creator": {
        "avatar_url": null,
        "email": "vuson897654@gmail.com",
        "fb_id": "377936050731194",
        "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "name": "Vũ Sơn",
        "phone_number": null
      },
      "display_id": 70,
      "id": "1885d8d4-e210-4e56-bb32-683988a032f5",
      "need_notify_users": [
        "cee3c05e-5f85-43c4-b27e-889b99c50097"
      ],
      "needs_call_at": "2024-01-30T02:20:48",
      "notice_created": "Gọi lại cho khách",
      "order_display_id": "SOICUN-12943-02",
      "order_id": 106703,
      "status": 1,
      "type": "call"
    },
    ...
  ],
  "key": "today",
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 3,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description
page_number false int 1
page_size false int 30
key false string today
status false int -1 Status
Status Status name
-1 All status
0 Not processed
3 Calling / Processing
1 Processed
2 Not listening / Unsuccessful
7 Removed

Response Parameters

Parameter Type Description
called_at unix timestamp Called at / Processed at
creator json Creator information
display_id int Call later & reminder id
need_notify_users array Processing staff
needs_call_at unix timestamp Need to call at / Need to process at
notice_created string Notice information
order_display_id string Order ID
status int Status
type string Notification type

Create call later and remind

POST /shops/<SHOP_ID>/order_call_laters?api_key=<api_key> HTTP/1.1

Request

{
  "order_call_later": {
    "status": 0,
    "need_notify_users": [
      "cee3c05e-5f85-43c4-b27e-889b99c50097"
    ],
    "notice_created": "Gọi lại xác nhận",
    "needs_call_at": "2024-08-29T05:50:31.700Z",
    "phone_number": "0929911922"
  }
}

Query Parameters

Parameter Required Type Description
status true int Status
need_notify_users false array Processing staff
notice_created false string Notice information
needs_call_at true iso 8601 Need to call at
phone_number true string Phone number

Product

Create product

POST /shops/<SHOP_ID>/products?api_key=<api_key> HTTP/1.1

Request

{
  "product": {
    "name": "Tên sản phẩm",
    "note_product": "Ghi chú sản phẩm",
    "product_attributes": [{"name": "Màu", "values": ["Đen", "Trắng", "Đỏ"]}, {"name": "Size", "values": ["S", "M", "L"]}],
    "tags": [193, 51],
    "variations": [
      {
        "fields": [{"name": "Màu", "value": "Trắng"}, {"name": "Size", "value": "M"}],
        "images": ["https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"],
        "last_imported_price": 30000,
        "retail_price": 0,
        "weight": 0,
        "barcode": "BARCODE123",
        "custom_id": "VCUSTOMID",
        "is_hidden": false
      }
    ],
    "weight": 1,
    "custom_id": "PCUSTOMID",
    "is_published": true,
    "variations_warehouses": [
      {
        "remain_quantity": 10,
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
        "batch_position": "lô 1",
        "shelf_position": "1.2"
      }
    ]
  }
}

Query Parameters

Parameter Required Type Default Example
name true string Product name Test
note_product false string Product notes
product_attributes false array Attribute information [{name: "Màu", values: ["Đen", "Trắng", "Đỏ"]}, {name: "Size", values: ["S", "M", "L"]}]
tags false array Product tags [193, 51]
weight true int Product weight 100
custom_id false string Product custom code TEST1
is_published false boolean StoreCake status true
variation.images false array Image link "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
variation.last_imported_price false int Imported price 30000
variation.retail_price true int Variation retail price 1000000
variation.weight true int Variation weight 100
variation.barcode false string Variation barcode ID BAR001
variation.custom_id false string Variation custom code TEST1001
variation.is_hidden false string StoreCake status is_hidden = true -> hide, is_hidden = false -> no hide false
variation.fields false array Variation attribute information [{name: "Màu", value: "Trắng"}, {name: "Size", value: "M"}]
variation.variations_warehouses false array Warehouse information [{remain_quantity: 10, warehouse_id: "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da", batch_position: "lô 1", "shelf_position": "1.2"}]

Update product information

PUT /shops/<SHOP_ID>/products/<PRODUCT_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "product": {
    "name": "Tên sản phẩm",
    "note_product": "Ghi chú sản phẩm",
    "product_attributes": [{"name": "Màu", "values": ["Đen", "Trắng", "Đỏ"]}, {"name": "Size", "values": ["S", "M", "L"]}],
    "variations": [
      {
        // Cập nhật mẫu  
        "id": "3c3aca82-030e-4708-a75b-b2eaf538a2f5",
        "fields": [{"name": "Màu", "value": "Trắng"}, {"name": "Size", "value": "M"}],
        "images": [],
        "last_imported_price": 30000,
        "retail_price": 0,
        "weight": 0,
        "barcode": "BARCODE123",
        "custom_id": "VCUSTOMID",
        "is_hidden": false
      },
      {
        // Tạo mẫu  mới cho Sản phẩm
        "fields": [{"name": "Màu", "value": "Đỏ"}, {"name": "Size", "value": "L"}],
        "images": ["https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"],
        "last_imported_price": 30000,
        "retail_price": 0,
        "weight": 0,
        "barcode": "BARCODE123",
        "custom_id": "VCUSTOMID2",
        "is_hidden": false
      }
    ],
    "weight": 1,
    "custom_id": "PCUSTOMID",
    "is_published": true,
    "tags": [193, 51],
    "variations_warehouses": [
      {
        "remain_quantity": 10,
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
        "batch_position": "lô 1",
        "shelf_position": "1.2"
      }
    ]
  }
}

Query Parameters

Parameter Type Description Example
name string Product name Test
note_product string Product notes
product_attributes array Attribute information [{name: "Màu", values: ["Đen", "Trắng", "Đỏ"]}, {name: "Size", values: ["S", "M", "L"]}]
tags array Product tags [193, 51]
weight int Product weight 100
custom_id string Product custom code TEST1
is_published false boolean StoreCake status
variations array Product variation
variation.images array Image link "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
variation.last_imported_price int Imported price 300000
variation.retail_price int Variation retail price 1000000
variation.weight int Variation weight 100
variation.barcode string Variation barcode ID BAR001
variation.custom_id string Variation custom code TEST1001
variation.is_hidden boolean StoreCake status is_hidden = true -> hide, is_hidden = false -> no hide false
variation.fields array Variation attribute information [{name: "Màu", value: "Trắng"}, {name: "Size", value: "M"}]
variation.variations_warehouses array Thông tin kho [{remain_quantity: 10, warehouse_id: "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da", batch_position: "lô 1", "shelf_position": "1.2"}]
variation.is_removed boolean true: Remove variation, false: No remove variation false

Update inventory

POST /shops/<SHOP_ID>/variations/<VARIATION_ID>/update_quantity?api_key=<api_key> HTTP/1.1

Request

{
 "variations_warehouses": [
    {
      "remain_quantity": 20,
      "warehouse_id": "a41b5d73-9236-4a5d-9954-4db6d93242d1"
    },
    {
      "remain_quantity": 20,
      "warehouse_id": "a41b5d73-9236-4a5d-9954-4db6d93242d4"
    },
    {
      "remain_quantity": 20,
      "warehouse_id": "a41b5d73-9236-4a5d-9954-4db6d93242d5"
    }
  ]
}

Query Parameters

Parameter Type Description Example
VARIATION_ID string Variation ID e190db2b-1163-4cc3-b956-7a9528fbf5ef
variations_warehouses array Inventory information
variations_warehouses.remain_quantity int Inventory remain quantity
variations_warehouses.warehouse_id string Warehouse ID
is_actual_remain_quantity boolean true: Update inventory, false: Update remain quantity

Updated inventory of many variations

POST /shops/<SHOP_ID>/variations/update_quantity?api_key=<api_key> HTTP/1.1

Request

{
  "is_actual_remain_quantity": true,
  "variations_warehouses": [
    {
      "variation_id": "20e7d183-c70c-445e-8ce2-4d7e3a378e34",
      "remain_quantity": 15,
      "warehouse_id": "229102e4-39c3-4523-bd57-4ed0a45a85ba"
    },
    {
      "variation_id": "5f0cfb8d-aee9-4ec0-9ff0-b5668d3143d2",
      "remain_quantity": 15,
      "warehouse_id": "24c4447e-c35f-4acc-affa-70e49eb354d1"
    },
    {
      "variation_id": "5f0cfb8d-aee9-4ec0-9ff0-b5668d31fhl3",
      "remain_quantity": 15,
      "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    }
  ]
}

Query Parameters

Parameter Type Description
is_actual_remain_quantity boolean true: Update inventory, false: Update remain quantity
variations_warehouses array Inventory information
variations_warehouses.variation_id string Variation ID
variations_warehouses.remain_quantity int Inventory remain quantity
variations_warehouses.warehouse_id string Warehouse ID

Update composite product

POST /shops/<SHOP_ID>/variations/update_composite_product?api_key=<api_key> HTTP/1.1

Request

{
  "variation_id": "79aecce9-3b1e-4ad3-afe1-2ee658720687",
  "composite_products": [
    {
      "quantity": 1,
      "component_id": "67b19856-3226-457e-a746-df26e4ec1360"
    }
  ]
}

Query Parameters

Parameter Type Description
variation_id uid Variation ID
composite_products.quantity int Composite quantity
composite_products.component_id string Composite variation id

List of products

GET /shops/<SHOP_ID>/products/variations?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "barcode": null,
      "display_id": "ADXL",
      "is_hidden": false,
      "is_locked": false,
      "is_sell_negative_variation": true,
      "fields": [
        {
          "id": "b032c515-3f71-4a1b-8e1d-77721ae72f37",
          "name": "màu",
          "value": "nâu"
        },
        {
          "id": "677c14b5-458f-4af6-8d73-08bcb2245547",
          "name": "size",
          "value": "s"
        }
      ],
      "id": "e190db2b-1163-4cc3-b956-7a9528fbf5ef",
      "images": [
        "https://cf.shopee.vn/file/03e670d02803fcfbb17b2b719762ee17",
        "https://cf.shopee.vn/file/9070bb1b0e6fcc84b46b6e5057544023"
      ],
      "last_imported_price": 55000,
      "product_id": "3b98a639-9d40-4faa-a692-6662f20e128d",
      "product": {
        "note_product": "Ghi chú sản phẩm",
        "categories": [],
        "display_id": "ADXL",
        "image": "https://content.pancake.vn/user-content-dev2.pancake.vn/2024/11/7/1fdf82943574017240257bf9c88bc70a06a8813a.png",
        "name": "ASOS đen XL",
        "tags": [
          {
            "id": 51,
            "note": "the 3"
          },
          {
            "id": 193,
            "note": "thẻ 1"
          }
        ],
        "is_published": true,
      },
      "remain_quantity": 20,
      "retail_price": 140000,
      "total_purchase_price": 4500000,
      "variations_warehouses": [
        {
          "actual_remain_quantity": 100,
          "pending_quantity": 0,
          "remain_quantity": 20,
          "returning_quantity": 0,
          "total_quantity": 102,
          "warehouse_id": "a41b5d73-9236-4a5d-9954-4db6d93242d1"
        }
      ],
      "wholesale_price": []
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 751,
  "total_pages": 26
}

Query Parameters

Parameter Required Type Default Description Example
page_size false int 30
page_number false int 1
search false string null
selling_status false string Selling speed
product_status false string Product status
category_id false array Category id
is_filter_categories_by_or false boolean true Filter category by "or" condition
filter_exclude_categories false boolean false Filter exclude category
warehouse_until false time null Get inventory information at time 2024-06-10T17:00:00.000Z
selling_status Description
none Testing
bad Slow
normal Sent
star Received
product_status Description
locked deactivate
not_locked active

Reponse Parameters

Parameter Type Description
display_id string Product display id
note_product string Product notes
is_hidden boolean StoreCake status is_hidden = true -> hide, is_hidden = false -> no hide
is_locked boolean Product notes
is_sell_negative_variation boolean Allow sell negative
fields json Details information of product
field.name string Attribute name
field.value string Attribute value
id uid Variation ID
last_imported_price int Price import
product.categories array Product categories
product.display_id string Product display id
product.image string The product's representative image
product.name string Product name
product.tags array Product tags
product.is_published boolean StoreCake status
product_id uid Product ID
remain_quantity int Number of remaining products
retail_price int Retail price
total_purchase_price int Remaining goods value
variations_warehouses array Detail information of inventory
variations_warehouses.actual_remain_quantity int In stock
variations_warehouses.pending_quantity int Pending quantity
variations_warehouses.remain_quantity int Number of remaining products in warehouse
variations_warehouses.returning_quantity int Returning quantity
variations_warehouses.total_quantity int Total quantity
variations_warehouses.warehouse_id uid Warehouse ID
wholesale_price array Wholesale price
images array Image link

Product categories

GET /shops/<SHOP_ID>/categories?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "id": 865301,
      "nodes": [],
      "text": "AirSense Áo Khoác Siêu Nhẹ",
    },
    {
      "id": 30163,
      "nodes": [
        {
          "id": 30167,
          "nodes": [],
          "text": "Áo Thun",
        },
        {
          "id": 30169,
          "nodes": [
            {
              "id": 865293,
              "nodes": [],
              "text": "Áo Thun In Họa Tiết"
            }
          ],
          "text": "Áo Cardigan",
        },
        {
          "id": 865292,
          "nodes": [],
          "text": "Áo Nỉ & Áo Hoodie",
        }
      ],
      "text": "ÁO",
    }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
id int Category id
text string Category name
nodes array Children category

Measure group

List of measure groups

GET /shops/<SHOP_ID>/product_measurements/get_measure?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "id": 58,
      "name": "Nước hoa 1",
      "nodes": [
        {
          "exchange_value": 30,
          "id": 61,
          "is_default": false,
          "name": "30 ml",
          "parent_id": 58,
        },
      ],
      "shop_id": 20
    },
    ...
  ],
  "success": true
}

Response Parameters

Parameter Type Description
id int Measure group id
name string Measure group name
nodes array Measure group information
nodes.exchange_value int Exchange value
nodes.id int Measure id
nodes.is_default boolean Default measure
nodes.name string Measure name
nodes.parent_id int Measure group id

Customer

List of customers

GET /shops/<SHOP_ID>/customers?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "date_of_birth": "1999-09-01",
      "fb_id": null,
      "reward_point": 10,
      "id": "b0110315-b102-436b-8b3b-ed8d16740327",
      "last_order_at": "2020-04-01T10:18:41",
      "level": null,
      "name": "Trần Thủ độ",
      "order_count": 108,
      "phone_numbers": ["0999999999"],
      "emails": ["thudo@gmail.com"],
      "reward_point": 100.5,
      "purchased_amount": 0,
      "reward_point": 0.0,
      "referral_code": "1nw4geGA",
      "shop_customer_addresses": [
        {
          "address": "lê văn lương",
          "commune_id": null,
          "country_code": null,
          "district_id": "10101",
          "full_address": "lê văn lương, Quận Ba Đình, Hà Nội",
          "full_name": "test",
          "id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
          "phone_number": "0999999999",
          "province_id": "101"
        },
        {
          "address": "asdsad",
          "commune_id": "2210951",
          "country_code": null,
          "district_id": "22109",
          "full_address": "asdsad, Xã Châu Minh, Huyện Hiệp Hòa, Bắc Giang",
          "full_name": "test",
          "id": "ea55405d-9879-4075-8ec4-5df01504f8ec",
          "phone_number": "0999999999",
          "province_id": "221"
        }
      ],
      "succeed_order_count": 8,
      "tags": [],
      "gender": "male"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 3,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description Example
page_size false int 30
page_number false int 1
search false string null
start_time_inserted_at false unix timestamp Start Time (Create) 1710608400
end_time_inserted_at false unix timestamp End Time (Create) 1713286799
start_time_updated_at false unix timestamp Start Time (Update) 1712595600
end_time_updated_at false unix timestamp End Time (Update) 1713286799
customer_ids false string null Customer ID "4c74b7cf-f87b-484e-8549-6872d964f78f,d74e7fe9-580e-45e5-9374-7241297bd69d"

Response Parameters

Parameter Type Description
date_of_birth string Birthday
fb_id string Facebook ID
reward_point int Reward points
id uid Customer ID
name string Full name of customer
order_count int Number of order
phone_numbers array Customer's phone number list
emails array Customer email
last_order_at time Last purchase times
purchased_amount int Amount purchased
shop_customer_addresses array Customer address information
succeed_order_count int Number of successful purchases
full_address string Full address warehouse
tags array Customer tags
phone_number string Warehouse phone number
reward_point float Reward points
referral_code string Referral code
gender string Giới tính

Create customer

POST /shops/<SHOP_ID>/customers?api_key=<api_key> HTTP/1.1

Response

{
  "data": {
    "succeed_order_count": 0,
    "emails": [],
    "total_amount_referred": null,
    "gender": null,
    "creator_id": "e4cec6de-96fa-4c16-9523-07910ddfee8e",
    "is_block": false,
    "name": "Nguyen Van Hoang",
    "phone_numbers": [
      "0903924956"
    ],
    "conversation_tags": null,
    "currency": null,
    "last_order_at": "2024-05-16T17:00:00",
    "tags": [],
    "username": null,
    "order_count": 0,
    "assigned_user_id": "e4cec6de-96fa-4c16-9523-07910ddfee8e",
    "reward_point": 0,
    "id": "9e749e68-142f-4587-a3b1-70279c30b5c2",
    "is_adjust_debts": null,
    "level": null,
    "customer_id": "5b717afb-1856-48c9-9b6e-b8ac9db7d520",
    "updated_at": "2024-05-14T02:59:02",
    "referral_code": "gqo7ulKf",
    "count_referrals": 0,
    "notes": [],
    "is_discount_by_level": true,
    "shop_id": 20,
    "purchased_amount": 0,
    "current_debts": 0,
    "list_voucher": [],
    "date_of_birth": "1995-02-01",
    "used_reward_point": 0,
    "fb_id": null,
    "user_block_id": null,
    "inserted_at": "2024-05-14T02:59:02",
    "shop_customer_addresses": [
      {
        "address": null,
        "commune_id": null,
        "country_code": 84,
        "district_id": null,
        "full_address": null,
        "full_name": null,
        "id": "deeb419a-e7b6-42fd-9684-52ec6a72a41a",
        "phone_number": "0903924956",
        "province_id": null
      }
    ],
    "returned_order_count": 0,
    "active_levera_pay": false
  },
  "success": true
}

Query Parameters

Parameter Required Type Description Example
name true string Full name of customer Nguyen Van Hoang
phoneNumber true string Phone number 0903924956
createType true string Create method ignore
dateOfBirth false string time Date of birth 1995-02-01
last_order_at false unix timestamp Last order at 1715878800
createType Create method
ignore Skip customer if phone number existed
update Update customer if phone number existed
force Create new customer if phone number existed

Update customer

PUT /shops/<SHOP_ID>/customers/<CUSTOMER_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "customer": {
    "name": "Nguyễn Thị Hằng",
    "gender": "female",
    "emails": ["pancake@gmail.com", "hoang@gmail.com"],
    "phone_numbers": ["0983925966"],
    "date_of_birth": "1995-03-04",
    "reward_point": 20,
    "is_discount_by_level": false,
    "tags": ["Hay hoàn"],
    "is_block": false,
    "assigned_user_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "level_id": "f8dced06-965d-4070-a765-dd8268373f1e",
    "notes": [
      {
        "id": "8a6f5380-4674-44e9-aaf2-40d898d460f5",
        "message": "Khách hàng thân thiết",
        "images": [
          {
            "url": "https://content.pancake.vn/user-content-dev2.pancake.vn/2023/9/6/655ae9172118ba9ffde16fa129a7001a392d1fff.png"
          }
        ]
      }
    ],
    "shop_customer_addresses": [
      {
        "id": "df631f21-3841-4d1c-8204-b85a7ecfce0c",
        "country_code": 84,
        "province_id": "101"
        "district_id": "10113",
        "commune_id": "1011309",
        "address": "190 Cầu Giấy",
        "full_name": "sơn",
        "phone_number": "0972868874",
      }
    ]
  }
}

Query Parameters

Parameter Required Type Description Example
name false string Full name of customer Nguyễn Thị Hằng
gender false string Giới tính female
emails false array Email ["pancake@gmail.com", "hoang@gmail.com"]
phone_numbers false array Phone number ["0983925966"]
date_of_birth false string Date of birth 1995-03-04
reward_point false int Reward points 20
is_discount_by_level false boolean Discount based on level false
tags false array Customer tags ["Hay hoàn"]
is_block false boolean Block customer false
assigned_user_id false uid Assigned employee Id
level_id false uid Customer level Id
notes (1.1) false array Customer note
shop_customer_address (1.2) false array Customer address

Note (1.1)

Parameter Required Type Description Example
id false uid Note id
message false string Content note
images false array Image note [{url: "https://content.pancake.vn/user-content.pancake.vn/2022/1/19/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"}]

Shop_customer_address (1.2)

Parameter Required Type Description
id false uid Address Id
country_code false int Country code
province_id false string Province ID
district_id false string District ID
commune_id false string Commune ID
address false string Address
full_name false string Recipient name
phone_number false string Phone number

Customer note

GET /shops/<SHOP_ID>/customers?/<CUSTOMER_ID>/load_customer_notes?api_key=<api_key> HTTP/1.1

Response

{
  "customer_notes": [
    {
      "notes": [
        {
          "created_at": 1678075407193,
          "created_by": {
              "fb_id": "377936050731194",
              "fb_name": "Vũ Sơn",
              "uid": "cee3c05e-5f85-43c4-b27e-889b99c50097"
          },
          "edit_history": [],
          "id": "a472f7db-b9db-410a-a43a-5f972c685b6c",
          "images": [],
          "message": "khách hàng mua lại",
          "order_id": "97798",
          "removed_at": null,
          "updated_at": null
        }
      ]
    }
  ]
}

Response Parameters

Parameter Type Description
created_at unix timestamp Creation time
created_by json Creator information
edit_history array Edit history
id uid Note id
images array Link note image
message string Content note
order_id string Order ID
removed_at unix timestamp Time delete
updated_at unix timestamp Update time

Customer reward point history

GET /shops/<SHOP_ID>/customers/point_logs?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "amount": 10.0,
      "creator": {
        "avatar_url": null,
        "fb_id": "377936050731194",
        "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "name": "Vũ Sơn"
      },
      "current_point": 20.0,
      "inserted_at": "2024-09-27T03:40:31",
      "note": "Tăng điểm khi chỉnh sửa điểm thưởng khách hàng"
    },
    ...
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 2,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description
page_size false int 30
page_number false int 1
shop_customer_id true uid Customer ID

Response Parameters

Parameter Type Description
amount int Number of points changed
creator json Creator information
current_point int Current point
inserted_at iso 8601 Creation time
note string Reason for changing reward point

Create promotion by customer

POST /shops/<SHOP_ID>/promotion_advance/create_multi?api_key=<api_key> HTTP/1.1

Request

{
  "promotion_advance": {
    "promotion": {
      "start_time": "2024-09-30T04:58:30.020Z",
      "end_time": "2024-10-30T04:58:30.020Z",
      "warehouse_ids": [],
      "customer_tags": [],
      "type": "discount_by_coupon_id",
      "is_activated": true,
      "promo_code_info": {
        "discount": 5,
        "is_percent": true,
        "max_discount_by_percent": 100000,
        "disable": false,
        "order_price_min": 2000000,
        "order_price_max": 3000000,
        "no_applied_products_in_other_promotions": true,
        "discount_after_other_discount": true
      }
    },
    "shop_customer_ids": ["a8c1113d-55c2-4f7e-b33a-d4ecd76668fd"]
  }
}

Request Parameters

Parameter Required Type Description
start_time false iso 8601 Start time
end_time false iso 8601 End time
warehouse_ids false array Warehouse id applied
customer_tags false array Customer tags
type true string Promotion type
is_activated true boolean Activate
promo_code_info true json Promotion information
promo_code_info.discount true int Discount value
promo_code_info.is_percent true boolean true: by %, false: by value
max_discount_by_percent false int Maximum discount amount by %
order_price_min false int Minimum order value
order_price_max false int Maximum order value
no_applied_products_in_other_promotions false boolean Not applicable to products already included in other promotions
discount_after_other_discount false boolean Discount based on order value after deducting other discounts
shop_customer_ids true array Customer id applied

Customer level

Customer level list

GET /shops/<SHOP_ID>/customer_levels?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "color_customer_level": "#87d068",
      "discount": 5,
      "discount_type": 3,
      "id": "84fdef8b-8e4b-44e7-8d61-8553ee7f5833",
      "name": "cap 1",
      "shop_id": 20,
      "upgrade_by_order_count": 10,
      "upgrade_by_point": 100,
      "upgrade_by_total_purchase": 30000000
    }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
color_customer_level string Color code of the level
discount int Discount value
discount_type int Discount type 2: By value, 3: By percentage (%)
id uid Level ID
name string Level name
upgrade_by_order_count int Upgrade by order count
upgrade_by_point int Upgrade by points
upgrade_by_total_purchase int Upgrade by total purchase

Transaction

List of transactions

GET /shops/<SHOP_ID>/transactions?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "advertising_cost_id": null,
      "amount": -70000,
      "creator": {
        "avatar_url": null,
        "fb_id": "1286585024855632",
        "id": "d6e6a545-f102-439e-9943-8ac8369f9735",
        "name": "vudzung12"
      },
      "creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
      "display_id": "KH6815",
      "id": "5b6bbae4-56b4-4189-a84d-d2ecfecead3e",
      "images": [
        "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
      ],
      "inserted_at": "2023-09-23T05:00:20",
      "is_accounting": false,
      "is_canceled": false,
      "is_locked": false,
      "name": "Giao dịch công nợ #1692 trả nhà cung cấp",
      "note": "trả nhà cung cấp",
      "payment_debts_to_suppliers": false,
      "payments": [
        "cash"
      ],
      "shop_id": 20,
      "status": 1,
      "supplier_products_id": 293,
      "table_name": "debts",
      "tag_ids": [
        "193a-e877-359a-b340-01d8-4d2e-2050",
        "55f6-111c-2fd5-38e8-5b9d-009f-d3b1"
      ],
      "time_incurred": "2023-09-23T05:00:20",
    },
    ....
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 117,
  "total_pages": 4
}

Query Parameters

Parameter Required Type Default Description Example
page false int 1
page_size false int 30
status false int -1 Status
startDateTime false unix timestamp null Start time 1692810000
endDateTime false unix timestamp null End time 1695488399
Status Status name
-1 All status
0 New
1 Effective
2 Canceled
3 Deleted

Response Parameters

Parameter Type Description
advertising_cost_id uid Advertising cost ID
amount int Amount of money
creator json Creator information
creator_id uid Creator id
display_id string Transaction ID
images array Image link
inserted_at unix timestamp Creation time
is_accounting boolean Financial accounting
is_locked boolean Locked
name string Transaction name
note string Note
payment_debts_to_suppliers boolean Paying off debts to suppliers
payments array Payment method
status int Status
supplier_products_id int Supplier products id
tag_ids array Transaction tag
time_incurred unix timestamp Time incurred

Create transaction

POST /shops/<SHOP_ID>/transactions?api_key=<api_key> HTTP/1.1

Request

{
  "transaction": {
    "name": "Thanh toán tiền hàng",
    "note": "thanh toán tiền hàng",
    "amount": -1000000,
    "is_locked": false,
    "tag_ids": [
      "193a-e877-359a-b340-01d8-4d2e-2050"
    ],
    "payments": [
      "transfer_money"
    ],
    "supplier_products_id": 293,
    "is_accounting": true,
    "time_incurred": "2023-09-23T08:41:54.404Z",
    "payment_debts_to_suppliers": true,
    "images": [
      "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
    ]
  }
}

Query Parameters

Parameter Required Type Description Example
name true string Transaction name
note false string Note
amount false int Amount of money
is_locked false boolean Locked
tag_ids false array Transaction tag ["193a-e877-359a-b340-01d8-4d2e-2050"]
payments false array Payment method ["transfer_money"]
supplier_products_id false int Supplier products id
is_accounting false boolean Financial accounting
time_incurred false unix timestamp Time incurred
images false array Image link ["https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"]
payments Payment method
cash Cash
transfer_money Transfer money
charged_by_card Charged by card
charged_by_momo Momo
charged_by_vnpay VNPay
charged_by_kredivo Kredivo
charged_by_fundiin Fundiin
charged_by_qrpay QRpay

Create advertising cost

POST /shops/<SHOP_ID>/adv_costs?api_key=<api_key> HTTP/1.1

Request

{
  "params": {
    "cost_date": "2023-09-07 22:00:00",
    "transaction": {
      "name": "Chi phí quảng cáo",
      "is_locked": false,
      "note": "example",
      "status": "0",
      "time_incurred": "2023-09-07 15:00:00",
      "tags": ["Thẻ 1", "Thẻ 2"]
    },
    "items": [
      {
        "cost": 10000,
        "warehouse_id": "IS",
        "is_livestream": true,
        "product": "1",
        "pke_mkter": "test@gmail.com",
        "source": {
          "key": "-3",
          "account": "3"
        },
        "is_wholesale": true,
        "post_ids": ["127967746288487_545680607828820"]
      }
    ]
  }
}

Request Parameters

Parameter Required Type Description
cost_date true string Date advertising costs
transaction true json Transaction
name true string Name of advertising cost
is_locked false boolean Locked
note false string Note
status true string Status
time_incurred false string Time incurred
tags false array Advertising cost tags
items true array Detailed list of advertising costs
cost true int Cost
warehouse_id false string Warehouse ID
is_livestream false boolean Livestream
product false string Product ID
pke_mkter false string Marketer
source false json Source
is_wholesale false boolean Wholesale
post_ids false array Post code list

Order statistics

GET /shops/<SHOP_ID>/analytics/sale?api_key=<api_key> HTTP/1.1

Response

  {
    "data": [
        {
            "Time.day": "2020-07-22",
            "returned": null,
            "success": {
                "cod": 1710000,
                "discount": 0,
                "order_count": 3,
                "price": 1800000,
                "product_count": 18,
                "shipping_fee": 0
            }
        },
        {
            "Time.day": "2020-07-27",
            "returned": null,
            "success": {
                "cod": 570000,
                "discount": 0,
                "order_count": 1,
                "price": 600000,
                "product_count": 6,
                "shipping_fee": 0
            }
        },
        {
            "Time.day": "2020-07-28",
            "returned": null,
            "success": {
                "cod": 5130000,
                "discount": 0,
                "order_count": 9,
                "price": 5400000,
                "product_count": 54,
                "shipping_fee": 0
            }
        },
        {
            "Time.day": "2020-07-30",
            "returned": null,
            "success": {
                "cod": 570000,
                "discount": 0,
                "order_count": 1,
                "price": 600000,
                "product_count": 6,
                "shipping_fee": 0
            }
        },
    ],
    "success": true
  }

Query Parameters

Parameter Required Type Example Description
since false string '2020-08-01 00:00:00' Time to start statistics
until false string '2020-08-20 00:00:00' Time to end statistics
split_by false array ["Time.day", "Order.source", "Variation.id", "Variation.product_id"] Time.day: By date, Order.source: By order source, Variation.id: By the variation, Variation.product_id: By the product
filter false json {"Variation.id":["08d25e0c-4016-498e-a0c6-48b8e7aad2b4"]} Variation.id: By the variation, Variation.product_id: By the product
success_status false string '1' 'send_to_partner': Close a sale after pushing to the shipping partner
'1': Close a sale after updating status to confirmed
success_record false string 'inserted_at' 'inserted_at': Revenue added by the time of order creation
'updated_at': Revenue added by the time of status update
user_type false string 'create' Who completed order ('create': Creator, 'update': Updating staff, 'assign': Assigned staff, 'care': Caring staff, 'marketer': Marketer)
returned_status false string '5' '5': Order is completed when returned
'4': Order is completed when returning
returned_record false string 'inserted_at' Revenue will be deducted at the time ('inserted_at': Create, 'updated_at': Status update, 'success_record': Closing sale)

Response Parameters

Parameter Type Description
Time.day string Statistic day
returned json Data of returned order
success json Data of success order
cod int Cash on delivery
discount int Discount
order_count int Number of order
price int Goods price
product_count int Products in orders
shipping_fee int Shipping fee

Tag

GET /shops/<SHOP_ID>/orders/tags?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "color": "#123123",
      "groups": [
        {
          "id": 13,
          "name": "nhom 1"
        },
        {
          "id": 16,
          "name": "nhom 2"
        }
      ],
      "id": 75,
      "name": "thẻ 4"
    },
    {
      "color": "#f04134",
      "groups": [
        {
          "id": -1,
          "name": "Delivery Group"
        },
        {
          "id": 13,
          "name": "nhom 1"
        }
      ],
      "id": 1,
      "is_system_tag": true,
      "name": "Giao không thành"
    },
    {
      "color": "#096dd9",
      "groups": [],
      "id": 2,
      "is_system_tag": true,
      "name": "Chờ cọc"
    },
    ...
  ],
  "success": true
}

Response Parameters

Parameter Type Description
id int Tag ID
name string Tag name
color string Tag color code
is_system_tag boolean true - System tag
groups array Tag group information

Purchase

List of purchases

GET /shops/<SHOP_ID>/purchases?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "auto_create_debts": true,
      "total_remain_quantity": 1,
      "status": 0,
      "display_id": 6392,
      "total_quantity": 1,
      "bill_images": [],
      "not_create_transaction": true,
      "inserted_at": "2023-09-20T02:21:51",
      "transport_fee": 10000,
      "id": "96bbc665-3fd5-4efc-9d8a-0110ecfa1754",
      "items": [
        {
          "id": "02cb1ff3-9b21-4e1c-9288-a29c16bd907d",
          "imported_price": 200000,
          "note_purchase": "áo nam thời trang",
          "product_name": "Áo nam",
          "quantity": 1,
          "selling_status": "bad",
          "variation_id": "20e7d183-c70c-445e-8ce2-4d7e3a378e34"
        }
      ],
      "is_lock": null,
      "images": [
        "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
      ],
      "user_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "prepaid_debt": 100000,
      "total_price": 200000,
      "received_at": "2023-09-21T00:00:00",
      "updated_at": "2023-09-20T02:22:05",
      "total_remain_price": 200000,
      "tags": [1],
      "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
      "supplier_products_id": 293,
      "discount": 10000,
      "created_type": "actual_purchase",
      "user": {
        "avatar_url": null,
        "fb_id": "377936050731194",
        "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "name": "Vũ Sơn"
      },
      "separate_by_display_ids": null,
      "note": "nhập kho sản phẩm"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 1,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description
page true int 1
page_size true int 30
status true int -2 Status
type true string product
preload_items false boolean true
Status Status name
-2 All status
-1 New
0 Confirmed
1 Imported goods
2 Canceled

Response Parameters

Parameter Type Description
auto_create_debts boolean Auto create debts
total_remain_quantity int Total remaining quantity
status int Status
display_id int Purchase id
total_quantity int Total quantity
bill_images array Invoice image link
not_create_transaction boolean Not create transaction
inserted_at unix timestamp Creation time
transport_fee int Shipping fee
items array Variation information
is_lock boolean Locked
images array Link note image
user_id uid Creator id
prepaid_debt int Prepaid debt
total_price int Total purchase price
received_at unix timestamp Date of receipt of goods
updated_at unix timestamp Updated at
total_remain_price int Total remaining price
tags array Tag id
warehouse_id uid Warehouse code list
supplier_products_id int Supplier products id
discount int Discount
created_type string Purchase type
user json Creator information
separate_by_display_ids int Separated purchase id
note string Note

items

Parameter Type Description
imported_price int Imported price
note_purchase int Note
product_name string Product name
quantity int Import quantity
selling_status string Sales status
variation_id uid Variation ID

Create purchase

POST /shops/<SHOP_ID>/purchases?api_key=<api_key> HTTP/1.1

Request

{
  "purchase": {
    "note": "",
    "status": 1,
    "not_create_transaction": false,
    "auto_create_debts": true,
    "supplier_products_id": 169,
    "shop_id": 20,
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "change_received_at": true,
    "received_at": 1651683600,
    "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
    "items": [
      {
        "imported_price": 100000,
        "quantity": 1,
        "variation_id": "29044dcf-2f4c-492f-a0a9-e447b20e21da",
        "index": 0,
      }
    ]
  }
}

Request Parameters

Parameter Type Description
note string Note
status int Purchase status
not_create_transaction boolean Not create transaction
auto_create_debts boolean Auto create debts
supplier_products_id int Supplier products id
shop_id int Shop ID
warehouse_id string Warehouse ID
change_received_at boolean Change received at
received_at unix timestamp Date of receipt of goods
images array Link purchase image
items array List product
items.imported_price int Import price
items.quantity int Import quantity
items.variation_id string Variation ID

Update purchase

PUT /shops/<SHOP_ID>/purchases/<PURCHASE_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "purchase": {
    "note": "",
    "status": 1,
    "not_create_transaction": false,
    "auto_create_debts": true,
    "supplier_products_id": 169,
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "change_received_at": true,
    "received_at": 1651683600,
    "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
    "items": [
      {
        "imported_price": 100000,
        "quantity": 1,
        "variation_id": "29044dcf-2f4c-492f-a0a9-e447b20e21da",
      }
    ]
  }
}

Request Parameters

Parameter Required Type Description
note false string Note
status false int Purchase status
not_create_transaction false boolean Not create transaction
auto_create_debts false boolean Auto create debts
supplier_products_id false int Supplier products id
warehouse_id true string Warehouse ID
change_received_at false boolean Change received at
received_at false unix timestamp Date of receipt of goods
images false array Link purchase image
items false array List product
items.imported_price true int Import price
items.quantity false int Import quantity
items.variation_id false string Variation ID
Status Status name
-1 New
0 Confirmed
1 Imported goods
2 Canceled

Separate purchase

POST /shops/<SHOP_ID>/purchases/separate?api_key=<api_key> HTTP/1.1

Request

{
    "newPurchase": {
        "auto_create_debts": true,
        "discount": 500,
        "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
        "items": [
            {
                "imported_price": 100000,
                "quantity": 1,
                "variation_id": "ddefd476-bc91-4151-8cd2-2cf5ad227f09",
                "index": 0
            }
        ],
        "not_create_transaction": false,
        "note": "Tách phiếu nhập",
        "prepaid_debt": 20000,
        "received_at": 1683997200,
        "status": 0,
        "supplier_products_id": 293,
        "tags": [1],
        "transport_fee": 0,
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    },
    "oldPurchase": {
        "auto_create_debts": true,
        "discount": 500,
        "id": "0ecbdb3b-a376-4a3d-9b8a-174ae15ae886",
        "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
        "items": [
            {
                "imported_price": 100000,
                "quantity": 23,
                "variation_id": "ddefd476-bc91-4151-8cd2-2cf5ad227f09",
                "index": 0
            }
        ],
        "not_create_transaction": false,
        "note": "Nhập hàng để bán",
        "prepaid_debt": 20000,
        "received_at": 1683997200,
        "status": 0,
        "supplier_products_id": 293,
        "tags": [1],
        "transport_fee": 0,
        "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    }
}

Request Parameters

Note: newPurchase and oldPurchase use the same request parameters

Parameter Required Type Description
newPurchase true json New purchase
oldPurchase true json Purchase need separate
auto_create_debts false boolean Auto create debts
discount false int Discount
id true string Purchase id / only for oldPurchase
images false array Link purchase image
items true array List product
items.imported_price true int Import price
items.quantity true int Import quantity
items.variation_id true string Variation ID
items.index false int Product sort order
not_create_transaction false boolean Not create transaction
note false string Note
prepaid_debt false int Prepaid debt
received_at false unix timestamp Date of receipt of goods
status true int Purchase status
supplier_products_id false int Supplier products id
tags false array Tag purchase
transport_fee false int Shipping fee
warehouse_id true string Warehouse ID

Export

List of exports

GET /shops/<SHOP_ID>/export?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "display_id": 472,
      "export_items": [
        {
          "display_id": 0,
          "id": "78dfe47a-a3dd-4d47-8f8b-16eb1ccd69ee",
          "imported_price": 0,
          "inserted_at": "2024-01-25T16:18:20",
          "quantity": 1,
          "variation_id": "76887a5b-8a27-472c-a15a-661ea59434dd"
        }
      ],
      "id": "8095ca3c-a485-4378-9914-5013e1179d55",
      "images": [
        "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
      ],
      "inserted_at": "2024-01-25T16:18:20",
      "note": "Xuất bán hàng",
      "status": 0,
      "supplier_products_id": 400037328,
      "tags": [1],
      "total": 1,
      "total_price": 0,
      "type": 0,
      "updated_at": "2024-01-25T16:18:20",
      "user": {
        "avatar_url": null,
        "fb_id": "1286585024855632",
        "id": "d6e6a545-f102-439e-9943-8ac8369f9735",
        "name": "vudzung12"
      },
      "user_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
      "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 1,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description
page true int 1
page_size true int 30
status true int -1 Status
type true int 0
Status Status name
-1 All status
0 New
1 Completed
2 Canceled

Response Parameters

Parameter Type Description
display_id int Export id
export_items array List product
images array Link export image
inserted_at unix timestamp Creation time
note string Note
status int Status
supplier_products_id int Supplier products id
tags array Tag id
total int Total quantity
total_price int Total export price
updated_at unix timestamp Updated at
user json Creator information
warehouse_id uid Warehouse code list

export_items

Parameter Type Description
id uid Export Item dd
imported_price int Export price
quantity int Export quantity
variation_id string Variation ID

Create export

POST /shops/<SHOP_ID>/export?api_key=<api_key> HTTP/1.1

Request

{
  "export_list": {
    "note": "",
    "supplier_products_id": 169,
    "tags": [
      1
    ],
    "status": 0,
    "type": 0,
    "shop_id": 20,
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "change_inserted_at": true,
    "inserted_at": 1651683600,
    "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
    "export_items": [
      {
        "id": "13d7ddf6-4cd9-4e1f-a5c1-ac3cd7a7fc17",
        "imported_price": 100000,
        "quantity": 1,
        "variation_id": "29044dcf-2f4c-492f-a0a9-e447b20e21da",
      }
    ]
  }
}

Request Parameters

Parameter Type Description
note string Note
supplier_products_id int Supplier products id
tags array Export Tag
status int Export status
type int Type of export
shop_id int Shop ID
warehouse_id string Warehouse ID
images array Link export image
change_inserted_at boolean Change date of create export
inserted_at unix timestamp Date of create export
export_items array List product
export_items.id uid Export Item dd
export_items.imported_price int Export price
export_items.quantity int Export quantity
export_items.variation_id string Variation ID

Update export

PUT /shops/<SHOP_ID>/export/<EXPORT_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "export_list": {
    "images": [
      "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/5/27/ee3be79d1574735ed35539ca48f7f6e9d7137706.jpg"
    ],
    "inserted_at": 1695142800,
    "note": "xuất bán hàng",
    "status": 0,
    "supplier_products_id": 319,
    "tags": [
      1
    ],
    "export_items": [
      {
        "id": "13d7ddf6-4cd9-4e1f-a5c1-ac3cd7a7fc17",
        "imported_price": 1000,
        "quantity": 1,
        "variation_id": "d1e522eb-2f6f-4d22-b8a1-ec25df4a33a4"
      }
    ]
  }
}

Query Parameters

Parameter Required Type Description
images false array Link export image
inserted_at false unix timestamp Date of create export
note false string Note
status (1.1) false int Export status
supplier_products_id false int Supplier products id
tags false array Export Tag
export_items false array List product
export_items.id true uid Export Item dd
export_items.imported_price true int Export price
export_items.quantity true int Export quantity
export_items.variation_id true string Variation ID
(1.1) status Status
0 New
1 Completed
2 Canceled

Product defective (by export)

Create export product defect

POST /shops/<SHOP_ID>/export?api_key=<api_key> HTTP/1.1

Request

{
"export_list": {
    "note": "Xuất hàng lỗi",
    "supplier_products_id": 169,
    "status": 0,
    "type": 1,
    "shop_id": 20,
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "change_inserted_at": true,
    "inserted_at": 1651683600,
    "images": ["https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"],
    "export_items": [
      {
        "imported_price": 100000,
        "quantity": 1,
        "variation_id": "29044dcf-2f4c-492f-a0a9-e447b20e21da",
      }
    ]
  }
}

Request Parameters

Parameter Type Description
note string Note
supplier_products_id int Supplier products id
status int Export status
type int Type of export
shop_id int Shop ID
warehouse_id string Warehouse ID
images array Link export image
change_inserted_at boolean Change date of create export
inserted_at unix timestamp Date of create export
export_items array List product
export_items.imported_price int Export price
export_items.quantity int Export quantity
export_items.variation_id string Variation ID

Update export product defect

PUT /shops/<SHOP_ID>/export/<EXPORT_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "export_list": {
    "images": [
      "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/5/27/ee3be79d1574735ed35539ca48f7f6e9d7137706.jpg"
    ],
    "inserted_at": 1695142800,
    "note": "xuất bỏ đi",
    "status": 0,
    "supplier_products_id": 319,
    "type": 1,
    "export_items": [
      {
        "id": "13d7ddf6-4cd9-4e1f-a5c1-ac3cd7a7fc17",
        "imported_price": 1000,
        "quantity": 1,
        "variation_id": "d1e522eb-2f6f-4d22-b8a1-ec25df4a33a4"
      }
    ]
  }
}

Query Parameters

Parameter Required Type Description
images false array Link export image
inserted_at false unix timestamp Date of create export
note false string Note
status (1.1) false int Export status
supplier_products_id false int Supplier products id
export_items false array List product
export_items.id true uid Export Item dd
export_items.imported_price true int Export price
export_items.quantity true int Export quantity
export_items.variation_id true string Variation ID
(1.1) status Status
0 Defect export
1 Elimination export
2 Canceled

Warehouse transfer

List of warehouse transfers

GET /shops/<SHOP_ID>/transfers?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "display_id": 309,
      "from_warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
      "from_warehouse_name": "Kho HCM",
      "id": "5c9ef4a6-2411-4d5f-9a91-1bc22dbb7eb1",
      "images": [
        "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
      ],
      "inserted_at": "2023-09-13T09:34:37",
      "items": [
        {
          "id": "f80bdc16-a000-4bf1-a979-c3fd4033f551",
          "product_display_id": "áo nam",
          "product_name": "áo nam",
          "quantity": 3,
          "variation_display_id": "XANH-M",
          "variation_fields": [
            {
              "id": "beb75502-5a50-48d6-bed8-89ea8ddc9a66",
              "keyValue": "xanh dương",
              "name": "màu",
              "value": "xanh dương"
            },
            {
              "id": "8eee6f85-0a76-46da-9dd7-6668bc6d8729",
              "keyValue": "M",
              "name": "size",
              "value": "M"
            }
          ]
          "variation_id": "3b11fb7b-9081-42c0-9546-dfac62b9c9ca"
        }
      ],
      "note": "Chuyển kho bán hàng",
      "shipping_fee": 30000,
      "shop_id": 20,
      "status": 0,
      "to_warehouse_id": "229102e4-39c3-4523-bd57-4ed0a45a85ba",
      "to_warehouse_name": "Cho tao cơm",
      "total_quantity": 1,
      "updated_status_at": "2023-09-13T09:34:37"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 1,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default Description
page_size true int 30
page true int 1
status true int 1 Status

Response Parameters

Parameter Type Description
creator_id uid Creator id
display_id int Warehouse transfer id
from_warehouse_id uid From warehouse id
from_warehouse_name string From warehouse name
images array Warehouse transfer image link
inserted_at time Creation time
items array List product
note string Note
shipping_fee int Shipping fee
shop_id int Shop ID
status int Status
to_warehouse_id uid To warehouse id
to_warehouse_name string To warehouse name
total_quantity int Total quantity
updated_status_at time Updated at

items

Parameter Type Description
product_display_id string Product ID
product_name string Product name
quantity int Transfer quantity
variation_display_id string Variation ID
variation_fields array Variation attribute information

Create warehouse transfer

POST /shops/<SHOP_ID>/transfers/multi?api_key=<api_key> HTTP/1.1

Request

{
  "transfer": {
    "from_warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "to_warehouse_ids": ["229102e4-39c3-4523-bd57-4ed0a45a85ba"],
    "shipping_fee": 20000,
    "items": [
      {
        "quantity": 1,
        "variation_id": "20e7d183-c70c-445e-8ce2-4d7e3a378e34"
      }
    ],
    "note": "đây là ghi chú",
    "images": [
      "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/5/27/ee3be79d1574735ed35539ca48f7f6e9d7137706.jpg"
    ],
    "inserted_at": 1694710800
  }
}

Request Parameters

Parameter Required Type Description
from_warehouse_id true uid From warehouse id
to_warehouse_ids true array To warehouse id
shipping_fee false int Shipping fee
note false string Note
images false array Warehouse transfer image link
inserted_at false unix timestamp Creation time
items true array List of products
item.quantity true int Quantily
item.variation_id true uid Variation ID

Update warehouse transfer

PUT /shops/<SHOP_ID>/transfers/<TRANSFER_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "transfer": {
    "status": 1,
    "from_warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "shipping_fee": 10000,
    "items": [
      {
        "variation_id": "51bb0bb7-77e9-407e-9f57-5072a0236cb4",
        "quantity": 1
      }
    ],
    "note": "Chuyển kho bán hàng",
    "images": [
      "https://content.pancake.vn/user-content-dev2.pancake.vn/2024/8/30/7886ccd76d3629808d21fa3e59849c8e79a28162.png"
    ],
    "inserted_at": 1718902800,
    "change_inserted_at": true
  }
}

Request Parameters

Parameter Required Type Description
status true int Status
from_warehouse_id true uid From warehouse id
shipping_fee false int Shipping fee
note false string Note
images false array Warehouse transfer image link
inserted_at false unix timestamp Creation time
change_inserted_at false / (true nếu có params inserted_at) boolean Change creation time
items false array List of products
items.variation_id true string Variation ID
items.quantity true int Transfer quantity
Status Status name
0 Waiting for pick up
1 Shipping
2 Completed
2 Canceled

Stocktaking

Stocktaking list

GET /shops/<SHOP_ID>/stocktakings?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "display_id": null,
      "id": "4d0f479d-feab-489b-bc82-4a656902a20b",
      "inserted_at": "2023-10-11T08:25:18",
      "items": null,
      "note": "Kiểm hàng tồn",
      "progress": 0,
      "shop_id": 20,
      "status": 0,
      "stocktaking_at": "2023-10-11T08:24:56",
      "stocktaking_by": "category_ids",
      "stocktaking_by_value": [
        "1315"
      ],
      "updated_at": "2023-10-11T09:03:03",
      "updated_status_at": "2023-10-11T08:25:18",
      "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 258,
  "total_pages": 9
}

Query Parameters

Parameter Required Type Default Description
page true int 1
page_size true int 30
status true int -2 Status
Status Status name
-2 All status
-1 Creating
0 Stocktaking
1 Stocktook
2 Canceled

Response Parameters

Parameter Type Description
creator_id uid Creator id
display_id int Stocktaking id
inserted_at unix timestamp Creation time
note string Note
progress int Processing percentage
shop_id int Shop ID
status int Status
stocktaking_at unix timestamp Stocktaking at
stocktaking_by (1.0) string Stocktaking by
stocktaking_by_value array Category id / Supplier products id / Brand id
updated_at unix timestamp Updated at
updated_status_at unix timestamp Updated status at
warehouse_id uid Warehouse ID
(1.0) stocktaking_by Stocktaking by
category_ids Category
supplier_product_ids Supplier
brand_id Brands

Create stocktaking

POST /shops/<SHOP_ID>/stocktakings?api_key=<api_key> HTTP/1.1

Request

{
  "stocktaking": {
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
    "items": [
      {
        "variation_id": "20e7d183-c70c-445e-8ce2-4d7e3a378e34",
        "changed_quantity": -1
      }
    ],
    "note": "Kiểm hàng tồn",
    "status": 0,
    "stocktaking_at": "2023-10-11T10:38:34.542Z",
    "stocktaking_by": "category_ids",
    "stocktaking_by_value": [
      "1315"
    ]
  }
}

Request Parameters

Parameter Required Type Description
warehouse_id true uid Warehouse ID
items true array List product
items.variation_id true string Variation ID
items.changed_quantity true int Changed quantity
note false string Note
status true int Export status
stocktaking_at false unix timestamp Stocktaking at
stocktaking_by (1.0) false string Stocktaking by
stocktaking_by_value false array Category id / Supplier products id / Brand id

Update stocktaking

PUT /shops/<SHOP_ID>/stocktakings/<STOCKTAKING_ID>?api_key=<api_key> HTTP/1.1

Request

{
  "stocktaking": {
    "creator_id": "890f9367-45cd-43e9-b2cc-ffccda390405",
    "id": "39d023e9-fae5-4eed-a882-2be9d33914b4",
    "items": [
      {
        "changed_quantity": -1,
        "id": "f852fd0b-d299-4ca9-8961-59afead3345b",
        "variation_id": "20e7d183-c70c-445e-8ce2-4d7e3a378e34"
      }
    ],
    "note": "Kiểm hàng tồn",
    "status": 0,
    "stocktaking_at": "2023-10-11T10:38:34",
    "stocktaking_by": "category_ids",
    "stocktaking_by_value": [
      "1315"
    ],
    "warehouse_id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da"
  }
}

Query Parameters

Parameter Required Type Description
creator_id false uid Creator id
id true uid Stocktaking id
items true array List product
items.changed_quantity true int Changed quantity
items.id true (Update) / false (Create) uid Stocktaking item id
items.variation_id true string Variation ID
note false string Note
status true int Export status
stocktaking_at false unix timestamp Stocktaking at
stocktaking_by (1.0) false string Stocktaking by
stocktaking_by_value false array Category id / Supplier products id / Brand id
warehouse_id true uid Warehouse ID

Inventory histories

GET /shops/<SHOP_ID>/inventory_histories?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "avg_price": 100000,
      "current_inventory": [
        {
          "actual_remain_quantity": 1170,
          "avg_price": 242295.345104334,
          "id": "c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da",
          "name": "Kho mặc định",
          "remain_quantity": 968,
          "total_quantity": 1246
        }
      ],
      "editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "id": 186206,
      "inserted_at": "2024-06-10T10:03:53.015323",
      "quantity": -1,
      "ref_display_id": "433",
      "remain_quantity": 3387,
      "table_name": "warehouse_transfers",
      "type": "Tạo phiếu chuyển kho #433",
      "variation_now": {
        "barcode": null,
        "display_id": "Nam Pari TX",
        "fields": [
          {
            "id": "56e0ac18-3bd0-47ac-91ba-0f4056326c1d",
            "keyValue": "WHITE",
            "name": "Color",
            "value": "WHITE"
          }
        ],
        "id": "76887a5b-8a27-472c-a15a-661ea59434dd",
        "images": [
          "https://content.pancake.vn/user-content-dev2.pancake.vn/2022/9/29/d05f44dcf2b9f96312d88b718da35aa5317242d6.jpg"
        ],
        "is_hidden": false,
        "is_locked": false,
        "is_sell_negative_variation": true,
        "last_imported_price": 100000,
        "product_id": "73ec61e2-52e3-41dd-bd24-b7ec1035184d",
        "retail_price": 200000,
        "weight": 700,
      },
      "warehouse": {
        "custom_id": null,
        "ffm_id": null,
        "full_address": "22, Jalan Kiara 6 jalan utamah pekan nanas johor 81500, Pekan Nenas, Johor, 81500",
        "id": "c0b42d67-7b53-48b7-9119-29c5b6e18d19",
        "name": "kho Malay",
        "phone_number": "0984565082"
      }
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 1,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Example Description
page true int 1
page_size true int 30
warehouse_id false iud c52e67ad-d9d0-4276-abe4-e0c9f1f7d2da Warehouse ID
variation_ids false array ["76887a5b-8a27-472c-a15a-661ea59434dd"] Variation ID
startDate false unix timestamp 1716310800 Start date
endDate false unix timestamp 1718989199 End date

Response Parameters

Parameter Type Description
avg_price int Average import price
current_inventory array Current inventory information
editor_id uid Updated employee id
id int Inventory history id
inserted_at unix timestamp Creation time
quantity int Change quantity
remain_quantity int In stock
variation_now json Variation information
warehouse json Warehouse change inventory

Voucher

Voucher list

GET /shops/<SHOP_ID>/vouchers?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
      "customer_tags": [
        "Tiềm năng",
        "Hay hoàn"
      ],
      "display_id": 8,
      "end_time": "2021-12-12T08:22:31",
      "id": "33640b56-4230-49b6-aa68-2fdb6b5ae77d",
      "inserted_at": "2021-12-06T08:22:43",
      "is_activated": false,
      "is_free_shipping": true,
      "is_used": null,
      "name": "bJZQBEXc",
      "promo_code_info": {
        "discount": 1234560,
        "is_percent": false,
        "max_discount_by_percent": 0
      },
      "shop_id": 3,
      "start_time": "2021-12-10T08:22:28",
      "type": "discount_by_coupon_id",
      "updated_at": "2021-12-06T08:22:43"
    },
    {
      "creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
      "customer_tags": [
        "Tiềm năng"
      ],
      "display_id": 7,
      "end_time": "2021-12-10T04:27:26",
      "id": "9589b791-013f-4a5b-b8d1-164fad73d84e",
      "inserted_at": "2021-12-06T04:27:40",
      "is_activated": true,
      "is_free_shipping": false,
      "is_used": null,
      "name": "d5IvGYtj",
      "promo_code_info": {
        "discount": 4534,
        "is_percent": false,
        "max_discount_by_percent": 0
      },
      "shop_id": 3,
      "start_time": "2021-12-09T04:27:23",
      "type": "discount_by_coupon_id",
      "updated_at": "2021-12-10T02:26:59"
    },
    {
      "creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
      "customer_tags": [
        "Hay hoàn"
      ],
      "display_id": 6,
      "end_time": "2021-12-05T08:14:04",
      "id": "0da90bea-b879-4679-a959-b7f8370073b6",
      "inserted_at": "2021-12-04T08:14:11",
      "is_activated": true,
      "is_free_shipping": false,
      "is_used": null,
      "name": "k3L7AUrV",
      "promo_code_info": {
        "discount": 2000,
        "is_percent": true,
        "max_discount_by_percent": 0
      },
      "shop_id": 3,
      "start_time": "2021-12-04T08:14:02",
      "type": "discount_by_coupon_id",
      "updated_at": "2021-12-10T02:27:24"
    }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
name string Voucher code
start_time unix timestamp The start date applied
end_time unix timestamp The end date applied
promo_code_info json Discount information
is_free_shipping boolean Free shipping
is_activated boolean Activated
is_used boolean Used
creator_id int Creator id
inserted_at unix timestamp The time of creating
updated_at unix timestamp The time of updating
display_id int Voucher display id
id int Voucher id
shop_id int Shop ID
type string Voucher type
customer_tags Array Customer tags

promo_code_info

Parameter Type Description
discount int Discount amount
is_percent boolean Discount according to percent
max_discount_by_percent int Maximum percentage

Voucher information

GET /shops/<SHOP_ID>/vouchers/<VOUCHER_ID>?api_key=<api_key> HTTP/1.1

Response

{
  "creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
  "customer_tags": [
    "Tiềm năng",
    "Hay hoàn"
  ],
  "display_id": 7,
  "end_time": "2021-12-10T04:27:26",
  "id": "9589b791-013f-4a5b-b8d1-164fad73d84e",
  "inserted_at": "2021-12-06T04:27:40",
  "is_activated": true,
  "is_free_shipping": false,
  "is_used": null,
  "name": "d5IvGYtj",
  "promo_code_info": {
    "discount": 4534,
    "is_percent": false,
    "max_discount_by_percent": 0
  },
  "shop_id": 3,
  "start_time": "2021-12-09T04:27:23",
  "type": "discount_by_coupon_id",
  "updated_at": "2021-12-06T04:27:40"
}

Create voucher

POST /shops/<SHOP_ID>/vouchers?api_key=<api_key> HTTP/1.1

Request

{
  "name": "test_voucher_5",
  "promo_code_info": {
    "discount": 53635,
    "is_percent": false
  },
  "is_free_shipping": false,
  "is_activated": true,
  "customer_tags": ["New tag"],
  "start_time": "2021-12-09T04:27:23",
  "end_time": "2021-12-10T04:27:26"
}

Request Parameters

Parameter Type Description
name string Voucher code
start_time unix timestamp The start date applied
end_time unix timestamp The end date applied
promo_code_info json Discount information
is_free_shipping boolean Free shipping
is_activated boolean Activated
customer_tags Array Customer tags

Create multipe voucher

POST /shops/<SHOP_ID>/vouchers?api_key=<api_key> HTTP/1.1

Request

{
  "create_multi_voucher": 15,
  "promo_code_info": {
    "discount": 53635,
    "is_percent": false
  },
  "is_free_shipping": false,
  "is_activated": true,
  "customer_tags": ["New tag"],
  "start_time": "2021-12-09T04:27:23",
  "end_time": "2021-12-10T04:27:26"
}

Request Parameters

Parameter Type Description
create_multi_voucher int Number of voucher
start_time unix timestamp The start date applied
end_time unix timestamp The end date applied
promo_code_info json Discount information
is_free_shipping boolean Free shipping
is_activated boolean Activated
customer_tags Array Customer tags

Promotion

Promotion list

GET /shops/<SHOP_ID>/promotion_products?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "arr_level_promotion": [],
      "arr_promotion_products": [
        {
          "discount_each_product": 0,
          "images": [
            "https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/5/24/fffa8e0be4ff6aa55b5c1caa8d2bc3eca51ddcac.png"
          ],
          "is_discount_percent": false,
          "key": "710da0c2-87ab-4686-b62c-cec219de9833",
          "one_time_product": false,
          "price_original": 0,
          "product_id": "9ddb474a-9a93-4a53-aac5-b7e190685371",
          "quantity": 2,
          "variation_id": "710da0c2-87ab-4686-b62c-cec219de9833",
          "variation_info": {
            "bonus_products": [
              {
                "price_original": "50000",
                "quantity": "1",
                "variation_id": "a3f18eca-f4bc-41ff-a616-3f476767a799",
                "variation_info": {
                  "id": "1",
                  "name": "sp1",
                  "product_id": "sp1",
                  "retail_price": "0",
                  "weight": "0"
                }
              }
            ],
            "brand_id": "f0da0fe6-c585-48af-b570-d2767900789d",
            "categories": [
              {
                "id": 1,
                "name": "ffff"
              }
            ],
            "category_ids": [
              1
            ],
            "custom_id": "xinchao",
            "description": null,
            "display_id": 82,
            "display_id_original": null,
            "fields": [
              {
                "id": "c1164d8f-f3fe-431f-8229-8fb26bd5daf5",
                "keyValue": "s",
                "name": "size",
                "value": "s"
              },
              {
                "id": "17eee851-f9f6-4d24-b4da-27bb9eb063df",
                "keyValue": "do",
                "name": "màu",
                "value": "do"
              }
            ],
            "id": 1,
            "ignore_awarded_point": null,
            "inserted_at": "2021-05-26T07:12:14",
            "is_sell_negative": null,
            "limit_quantity_to_warn": 0,
            "manipulation_warehouses": [],
            "name": "xinchao",
            "note_product": "",
            "offline_id": null,
            "product_attributes": [
              {
                "id": "4f0c6fe1-fed7-4d6b-bc5d-4809856c6ac6",
                "keyword": [
                  {
                    "keyValue": "do",
                    "value": "do"
                  },
                  {
                    "keyValue": "vang",
                    "value": "vang"
                  }
                ],
                "name": "màu",
                "values": [
                  "do",
                  "vang"
                ]
              },
              {
                "id": "4861715c-eba9-47ec-be3f-14cc143b4bf5",
                "keyword": [
                  {
                    "keyValue": "s",
                    "value": "s"
                  },
                  {
                    "keyValue": "x",
                    "value": "x"
                  }
                ],
                "name": "size",
                "values": [
                  "s",
                  "x"
                ]
              }
            ],
            "product_id": "xinchao",
            "product_links": [],
            "retail_price": 0,
            "shop_warranty_policy_id": null,
            "supplier_product_ids": [],
            "tags": [
              {
                "id": 2,
                "note": "dan choi 2*"
              }
            ],
            "third_parties": null,
            "warning_by_variation": null,
            "warranty_period": null
          },
          "variations_warehouses": [
            {
              "actual_remain_quantity": 34,
              "adjustments": [
                {
                  "actual_remain_changed": 10,
                  "edited_at": "2021-05-26T08:14:10.517835",
                  "editor": {
                    "fb_id": "1302588949892988",
                    "id": "84616be7-7a6b-4f58-af37-2c64d9ee04a9",
                    "name": "Huỳnh Đăng"
                  },
                  "note": null,
                  "remain_changed": 10,
                  "stocktaking_display_id": null,
                  "total_changed": 10,
                  "warehouse_id": "7442b538-002b-42e3-8520-64425897e2f5",
                  "warehouse_name": "Kho mặc định"
                },
                {
                  "actual_remain_changed": -20,
                  "edited_at": "2021-05-26T07:33:38.055815",
                  "editor": {
                    "fb_id": "1302588949892988",
                    "id": "84616be7-7a6b-4f58-af37-2c64d9ee04a9",
                    "name": "Huỳnh Đăng"
                  },
                  "note": null,
                  "remain_changed": -20,
                  "stocktaking_display_id": null,
                  "total_changed": 0,
                  "warehouse_id": "7442b538-002b-42e3-8520-64425897e2f5",
                  "warehouse_name": "Kho mặc định"
                }
              ],
              "batch_position": "1.A.1",
              "defect_quantity": 0,
              "id": "ae19c130-1a99-4aa8-b53f-0e42b387abe1",
              "pending_quantity": 0,
              "pending_transfer_quantity": 0,
              "quantity_in_batch": 18,
              "remain_quantity": 34,
              "returning_quantity": 0,
              "shelf_position": "1.A.2",
              "shelf_quantity": 0,
              "shipping_quantity": 0,
              "total_quantity": 73,
              "total_quantity_transfer": 0,
              "transfer_quantity": 0,
              "variation_id": "710da0c2-87ab-4686-b62c-cec219de9833",
              "waitting_quantity": 0,
              "warehouse_id": "7442b538-002b-42e3-8520-64425897e2f5"
            }
          ]
        }
      ],
      "brands": [],
      "categories": [],
      "char_name_product": "",
      "creator_id": null,
      "discount_amount": 0,
      "discount_categories": [],
      "end_price_product": 0,
      "id": 11,
      "inserted_at": "2021-10-13T02:22:04",
      "is_active": false,
      "is_free_shipping": false,
      "is_use_percent": false,
      "max_promotion_by_percent": 0,
      "name": "test1",
      "product_tags": [],
      "promotion_percent": 0,
      "quantity_product": 0,
      "quantity_same_product": 8,
      "shop_id": 3,
      "start_price_product": 0,
      "total_orders": 0,
      "updated_at": "2021-10-22T08:57:00"
    }
  ],
  "success": true
}

Query Parameters

Parameter Required Type Default Description
textSearch false string null Keyword search

Reponse Parameters

Parameter Type Description
arr_level_promotion array Promotion level
arr_promotion_products array Promotion products
brands array Brands
categories array Category
char_name_product string Product name does not contain characters
creator_id string Creator
discount_amount int Discount amount
discount_categories array Discount product categories
end_price_product int End price product
id int Promotion code
inserted_at string Creation time
is_active boolean Activated
is_free_shipping boolean Free shipping
is_use_percent boolean Discount according to percent
max_promotion_by_percent int Maximum percentage
name string Promotion name
product_tags array Product tags
promotion_percent int Percentage of discounts
quantity_product int The number of products
quantity_same_product int Number of the same product
shop_id int Shop ID
start_price_product int Start price product
total_orders int Total order
updated_at string Update time

Create promotion

POST /shops/<SHOP_ID>/promotion_products?api_key=<api_key> HTTP/1.1
{
  "promotion_product": {
    "arr_level_promotion": [],
    "arr_promotion_products": [],
    "brands": [],
    "categories": [],
    "char_name_product": "",
    "discount_amount": 600,
    "discount_categories": [],
    "discount_promotion": 0,
    "end_price_product": 500,
    "is_active": true,
    "is_free_shipping": false,
    "is_use_percent": false,
    "max_promotion_by_percent": 0,
    "name": "km_thu2",
    "product_tags": [],
    "promotion_percent": 0,
    "quantity_product": 3,
    "quantity_same_product": 0,
    "start_price_product": 300,
    "total_orders": 1000
  }
}

Promotion updates

PUT /shops/<SHOP_ID>/promotion_products/<ID>?api_key=<api_key> HTTP/1.1
{
  "promotion_product": {
    "arr_level_promotion": [],
    "arr_promotion_products": [],
    "brands": [],
    "categories": [],
    "char_name_product": "",
    "discount_amount": 600,
    "discount_categories": [],
    "discount_promotion": 0,
    "end_price_product": 500,
    "is_active": true,
    "is_free_shipping": false,
    "is_use_percent": false,
    "max_promotion_by_percent": 0,
    "name": "update_km_thu2",
    "product_tags": [],
    "promotion_percent": 0,
    "quantity_product": 3,
    "quantity_same_product": 0,
    "start_price_product": 300,
    "total_orders": 1000
  }
}

List of advanced promotion

GET /shops/<SHOP_ID>/promotion_advance?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "arr_level_promotion": [],
      "bonus_items": [],
      "coupon_info": {
        "discount": 0,
        "is_percent": false
      },
      "creator_id": "4eab0efc-2994-4b96-acf0-e4c847668555",
      "customer_tags": [],
      "discount_by_quantity": 1,
      "display_id": 50,
      "end_time": "2022-03-11T05:04:13",
      "group_name": "Nhóm 1",
      "id": "260a0d45-ba88-457b-8b31-afa3fda0ce0e",
      "inserted_at": "2022-03-10T05:04:33",
      "is_activated": true,
      "is_discount_in_birthday_customer": false,
      "is_free_shipping": false,
      "is_used": null,
      "is_variation": true,
      "level_order_prices": [],
      "name": "km 345",
      "order_sources": [],
      "post_ids": [],
      "priority_level": null,
      "promo_code_info": {
        "discount": 0,
        "is_percent": false,
        "max_discount_by_percent": 0
      },
      "shop_id": 3,
      "start_time": "2022-03-10T05:04:11",
      "total_quantity_bonus": 0,
      "type": "discount_by_product",
      "type_employee": "all",
      "updated_at": "2022-04-08T08:14:58",
      "warehouse_ids": []
    },
    {
      "arr_level_promotion": [],
      "bonus_items": [],
      "coupon_info": null,
      "creator_id": "20e88bf5-b755-4cc1-9f2e-740fa5a0a9d8",
      "customer_tags": [
        "New tag"
      ],
      "discount_by_quantity": 0,
      "display_id": 46,
      "end_time": null,
      "group_name": "Nhóm 1",
      "id": "9338e84b-5796-468c-856c-450d5ae73e35",
      "inserted_at": "2021-12-18T10:17:12",
      "is_activated": true,
      "is_discount_in_birthday_customer": null,
      "is_free_shipping": false,
      "is_used": null,
      "is_variation": true,
      "level_order_prices": null,
      "name": "km 454",
      "order_sources": [],
      "post_ids": [],
      "priority_level": null,
      "promo_code_info": {
        "discount": 53635,
        "is_percent": false
      },
      "shop_id": 3,
      "start_time": null,
      "total_quantity_bonus": 0,
      "type": "discount_by_coupon_id",
      "type_employee": null,
      "updated_at": "2021-12-18T10:17:12",
      "warehouse_ids": []
    }
  ],
  "page_number": 1,
  "page_size": 2,
  "success": true,
  "total_entries": 23,
  "total_pages": 12
}

Query Parameters

Parameter Required Type Default Description
page false int 1 Page
page_size false int 10 Number of record displayed in 1 page
textSearch false string null Keyword search

Reponse Parameters

Parameter Type Description
arr_level_promotion array Promotion level
bonus_items array Additional products
coupon_info json Coupon information
creator_id string Creator
customer_tags array Customer tags
discount_by_quantity int Number of discounts
display_id string Promotion code display code
end_time string End time
group_name string Promotion group
id string Promotion code
inserted_at string Time creation
is_activated boolean Activated
is_discount_in_birthday_customer boolean Promotion for birthdays
is_free_shipping boolean Free shipping
is_used boolean Used
is_variation boolean Promotion by variation
level_order_prices json Prices level
name string Promotion name
order_sources array Order sources
post_ids array Post code list
priority_level int Priority level
promo_code_info json Promotion code information
discount int Discount
is_percent boolean Discount according to percent
max_discount_by_percent int Maximum percentage
shop_id int Shop ID
start_time string Start time
total_quantity_bonus int Total number of promotion
type string Promotion type
type_employee string Staff type
updated_at string Update time
warehouse_ids array Warehouse code list

Create advanced promotion

POST /shops/<SHOP_ID>/promotion_advance?api_key=<api_key> HTTP/1.1

Request

{
  "promotion_advance": {
    "name": "wert234454",
    "start_time": null,
    "end_time": null,
    "warehouse_ids": [
        "-1"
    ],
    "customer_tags": [],
    "order_sources": [],
    "type_employee": "all",
    "type": "discount_by_product",
    "level_order_prices": [],
    "group_name": "Nhóm 1",
    "is_activated": true,
    "is_variation": true,
    "coupon_info": {
        "discount": 0,
        "is_percent": false
    },
    "promo_code_info": {
        "discount": 0,
        "is_percent": false,
        "max_discount_by_percent": 0
    },
    "items": [],
    "is_free_shipping": false,
    "discount_by_quantity": 0,
    "bonus_items": [],
    "is_discount_in_birthday_customer": false,
    "arr_level_promotion": [],
    "total_quantity_bonus": 0,
    "priority_level": null,
    "isLoadingItem": false,
    "post_ids": []
  }
}

Promotion type

Type Description
discount_by_coupon_id Promotion by coupon id
discount_by_product Promotion by product
fixed_prices Promotion at fixed prices
coupon Coupons
double_reward_point Double bonus points
discount_by_entire_or_category_product Discount by entire or category product
discount_by_order_price Discount by order price

Update advanced promotion

PUT /shops/<SHOP_ID>/promotion_advance/<ID>?api_key=<api_key> HTTP/1.1

Request

{
  "promotion_advance": {
    "arr_level_promotion": [],
      "bonus_items": [],
      "coupon_info": {
        "discount": 0,
        "is_percent": false
      },
      "creator_id": "4eab0efc-2994-4b96-acf0-e4c847668555",
      "customer_tags": [],
      "discount_by_quantity": 1,
      "display_id": 50,
      "end_time": "2022-03-11T05:04:13",
      "id": "260a0d45-ba88-457b-8b31-afa3fda0ce0e",
      "inserted_at": "2022-03-10T05:04:33",
      "is_activated": true,
      "group_name": "Nhóm 1",
      "is_discount_in_birthday_customer": false,
      "is_free_shipping": false,
      "is_used": null,
      "is_variation": true,
      "level_order_prices": [],
      "name": "test cap nhat km555555",
      "order_sources": [],
      "post_ids": [],
      "priority_level": null,
      "promo_code_info": {
        "discount": 0,
        "is_percent": false,
        "max_discount_by_percent": 0
      },
      "shop_id": 3,
      "start_time": "2022-03-10T05:04:11",
      "total_quantity_bonus": 0,
      "type": "discount_by_product",
      "type_employee": "all",
      "updated_at": "2022-03-10T05:04:33",
      "warehouse_ids": []
  }
}

Combo product

Combo list

GET /shops/<SHOP_ID>/combo_products?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {
      "currency": "VND",
      "custom_id": null,
      "discount_amount": 10000,
      "discount_by_percent": 0,
      "end_time": "2024-07-19T16:59:59",
      "id": 282,
      "inserted_at": "2024-06-19T10:42:33",
      "is_free_shipping": true,
      "is_use_percent": false,
      "is_value_combo": false,
      "is_variation": true,
      "max_discount_by_percent": 0,
      "name": "combo 1",
      "order_sources": [
        {
          "account": null,
          "key": "-2",
          "page_id": null
        }
      ],
      "order_types": [
        "all"
      ],
      "shop_id": 20,
      "snippet": null,
      "start_time": "2024-06-18T17:00:00",
      "updated_at": "2024-06-19T10:42:33",
      "value_combo": 0,
      "bonus_products": [
        {
          "discount_each_product": 0,
          "images": [
            "https://statics.pancake.vn/user-content-dev2.pancake.vn/2022/7/7/eb376f0bf90f47d25396d49e4d547700f182981b.jpg"
          ],
          "key": "fd46af68-9c2c-419b-adb6-309cd01a548c",
          "price_original": 200000,
          "product_id": "3116c7bc-d206-4c6c-a6e9-13b7999a543a",
          "quantity": 1,
          "variation_id": "fd46af68-9c2c-419b-adb6-309cd01a548c",
          "variation_info": {
            "creator_id": "ad584de3-8c39-4cb8-bdcb-325e40d5b957",
            "product_attributes": [
              {
                "id": "3b3fe83f-cd98-4f1a-80c6-9141e8737cba",
                "name": "Size",
                "values": ["S"]
              },
              {
                "id": "14a9d29a-d1dc-4f02-a705-0df9b068b8a5",
                "name": "Color",
                "values": ["red"]
              }
            ],
            "manipulation_warehouses": [],
            "retail_price": 0,
            "is_sell_negative": null,
            "id": "XXL-yellow",
            "removed": false,
            "category_ids": [
              564
            ],
            "product_id": "áo phông nam",
            "categories": [
              {
                "id": 564,
                "name": "danh muc 1"
              }
            ],
            "shop_id": 20,
            "type": "product",
            "note": "xoas",
            "custom_id": "áo phông nam",
            "supplier_product_ids": [
              225
            ],
            "product_links": [
              "https://metruyenchu.com/truyen/chu-thien-van-gioi-nhan-vat-chinh-deu-la-ta-de/chuong-4"
            ],
            "inserted_at": "2022-06-04T07:30:05",
            "fields": [
              {
                "id": "17ca5a3d-3cad-4d49-863a-251aa12e4651",
                "keyValue": "XXL",
                "name": "Size",
                "value": "XXL"
              },
              {
                "id": "c71836c4-a8ac-44e8-8b3f-1b66fada74ac",
                "keyValue": "YELLOW",
                "name": "Color",
                "value": "yellow"
              }
            ],
            "name": "áo phông nam",
            "keyword": null,
            "description": null,
            "brand_id": "a205de96-1d36-443e-9dd8-5f12f1b26909",
            "bonus_products": [
              {
                "images": {
                  "0": "https://statics.pancake.vn/user-content-dev2.pancake.vn/2021/12/27/8d678fdb1491c8114c7fedcfc853c82307da2435.jpg"
                },
                "price_original": "0",
                "quantity": "1",
                "variation_id": "29044dcf-2f4c-492f-a0a9-e447b20e21da",
                "variation_info": {
                  "id": "2",
                  "name": "SP N",
                  "product_id": "SP N",
                  "retail_price": "0",
                  "weight": "300"
                }
              }
            ],
            "limit_quantity_to_warn": 0,
            "note_product": "asd",
            "tags": [
              {
                "id": 95,
                "note": "thẻ 3. 2"
              }
            ],
            "updated_at": "2023-11-09T08:53:34",
            "display_id": 11772
          }
        }
      ]
    }
  ],
  "page_number": 1,
  "page_size": 30,
  "success": true,
  "total_entries": 3,
  "total_pages": 1
}

Query Parameters

Parameter Required Type Default
page false int 1
page_size false int 30

Response Parameters

Parameter Type Description
currency string Currency unit
custom_id string Custom ID
discount_amount int Discount amount
discount_by_percent int Discount according to percent
end_time unix timestamp End time
id string Combo ID
inserted_at unix timestamp Creation time
is_free_shipping boolean Free shipping
is_use_percent boolean Apply percent discount
is_value_combo boolean Apply combo value
is_variation boolean Apply to variation
max_discount_by_percent int Maximum discount amount in percent
name string Combo name
order_sources array Order source apply
order_types string Order type apply
start_time unix timestamp Start time
updated_at unix timestamp Updated at
value_combo int Value of combo
bonus_products array List of products in combo

Fee partner caculator

POST /shops/<SHOP_ID>/orders/price_comparing?api_key=<api_key> HTTP/1.1

Request

  {
    "des_province": "805",
    "des_district": "80511",
    "des_commune": "8051125",
    "weight": "0",
    "warehouse_id": "7442b538-002b-42e3-8520-64425897e2f5",
    "shop_id": "",
    "quantity": "1",
    "price_product": "200000",
    "cod": "100000"
  }

Response

{
  "data": [
    {
      "partner_fee": 45000,
      "partner_id": 0,
      "partner_name": "Snappy"
    },
    {
      "partner_fee": 40000,
      "partner_id": 1,
      "partner_name": "GHTK"
    },
    {
      "partner_fee": 0,
      "partner_id": 3,
      "partner_name": "VTP"
    },
    {
      "partner_fee": 82500,
      "partner_id": 5,
      "partner_name": "GHN"
    },
    {
      "partner_fee": 0,
      "partner_id": 17,
      "partner_name": "VNPOST"
    },
    {
      "partner_fee": 0,
      "partner_id": 15,
      "partner_name": "JNT"
    },
    {
      "partner_fee": 36000,
      "partner_id": 16,
      "partner_name": "Best Express"
    }
  ],
  "success": true
}

Request Parameters

Parameter Required Type Description
des_province true string Code of provinces/cities to receive goods
des_district true string Code of county/district receives goods
des_commune true string Code of ward/commune receiving goods
weight true string Weight
warehouse_id true string Warehouse ID
shop_id true string Shop ID
quantity true string Quantily
price_product true string Product price
cod true string Cash on delivery
service_vtp false string VTP service code
service_vnpost false string VNPOST service code
service_best false string BEST service code
service_ghn false string GHN service code

VTP service code

Service code Description
LCOD LCOD - Road e-commerce
NCOD NCOD - Flight e-commerce
VCN VCN Express delivery
VTK VTK Saving
V60 V60 Quick Service 60h
VVT VVT Transportation services
VHT VHT Very fast delivery
PTN PTN Delivery in day within the province
PHT PHT Delivery within the province
PHS PHS Delivery delay a day within the province
VBE VBE Savings under the box
VBS VBS Express in the box
SCOD SCOD Cashing delivery
ECOD ECOD Cashing saving delivery
V20 V20
V25 V25
V30 V30
V35 V35
VCBA VCBA Airline delivery
VCBO VCBO Road delivery

VNPOST service code

Service code Description
EMS EMS - Express delivery
BK BK - Common delivery
ECOD ECOD - Savings delivery
BKCOD BKCOD - E-commerce up to 5kg (VP2)
DONG_GIA DONG_GIA - Private deal service between customers and VNPost
TMDT_EMS E-commerce - Express delivery EMS
TMDT_BK E-commerce - Standard delivery
TMDT_EMS_TK E-commerce - Express saving delivery EMS (Interregional)

BEST service code

Service code Description
12490 Express delivery (Express)
12491 Savings delivery (Eco)

GHN service code

Service code Description
1 Fast
2 Standard
3 Save

Response Parameters

Parameter Type Description
partner_fee int Fee from shipping partner
partner_id int Partner ID
partner_name string Shipping partner name

Partner

GET /shops/<SHOP_ID>/partners?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
    {"id": 0, "name": "Snappy"},
    {"id": 1, "name": "Giao hàng tiết kiệm"},
    {"id": 2, "name": "EMS"},
    {"id": 4, "name": "247 Express"},
    {"id": 5, "name": "Giao hàng nhanh"},
    {"id": 7, "name": "VNP"},
    {"id": 8, "name": "SPL"},
    {"id": 9, "name": "DHL"},
    {"id": 10, "name": "J&T Philippines"},
    {"id": 11, "name": "Ahamove"},
    {"id": 12, "name": "LBC"},
    {"id": 13, "name": "Lazada Express"},
    {"id": 15, "name": "J&T"},
    {"id": 16, "name": "Best Inc"},
    {"id": 17, "name": "VN Post v2"},
    {"id": 19, "name": "Ninja Van"},
    {"id": 32, "name": "SuperShip"},
    {"id": 33, "name": "ZTO Express"},
    {"id": 36, "name": "NTX"},
    {"id": 37, "name": "Grab Express"},
    {"id": 38, "name": "Van Phuc"},
    {"id": 39, "name": "Hola Ship"},
    {"id": 40, "name": "LWE Express"},
    {"id": 41, "name": "Flash Express Phi"}
 ],
 "success": true
}

Response Parameters

Parameter Type Description
id int Partner ID
name string Partner name

WEBHOOK

Go website Setting -> Application
On frame WEBHOOK URL switch button, setting information:
- Webhook URL (Require)
- Email error message
- Request Headers
- Data type Orders(POS), Data table(CRM), Customers(POS, CRM), In stock(POS)

Webhook

Cấu hình Webhook

PUT /shops/<SHOP_ID>?api_key=<api_key> HTTP/1.1

Response

  {
    "shop": {
      "webhook_enable": true,
      "webhook_url": "https://test.com",
      "webhook_email": "1234@gmail.com",
      "webhook_types": ["orders", "customers", "variations_warehouses"],
      "webhook_partner": "",
      "webhook_headers": {
          "X-API-KEY": "elqsF9ERiFWGacWQO9Gg5XC4kXojot"
      }
    }
  }

Response Parameters

Parameter Type Description
webhook_enable boolean Enable/Disable Webhook
webhook_url string Link URL
webhook_email string Error message email
webhook_types array Webhook data
webhook_partner string Partner

Order

Order Response

Response

  {
    "bill_full_name": "hoang anh ",
    "bill_phone_number": "0999999999",
    "page_id": "256469571178082",
    "creator": {
      "avatar_url": null,
      "fb_id": "2042723249341651",
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "name": "Hoang Anh"
    },
    "id": 1418,
    "inserted_at": "2020-05-12T04:51:42",
    "updated_at": "2020-05-12T04:51:54",
    "is_free_shipping": false,
    "received_at_shop": false,
    "partner_fee": 28000,
    "customer_pay_fee": false,
    "items": [
      {
        "discount_each_product": 0,
        "is_bonus_product": false,
        "is_discount_percent": false,
        "is_wholesale": false,
        "one_time_product": false,
        "quantity": 1,
        "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "variation_info": {
          "detail": null,
          "fields": null,
          "display_id": null,
          "name": "aaaaaa",
          "product_display_id": null,
          "retail_price": 100000,
          "weight": 100
        }
      }
    ],
    "note": "",
    "note_print": null,
    "returned_reason": 1,
    "partner": {
    "cod": 0,
    "custom_partner_id": null,
    "extend_code": "S58824.MB25.C3.500020713",
    "extend_update": [],
    "is_returned": null,
    "order_number_vtp": null,
    "paid_at": null,
    "partner_id": 1,
    "sort_code": null,
    "system_created": true,
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16"
  },
    "warehouse_id": "630744ef-4614-4a70-988c-52e6d78c953c",
    "shipping_address": {
      "address": "aaaaa",
      "commune_id": "2210941",
      "country_code": null,
      "district_id": "22109",
      "full_address": "aaaaa, Xã Bắc Lý, Huyện Hiệp Hòa, Bắc Giang",
      "full_name": "hoang anh ",
      "phone_number": "0999999999",
      "post_code": null,
      "province_id": "221"
    },
    "shipping_fee": 0,
    "shop_id": 4,
    "status": 0,
    "status_name": "new",
    "tags": [
    {
      "id": 2,
      "name": "Chờ cọc"
    },
    {
      "id": 3,
      "name": "Nhập hàng"
    },
    {
      "id": 13,
      "name": "Delay lấy hàng"
    }
  ],
    "total_discount": 0,
    "warehouse_info": {
      "district_id": "10111",
      "full_address": "kakakaka, Phường Khương Trung, Quận Thanh Xuân, Hà Nội",
      "name": "snappy",
      "phone_number": "0999999999",
      "province_id": "101"
    }
  }

CRM

CRM Response

Response

{
  "data": {
    "record": {
      "Address": "123",
      "CreatedBy": "6dcd3606-092a-467c-85d1-3149789cd470",
      "CreatedOn": "2019-06-21 10:50:21.411404",
      "Email": "qvasdaaasd@gmail.com",
      "LastContactAt": "2019-06-25T10:50:17.867Z",
      "LastContactUser": null,
      "ModifiedBy": "340644fc-314d-450e-a45f-33343678cab6",
      "ModifiedOn": "2020-11-03 16:02:50.217203",
    },
    "success": true
  }
}

Customer

Customer Response

Response

{
  "id": "00094712-d419-4f27-a8cc-e5ac9ed2dd75",
  "name": "Customer",
  "phone_numbers": ["0912312312"],
  "ad_clicks": [
    {
      "ad_id": "23851252560290199",
      "inserted_at": "2022-03-22T13:58:12",
      "post_id":"155703382366461_451824450048652"
    },
    {
      "ad_id": "23845321522860199",
      "inserted_at": "2022-03-25T03:32:12",
      "post_id": "109703394252261_451873526716231"
    }
  ],
  "birthday": null,
  "gender": "male",
  "customer_tags": ["tag 1", "tag 2"],
  "emails": ["hi@gmail.com"],
  "page_id": "4124125124323223",
  "reward_point": 100,
  "adjust_points": 20,
  "shop_id": 10,
  "type": "customers"
}

In stock

Response

{
  "data": {
    "record": {
      "actual_remain_quantity": 1,
      "remain_quantity": 1,
      "type": "variations_warehouses",
      "variation_id": "1996b3cd-fd72-4bd8-8889-a7f387821368",
      "warehouse_id": "77cbe2d5-6e65-4220-9c57-5d5d34f847e2",
      "change_quantity": -1,
      "is_actual_remain_quantity": false,
      "inserted_at": "2023-05-26 04:02:00.324609"
    },
    "success": true
  }
}

Response Parameters

Parameter Type Description
actual_remain_quantity int Actual remain quantity
remain_quantity int Number of remaining products
variation_id uid Variation ID
warehouse_id uid Warehouse ID
change_quantity int Change quantity
is_actual_remain_quantity boolean False: Is the act of changing the remaining quantity, True: Is the act of changing the actual amount remaining
inserted_at string Inserted at

CRM

List of tables

GET /shops/<SHOP_ID>/crm/tables?api_key=<api_key> HTTP/1.1

Response

{
  "success": true,
  "tables": [
    {
      "can_remove": false,
      "creator_id": null,
      "filters": [],
      "icon": null,
      "inserted_at": "2021-04-08T08:29:43",
      "is_removed": false,
      "label": "Contact",
      "modified_id": null,
      "name": "Contact",
      "permission_type": 1,
      "sections": [
        {
          "can_remove": false,
          "creator_id": null,
          "fields": [
            {
              "name": "Name",
              "label": "Name",
              "agg_field_id": null,
              "association_multi": true,
              "association_table": null,
              "association_type": null,
              "can_remove": false,
              "creator_id": null,
              "select_options": [],
              "summary_display_field_id": null,
              "summary_field_id": null,
              "summary_type": null,
              "type": 5,
              "order": 1,
              "quick_update": false,
              "is_require": true,
              "is_unique": false,
              "formulas": null
            },
            {
              "name": "Phone",
              "label": "Phone",
              "agg_field_id": null,
              "association_multi": true,
              "association_table": null,
              "association_type": null,
              "can_remove": false,
              "creator_id": null,
              "select_options": [],
              "summary_display_field_id": null,
              "summary_field_id": null,
              "summary_type": null,
              "type": 2,
              "order": 1,
              "quick_update": false,
              "is_require": true,
              "is_unique": false,
              "formulas": null
            }
          ]
        }
      ],
      "table_permissions": [
        {
          "id": "3f7ef102-7b45-4198-8783-7f7854b4a64a",
          "profile_id": "c25c1d3a-3dae-4877-af1e-5e71a41f6113",
          "role": 63,
          "table_id": "Contact"
        },
        {
          "id": "ea6c1d47-c230-43b8-a11e-fb61f4b611e4",
          "profile_id": "8e4d6a59-47e8-48bf-a51d-eb873ffd7eae",
          "role": 31,
          "table_id": "Contact"
        },
        {
          "id": "6963295c-fd7c-49c8-ab67-86641a800653",
          "profile_id": "58c99b60-2d8a-4edb-b7a2-a907bc874dbb",
          "role": 31,
          "table_id": "Contact"
        }
      ]
    }
 ]
}

Response Parameters

Parameter Type Description
label string Label of table
name string Name of table
permission_type int Who can see the table (1. Everyone, 2. Record owner and his manager)
sections.order int Order of section
sections.fields array Fields of section
sections.fields.order int Order fields in the section
sections.fields.type int Type of field
table_permissions array Permission of each group in the table

Data of table

GET /shops/<SHOP_ID>/crm/<TABLE_NAME>/records?api_key=<api_key> HTTP/1.1

Response

{
  "data": {
    "entries": [
      {
        "Address": "asdasd",
        "CreatedBy": "6dcd3606-092a-467c-85d1-3149789cd470",
        "CreatedOn": "2019-06-21 10:50:21.411404",
        "Email": "qwdasd@gmail.com",
        "LastContactAt": "2019-06-25T10:50:17.867Z",
        "LastContactUser": null,
        "ModifiedBy": "340644fc-314d-450e-a45f-33343678cab6",
        "ModifiedOn": "2020-11-03 16:02:50.217203",
      },
      {
        "Address": "123",
        "CreatedBy": "6dcd3606-092a-467c-85d1-3149789cd470",
        "CreatedOn": "2019-06-21 10:50:21.411404",
        "Email": "qvasdaaasd@gmail.com",
        "LastContactAt": "2019-06-25T10:50:17.867Z",
        "LastContactUser": null,
        "ModifiedBy": "340644fc-314d-450e-a45f-33343678cab6",
        "ModifiedOn": "2020-11-03 16:02:50.217203",
      }
    ]
  }
}

Query Parameters

Parameter Required Type Default Description
page_size false int 30
page false int 1

Create Record

POST /shops/<SHOP_ID>/crm/<TABLE_NAME>/records?api_key=<api_key> HTTP/1.1

Response

{
  "data": {
    "record": {
      "Address": "123",
      "CreatedBy": "6dcd3606-092a-467c-85d1-3149789cd470",
      "CreatedOn": "2019-06-21 10:50:21.411404",
      "Email": "qvasdaaasd@gmail.com",
      "LastContactAt": "2019-06-25T10:50:17.867Z",
      "LastContactUser": null,
      "ModifiedBy": "340644fc-314d-450e-a45f-33343678cab6",
      "ModifiedOn": "2020-11-03 16:02:50.217203",
    },
    "success": true
  }
}

Query Parameters

Parameter Required Type Default Description
record.field_name field.is_required string OR array field.default_value Type: array (field.type IN [10, 14, 15, 17] OR field.association_multi)

Update Record

PUT /shops/<SHOP_ID>/crm/<TABLE_NAME>/records?api_key=<api_key> HTTP/1.1

Response

{
  "data": {
    "record": {
      "Address": "123",
      "CreatedBy": "6dcd3606-092a-467c-85d1-3149789cd470",
      "CreatedOn": "2019-06-21 10:50:21.411404",
      "Email": "qvasdaaasd@gmail.com",
      "LastContactAt": "2019-06-25T10:50:17.867Z",
      "LastContactUser": null,
      "ModifiedBy": "340644fc-314d-450e-a45f-33343678cab6",
      "ModifiedOn": "2020-11-03 16:02:50.217203",
    },
    "success": true
  }
}

Query Parameters

Parameter Required Type Default Description
record.field_name field.is_required string OR array field.default_value Type: array (field.type IN [10, 14, 15, 17] OR field.association_multi)

Create Table

POST /shops/<SHOP_ID>/crm/tables?api_key=<api_key> HTTP/1.1

Response

{
  "data": {
    "table": {
      "name": "test",
      "label": "test",
      "auto_create_config": null,
      "can_remove": false,
      "creator_id": "6dcd3606-092a-467c-85d1-3149789cd470",
      "icon": null,
      "inserted_at": "2019-06-25T10:50:17.867Z",
      "updated_at": "2019-06-25T10:50:17.867Z",
      "show_fields": null,
      "sections": [
        {
          "can_remove": false,
          "creator_id": null,
          "fields": [
            {
              "name": "Name",
              "label": "Name",
              "agg_field_id": null,
              "association_multi": true,
              "association_table": null,
              "association_type": null,
              "can_remove": false,
              "creator_id": null,
              "select_options": [],
              "summary_display_field_id": null,
              "summary_field_id": null,
              "summary_type": null,
              "type": 5,
              "order": 1,
              "quick_update": false,
              "is_require": true,
              "is_unique": false,
              "formulas": null
            },
            {
              "name": "Phone",
              "label": "Phone",
              "agg_field_id": null,
              "association_multi": true,
              "association_table": null,
              "association_type": null,
              "can_remove": false,
              "creator_id": null,
              "select_options": [],
              "summary_display_field_id": null,
              "summary_field_id": null,
              "summary_type": null,
              "type": 2,
              "order": 1,
              "quick_update": false,
              "is_require": true,
              "is_unique": false,
              "formulas": null
            }
          ]
        }
      ]
    },
    "success": true
  }
}

Query Parameters

Parameter Required Unique Type
table.name true true string
table.label true false string

List of Profiles

GET /shops/<SHOP_ID>/crm/profile?api_key=<api_key> HTTP/1.1

Response

{
  "data": [
      {
          "can_remove": false,
          "id": "994b620f-ebf6-4386-bea2-c37ed020aae4",
          "is_admin": true,
          "is_removed": false,
          "name": "CEO",
          "reports_to": null,
          "role": 0,
          "shop_id": 403
      },
      {
          "can_remove": true,
          "id": "7ffb87d1-63ed-405e-84f8-5587748889ea",
          "is_admin": false,
          "is_removed": false,
          "name": "Manager",
          "reports_to": "CEO",
          "role": 0,
          "shop_id": 403
      },
      {
          "can_remove": true,
          "id": "3a383661-6031-4ded-ad82-1a5e3e6cf760",
          "is_admin": false,
          "is_removed": false,
          "name": "User",
          "reports_to": "Manager",
          "role": 0,
          "shop_id": 403
      }
  ],
  "success": true
}

Response Parameters

Parameter Type Description
shop_id int Shop ID
name string Profile name
reports_to string Reports to
is_admin string Admin
can_remove boolean Can remove

Record History

GET /shops/<SHOP_ID>/crm/<TABLE_NAME>/history?api_key=<api_key>&record_id=<record_id> HTTP/1.1

Response

{
    "history": [
      {
        "changes": [
          {
            "field_label": "Tag Pancake",
            "new": "Mua hàng, Đã gửi",
            "old": "Mua hàng"
          }
        ],
        "editor_id": "4eab0efc-2994-4b96-acf0-e4c847668555",
        "id": "f673edbb-a008-46dd-a4df-bd4edbc8e41f",
        "record_id": "42958b34-e30c-4126-b00e-e3abf9803de2",
        "shop_id": 275,
        "updated_at": "2022-07-21T07:43:49"
      }
    ],
    "success": true
}

Response Parameters

Parameter Type Description
changes.field_label string Field label
changes.old string Old value
changes.new string New value
editor_name string Editor name