# Order

> Base URL: `https://pos.pages.fm/api/v1`. Authenticate with the `api_key` query parameter.

## List of orders

`GET /shops/{SHOP_ID}/orders`

Get list of orders. Get information of specific order

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `page_size` | query | integer |  | Page size |
| `page_number` | query | integer |  | Page number |
| `search` | query | string |  | Phone number, name of customer, note, .... |
| `filter_status[]` | query | integer[] |  | Order status |
| `include_removed` | query | integer |  | Include removed orders |
| `updateStatus` | query | string |  | Filter orders by time Values: `inserted_at` Order creation time, `updated_at` Last update time, `partner_inserted_at` Time sent to courier, `paid_at` Reconciliation time, `estimate_delivery_date` Estimate delivery time, `picked_up_at` Courier picked up at, `first_delivery_at` First delivery at, `transfer_proof` Transfer proof, `time_assign_seller` Time assign seller, `time_assign_care` Time assign care, `time_assign_marketer` Time assign marketer, `-1` Last status update, `0` New, `11` Restocking, `20` Purchased, `1` Confirmed, `12` Wait for printing, `13` Printed, `8` Packaging, `9` Waiting for pick up, `2` Shipped, `3` Received, `16` Collected money, `4` Returning, `15` Partial return, `5` Returned. |
| `startDateTime` | query | integer (int64) |  | Start date (unix timestamp) |
| `endDateTime` | query | integer (int64) |  | End date (unix timestamp) |
| `option_sort` | query | string |  | Orders sequence Values: `inserted_at_desc` Order creation time gradually decreases, `inserted_at_asc` Order creation time gradually increases, `last_updated_order_desc` Last updated order gradually decreases, `last_updated_order_asc` Last updated order gradually increases, `last_update_status_at_desc` Last update status at gradually decreases, `last_update_status_at_asc` Last update status at gradually increases, `order_valuation_desc` Order value gradually decreases, `order_valuation_asc` Order value gradually increases, `product_quantity_desc` Product quantity gradually decreases, `product_quantity_asc` Product quantity gradually increases, `product_name_desc` Product name gradually decreases, `product_name_asc` Product name gradually increases, `sub_status_sort_desc` Delivery delay update gradually decreases, `sub_status_sort_asc` Delivery delay update gradually increases, `first_undeliverable_at_desc` First undeliverable at gradually decreases, `first_undeliverable_at_asc` First undeliverable at gradually increases, `customer_sort_desc` Customer name gradually decreases, `customer_sort_asc` Customer name gradually increases, `estimate_delivery_date_desc` Estimate delivery date gradually decreases, `estimate_delivery_date_asc` Estimate delivery date gradually increases, `order_source_desc` Order source gradually decreases, `order_source_asc` Order source gradually increases. |
| `fields[]` | query | string[] |  | Response fields |
| `partner_id[]` | query | integer[] |  | Shipping partner ID on Pancake system |
| `shop_partner_account` | query | integer |  | Filter by shipping account ID connected to the shop |
| `customer_id` | query | string |  | Customer ID |
| `order_sources[]` | query | string[][] |  | Order sources. Format: [[order_source_id, account_id], ...] Example: [["-1", "314"], ["-3"]] |
| `is_filter_exclude_source` | query | boolean |  | Exclude order source |
| `ad_ids[]` | query | string[] |  | Advertising IDs |
| `project_ids` | query | integer |  | Project ID |
| `extra_fields[]` | query | string[] |  | Extra fields |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": 1418,
      "system_id": 1,
      "shop_id": 4,
      "inserted_at": "2020-05-12T04:51:42",
      "updated_at": "2020-05-12T04:51:54",
      "status": 0,
      "status_name": "new",
      "bill_full_name": "Hoang Anh",
      "bill_phone_number": "0999999999",
      "bill_email": "customer@example.com",
      "conversation_id": "117967746266487_9306266852780716",
      "page_id": "256469571178082",
      "post_id": "185187094667903_477083092110915",
      "ad_id": "23851252560290199",
      "shipping_fee": 0,
      "cod": 0,
      "cash": 0,
      "account": 1,
      "total_discount": 0,
      "note": "",
      "note_print": null,
      "received_at_shop": false,
      "is_free_shipping": false,
      "is_locked": false,
      "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "creator": {
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "fb_id": "2042723249341651",
        "name": "Hoang Anh",
        "avatar_url": null
      },
      "items": [],
      "partner": {
        "partner_id": 1,
        "cod": 0,
        "extend_code": "S58824.MB25.C3.500020713",
        "total_fee": 0,
        "updated_at": "2020-05-12T05:18:16",
        "delivery_name": null,
        "delivery_tel": null,
        "picked_up_at": null,
        "sort_code": null,
        "paid_at": null,
        "system_created": true,
        "partner_status": "request_received",
        "partner_name": "Shopee Xpress",
        "first_delivery_at": null,
        "first_undeliverable_at": "2025-06-30T06:41:44",
        "count_of_delivery": 1,
        "order_number_vtp": null,
        "printed_form": null,
        "extend_update": [
          {
            "key": "status",
            "status": "delivered",
            "tracking_id": "S58824.MB25.C3.500020713",
            "note": "",
            "update_at": "2020-05-12T05:18:16",
            "webhook_params": null
          }
        ]
      },
      "shipping_address": {
        "full_name": "Hoang Anh",
        "phone_number": "0999999999",
        "address": "90 Cầu Giấy",
        "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
        "province_id": "101",
        "district_id": "10113",
        "commune_id": "1011309"
      },
      "additional_info": {
        "service_partner": "instant"
      },
      "invoice_info_list": [
        {
          "error": "",
          "invoice_detail": {
            "company_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
            "company_address_breakdown": {
              "company_additional_info": "",
              "company_barangay": "",
              "company_city": "",
              "company_detailed_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
              "company_district": "Phường Nam Định",
              "company_full_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
              "company_postcode": "",
              "company_province": "",
              "company_region": "VietNam",
              "company_state": "Ninh Bình",
              "company_town": "Phường Nam Định"
            },
            "company_email": "acb@gmail.com",
            "company_name": "Công ty cổ phần tư vấn xây dựng điện Hoàng Phát",
            "company_tax_id": "0601043840"
          },
          "invoice_type": "company",
          "is_requested": true,
          "order_sn": "251121BVGU6RVE"
        }
      ],
      "reports_by_phone": {
        "+639175706297": {
          "order_fail": 29,
          "order_success": 20,
          "warning": 0
        }
      },
      "p_utm_source": "fb",
      "p_utm_medium": "paid",
      "p_utm_campaign": "120236828168640593",
      "p_utm_term": "120236828168790593",
      "p_utm_content": "120236828168960593",
      "link": "https://www.myfahathai.com/doc?fbclid=IwZXh0bgNhZW0BMABhZGlkAasqwhnoX"
    }
  ],
  "page_number": 1,
  "page_size": 100,
  "success": true,
  "total_entries": 1418,
  "total_pages": 15
}
```

## Create order

`POST /shops/{SHOP_ID}/orders`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Request body

Order information to create

- `id` (integer): Order ID
- `system_id` (integer): System ID
- `shop_id` (integer, required): Shop ID
- `inserted_at` (string (date-time)): Order creation time
- `updated_at` (string (date-time)): Order update time
- `status` (integer): Order status Values: `0` New, `17` Waiting for confirmation, `11` Restocking, `12` Wait for printing, `13` Printed, `20` Purchased, `1` Confirmed, `8` Packaging, `9` Waiting for pick up, `2` Shipped, `3` Received, `16` Collected money, `4` Returning, `15` Partial return, `5` Returned, `6` Canceled, `7` Deleted recently.
- `status_name` (string): Order status name
- `bill_full_name` (string): Customer name
- `bill_phone_number` (string): Phone number of customer
- `bill_email` (string): Customer email
- `conversation_id` (string): Conversation ID
- `page_id` (string): Facebook page ID
- `post_id` (string): Post ID
- `ad_id` (string): Ad ID
- `shipping_fee` (integer): Shipping fee
- `partner_fee` (integer): Fee from shipping partner
- `fee_marketplace` (integer): Fees from e-commerce platforms
- `customer_pay_fee` (boolean): Customer pay shipping fee
- `is_free_shipping` (boolean): Free shipping
- `is_livestream` (boolean): Is livestream order
- `is_live_shopping` (boolean): Is live shopping order
- `is_smc` (boolean): Shopping on Messenger
- `received_at_shop` (boolean): true: Sales at counter, false: Sell online
- `total_discount` (integer): Discount total
- `note` (string): Internal note
- `note_print` (string): Note for printing
- `returned_reason` (integer): Return reason code (1: Customer, 2: Staff, 3: Defective product, 4: Shipping carrier, 5: Exchange). Other values are shop-defined custom reasons, see returned_reason_name for the display name
- `returned_reason_name` (string): Return reason name
- `sub_status` (integer): Reason for delivery delay
- `warehouse_id` (string): Warehouse ID
- `warehouse_info` (object): Warehouse information
  - `name` (string): Warehouse name
  - `phone_number` (string): Warehouse phone number
  - `full_address` (string): Warehouse full address
  - `address` (string): Warehouse address
  - `province_id` (string): Province ID
  - `district_id` (string): District ID
  - `commune_id` (string): Commune ID
  - `affiliate_id` (string): Affiliate ID
  - `ffm_id` (string): FFM ID
  - `has_snappy_service` (boolean): Has Snappy service
  - `custom_id` (string): Custom ID
- `creator_id` (string): Creator ID
- `creator` (object): Order creator
  - `id` (string): Creator ID
  - `fb_id` (string): Facebook ID of creator
  - `name` (string): Creator name
  - `avatar_url` (string): Creator avatar URL
- `items` (object[]): Product list
  - `product_id` (string): Product ID
  - `quantity` (integer, required): Quantity
  - `returned_count` (integer): Returned count
  - `assigning_seller_id` (string): Assigning seller ID
  - `quantity_by_combo_products` (object[]): Quantity by combo products
  - `discount_each_product` (integer): Discount for each product
  - `is_bonus_product` (boolean): Is bonus product
  - `is_discount_percent` (boolean): Is discount by percent
  - `is_wholesale` (boolean): Is wholesale
  - `is_composite` (boolean): Is composite product
  - `one_time_product` (boolean): One time product
  - `note` (string): Product note
  - `note_product` (string): Product note
  - `inserted_at` (string (date-time)): Inserted at
  - `measure_group_id` (integer): Measure group ID
  - `variation_info` (object): Variation information. Optional when creating/updating an order (the backend defaults it to an empty object if omitted). Its inner fields are not individually required, but sending `retail_price` is recommended so the line price is correct.
  - `components` (object[]): Product components
  - `variation_id` (string, required): Variation ID (SKU of the variation can also be used)
- `partner` (object): Partner information When updating an order that already has shipping info, only the fields you send are written; omitted fields keep their current values. Send `null` to clear `partner_id`, `extend_code` or `shop_partner_id`.
  - `partner_id` (integer): Partner ID
  - `cod` (integer): Reconciliation COD
  - `extend_code` (string): Shipping order ID on partner system
  - `total_fee` (integer): Total fee
  - `updated_at` (string (date-time)): Updated at
  - `delivery_name` (string): Shipper name
  - `delivery_tel` (string): Delivery phone
  - `picked_up_at` (string (date-time)): Picked up at
  - `sort_code` (string): Sort code
  - `paid_at` (string (date-time)): Paid at
  - `system_created` (boolean): System created
  - `extend_update` (object[]): Update from courier
  - `partner_status` (string): Partner shipping status Values: `waiting` Waiting for processing, `request_received` Carrier received the request, `processing_picked_up` Processing pickup, `picking_up` Picking up, `delay_pickup` Delayed pickup, `picked_up` Picked up, `waiting_on_the_way` Waiting for transit, `on_the_way` In transit, `contact_delivery_company` Contact the carrier, `out_for_delivery` Out for delivery, `delay_delivery` Delayed delivery, `inform_recipient` Notify the recipient, `undeliverable` Undeliverable, `waiting_for_return` Waiting for return, `delivered` Delivered, `delivered_cod` Delivered, COD reconciled, `returning` Returning, `returned` Returned, `returned_cod` Returned, COD reconciled, `canceled` Canceled.
  - `partner_name` (string): Partner name
  - `first_delivery_at` (string (date-time)): First delivery time
  - `first_undeliverable_at` (string (date-time)): First failed delivery time
  - `count_of_delivery` (integer): Number of delivery attempts. Courier updates add 1 each time the shipment moves to `out_for_delivery` or `delay_delivery`. Can be set when creating or updating an order (integer 0-32767); omitted or invalid values keep the current value, and later courier updates keep counting from the value you set.
  - `order_number_vtp` (string): Viettel Post tracking number
  - `printed_form` (object): Printed form
- `shipping_address` (ShippingAddress): 
  - `address` (string): Street address. When creating an order via API, if `address` is provided but `province_id` is left empty, the system automatically parses this free-text address to fill in `province_id`, `district_id` and `commune_id`. Auto-fill is skipped when the parsed location is in Thailand (country code 66) or when no commune can be resolved from the text.
  - `commnue_name` (string): Commune name
  - `commune_id` (string): Commune ID
  - `country_code` (string): Country code
  - `district_id` (string): District ID
  - `district_name` (string): District name
  - `full_address` (string): Full address
  - `full_name` (string): Full name
  - `new_full_address` (string): New full address
  - `new_province_id` (string): New province ID
  - `phone_number` (string): Phone number
  - `post_code` (string): Post code
  - `province_id` (string): Province ID
  - `province_name` (string): Province name
  - `render_type` (string): Render type
- `payment_purchase_histories` (object[]): Payment histories
  - `amount` (integer): Amount of money
  - `type` (string): Payment type
  - `inserted_at` (string (date-time)): Transaction time
  - `result_code` (string): Result code
  - `ipn_reply` (boolean): IPN reply
  - `voucher_amount` (integer): Voucher amount
  - `tags` (string[]): Tags
- `tags` (object[]): Tags list
  - `id` (integer): Tag ID
  - `name` (string): Tag name
- `marketer` (object): Marketer information
  - `id` (string): Marketer ID
  - `name` (string): Marketer name
  - `email` (string): Marketer email
  - `phone_number` (string): Marketer phone number
  - `fb_id` (string): Marketer Facebook ID
  - `avatar_url` (string): Marketer avatar URL
- `pke_mkter` (string): Marketer ID
- `activated_combo_products` (object): Activated combo products information
  - `combo_product_id` (integer): Combo product ID
  - `quantity_combo_activated` (integer): Quantity combo activated
  - `combo_product_info` (object): Combo product information
- `activated_promotion_advances` (object[]): Activated promotion advances information
  - `id` (integer): ID
  - `promotion_advance_id` (string): Promotion advance ID
  - `promotion_advance_info` (object): Promotion advance information
- `invoice_info_list` (object[]): Invoice information list
  - `error` (string): Error message if any
  - `invoice_detail` (object): Invoice detail information. The fields to send depend on `invoice_type`: - `company`: use `company_name`, `company_tax_id`, `company_address`, `company_email` (and optionally `company_address_breakdown`). - `personal`: use `name`, `phone_number`, `identity_code`, `tax_id`, `email`.
  - `invoice_type` (string): Invoice type: `company` for an organization, `personal` for an individual. Determines which `invoice_detail` fields are used. Values: `company`, `personal`.
  - `is_requested` (boolean): Customer requests an e-invoice for this order. Set `true` together with `invoice_type` and `invoice_detail` to request invoice issuance.
  - `order_sn` (string): Order code on the marketplace
- `reports_by_phone` (object): Reports by phone number
  - `order_fail` (integer): Number of failed orders
  - `order_success` (integer): Number of successful orders
  - `warning` (integer): Number of warnings orders
- `tracking_link` (string): Link confirm order
- `payment_link` (string): Payment link
- `ads_source` (string): Advertising source
- `bank_payments` (object): Payment method
- `transfer_proofs` (object[]): Bank transfer payment proofs, including verification time, amount and receipt images
  - `id` (integer): Transfer proof ID
  - `order_id` (integer): Order ID
  - `shop_id` (integer): Shop ID
  - `payment_id` (string): Bank payment method ID (matches a key in `bank_payments`)
  - `amount` (integer): Transferred amount
  - `images` (string[]): Transfer receipt images
  - `note` (string): Note
  - `is_income` (boolean): Money received (true) or paid out (false)
  - `is_verify` (boolean): Whether the transfer has been verified
  - `verify_at` (string (date-time)): Verification time
  - `verifier` (object): Verifier information
  - `creator` (object): Creator information
  - `last_editor` (object): Last editor information
  - `order_info` (object): Additional order information
  - `inserted_at` (string (date-time)): Transfer proof creation time
  - `updated_at` (string (date-time)): Transfer proof update time
- `shopify_order_id` (string): Shopify order ID
- `shopify_abandon_checkout_id` (integer): Shopify abandon checkout ID
- `is_abandoned_order` (boolean): Abandoned-cart flag for creating or updating an order. Send it directly in the request body, not inside `third_party` or `third_party_infomation`. An explicit value, including `false`, takes precedence over automatic detection. If omitted on creation, the flag is determined automatically; if omitted on update, the current value is preserved. Only boolean `true` or string `"true"` is normalized to `true`; all other submitted values become `false`.
- `cod` (integer): Cash on delivery
- `cash` (integer): Cash payment
- `account` (integer): Order source ID
- `account_name` (string): Order source name
- `advanced_platform_fee` (object): Fees from e-commerce platforms
  - `ads_top_up` (integer): Ads wallet top-up
  - `affiliate_commission` (integer): Affiliate commission
  - `diff_shipping_fee` (integer): Difference shipping fee
  - `marketplace_voucher` (integer): Marketplace voucher
  - `payment_fee` (integer): Payment fee
  - `platform_commission` (integer): Platform commission
  - `seller_transaction_fee` (integer): Seller transaction fee
  - `service_fee` (integer): Service fee
  - `sfp_service_fee` (integer): SFP service fee
- `printing_count` (integer): Printing count
- `money_to_collect` (integer): Money to collect
- `marketplace_id` (string): Marketplace ID Values: `-2`, `-3`, `-4`, `-9`, `-16`, `-17`, `-20`, `-25`, `-27`, `-28`.
- `total_price` (integer): Total price
- `shop_customer_address_id` (string): Customer address ID
- `customer` (object): Customer information
  - `fb_id` (string): Customer Facebook ID
  - `id` (string): Customer ID
  - `name` (string): Customer name
  - `page_id` (string): Page ID
- `total_quantity` (integer): Total quantity
- `time_assign_marketer` (string (date-time)): Time assign marketer
- `p_utm_source` (string): UTM Source
- `p_utm_medium` (string): UTM Medium
- `p_utm_campaign` (string): UTM Campaign
- `p_utm_term` (string): UTM Term
- `p_utm_content` (string): UTM Content
- `p_utm_id` (string): UTM ID
- `utm_affiliate` (string): Affiliate
- `link` (string): Link
- `status_history` (object[]): Status update history
  - `avatar_url` (string): Avatar URL
  - `editor` (object): Editor information
  - `editor_fb` (string): Editor Facebook ID
  - `editor_id` (string): Editor ID
  - `name` (string): Name
  - `old_status` (integer): Old status
  - `status` (integer): Status
  - `updated_at` (string (date-time)): Updated at
- `duplicated_phone` (boolean): Duplicated phone
- `order_currency` (string): Order currency
- `charged_by_vnpay` (integer): Charged by VNPay
- `charged_by_qrpay` (integer): Charged by QRPay
- `custom_id` (string): Custom ID
- `last_editor` (object): Last editor information
  - `id` (string): Editor ID
  - `fb_id` (string): Facebook ID of editor
  - `name` (string): Editor name
  - `email` (string): Editor email
  - `avatar_url` (string): Editor avatar URL
  - `phone_number` (string): Editor phone number
- `last_editor_id` (string): Last editor ID
- `charged_by_momo` (integer): Charged by MoMo
- `prepaid_by_point` (object): Prepaid by point
  - `money` (integer): Money amount
  - `point` (integer): Point amount
- `bank_transfer_images` (string (uri)[]): Bank transfer images
- `transfer_money` (integer): Transfer money
- `lock_order_by_user` (string): Lock order by user ID
- `assigning_care` (object): Assigning care information
  - `id` (string): Care ID
  - `fb_id` (string): Facebook ID of care
  - `name` (string): Care name
  - `email` (string): Care email
  - `avatar_url` (string): Care avatar URL
  - `phone_number` (string): Care phone number
- `assigning_care_id` (string): Assigning care ID
- `time_assign_care` (string (date-time)): Time assign care
- `assigning_seller` (object): Assigning seller information
  - `id` (string): Seller ID
  - `fb_id` (string): Facebook ID of seller
  - `name` (string): Seller name
  - `email` (string): Seller email
  - `avatar_url` (string): Seller avatar URL
  - `phone_number` (string): Seller phone number
- `einvoices` (EInvoice[]): 
  - `actual_shipping_fee` (integer): Shipping fee
  - `adjust_amount` (integer): Percentage reduction on revenue
  - `adjustment_criteria` (integer): Adjustment criteria Values: `1` Quantity adjustment, `2` Price adjustment, `3` Tax rate adjustment, `4` Tax amount adjustment.
  - `adjustment_type` (integer): Adjustment type Values: `1` Increase adjustment, `2` Decrease adjustment, `3` Information.
  - `allocation_discounts` (object[]): Allocation discounts
  - `allocation_type` (integer): Allocation type Values: `1` By unit price, `2` custom.
  - `bank_account_number` (string): Bank account number
  - `bank_name` (string): Bank name
  - `budget_unit_code` (string): Budget unit code
  - `buyer_not_get_invoice` (boolean): Buyer not get invoice
  - `creator` (object): Creator information
  - `discount` (integer): General discount amount
  - `display_id` (integer): Display ID
  - `einvoice_account_id` (integer): E-invoice account ID
  - `email` (string): Email address
  - `full_name` (string): Buyer's name
  - `id` (integer): Invoice ID
  - `identity_code` (string): Buyer's identity code
  - `included_tax` (integer): Included tax
  - `invoice_no` (string): Invoice number
  - `invoice_series` (string): Invoice series
  - `invoice_type` (integer): Invoice type
  - `is_adjust_amount` (boolean): Is adjust amount
  - `is_included_tax` (boolean): Is included tax
  - `items` (object[]): Invoice items
  - `key_search` (string): Key search
  - `last_editor_id` (string): Last editor ID
  - `note` (string): Note
  - `order_id` (integer): Order ID
  - `order_info` (object): Order information
  - `original_einvoice` (object): Original e-invoice ID
  - `payment_method` (string): Payment method
  - `phone_number` (string): Phone number
  - `purchaser_tax_code` (string): Purchaser tax code
  - `purchaser_unit` (string): Purchaser unit
  - `release_date` (string (date-time)): Release date
  - `release_type` (integer): Release type
  - `shipping_address` (ShippingAddress): 
  - `shipping_fee` (integer): Shipping fee
  - `shop_id` (integer): Shop ID
  - `signature_type` (integer): Signature type
  - `status` (integer): Status Values: `0` Not released, `1` Pending release, `2` Released, `3` Canceled, `4` Replacement invoice, `5` Replaced invoice, `6` Adjustment invoice, `7` Adjusted.
  - `tax` (integer): Tax rate
  - `template_code` (string): Template code
  - `total_amount` (integer): Total amount
  - `verification_code` (string): Tax Authority Code
  - `voucher_book` (object): Voucher book
- `charged_by_card` (integer): Charged by card
- `estimate_delivery_date` (string (date-time)): Estimate delivery date
- `order_sources` (string): Order sources ID
- `charged_by_fundiin` (integer): Charged by Fundiin
- `surcharge` (integer): Surcharge
- `is_linked_partner` (boolean): Is linked partner
- `call_laters` (object[]): Call laters
- `last_update_status_at` (string (date-time)): Last update status at
- `discount_by_customer_level` (integer): Discount by customer level
- `viewing` (object[]): Viewing
- `additional_info` (object): Additional info
  - `service_partner` (string): Service partner Values: `instant` Instant.
  - `delivery_deadline` (string (date-time)): Delivery deadline (ISO8601, no timezone).
  - `ship_by_date` (integer): Marketplace ship-by deadline (Unix timestamp, seconds) for Shopee/TikTok orders — the order must be handed over to the carrier before this time, otherwise the marketplace may cancel it automatically. Shopee `ship_by_date`, TikTok `collection_due_time`. `0` = the marketplace has not returned it yet; `null` for non-marketplace orders.
- `order_returned_ids` (string): Order returned IDs
- `cost_surcharge` (integer): Cost surcharge
- `time_send_partner` (string (date-time)): Time send partner
- `charged_by_kredivo` (integer): Charged by Kredivo
- `discount` (integer): Discount
- `histories` (object[]): Histories
- `duplicated_customer` (boolean): Duplicated customer
- `customer_referral_code` (object): Customer referral code
  - `active` (string): Active status
  - `customer_id` (string (uuid)): Customer ID
  - `discount` (string): Discount value
  - `format` (string): Referral code format
  - `free_products_priced_between_approx` (object): Free products priced between approximately
  - `is_percent` (string): Discount is percentage
  - `only_customers_with_level_will_have_referral_code` (string): Only customers with level will have referral code
  - `referral_code` (string): Referral code
  - `reward_points_for_old_customers` (object): Reward points for customers
  - `shop_customer_id` (string (uuid)): Shop customer ID
- `tax` (integer): Tax
- `is_from_ecommerce` (boolean): Is from e-commerce
- `note_image` (string (uri)[]): Note images
- `shopify_draft_order_id` (string): Shopify draft order ID
- `display_id` (integer): Display ID
- `shop_partner_id` (integer): Shop partner ID
- `is_locked` (boolean): Order lock
- `merge_order` (boolean): Allows merging orders

```json
{
  "is_abandoned_order": true,
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "conversation_id": "117967746266487_9306266852780716",
  "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,
  "merge_order": false,
  "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",
  "activated_promotion_advances": [
    {
      "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121",
      "is_activated": true
    }
  ],
  "invoice_info_list": [
    {
      "invoice_type": "personal",
      "is_requested": true,
      "invoice_detail": {
        "name": "Hoang Anh",
        "phone_number": "0934283743",
        "identity_code": "029374382740",
        "tax_id": "",
        "email": ""
      }
    }
  ],
  "status": 0,
  "cash": 0
}
```

### Responses

- `200` Success (object)

```json
{
  "id": 1418,
  "system_id": 1,
  "shop_id": 4,
  "inserted_at": "2020-05-12T04:51:42",
  "updated_at": "2020-05-12T04:51:54",
  "status": 0,
  "status_name": "new",
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "bill_email": "customer@example.com",
  "page_id": "256469571178082",
  "post_id": "185187094667903_477083092110915",
  "ad_id": "23851252560290199",
  "shipping_fee": 0,
  "cod": 0,
  "cash": 0,
  "account": 1,
  "total_discount": 0,
  "note": "",
  "note_print": null,
  "received_at_shop": false,
  "is_free_shipping": false,
  "is_locked": false,
  "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "creator": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "avatar_url": null
  },
  "items": [],
  "partner": {
    "partner_id": 1,
    "cod": 0,
    "extend_code": "S58824.MB25.C3.500020713",
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16"
  },
  "shipping_address": {
    "full_name": "Hoang Anh",
    "phone_number": "0999999999",
    "address": "90 Cầu Giấy",
    "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
    "province_id": "101",
    "district_id": "10113",
    "commune_id": "1011309"
  }
}
```

## Get order information

`GET /shops/{SHOP_ID}/orders/{ORDER_ID}`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `ORDER_ID` | path | string | yes | Order ID |

### Responses

- `200` Success (object)

```json
{
  "id": 1,
  "system_id": 1,
  "shop_id": 1,
  "inserted_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "status": 1,
  "status_name": "Đã xác nhận",
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "bill_email": "hoang@example.com",
  "page_id": "104438181227821",
  "post_id": "185187094667903_477083092110915",
  "ad_id": "23851252560290199",
  "shipping_fee": 1,
  "partner_fee": 1,
  "fee_marketplace": 1,
  "customer_pay_fee": true,
  "is_free_shipping": true,
  "is_livestream": true,
  "is_live_shopping": true,
  "is_smc": true,
  "received_at_shop": true,
  "total_discount": 1,
  "note": "",
  "note_print": null,
  "returned_reason": 1,
  "returned_reason_name": "Do khách hàng",
  "sub_status": 1,
  "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
  "warehouse_info": {
    "name": "kho test ecod",
    "phone_number": "0999999999",
    "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
    "address": "hâhhha",
    "province_id": "717",
    "district_id": "71705",
    "commune_id": "7170510",
    "affiliate_id": null,
    "ffm_id": null,
    "has_snappy_service": true,
    "custom_id": null
  },
  "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "creator": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "avatar_url": null
  },
  "items": [
    {
      "id": 1,
      "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
      "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
      "quantity": 1,
      "returned_count": 1,
      "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
      "quantity_by_combo_products": [],
      "discount_each_product": 1,
      "is_bonus_product": true,
      "is_discount_percent": true,
      "is_wholesale": true,
      "is_composite": true,
      "one_time_product": true,
      "note": "",
      "note_product": "",
      "inserted_at": "2024-01-01T00:00:00Z",
      "measure_group_id": 1,
      "variation_info": {
        "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "name": "Ao so mi nam",
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "retail_price": 140000,
        "detail": "",
        "images": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "fields": [
          {
            "id": "field-id-1",
            "name": "Màu",
            "value": "Trắng",
            "keyValue": "Màu"
          }
        ],
        "barcode": "BARCODE123",
        "brand_id": null,
        "category_ids": [
          1290021044
        ],
        "display_id": "13109",
        "product_display_id": "a131092025",
        "is_upsale_product": true,
        "last_imported_price": 30000,
        "weight": 0,
        "measure_info": {
          "measure_id": 1,
          "exchange_value": 1
        },
        "avg_price": 30000
      },
      "components": [
        {
          "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "quantity": 1,
          "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
        }
      ]
    }
  ],
  "partner": {
    "partner_id": 1,
    "cod": 0,
    "extend_code": "S58824.MB25.C3.500020713",
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16",
    "delivery_name": null,
    "delivery_tel": null,
    "picked_up_at": null,
    "sort_code": null,
    "paid_at": null,
    "system_created": true,
    "partner_status": "request_received",
    "partner_name": "Shopee Xpress",
    "first_delivery_at": null,
    "first_undeliverable_at": "2025-06-30T06:41:44",
    "count_of_delivery": 1,
    "order_number_vtp": null,
    "printed_form": null,
    "extend_update": [
      {
        "key": "status",
        "status": "delivered",
        "tracking_id": "S58824.MB25.C3.500020713",
        "note": "",
        "update_at": "2020-05-12T05:18:16"
      }
    ]
  },
  "shipping_address": {
    "full_name": "Hoang Anh",
    "phone_number": "0999999999",
    "address": "90 Cầu Giấy",
    "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
    "province_id": "101",
    "district_id": "10113",
    "commune_id": "1011309",
    "commnue_name": "Phường Dịch Vọng",
    "district_name": "Quận Cầu Giấy",
    "province_name": "Hà Nội",
    "country_code": "84",
    "post_code": null
  },
  "payment_purchase_histories": [
    {
      "amount": 1800000,
      "type": "cash",
      "inserted_at": "2024-01-01T00:00:00Z",
      "result_code": "00",
      "ipn_reply": true,
      "voucher_amount": 0,
      "tags": [
        "payment"
      ]
    }
  ],
  "tags": [
    {
      "id": 75,
      "name": "thẻ 4"
    }
  ],
  "marketer": {
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Marketer Name",
    "email": "marketer@example.com",
    "phone_number": "0999999999",
    "fb_id": "2042723249341651",
    "avatar_url": null
  },
  "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "activated_combo_products": {
    "combo_product_id": 1,
    "quantity_combo_activated": 1
  },
  "activated_promotion_advances": [
    {
      "id": 1,
      "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
    }
  ],
  "tracking_link": "https://tracking.example.com",
  "payment_link": "https://payment.example.com",
  "ads_source": null,
  "shopify_order_id": null,
  "shopify_abandon_checkout_id": 1,
  "is_abandoned_order": true,
  "cod": 0,
  "cash": 0,
  "account": 1,
  "account_name": "facebook321",
  "advanced_platform_fee": {
    "ads_top_up": 1,
    "affiliate_commission": 1,
    "diff_shipping_fee": 1,
    "marketplace_voucher": 1,
    "payment_fee": 1,
    "platform_commission": 1,
    "seller_transaction_fee": 1,
    "service_fee": 1,
    "sfp_service_fee": 1
  },
  "printing_count": 1,
  "marketplace_id": "-3",
  "money_to_collect": 1,
  "total_price": 1,
  "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
  "customer": {
    "fb_id": null,
    "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
    "name": "Trần Văn Hoàng",
    "page_id": "104438181227821"
  },
  "total_quantity": 1,
  "time_assign_marketer": "2024-01-01T00:00:00Z",
  "status_history": [
    {
      "avatar_url": null,
      "editor_fb": "2042723249341651",
      "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "name": "Hoang Anh",
      "old_status": 0,
      "status": 1,
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "duplicated_phone": true,
  "order_currency": "VND",
  "charged_by_vnpay": 1,
  "charged_by_qrpay": 1,
  "custom_id": null,
  "last_editor": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "email": "hoang@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "charged_by_momo": 1,
  "bank_transfer_images": [
    "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
  ],
  "transfer_money": 1,
  "transfer_proofs": [
    {
      "id": 1,
      "order_id": 1,
      "shop_id": 1,
      "payment_id": "64e130e4-012a-45b1-bd88-51811f23ead8",
      "amount": 1,
      "images": [
        "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
      ],
      "note": null,
      "is_income": true,
      "is_verify": true,
      "verify_at": "2024-01-01T00:00:00Z",
      "verifier": {
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "fb_id": "2042723249341651",
        "name": "Hoang Anh",
        "avatar_url": null
      },
      "creator": {
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "fb_id": "2042723249341651",
        "name": "Hoang Anh",
        "avatar_url": null
      },
      "last_editor": {
        "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "fb_id": "2042723249341651",
        "name": "Hoang Anh",
        "avatar_url": null
      },
      "order_info": null,
      "inserted_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "lock_order_by_user": null,
  "assigning_care": {
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "fb_id": "2042723249341651",
    "name": "Care Name",
    "email": "care@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "time_assign_care": "2024-01-01T00:00:00Z",
  "assigning_seller": {
    "id": "340644fc-314d-450e-a45f-33343678cab6",
    "fb_id": "2042723249341651",
    "name": "Seller Name",
    "email": "seller@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "einvoices": [],
  "charged_by_card": 1,
  "estimate_delivery_date": "2024-01-01T00:00:00Z",
  "order_sources": "-1",
  "charged_by_fundiin": 1,
  "surcharge": 1,
  "is_linked_partner": true,
  "call_laters": [],
  "last_update_status_at": "2024-01-01T00:00:00Z",
  "discount_by_customer_level": 1,
  "viewing": [],
  "order_returned_ids": null,
  "cost_surcharge": 1,
  "time_send_partner": "2024-01-01T00:00:00Z",
  "charged_by_kredivo": 1,
  "discount": 1,
  "histories": [],
  "duplicated_customer": true,
  "tax": 1,
  "is_from_ecommerce": true,
  "note_image": [
    "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
  ],
  "shopify_draft_order_id": null,
  "display_id": 1,
  "shop_partner_id": 1,
  "is_locked": true,
  "additional_info": {
    "service_partner": "instant"
  },
  "invoice_info_list": [
    {
      "error": "",
      "invoice_detail": {
        "company_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
        "company_address_breakdown": {
          "company_additional_info": "",
          "company_barangay": "",
          "company_city": "",
          "company_detailed_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
          "company_district": "Phường Nam Định",
          "company_full_address": "85 lê quý đôn, phường nam định, tỉnh Ninh Bình",
          "company_postcode": "",
          "company_province": "",
          "company_region": "VietNam",
          "company_state": "Ninh Bình",
          "company_town": "Phường Nam Định",
          "company_email": "acb@gmail.com",
          "company_name": "Công ty cổ phần tư vấn xây dựng điện Hoàng Phát",
          "company_tax_id": "0601043840"
        }
      },
      "invoice_type": "company",
      "is_requested": true,
      "order_sn": "251121BVGU6RVE"
    }
  ],
  "reports_by_phone": {
    "+639175706297": {
      "order_fail": 29,
      "order_success": 20,
      "warning": 0
    }
  },
  "p_utm_source": "fb",
  "p_utm_medium": "paid",
  "p_utm_campaign": "120236828168640593",
  "p_utm_term": "120236828168790593",
  "p_utm_content": "120236828168960593",
  "link": "https://www.myfahathai.com/doc?fbclid=IwZXh0bgNhZW0BMABhZGlkAasqwhnoX"
}
```

## Update order

`PUT /shops/{SHOP_ID}/orders/{ORDER_ID}`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `ORDER_ID` | path | string | yes | Order ID |

### Request body

Order information to update

- `id` (integer): Order ID
- `system_id` (integer): System ID
- `shop_id` (integer): Shop ID
- `inserted_at` (string (date-time)): Order creation time
- `updated_at` (string (date-time)): Order update time
- `status` (integer): Order status Values: `0` New, `17` Waiting for confirmation, `11` Restocking, `12` Wait for printing, `13` Printed, `20` Purchased, `1` Confirmed, `8` Packaging, `9` Waiting for pick up, `2` Shipped, `3` Received, `16` Collected money, `4` Returning, `15` Partial return, `5` Returned, `6` Canceled, `7` Deleted recently.
- `status_name` (string): Order status name
- `bill_full_name` (string): Customer name
- `bill_phone_number` (string): Phone number of customer
- `bill_email` (string): Customer email
- `conversation_id` (string): Conversation ID
- `page_id` (string): Facebook page ID
- `post_id` (string): Post ID
- `ad_id` (string): Ad ID
- `shipping_fee` (integer): Shipping fee
- `partner_fee` (integer): Fee from shipping partner
- `fee_marketplace` (integer): Fees from e-commerce platforms
- `customer_pay_fee` (boolean): Customer pay shipping fee
- `is_free_shipping` (boolean): Free shipping
- `is_livestream` (boolean): Is livestream order
- `is_live_shopping` (boolean): Is live shopping order
- `is_smc` (boolean): Shopping on Messenger
- `received_at_shop` (boolean): true: Sales at counter, false: Sell online
- `total_discount` (integer): Discount total
- `note` (string): Internal note
- `note_print` (string): Note for printing
- `returned_reason` (integer): Return reason code (1: Customer, 2: Staff, 3: Defective product, 4: Shipping carrier, 5: Exchange). Other values are shop-defined custom reasons, see returned_reason_name for the display name
- `returned_reason_name` (string): Return reason name
- `sub_status` (integer): Reason for delivery delay
- `warehouse_id` (string): Warehouse ID
- `warehouse_info` (object): Warehouse information
  - `name` (string): Warehouse name
  - `phone_number` (string): Warehouse phone number
  - `full_address` (string): Warehouse full address
  - `address` (string): Warehouse address
  - `province_id` (string): Province ID
  - `district_id` (string): District ID
  - `commune_id` (string): Commune ID
  - `affiliate_id` (string): Affiliate ID
  - `ffm_id` (string): FFM ID
  - `has_snappy_service` (boolean): Has Snappy service
  - `custom_id` (string): Custom ID
- `creator_id` (string): Creator ID
- `creator` (object): Order creator
  - `id` (string): Creator ID
  - `fb_id` (string): Facebook ID of creator
  - `name` (string): Creator name
  - `avatar_url` (string): Creator avatar URL
- `items` (object[]): Product list
  - `product_id` (string): Product ID
  - `quantity` (integer, required): Quantity
  - `returned_count` (integer): Returned count
  - `assigning_seller_id` (string): Assigning seller ID
  - `quantity_by_combo_products` (object[]): Quantity by combo products
  - `discount_each_product` (integer): Discount for each product
  - `is_bonus_product` (boolean): Is bonus product
  - `is_discount_percent` (boolean): Is discount by percent
  - `is_wholesale` (boolean): Is wholesale
  - `is_composite` (boolean): Is composite product
  - `one_time_product` (boolean): One time product
  - `note` (string): Product note
  - `note_product` (string): Product note
  - `inserted_at` (string (date-time)): Inserted at
  - `measure_group_id` (integer): Measure group ID
  - `variation_info` (object): Variation information. Optional when creating/updating an order (the backend defaults it to an empty object if omitted). Its inner fields are not individually required, but sending `retail_price` is recommended so the line price is correct.
  - `components` (object[]): Product components
  - `variation_id` (string, required): Variation ID
- `partner` (object): Partner information When updating an order that already has shipping info, only the fields you send are written; omitted fields keep their current values. Send `null` to clear `partner_id`, `extend_code` or `shop_partner_id`.
  - `partner_id` (integer): Partner ID
  - `cod` (integer): Reconciliation COD
  - `extend_code` (string): Shipping order ID on partner system
  - `total_fee` (integer): Total fee
  - `updated_at` (string (date-time)): Updated at
  - `delivery_name` (string): Shipper name
  - `delivery_tel` (string): Delivery phone
  - `picked_up_at` (string (date-time)): Picked up at
  - `sort_code` (string): Sort code
  - `paid_at` (string (date-time)): Paid at
  - `system_created` (boolean): System created
  - `extend_update` (object[]): Update from courier
  - `partner_status` (string): Partner shipping status Values: `waiting` Waiting for processing, `request_received` Carrier received the request, `processing_picked_up` Processing pickup, `picking_up` Picking up, `delay_pickup` Delayed pickup, `picked_up` Picked up, `waiting_on_the_way` Waiting for transit, `on_the_way` In transit, `contact_delivery_company` Contact the carrier, `out_for_delivery` Out for delivery, `delay_delivery` Delayed delivery, `inform_recipient` Notify the recipient, `undeliverable` Undeliverable, `waiting_for_return` Waiting for return, `delivered` Delivered, `delivered_cod` Delivered, COD reconciled, `returning` Returning, `returned` Returned, `returned_cod` Returned, COD reconciled, `canceled` Canceled.
  - `partner_name` (string): Partner name
  - `first_delivery_at` (string (date-time)): First delivery time
  - `first_undeliverable_at` (string (date-time)): First failed delivery time
  - `count_of_delivery` (integer): Number of delivery attempts. Courier updates add 1 each time the shipment moves to `out_for_delivery` or `delay_delivery`. Can be set when creating or updating an order (integer 0-32767); omitted or invalid values keep the current value, and later courier updates keep counting from the value you set.
  - `order_number_vtp` (string): Viettel Post tracking number
  - `printed_form` (object): Printed form
- `shipping_address` (ShippingAddress): 
  - `address` (string): Street address. When creating an order via API, if `address` is provided but `province_id` is left empty, the system automatically parses this free-text address to fill in `province_id`, `district_id` and `commune_id`. Auto-fill is skipped when the parsed location is in Thailand (country code 66) or when no commune can be resolved from the text.
  - `commnue_name` (string): Commune name
  - `commune_id` (string): Commune ID
  - `country_code` (string): Country code
  - `district_id` (string): District ID
  - `district_name` (string): District name
  - `full_address` (string): Full address
  - `full_name` (string): Full name
  - `new_full_address` (string): New full address
  - `new_province_id` (string): New province ID
  - `phone_number` (string): Phone number
  - `post_code` (string): Post code
  - `province_id` (string): Province ID
  - `province_name` (string): Province name
  - `render_type` (string): Render type
- `payment_purchase_histories` (object[]): Payment histories
  - `amount` (integer): Amount of money
  - `type` (string): Payment type
  - `inserted_at` (string (date-time)): Transaction time
  - `result_code` (string): Result code
  - `ipn_reply` (boolean): IPN reply
  - `voucher_amount` (integer): Voucher amount
  - `tags` (string[]): Tags
- `tags` (object[]): Tags list
  - `id` (integer): Tag ID
  - `name` (string): Tag name
- `marketer` (object): Marketer information
  - `id` (string): Marketer ID
  - `name` (string): Marketer name
  - `email` (string): Marketer email
  - `phone_number` (string): Marketer phone number
  - `fb_id` (string): Marketer Facebook ID
  - `avatar_url` (string): Marketer avatar URL
- `pke_mkter` (string): Marketer ID
- `activated_combo_products` (object): Activated combo products information
  - `combo_product_id` (integer): Combo product ID
  - `quantity_combo_activated` (integer): Quantity combo activated
  - `combo_product_info` (object): Combo product information
- `activated_promotion_advances` (object[]): Activated promotion advances information
  - `id` (integer): ID
  - `promotion_advance_id` (string): Promotion advance ID
  - `promotion_advance_info` (object): Promotion advance information
- `invoice_info_list` (object[]): Invoice information list
  - `error` (string): Error message if any
  - `invoice_detail` (object): Invoice detail information. The fields to send depend on `invoice_type`: - `company`: use `company_name`, `company_tax_id`, `company_address`, `company_email` (and optionally `company_address_breakdown`). - `personal`: use `name`, `phone_number`, `identity_code`, `tax_id`, `email`.
  - `invoice_type` (string): Invoice type: `company` for an organization, `personal` for an individual. Determines which `invoice_detail` fields are used. Values: `company`, `personal`.
  - `is_requested` (boolean): Customer requests an e-invoice for this order. Set `true` together with `invoice_type` and `invoice_detail` to request invoice issuance.
  - `order_sn` (string): Order code on the marketplace
- `reports_by_phone` (object): Reports by phone number
  - `order_fail` (integer): Number of failed orders
  - `order_success` (integer): Number of successful orders
  - `warning` (integer): Number of warnings orders
- `tracking_link` (string): Link confirm order
- `payment_link` (string): Payment link
- `ads_source` (string): Advertising source
- `bank_payments` (object): Payment method
- `transfer_proofs` (object[]): Bank transfer payment proofs, including verification time, amount and receipt images
  - `id` (integer): Transfer proof ID
  - `order_id` (integer): Order ID
  - `shop_id` (integer): Shop ID
  - `payment_id` (string): Bank payment method ID (matches a key in `bank_payments`)
  - `amount` (integer): Transferred amount
  - `images` (string[]): Transfer receipt images
  - `note` (string): Note
  - `is_income` (boolean): Money received (true) or paid out (false)
  - `is_verify` (boolean): Whether the transfer has been verified
  - `verify_at` (string (date-time)): Verification time
  - `verifier` (object): Verifier information
  - `creator` (object): Creator information
  - `last_editor` (object): Last editor information
  - `order_info` (object): Additional order information
  - `inserted_at` (string (date-time)): Transfer proof creation time
  - `updated_at` (string (date-time)): Transfer proof update time
- `shopify_order_id` (string): Shopify order ID
- `shopify_abandon_checkout_id` (integer): Shopify abandon checkout ID
- `is_abandoned_order` (boolean): Abandoned-cart flag for creating or updating an order. Send it directly in the request body, not inside `third_party` or `third_party_infomation`. An explicit value, including `false`, takes precedence over automatic detection. If omitted on creation, the flag is determined automatically; if omitted on update, the current value is preserved. Only boolean `true` or string `"true"` is normalized to `true`; all other submitted values become `false`.
- `cod` (integer): Cash on delivery
- `cash` (integer): Cash payment
- `account` (integer): Order source ID
- `account_name` (string): Order source name
- `advanced_platform_fee` (object): Fees from e-commerce platforms
  - `ads_top_up` (integer): Ads wallet top-up
  - `affiliate_commission` (integer): Affiliate commission
  - `diff_shipping_fee` (integer): Difference shipping fee
  - `marketplace_voucher` (integer): Marketplace voucher
  - `payment_fee` (integer): Payment fee
  - `platform_commission` (integer): Platform commission
  - `seller_transaction_fee` (integer): Seller transaction fee
  - `service_fee` (integer): Service fee
  - `sfp_service_fee` (integer): SFP service fee
- `printing_count` (integer): Printing count
- `money_to_collect` (integer): Money to collect
- `marketplace_id` (string): Marketplace ID Values: `-2`, `-3`, `-4`, `-9`, `-16`, `-17`, `-20`, `-25`, `-27`, `-28`.
- `total_price` (integer): Total price
- `shop_customer_address_id` (string): Customer address ID
- `customer` (object): Customer information
  - `fb_id` (string): Customer Facebook ID
  - `id` (string): Customer ID
  - `name` (string): Customer name
  - `page_id` (string): Page ID
- `total_quantity` (integer): Total quantity
- `time_assign_marketer` (string (date-time)): Time assign marketer
- `p_utm_source` (string): UTM Source
- `p_utm_medium` (string): UTM Medium
- `p_utm_campaign` (string): UTM Campaign
- `p_utm_term` (string): UTM Term
- `p_utm_content` (string): UTM Content
- `p_utm_id` (string): UTM ID
- `utm_affiliate` (string): Affiliate
- `link` (string): Link
- `status_history` (object[]): Status update history
  - `avatar_url` (string): Avatar URL
  - `editor` (object): Editor information
  - `editor_fb` (string): Editor Facebook ID
  - `editor_id` (string): Editor ID
  - `name` (string): Name
  - `old_status` (integer): Old status
  - `status` (integer): Status
  - `updated_at` (string (date-time)): Updated at
- `duplicated_phone` (boolean): Duplicated phone
- `order_currency` (string): Order currency
- `charged_by_vnpay` (integer): Charged by VNPay
- `charged_by_qrpay` (integer): Charged by QRPay
- `custom_id` (string): Custom ID
- `last_editor` (object): Last editor information
  - `id` (string): Editor ID
  - `fb_id` (string): Facebook ID of editor
  - `name` (string): Editor name
  - `email` (string): Editor email
  - `avatar_url` (string): Editor avatar URL
  - `phone_number` (string): Editor phone number
- `last_editor_id` (string): Last editor ID
- `charged_by_momo` (integer): Charged by MoMo
- `prepaid_by_point` (object): Prepaid by point
  - `money` (integer): Money amount
  - `point` (integer): Point amount
- `bank_transfer_images` (string (uri)[]): Bank transfer images
- `transfer_money` (integer): Transfer money
- `lock_order_by_user` (string): Lock order by user ID
- `assigning_care` (object): Assigning care information
  - `id` (string): Care ID
  - `fb_id` (string): Facebook ID of care
  - `name` (string): Care name
  - `email` (string): Care email
  - `avatar_url` (string): Care avatar URL
  - `phone_number` (string): Care phone number
- `assigning_care_id` (string): Assigning care ID
- `time_assign_care` (string (date-time)): Time assign care
- `assigning_seller` (object): Assigning seller information
  - `id` (string): Seller ID
  - `fb_id` (string): Facebook ID of seller
  - `name` (string): Seller name
  - `email` (string): Seller email
  - `avatar_url` (string): Seller avatar URL
  - `phone_number` (string): Seller phone number
- `einvoices` (EInvoice[]): 
  - `actual_shipping_fee` (integer): Shipping fee
  - `adjust_amount` (integer): Percentage reduction on revenue
  - `adjustment_criteria` (integer): Adjustment criteria Values: `1` Quantity adjustment, `2` Price adjustment, `3` Tax rate adjustment, `4` Tax amount adjustment.
  - `adjustment_type` (integer): Adjustment type Values: `1` Increase adjustment, `2` Decrease adjustment, `3` Information.
  - `allocation_discounts` (object[]): Allocation discounts
  - `allocation_type` (integer): Allocation type Values: `1` By unit price, `2` custom.
  - `bank_account_number` (string): Bank account number
  - `bank_name` (string): Bank name
  - `budget_unit_code` (string): Budget unit code
  - `buyer_not_get_invoice` (boolean): Buyer not get invoice
  - `creator` (object): Creator information
  - `discount` (integer): General discount amount
  - `display_id` (integer): Display ID
  - `einvoice_account_id` (integer): E-invoice account ID
  - `email` (string): Email address
  - `full_name` (string): Buyer's name
  - `id` (integer): Invoice ID
  - `identity_code` (string): Buyer's identity code
  - `included_tax` (integer): Included tax
  - `invoice_no` (string): Invoice number
  - `invoice_series` (string): Invoice series
  - `invoice_type` (integer): Invoice type
  - `is_adjust_amount` (boolean): Is adjust amount
  - `is_included_tax` (boolean): Is included tax
  - `items` (object[]): Invoice items
  - `key_search` (string): Key search
  - `last_editor_id` (string): Last editor ID
  - `note` (string): Note
  - `order_id` (integer): Order ID
  - `order_info` (object): Order information
  - `original_einvoice` (object): Original e-invoice ID
  - `payment_method` (string): Payment method
  - `phone_number` (string): Phone number
  - `purchaser_tax_code` (string): Purchaser tax code
  - `purchaser_unit` (string): Purchaser unit
  - `release_date` (string (date-time)): Release date
  - `release_type` (integer): Release type
  - `shipping_address` (ShippingAddress): 
  - `shipping_fee` (integer): Shipping fee
  - `shop_id` (integer): Shop ID
  - `signature_type` (integer): Signature type
  - `status` (integer): Status Values: `0` Not released, `1` Pending release, `2` Released, `3` Canceled, `4` Replacement invoice, `5` Replaced invoice, `6` Adjustment invoice, `7` Adjusted.
  - `tax` (integer): Tax rate
  - `template_code` (string): Template code
  - `total_amount` (integer): Total amount
  - `verification_code` (string): Tax Authority Code
  - `voucher_book` (object): Voucher book
- `charged_by_card` (integer): Charged by card
- `estimate_delivery_date` (string (date-time)): Estimate delivery date
- `order_sources` (string): Order sources ID
- `charged_by_fundiin` (integer): Charged by Fundiin
- `surcharge` (integer): Surcharge
- `is_linked_partner` (boolean): Is linked partner
- `call_laters` (object[]): Call laters
- `last_update_status_at` (string (date-time)): Last update status at
- `discount_by_customer_level` (integer): Discount by customer level
- `viewing` (object[]): Viewing
- `additional_info` (object): Additional info
  - `service_partner` (string): Service partner Values: `instant` Instant.
  - `delivery_deadline` (string (date-time)): Delivery deadline (ISO8601, no timezone).
  - `ship_by_date` (integer): Marketplace ship-by deadline (Unix timestamp, seconds) for Shopee/TikTok orders — the order must be handed over to the carrier before this time, otherwise the marketplace may cancel it automatically. Shopee `ship_by_date`, TikTok `collection_due_time`. `0` = the marketplace has not returned it yet; `null` for non-marketplace orders.
- `order_returned_ids` (string): Order returned IDs
- `cost_surcharge` (integer): Cost surcharge
- `time_send_partner` (string (date-time)): Time send partner
- `charged_by_kredivo` (integer): Charged by Kredivo
- `discount` (integer): Discount
- `histories` (object[]): Histories
- `duplicated_customer` (boolean): Duplicated customer
- `customer_referral_code` (object): Customer referral code
  - `active` (string): Active status
  - `customer_id` (string (uuid)): Customer ID
  - `discount` (string): Discount value
  - `format` (string): Referral code format
  - `free_products_priced_between_approx` (object): Free products priced between approximately
  - `is_percent` (string): Discount is percentage
  - `only_customers_with_level_will_have_referral_code` (string): Only customers with level will have referral code
  - `referral_code` (string): Referral code
  - `reward_points_for_old_customers` (object): Reward points for customers
  - `shop_customer_id` (string (uuid)): Shop customer ID
- `tax` (integer): Tax
- `is_from_ecommerce` (boolean): Is from e-commerce
- `note_image` (string (uri)[]): Note images
- `shopify_draft_order_id` (string): Shopify draft order ID
- `display_id` (integer): Display ID
- `shop_partner_id` (integer): Shop partner ID
- `is_locked` (boolean): Order lock
- `merge_order` (boolean): Allows merging orders

```json
{
  "is_abandoned_order": true,
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "partner": {
    "partner_id": 1,
    "extend_code": "S58824.MB25.C3.500020713",
    "count_of_delivery": 2
  },
  "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,
        "is_upsale_product": true,
        "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",
  "activated_promotion_advances": [
    {
      "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121",
      "is_activated": true
    }
  ],
  "invoice_info_list": [
    {
      "invoice_type": "personal",
      "is_requested": true,
      "invoice_detail": {
        "name": "Hoang Anh",
        "phone_number": "0934283743",
        "identity_code": "029374382740",
        "tax_id": "",
        "email": ""
      }
    }
  ],
  "status": 0,
  "cash": 0
}
```

### Responses

- `200` Success (object)

```json
{
  "id": 1,
  "system_id": 1,
  "shop_id": 1,
  "inserted_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "status": 1,
  "status_name": "Đã xác nhận",
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "bill_email": "hoang@example.com",
  "page_id": "104438181227821",
  "post_id": "185187094667903_477083092110915",
  "ad_id": "23851252560290199",
  "shipping_fee": 1,
  "partner_fee": 1,
  "fee_marketplace": 1,
  "customer_pay_fee": true,
  "is_free_shipping": true,
  "is_livestream": true,
  "is_live_shopping": true,
  "is_smc": true,
  "received_at_shop": true,
  "total_discount": 1,
  "note": "",
  "note_print": null,
  "returned_reason": 1,
  "returned_reason_name": "Do khách hàng",
  "sub_status": 1,
  "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
  "warehouse_info": {
    "name": "kho test ecod",
    "phone_number": "0999999999",
    "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
    "address": "hâhhha",
    "province_id": "717",
    "district_id": "71705",
    "commune_id": "7170510",
    "affiliate_id": null,
    "ffm_id": null,
    "has_snappy_service": true,
    "custom_id": null
  },
  "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "creator": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "avatar_url": null
  },
  "items": [
    {
      "id": 1,
      "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
      "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
      "quantity": 1,
      "returned_count": 1,
      "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
      "quantity_by_combo_products": [],
      "discount_each_product": 1,
      "is_bonus_product": true,
      "is_discount_percent": true,
      "is_wholesale": true,
      "is_composite": true,
      "one_time_product": true,
      "note": "",
      "note_product": "",
      "inserted_at": "2024-01-01T00:00:00Z",
      "measure_group_id": 1,
      "variation_info": {
        "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "name": "Ao so mi nam",
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "retail_price": 140000,
        "detail": "",
        "images": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "fields": [
          {
            "id": "field-id-1",
            "name": "Màu",
            "value": "Trắng",
            "keyValue": "Màu"
          }
        ],
        "barcode": "BARCODE123",
        "brand_id": null,
        "category_ids": [
          1290021044
        ],
        "display_id": "13109",
        "product_display_id": "a131092025",
        "is_upsale_product": true,
        "last_imported_price": 30000,
        "weight": 0,
        "measure_info": {
          "measure_id": 1,
          "exchange_value": 1
        },
        "avg_price": 30000
      },
      "components": [
        {
          "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "quantity": 1,
          "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
        }
      ]
    }
  ],
  "partner": {
    "partner_id": 1,
    "cod": 0,
    "extend_code": "S58824.MB25.C3.500020713",
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16",
    "delivery_name": null,
    "delivery_tel": null,
    "picked_up_at": null,
    "sort_code": null,
    "paid_at": null,
    "system_created": true,
    "extend_update": [
      {
        "key": "status",
        "status": "delivered",
        "tracking_id": "S58824.MB25.C3.500020713",
        "note": "",
        "update_at": "2020-05-12T05:18:16"
      }
    ]
  },
  "shipping_address": {
    "full_name": "Hoang Anh",
    "phone_number": "0999999999",
    "address": "90 Cầu Giấy",
    "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
    "province_id": "101",
    "district_id": "10113",
    "commune_id": "1011309",
    "commnue_name": "Phường Dịch Vọng",
    "district_name": "Quận Cầu Giấy",
    "province_name": "Hà Nội",
    "country_code": "84",
    "post_code": null
  },
  "payment_purchase_histories": [
    {
      "amount": 1800000,
      "type": "cash",
      "inserted_at": "2024-01-01T00:00:00Z",
      "result_code": "00",
      "ipn_reply": true,
      "voucher_amount": 0,
      "tags": [
        "payment"
      ]
    }
  ],
  "tags": [
    {
      "id": 75,
      "name": "thẻ 4"
    }
  ],
  "marketer": {
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "name": "Marketer Name",
    "email": "marketer@example.com",
    "phone_number": "0999999999",
    "fb_id": "2042723249341651",
    "avatar_url": null
  },
  "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "activated_combo_products": {
    "combo_product_id": 1,
    "quantity_combo_activated": 1
  },
  "activated_promotion_advances": [
    {
      "id": 1,
      "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
    }
  ],
  "tracking_link": "https://tracking.example.com",
  "payment_link": "https://payment.example.com",
  "ads_source": null,
  "shopify_order_id": null,
  "shopify_abandon_checkout_id": 1,
  "is_abandoned_order": true,
  "cod": 0,
  "cash": 0,
  "account": 1,
  "account_name": "facebook321",
  "advanced_platform_fee": {
    "ads_top_up": 1,
    "affiliate_commission": 1,
    "diff_shipping_fee": 1,
    "marketplace_voucher": 1,
    "payment_fee": 1,
    "platform_commission": 1,
    "seller_transaction_fee": 1,
    "service_fee": 1,
    "sfp_service_fee": 1
  },
  "printing_count": 1,
  "money_to_collect": 1,
  "total_price": 1,
  "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
  "customer": {
    "fb_id": null,
    "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
    "name": "Trần Văn Hoàng",
    "page_id": "104438181227821"
  },
  "total_quantity": 1,
  "time_assign_marketer": "2024-01-01T00:00:00Z",
  "status_history": [
    {
      "avatar_url": null,
      "editor_fb": "2042723249341651",
      "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "name": "Hoang Anh",
      "old_status": 0,
      "status": 1,
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "duplicated_phone": true,
  "order_currency": "VND",
  "charged_by_vnpay": 1,
  "charged_by_qrpay": 1,
  "custom_id": null,
  "last_editor": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "email": "hoang@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "charged_by_momo": 1,
  "bank_transfer_images": [
    "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
  ],
  "transfer_money": 1,
  "lock_order_by_user": null,
  "assigning_care": {
    "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "fb_id": "2042723249341651",
    "name": "Care Name",
    "email": "care@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
  "time_assign_care": "2024-01-01T00:00:00Z",
  "assigning_seller": {
    "id": "340644fc-314d-450e-a45f-33343678cab6",
    "fb_id": "2042723249341651",
    "name": "Seller Name",
    "email": "seller@example.com",
    "avatar_url": null,
    "phone_number": "0999999999"
  },
  "einvoices": [],
  "charged_by_card": 1,
  "estimate_delivery_date": "2024-01-01T00:00:00Z",
  "order_sources": "-1",
  "charged_by_fundiin": 1,
  "surcharge": 1,
  "is_linked_partner": true,
  "call_laters": [],
  "last_update_status_at": "2024-01-01T00:00:00Z",
  "discount_by_customer_level": 1,
  "viewing": [],
  "order_returned_ids": null,
  "cost_surcharge": 1,
  "time_send_partner": "2024-01-01T00:00:00Z",
  "charged_by_kredivo": 1,
  "discount": 1,
  "histories": [],
  "duplicated_customer": true,
  "tax": 1,
  "is_from_ecommerce": true,
  "note_image": [
    "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
  ],
  "shopify_draft_order_id": null,
  "display_id": 1,
  "shop_partner_id": 1,
  "is_locked": true
}
```

## Get order conversation messages

`GET /shops/{SHOP_ID}/orders/{ORDER_ID}/messages`

Resolves the conversation associated with the order and returns messages from the entire conversation. Messages in each response are ordered chronologically (oldest to newest).

Pagination follows the Pancake web application semantics:
- Omit `current_count` or set it to `0` to load up to 25 of the newest records, rendered in chronological order.
- To load older records, set `current_count` to the total number of messages already loaded. After the first response use `25`; if the next response contains 30 messages, use `55`, and continue in the same way.
- Calls with a positive `current_count` return up to 30 older messages.

A valid order without an associated conversation returns `{"success":true,"data":[]}`.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `ORDER_ID` | path | string | yes | Order ID |
| `current_count` | query | integer |  | Number of messages already loaded. This is an offset count, not a cursor. |
| `fields[]` | query | string[] |  | Top-level message fields to include in each item. Repeat the query parameter for multiple fields, for example `fields[]=id&fields[]=message`. Omit it to return all fields. |

### Responses

- `200` Conversation messages, an empty data array when the valid order has no conversation, or a legacy authentication error returned with HTTP 200 ()
- `400` The current_count parameter is invalid (ErrorResponse)
- `403` The API key is invalid or disabled, or the authenticated user cannot access order management (ErrorResponse)
- `404` The shop or order does not exist, or the order is not visible to the authenticated API client (ErrorResponse)
- `429` The Open API request rate limit was reached (ErrorResponse)
- `502` The upstream conversation service returned an error (ErrorResponse)
- `504` The upstream conversation service timed out (ErrorResponse)

```json
{
  "success": true,
  "data": [
    {
      "id": "m_hULhobwR0nAa0NzuQaVc3O",
      "type": "INBOX",
      "message": "<div>Xin chào, shop còn size M không?</div>",
      "original_message": "Xin chào, shop còn size M không?",
      "message_tags": [],
      "from": {
        "id": "9306266852780716",
        "name": "Nguyễn Văn A"
      },
      "seen": true,
      "can_like": false,
      "user_likes": false,
      "like_count": null,
      "can_comment": false,
      "comment_count": null,
      "can_remove": false,
      "is_removed": false,
      "is_hidden": false,
      "can_hide": false,
      "can_reply_privately": false,
      "private_reply_conversation": null,
      "attachments": [],
      "has_phone": false,
      "phone_info": [],
      "is_parent": false,
      "inserted_at": "2026-06-25T02:00:38.675576",
      "page_id": "117967746266487",
      "show_info": true,
      "parent_id": null,
      "is_parent_hidden": false,
      "edit_history": null,
      "removed_by": null,
      "rich_message": null,
      "conversation_id": "117967746266487_9306266852780716",
      "is_livestream_order": null
    }
  ]
}
```

## Print order as PDF

`GET /shops/{SHOP_ID}/orders/{ORDER_ID}/print`

Fills one of the shop's print templates with the order data and returns a PDF, as when printing the order from POS web.

When `label_id` is omitted, the template is chosen in this order: the **Print template by courier** of the order's courier, the shop's default template, then the shop's first template. Shops without templates use the system template. The **Print order twice** and **Attached print template** settings of the chosen template also apply.

- The page size follows the template's paper size. Roll paper (K80, K58...) returns one page whose height fits the content.
- Printing through this endpoint does not increase the order's printing count.
- Not supported yet: CRM variables, draft e-invoice data, order tracking and invoice request links, component items of composite products, templates by order source or for returned orders, and printed forms provided by the courier.

The PDF can differ slightly from printing in a browser: fonts that only exist on the user's computer (Segoe UI, Tahoma, Verdana...) are replaced, and templates whose content is longer or wider than the paper can break pages differently. Images are downloaded by the server: images on non-public hosts, larger than 5 MB, slower than 5 seconds, beyond 15 MB in total, beyond the first 30 image URLs of the document, or repeated beyond 20 MB of embedded image data are left blank. Only images in `<img>` (`src`/`srcset`) and CSS `url()` are downloaded; other external resources (`<link>` stylesheets, `@import`, SVG `<image href>`, `background` attributes) are not loaded.

Errors are returned as JSON. For the `404` order and print template errors and the `503` error, the `message` follows the shop's language.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `ORDER_ID` | path | string | yes | Order ID, system ID or custom order ID |
| `label_id` | query | integer |  | ID of the shop's print template. Omit it to choose the template automatically. |

### Responses

- `200` The order printed as a PDF file, or a legacy authentication error returned with HTTP 200 (ErrorResponse)
- `403` The API key is invalid or disabled, or the authenticated user cannot access order management (ErrorResponse)
- `404` The shop or order does not exist, the order is not visible to the authenticated API client, or `label_id` is not a print template of the shop (ErrorResponse)
- `429` The Open API request rate limit was reached (ErrorResponse)
- `503` The PDF could not be rendered. Retry later. (ErrorResponse)

```json
{
  "success": false,
  "message": "Missing access_token",
  "error_code": 101
}
```

## List of order sources

`GET /shops/{SHOP_ID}/order_source`

Get list of order sources

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": -3,
      "inserted_at": "2020-06-10T11:50:07",
      "name": "Shopee",
      "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"
    },
    {
      "id": "987654",
      "inserted_at": "2024-05-01T08:00:00",
      "link": "https://landing.example.com/source-abc",
      "name": "Landing ABC",
      "parent_id": -7,
      "shop_id": 20,
      "updated_at": "2024-05-01T08:00:00"
    }
  ],
  "success": true
}
```

## Get link print label

`POST /shops/{SHOP_ID}/products/get_logistics_shipping_document`

Get link to print shipping label and packing slips

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `document_type` | query | string |  | Document type Values: `SL_PL` Shipping label + Packing slips, `SHIPPING_LABEL` Shipping label, `PICK_LIST` Packing slips. |

### Request body

Request body containing list of order IDs to print labels

- `params` (object[], required): List of order IDs
  - `order_id` (string, required): Order ID

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

### Responses

- `200` Success (object)

```json
{
  "data": [
    "https://content.pancake.vn/2-25/2025/3/28/071edc2cc6c728f6c3fa493a2cb033e8f61fb11e.071edc2cc6c728f6c3fa493a2cb033e8f61fb11e"
  ],
  "success": true
}
```

## Get order confirm link

`POST /shops/{SHOP_ID}/orders/get_tracking_url`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Request body

Request body containing system ID to get tracking URL

- `system_id` (integer, required): System ID

```json
{
  "system_id": 862
}
```

### Responses

- `200` Success (object)

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

## Prepare order shipment

`POST /shops/{SHOP_ID}/orders/arrange_shipment`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Request body

Request body containing order IDs to prepare shipment

- `order_id` (string, required): Order ID
- `pickup_shift` (string): Pickup shift. Required for Shopee platform. Values: `closest` closest, `farthest` farthest.
- `pickup_method` (string): Pickup method. Required for Shopee and TikTok platforms. Values: `pick_up` ĐVVC lấy hàng, `drop_off` Mang hàng ra bưu cục.

```json
{
  "order_id": "34123423498237",
  "pickup_shift": "closest",
  "pickup_method": "pick_up"
}
```

### Responses

- `200` Success (object)

```json
{
  "message": "Arrange shipment successfully",
  "success": true
}
```

## List of advanced promotions of order

`POST /shops/{SHOP_ID}/orders/get_promotion_advance_active`

Get list of advanced promotions that can be applied to an order

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Request body

Request body containing order information (existing order ID or new order details) to get active promotions


```json
null
```

### Responses

- `200` Success (object)

```json
{
  "id": 1418,
  "system_id": 1,
  "shop_id": 4,
  "inserted_at": "2020-05-12T04:51:42",
  "updated_at": "2020-05-12T04:51:54",
  "status": 0,
  "status_name": "new",
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "bill_email": "customer@example.com",
  "page_id": "256469571178082",
  "post_id": "185187094667903_477083092110915",
  "ad_id": "23851252560290199",
  "shipping_fee": 0,
  "cod": 0,
  "cash": 0,
  "account": 1,
  "total_discount": 0,
  "note": "",
  "note_print": null,
  "received_at_shop": false,
  "is_free_shipping": false,
  "is_locked": false,
  "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "creator": {
    "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "fb_id": "2042723249341651",
    "name": "Hoang Anh",
    "avatar_url": null
  },
  "items": [],
  "partner": {
    "partner_id": 1,
    "cod": 0,
    "extend_code": "S58824.MB25.C3.500020713",
    "total_fee": 0,
    "updated_at": "2020-05-12T05:18:16"
  },
  "shipping_address": {
    "full_name": "Hoang Anh",
    "phone_number": "0999999999",
    "address": "90 Cầu Giấy",
    "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
    "province_id": "101",
    "district_id": "10113",
    "commune_id": "1011309"
  }
}
```

## List of payment methods

`GET /shops/{SHOP_ID}/bank_payments`

Get list of payment methods

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": "e01fed02-8680-4102-bdf4-343a7e1a00f5",
      "creator_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "name": "Tiền cọc",
      "shop_id": 224,
      "inserted_at": "2025-08-19T02:25:37",
      "updated_at": "2025-08-19T02:25:37"
    }
  ],
  "success": true
}
```

## List of return orders

`GET /shops/{SHOP_ID}/orders_returned`

Get list of return orders

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `page` | query | integer |  | Page number |
| `page_size` | query | integer |  | Page size |
| `status` | query | integer |  | Order status |
| `update_status` | query | string |  | Filter orders by time Values: `inserted_at` Order creation time, `updated_at` Last update time, `0` New, `2` Shipped, `1` Completed, `4` Canceled. |
| `start_time` | query | integer |  | Start date (unix timestamp) |
| `end_time` | query | integer |  | End date (unix timestamp) |

### Responses

- `200` Success (object)

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "display_id": 1,
      "bill_full_name": "Hoang Anh",
      "bill_phone_number": "0999999999",
      "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "custom_id": null,
      "discount": 1,
      "discount_from_order_to_returned": 1,
      "inserted_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z",
      "order_id": 1,
      "order_id_to_returned": 1,
      "order": {
        "id": 1,
        "system_id": 1,
        "shop_id": 1,
        "inserted_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z",
        "status": 1,
        "status_name": "Đã xác nhận",
        "bill_full_name": "Hoang Anh",
        "bill_phone_number": "0999999999",
        "bill_email": "hoang@example.com",
        "page_id": "104438181227821",
        "post_id": "185187094667903_477083092110915",
        "ad_id": "23851252560290199",
        "shipping_fee": 1,
        "partner_fee": 1,
        "fee_marketplace": 1,
        "customer_pay_fee": true,
        "is_free_shipping": true,
        "is_livestream": true,
        "is_live_shopping": true,
        "is_smc": true,
        "received_at_shop": true,
        "total_discount": 1,
        "note": "",
        "note_print": null,
        "returned_reason": 1,
        "returned_reason_name": "Do khách hàng",
        "sub_status": 1,
        "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
        "warehouse_info": {
          "name": "kho test ecod",
          "phone_number": "0999999999",
          "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
          "address": "hâhhha",
          "province_id": "717",
          "district_id": "71705",
          "commune_id": "7170510",
          "affiliate_id": null,
          "ffm_id": null,
          "has_snappy_service": true,
          "custom_id": null
        },
        "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "creator": {
          "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
          "fb_id": "2042723249341651",
          "name": "Hoang Anh",
          "avatar_url": null
        },
        "items": [
          {
            "id": 1,
            "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
            "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
            "quantity": 1,
            "returned_count": 1,
            "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
            "quantity_by_combo_products": [],
            "discount_each_product": 1,
            "is_bonus_product": true,
            "is_discount_percent": true,
            "is_wholesale": true,
            "is_composite": true,
            "one_time_product": true,
            "note": "",
            "note_product": "",
            "inserted_at": "2024-01-01T00:00:00Z",
            "measure_group_id": 1,
            "variation_info": {
              "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
              "name": "Ao so mi nam",
              "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
              "retail_price": 140000,
              "detail": "",
              "images": [
                "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
              ],
              "fields": [
                {
                  "id": "field-id-1",
                  "name": "Màu",
                  "value": "Trắng",
                  "keyValue": "Màu"
                }
              ],
              "barcode": "BARCODE123",
              "brand_id": null,
              "category_ids": [
                1290021044
              ],
              "display_id": "13109",
              "product_display_id": "a131092025",
              "last_imported_price": 30000,
              "weight": 0,
              "measure_info": {
                "measure_id": 1,
                "exchange_value": 1
              },
              "avg_price": 30000
            },
            "components": [
              {
                "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
                "quantity": 1,
                "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
              }
            ]
          }
        ],
        "partner": {
          "partner_id": 1,
          "cod": 0,
          "extend_code": "S58824.MB25.C3.500020713",
          "total_fee": 0,
          "updated_at": "2020-05-12T05:18:16",
          "delivery_name": null,
          "delivery_tel": null,
          "picked_up_at": null,
          "sort_code": null,
          "paid_at": null,
          "system_created": true,
          "extend_update": [
            {
              "key": "status",
              "status": "delivered",
              "tracking_id": "S58824.MB25.C3.500020713",
              "note": "",
              "update_at": "2020-05-12T05:18:16"
            }
          ]
        },
        "shipping_address": {
          "full_name": "Hoang Anh",
          "phone_number": "0999999999",
          "address": "90 Cầu Giấy",
          "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
          "province_id": "101",
          "district_id": "10113",
          "commune_id": "1011309",
          "commnue_name": "Phường Dịch Vọng",
          "district_name": "Quận Cầu Giấy",
          "province_name": "Hà Nội",
          "country_code": "84",
          "post_code": null
        },
        "payment_purchase_histories": [
          {
            "amount": 1800000,
            "type": "cash",
            "inserted_at": "2024-01-01T00:00:00Z",
            "result_code": "00",
            "ipn_reply": true,
            "voucher_amount": 0,
            "tags": [
              "payment"
            ]
          }
        ],
        "tags": [
          {
            "id": 75,
            "name": "thẻ 4"
          }
        ],
        "marketer": {
          "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "name": "Marketer Name",
          "email": "marketer@example.com",
          "phone_number": "0999999999",
          "fb_id": "2042723249341651",
          "avatar_url": null
        },
        "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "activated_combo_products": {
          "combo_product_id": 1,
          "quantity_combo_activated": 1
        },
        "activated_promotion_advances": [
          {
            "id": 1,
            "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
          }
        ],
        "tracking_link": "https://tracking.example.com",
        "payment_link": "https://payment.example.com",
        "ads_source": null,
        "shopify_order_id": null,
        "shopify_abandon_checkout_id": 1,
        "is_abandoned_order": true,
        "cod": 0,
        "cash": 0,
        "account": 1,
        "account_name": "facebook321",
        "advanced_platform_fee": {
          "ads_top_up": 1,
          "affiliate_commission": 1,
          "diff_shipping_fee": 1,
          "marketplace_voucher": 1,
          "payment_fee": 1,
          "platform_commission": 1,
          "seller_transaction_fee": 1,
          "service_fee": 1,
          "sfp_service_fee": 1
        },
        "printing_count": 1,
        "money_to_collect": 1,
        "total_price": 1,
        "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
        "customer": {
          "fb_id": null,
          "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
          "name": "Trần Văn Hoàng",
          "page_id": "104438181227821"
        },
        "total_quantity": 1,
        "time_assign_marketer": "2024-01-01T00:00:00Z",
        "status_history": [
          {
            "avatar_url": null,
            "editor_fb": "2042723249341651",
            "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
            "name": "Hoang Anh",
            "old_status": 0,
            "status": 1,
            "updated_at": "2024-01-01T00:00:00Z"
          }
        ],
        "duplicated_phone": true,
        "order_currency": "VND",
        "charged_by_vnpay": 1,
        "charged_by_qrpay": 1,
        "custom_id": null,
        "last_editor": {
          "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
          "fb_id": "2042723249341651",
          "name": "Hoang Anh",
          "email": "hoang@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "charged_by_momo": 1,
        "bank_transfer_images": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "transfer_money": 1,
        "lock_order_by_user": null,
        "assigning_care": {
          "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "fb_id": "2042723249341651",
          "name": "Care Name",
          "email": "care@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "time_assign_care": "2024-01-01T00:00:00Z",
        "assigning_seller": {
          "id": "340644fc-314d-450e-a45f-33343678cab6",
          "fb_id": "2042723249341651",
          "name": "Seller Name",
          "email": "seller@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "einvoices": [],
        "charged_by_card": 1,
        "estimate_delivery_date": "2024-01-01T00:00:00Z",
        "order_sources": "-1",
        "charged_by_fundiin": 1,
        "surcharge": 1,
        "is_linked_partner": true,
        "call_laters": [],
        "last_update_status_at": "2024-01-01T00:00:00Z",
        "discount_by_customer_level": 1,
        "viewing": [],
        "order_returned_ids": null,
        "cost_surcharge": 1,
        "time_send_partner": "2024-01-01T00:00:00Z",
        "charged_by_kredivo": 1,
        "discount": 1,
        "histories": [],
        "duplicated_customer": true,
        "tax": 1,
        "is_from_ecommerce": true,
        "note_image": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "shopify_draft_order_id": null,
        "display_id": 1,
        "shop_partner_id": 1,
        "is_locked": true
      },
      "order_to_returned": {
        "id": 1,
        "system_id": 1,
        "shop_id": 1,
        "inserted_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z",
        "status": 1,
        "status_name": "Đã xác nhận",
        "bill_full_name": "Hoang Anh",
        "bill_phone_number": "0999999999",
        "bill_email": "hoang@example.com",
        "page_id": "104438181227821",
        "post_id": "185187094667903_477083092110915",
        "ad_id": "23851252560290199",
        "shipping_fee": 1,
        "partner_fee": 1,
        "fee_marketplace": 1,
        "customer_pay_fee": true,
        "is_free_shipping": true,
        "is_livestream": true,
        "is_live_shopping": true,
        "is_smc": true,
        "received_at_shop": true,
        "total_discount": 1,
        "note": "",
        "note_print": null,
        "returned_reason": 1,
        "returned_reason_name": "Do khách hàng",
        "sub_status": 1,
        "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
        "warehouse_info": {
          "name": "kho test ecod",
          "phone_number": "0999999999",
          "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
          "address": "hâhhha",
          "province_id": "717",
          "district_id": "71705",
          "commune_id": "7170510",
          "affiliate_id": null,
          "ffm_id": null,
          "has_snappy_service": true,
          "custom_id": null
        },
        "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "creator": {
          "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
          "fb_id": "2042723249341651",
          "name": "Hoang Anh",
          "avatar_url": null
        },
        "items": [
          {
            "id": 1,
            "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
            "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
            "quantity": 1,
            "returned_count": 1,
            "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
            "quantity_by_combo_products": [],
            "discount_each_product": 1,
            "is_bonus_product": true,
            "is_discount_percent": true,
            "is_wholesale": true,
            "is_composite": true,
            "one_time_product": true,
            "note": "",
            "note_product": "",
            "inserted_at": "2024-01-01T00:00:00Z",
            "measure_group_id": 1,
            "variation_info": {
              "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
              "name": "Ao so mi nam",
              "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
              "retail_price": 140000,
              "detail": "",
              "images": [
                "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
              ],
              "fields": [
                {
                  "id": "field-id-1",
                  "name": "Màu",
                  "value": "Trắng",
                  "keyValue": "Màu"
                }
              ],
              "barcode": "BARCODE123",
              "brand_id": null,
              "category_ids": [
                1290021044
              ],
              "display_id": "13109",
              "product_display_id": "a131092025",
              "last_imported_price": 30000,
              "weight": 0,
              "measure_info": {
                "measure_id": 1,
                "exchange_value": 1
              },
              "avg_price": 30000
            },
            "components": [
              {
                "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
                "quantity": 1,
                "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
              }
            ]
          }
        ],
        "partner": {
          "partner_id": 1,
          "cod": 0,
          "extend_code": "S58824.MB25.C3.500020713",
          "total_fee": 0,
          "updated_at": "2020-05-12T05:18:16",
          "delivery_name": null,
          "delivery_tel": null,
          "picked_up_at": null,
          "sort_code": null,
          "paid_at": null,
          "system_created": true,
          "extend_update": [
            {
              "key": "status",
              "status": "delivered",
              "tracking_id": "S58824.MB25.C3.500020713",
              "note": "",
              "update_at": "2020-05-12T05:18:16"
            }
          ]
        },
        "shipping_address": {
          "full_name": "Hoang Anh",
          "phone_number": "0999999999",
          "address": "90 Cầu Giấy",
          "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
          "province_id": "101",
          "district_id": "10113",
          "commune_id": "1011309",
          "commnue_name": "Phường Dịch Vọng",
          "district_name": "Quận Cầu Giấy",
          "province_name": "Hà Nội",
          "country_code": "84",
          "post_code": null
        },
        "payment_purchase_histories": [
          {
            "amount": 1800000,
            "type": "cash",
            "inserted_at": "2024-01-01T00:00:00Z",
            "result_code": "00",
            "ipn_reply": true,
            "voucher_amount": 0,
            "tags": [
              "payment"
            ]
          }
        ],
        "tags": [
          {
            "id": 75,
            "name": "thẻ 4"
          }
        ],
        "marketer": {
          "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "name": "Marketer Name",
          "email": "marketer@example.com",
          "phone_number": "0999999999",
          "fb_id": "2042723249341651",
          "avatar_url": null
        },
        "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "activated_combo_products": {
          "combo_product_id": 1,
          "quantity_combo_activated": 1
        },
        "activated_promotion_advances": [
          {
            "id": 1,
            "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
          }
        ],
        "tracking_link": "https://tracking.example.com",
        "payment_link": "https://payment.example.com",
        "ads_source": null,
        "shopify_order_id": null,
        "shopify_abandon_checkout_id": 1,
        "is_abandoned_order": true,
        "cod": 0,
        "cash": 0,
        "account": 1,
        "account_name": "facebook321",
        "advanced_platform_fee": {
          "ads_top_up": 1,
          "affiliate_commission": 1,
          "diff_shipping_fee": 1,
          "marketplace_voucher": 1,
          "payment_fee": 1,
          "platform_commission": 1,
          "seller_transaction_fee": 1,
          "service_fee": 1,
          "sfp_service_fee": 1
        },
        "printing_count": 1,
        "money_to_collect": 1,
        "total_price": 1,
        "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
        "customer": {
          "fb_id": null,
          "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
          "name": "Trần Văn Hoàng",
          "page_id": "104438181227821"
        },
        "total_quantity": 1,
        "time_assign_marketer": "2024-01-01T00:00:00Z",
        "status_history": [
          {
            "avatar_url": null,
            "editor_fb": "2042723249341651",
            "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
            "name": "Hoang Anh",
            "old_status": 0,
            "status": 1,
            "updated_at": "2024-01-01T00:00:00Z"
          }
        ],
        "duplicated_phone": true,
        "order_currency": "VND",
        "charged_by_vnpay": 1,
        "charged_by_qrpay": 1,
        "custom_id": null,
        "last_editor": {
          "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
          "fb_id": "2042723249341651",
          "name": "Hoang Anh",
          "email": "hoang@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "charged_by_momo": 1,
        "bank_transfer_images": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "transfer_money": 1,
        "lock_order_by_user": null,
        "assigning_care": {
          "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
          "fb_id": "2042723249341651",
          "name": "Care Name",
          "email": "care@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
        "time_assign_care": "2024-01-01T00:00:00Z",
        "assigning_seller": {
          "id": "340644fc-314d-450e-a45f-33343678cab6",
          "fb_id": "2042723249341651",
          "name": "Seller Name",
          "email": "seller@example.com",
          "avatar_url": null,
          "phone_number": "0999999999"
        },
        "einvoices": [],
        "charged_by_card": 1,
        "estimate_delivery_date": "2024-01-01T00:00:00Z",
        "order_sources": "-1",
        "charged_by_fundiin": 1,
        "surcharge": 1,
        "is_linked_partner": true,
        "call_laters": [],
        "last_update_status_at": "2024-01-01T00:00:00Z",
        "discount_by_customer_level": 1,
        "viewing": [],
        "order_returned_ids": null,
        "cost_surcharge": 1,
        "time_send_partner": "2024-01-01T00:00:00Z",
        "charged_by_kredivo": 1,
        "discount": 1,
        "histories": [],
        "duplicated_customer": true,
        "tax": 1,
        "is_from_ecommerce": true,
        "note_image": [
          "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
        ],
        "shopify_draft_order_id": null,
        "display_id": 1,
        "shop_partner_id": 1,
        "is_locked": true
      },
      "returned_items": [
        {
          "id": 1,
          "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
          "returned_quantity": 1,
          "discount_each_product": 1,
          "is_discount_percent": true
        }
      ],
      "returned_fee": 1,
      "shop_customer_id": "96a8e283-3fba-492e-a35a-970f72a30a02",
      "shop_id": 1,
      "status": 1,
      "status_histories": [
        {
          "id": 1,
          "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
          "old_status": 0,
          "status": 1,
          "inserted_at": "2024-01-01T00:00:00Z",
          "updated_at": "2024-01-01T00:00:00Z"
        }
      ],
      "tags": [
        1
      ],
      "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8"
    }
  ]
}
```

## Create return order

`POST /shops/{SHOP_ID}/orders_returned`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Request body

Request body containing return order information

- `discount_from_order_to_returned` (integer): Discount from order to returned
- `order_additional` (object, required): Exchange order information
  - `bill_email` (string): Customer email
  - `bill_full_name` (string): Customer name
  - `bill_phone_number` (string): Phone number of customer
  - `cash` (integer): Cash payment
  - `discount` (integer): Discount total
  - `items` (object[], required): List of products in exchange order
  - `note` (string): Internal note
  - `note_print` (string): Note for printing
  - `order_currency` (string): Order currency
  - `payment_from_customers_exchange_order` (integer): Payment from customers exchange order
  - `prepaid` (integer): Prepaid amount
  - `received_at_shop` (boolean): true: Sales at counter, false: Sell online
  - `shipping_address` (object): Delivery address information
  - `shipping_fee` (integer): Shipping fee
  - `shop_customer_id` (string): Customer ID
  - `surcharge` (integer): Surcharge
  - `warehouse_id` (string, required): Warehouse ID
- `order_to_returned` (object): Order to be returned
  - `id` (string): Order ID to returned
- `returned_items` (object[], required): List of products in returned order
  - `product_id` (string, required): Product ID
  - `returned_quantity` (integer, required): Returned quantity
  - `variation_id` (string, required): Variation ID
  - `variation_info` (object, required): Variation information
- `shop_customer_id` (string): Customer ID
- `status` (integer, required): Order status
- `warehouse_id` (string, required): Warehouse ID

```json
{
  "discount_from_order_to_returned": 50000,
  "order_additional": {
    "bill_email": "",
    "bill_full_name": "Lê Văn Tám",
    "bill_phone_number": "0384596873",
    "cash": 1,
    "discount": 20000,
    "items": [
      {
        "discount_each_product": 0,
        "product_id": "db7cb77a-64c4-4572-9cca-86e846c0897c",
        "quantity": 1,
        "returned_quantity": 1,
        "variation_id": "749f52be-2bd0-4e76-b9fd-a4914c53192a",
        "variation_info": {
          "detail": "size: XL, color: blue",
          "fields": [
            {
              "id": "25698fb6-158e-472f-a8a7-fa48250337ae",
              "keyValue": "XL",
              "name": "size",
              "value": "XL"
            },
            {
              "id": "c414ff3c-cba7-497c-a6f8-13355605b391",
              "keyValue": "BLUE",
              "name": "color",
              "value": "blue"
            }
          ],
          "images": [
            "https://content.pancake.vn/2/2022/1/19/18c4500c320cb2e993b3ff4b3be81165df64d3ba.png"
          ],
          "name": "Sao chép Áo nam thời trang Pari",
          "retail_price": 500000,
          "weight": 100
        }
      }
    ],
    "note": "đơn trả hàng",
    "note_print": "đơn trả hàng",
    "order_currency": "VND",
    "payment_from_customers_exchange_order": 150000,
    "prepaid": 123,
    "received_at_shop": false,
    "shipping_address": {
      "address": "BT2-12 ngõ 178910",
      "commune_id": "1012129",
      "country_code": "84",
      "district_id": "10121",
      "full_address": "BT2-12 ngõ 178, Phường Đại Mỗ, Quận Nam Từ Liêm, Hà Nội",
      "full_name": "Nguyễn Hải Nhạn",
      "new_full_address": "BT2-12 ngõ 178, Hà Nội",
      "phone_number": "0384596873",
      "province_id": "101",
      "render_type": "old"
    },
    "shipping_fee": 0,
    "shop_customer_id": "ef9fc5ef-b4b5-4682-a1b9-b7ea259ae353",
    "surcharge": 0,
    "warehouse_id": "4051d111-a6b6-44fb-aca1-61fb954298cb"
  },
  "order_to_returned": {
    "id": "123157"
  },
  "returned_items": [
    {
      "product_id": "6c998441-146b-4daa-b8e0-313a2a543623",
      "returned_quantity": 1,
      "variation_id": "efac90c8-0ba7-4aa0-bef6-8f4be3c0c6e6",
      "variation_info": {
        "name": "[HỎA TỐC] Phồng Tôm Cà Mau VITOT Bánh Phồng Tôm Loại Cao Cấp Với Tỉ Lệ Tôm 48%, Đậm Đà Vị Tôm",
        "retail_price": 200000,
        "images": [
          "https://content.pancake.vn/user-content-dev2.pancake.vn/2024/12/31/a549582c91f1bee856f8a4383408de4f10585fac.jpg"
        ],
        "fields": [
          {
            "id": "995a0b6d-4e08-493e-b776-0afb2138e8a7",
            "name": "PHÂN LOẠI",
            "value": "1 HỘP CÀ MAU"
          }
        ],
        "detail": "PHÂN LOẠI: 1 HỘP CÀ MAU"
      }
    }
  ],
  "shop_customer_id": "ef9fc5ef-b4b5-4682-a1b9-b7ea259ae353",
  "status": 2,
  "warehouse_id": "4051d111-a6b6-44fb-aca1-61fb954298cb"
}
```

### Responses

- `200` Success (ReturnOrder)

```json
{
  "id": 1,
  "display_id": 1,
  "bill_full_name": "Hoang Anh",
  "bill_phone_number": "0999999999",
  "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
  "custom_id": null,
  "discount": 1,
  "discount_from_order_to_returned": 1,
  "inserted_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "order_id": 1,
  "order_id_to_returned": 1,
  "order": {
    "id": 1,
    "system_id": 1,
    "shop_id": 1,
    "inserted_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "status": 1,
    "status_name": "Đã xác nhận",
    "bill_full_name": "Hoang Anh",
    "bill_phone_number": "0999999999",
    "bill_email": "hoang@example.com",
    "page_id": "104438181227821",
    "post_id": "185187094667903_477083092110915",
    "ad_id": "23851252560290199",
    "shipping_fee": 1,
    "partner_fee": 1,
    "fee_marketplace": 1,
    "customer_pay_fee": true,
    "is_free_shipping": true,
    "is_livestream": true,
    "is_live_shopping": true,
    "is_smc": true,
    "received_at_shop": true,
    "total_discount": 1,
    "note": "",
    "note_print": null,
    "returned_reason": 1,
    "returned_reason_name": "Do khách hàng",
    "sub_status": 1,
    "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
    "warehouse_info": {
      "name": "kho test ecod",
      "phone_number": "0999999999",
      "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
      "address": "hâhhha",
      "province_id": "717",
      "district_id": "71705",
      "commune_id": "7170510",
      "affiliate_id": null,
      "ffm_id": null,
      "has_snappy_service": true,
      "custom_id": null
    },
    "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "creator": {
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "fb_id": "2042723249341651",
      "name": "Hoang Anh",
      "avatar_url": null
    },
    "items": [
      {
        "id": 1,
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "quantity": 1,
        "returned_count": 1,
        "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
        "quantity_by_combo_products": [],
        "discount_each_product": 1,
        "is_bonus_product": true,
        "is_discount_percent": true,
        "is_wholesale": true,
        "is_composite": true,
        "one_time_product": true,
        "note": "",
        "note_product": "",
        "inserted_at": "2024-01-01T00:00:00Z",
        "measure_group_id": 1,
        "variation_info": {
          "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
          "name": "Ao so mi nam",
          "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "retail_price": 140000,
          "detail": "",
          "images": [
            "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
          ],
          "fields": [
            {
              "id": "field-id-1",
              "name": "Màu",
              "value": "Trắng",
              "keyValue": "Màu"
            }
          ],
          "barcode": "BARCODE123",
          "brand_id": null,
          "category_ids": [
            1290021044
          ],
          "display_id": "13109",
          "product_display_id": "a131092025",
          "last_imported_price": 30000,
          "weight": 0,
          "measure_info": {
            "measure_id": 1,
            "exchange_value": 1
          },
          "avg_price": 30000
        },
        "components": [
          {
            "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
            "quantity": 1,
            "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
          }
        ]
      }
    ],
    "partner": {
      "partner_id": 1,
      "cod": 0,
      "extend_code": "S58824.MB25.C3.500020713",
      "total_fee": 0,
      "updated_at": "2020-05-12T05:18:16",
      "delivery_name": null,
      "delivery_tel": null,
      "picked_up_at": null,
      "sort_code": null,
      "paid_at": null,
      "system_created": true,
      "extend_update": [
        {
          "key": "status",
          "status": "delivered",
          "tracking_id": "S58824.MB25.C3.500020713",
          "note": "",
          "update_at": "2020-05-12T05:18:16"
        }
      ]
    },
    "shipping_address": {
      "full_name": "Hoang Anh",
      "phone_number": "0999999999",
      "address": "90 Cầu Giấy",
      "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
      "province_id": "101",
      "district_id": "10113",
      "commune_id": "1011309",
      "commnue_name": "Phường Dịch Vọng",
      "district_name": "Quận Cầu Giấy",
      "province_name": "Hà Nội",
      "country_code": "84",
      "post_code": null
    },
    "payment_purchase_histories": [
      {
        "amount": 1800000,
        "type": "cash",
        "inserted_at": "2024-01-01T00:00:00Z",
        "result_code": "00",
        "ipn_reply": true,
        "voucher_amount": 0,
        "tags": [
          "payment"
        ]
      }
    ],
    "tags": [
      {
        "id": 75,
        "name": "thẻ 4"
      }
    ],
    "marketer": {
      "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "name": "Marketer Name",
      "email": "marketer@example.com",
      "phone_number": "0999999999",
      "fb_id": "2042723249341651",
      "avatar_url": null
    },
    "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "activated_combo_products": {
      "combo_product_id": 1,
      "quantity_combo_activated": 1
    },
    "activated_promotion_advances": [
      {
        "id": 1,
        "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
      }
    ],
    "tracking_link": "https://tracking.example.com",
    "payment_link": "https://payment.example.com",
    "ads_source": null,
    "shopify_order_id": null,
    "shopify_abandon_checkout_id": 1,
    "is_abandoned_order": true,
    "cod": 0,
    "cash": 0,
    "account": 1,
    "account_name": "facebook321",
    "advanced_platform_fee": {
      "ads_top_up": 1,
      "affiliate_commission": 1,
      "diff_shipping_fee": 1,
      "marketplace_voucher": 1,
      "payment_fee": 1,
      "platform_commission": 1,
      "seller_transaction_fee": 1,
      "service_fee": 1,
      "sfp_service_fee": 1
    },
    "printing_count": 1,
    "money_to_collect": 1,
    "total_price": 1,
    "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
    "customer": {
      "fb_id": null,
      "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
      "name": "Trần Văn Hoàng",
      "page_id": "104438181227821"
    },
    "total_quantity": 1,
    "time_assign_marketer": "2024-01-01T00:00:00Z",
    "status_history": [
      {
        "avatar_url": null,
        "editor_fb": "2042723249341651",
        "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "name": "Hoang Anh",
        "old_status": 0,
        "status": 1,
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ],
    "duplicated_phone": true,
    "order_currency": "VND",
    "charged_by_vnpay": 1,
    "charged_by_qrpay": 1,
    "custom_id": null,
    "last_editor": {
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "fb_id": "2042723249341651",
      "name": "Hoang Anh",
      "email": "hoang@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "charged_by_momo": 1,
    "bank_transfer_images": [
      "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
    ],
    "transfer_money": 1,
    "lock_order_by_user": null,
    "assigning_care": {
      "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "fb_id": "2042723249341651",
      "name": "Care Name",
      "email": "care@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "time_assign_care": "2024-01-01T00:00:00Z",
    "assigning_seller": {
      "id": "340644fc-314d-450e-a45f-33343678cab6",
      "fb_id": "2042723249341651",
      "name": "Seller Name",
      "email": "seller@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "einvoices": [],
    "charged_by_card": 1,
    "estimate_delivery_date": "2024-01-01T00:00:00Z",
    "order_sources": "-1",
    "charged_by_fundiin": 1,
    "surcharge": 1,
    "is_linked_partner": true,
    "call_laters": [],
    "last_update_status_at": "2024-01-01T00:00:00Z",
    "discount_by_customer_level": 1,
    "viewing": [],
    "order_returned_ids": null,
    "cost_surcharge": 1,
    "time_send_partner": "2024-01-01T00:00:00Z",
    "charged_by_kredivo": 1,
    "discount": 1,
    "histories": [],
    "duplicated_customer": true,
    "tax": 1,
    "is_from_ecommerce": true,
    "note_image": [
      "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
    ],
    "shopify_draft_order_id": null,
    "display_id": 1,
    "shop_partner_id": 1,
    "is_locked": true
  },
  "order_to_returned": {
    "id": 1,
    "system_id": 1,
    "shop_id": 1,
    "inserted_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "status": 1,
    "status_name": "Đã xác nhận",
    "bill_full_name": "Hoang Anh",
    "bill_phone_number": "0999999999",
    "bill_email": "hoang@example.com",
    "page_id": "104438181227821",
    "post_id": "185187094667903_477083092110915",
    "ad_id": "23851252560290199",
    "shipping_fee": 1,
    "partner_fee": 1,
    "fee_marketplace": 1,
    "customer_pay_fee": true,
    "is_free_shipping": true,
    "is_livestream": true,
    "is_live_shopping": true,
    "is_smc": true,
    "received_at_shop": true,
    "total_discount": 1,
    "note": "",
    "note_print": null,
    "returned_reason": 1,
    "returned_reason_name": "Do khách hàng",
    "sub_status": 1,
    "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
    "warehouse_info": {
      "name": "kho test ecod",
      "phone_number": "0999999999",
      "full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
      "address": "hâhhha",
      "province_id": "717",
      "district_id": "71705",
      "commune_id": "7170510",
      "affiliate_id": null,
      "ffm_id": null,
      "has_snappy_service": true,
      "custom_id": null
    },
    "creator_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "creator": {
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "fb_id": "2042723249341651",
      "name": "Hoang Anh",
      "avatar_url": null
    },
    "items": [
      {
        "id": 1,
        "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
        "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
        "quantity": 1,
        "returned_count": 1,
        "assigning_seller_id": "340644fc-314d-450e-a45f-33343678cab6",
        "quantity_by_combo_products": [],
        "discount_each_product": 1,
        "is_bonus_product": true,
        "is_discount_percent": true,
        "is_wholesale": true,
        "is_composite": true,
        "one_time_product": true,
        "note": "",
        "note_product": "",
        "inserted_at": "2024-01-01T00:00:00Z",
        "measure_group_id": 1,
        "variation_info": {
          "id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
          "name": "Ao so mi nam",
          "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
          "retail_price": 140000,
          "detail": "",
          "images": [
            "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
          ],
          "fields": [
            {
              "id": "field-id-1",
              "name": "Màu",
              "value": "Trắng",
              "keyValue": "Màu"
            }
          ],
          "barcode": "BARCODE123",
          "brand_id": null,
          "category_ids": [
            1290021044
          ],
          "display_id": "13109",
          "product_display_id": "a131092025",
          "last_imported_price": 30000,
          "weight": 0,
          "measure_info": {
            "measure_id": 1,
            "exchange_value": 1
          },
          "avg_price": 30000
        },
        "components": [
          {
            "component_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
            "quantity": 1,
            "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7"
          }
        ]
      }
    ],
    "partner": {
      "partner_id": 1,
      "cod": 0,
      "extend_code": "S58824.MB25.C3.500020713",
      "total_fee": 0,
      "updated_at": "2020-05-12T05:18:16",
      "delivery_name": null,
      "delivery_tel": null,
      "picked_up_at": null,
      "sort_code": null,
      "paid_at": null,
      "system_created": true,
      "extend_update": [
        {
          "key": "status",
          "status": "delivered",
          "tracking_id": "S58824.MB25.C3.500020713",
          "note": "",
          "update_at": "2020-05-12T05:18:16"
        }
      ]
    },
    "shipping_address": {
      "full_name": "Hoang Anh",
      "phone_number": "0999999999",
      "address": "90 Cầu Giấy",
      "full_address": "90 Cầu Giấy, Phường Dịch Vọng, Quận Cầu Giấy, Hà Nội",
      "province_id": "101",
      "district_id": "10113",
      "commune_id": "1011309",
      "commnue_name": "Phường Dịch Vọng",
      "district_name": "Quận Cầu Giấy",
      "province_name": "Hà Nội",
      "country_code": "84",
      "post_code": null
    },
    "payment_purchase_histories": [
      {
        "amount": 1800000,
        "type": "cash",
        "inserted_at": "2024-01-01T00:00:00Z",
        "result_code": "00",
        "ipn_reply": true,
        "voucher_amount": 0,
        "tags": [
          "payment"
        ]
      }
    ],
    "tags": [
      {
        "id": 75,
        "name": "thẻ 4"
      }
    ],
    "marketer": {
      "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "name": "Marketer Name",
      "email": "marketer@example.com",
      "phone_number": "0999999999",
      "fb_id": "2042723249341651",
      "avatar_url": null
    },
    "pke_mkter": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "activated_combo_products": {
      "combo_product_id": 1,
      "quantity_combo_activated": 1
    },
    "activated_promotion_advances": [
      {
        "id": 1,
        "promotion_advance_id": "fb056b32-9cf6-4c5a-92de-0eb94db71121"
      }
    ],
    "tracking_link": "https://tracking.example.com",
    "payment_link": "https://payment.example.com",
    "ads_source": null,
    "shopify_order_id": null,
    "shopify_abandon_checkout_id": 1,
    "is_abandoned_order": true,
    "cod": 0,
    "cash": 0,
    "account": 1,
    "account_name": "facebook321",
    "advanced_platform_fee": {
      "ads_top_up": 1,
      "affiliate_commission": 1,
      "diff_shipping_fee": 1,
      "marketplace_voucher": 1,
      "payment_fee": 1,
      "platform_commission": 1,
      "seller_transaction_fee": 1,
      "service_fee": 1,
      "sfp_service_fee": 1
    },
    "printing_count": 1,
    "money_to_collect": 1,
    "total_price": 1,
    "shop_customer_address_id": "0fefd213-7d0c-4d5b-bdbf-35694da80857",
    "customer": {
      "fb_id": null,
      "id": "96a8e283-3fba-492e-a35a-970f72a30a02",
      "name": "Trần Văn Hoàng",
      "page_id": "104438181227821"
    },
    "total_quantity": 1,
    "time_assign_marketer": "2024-01-01T00:00:00Z",
    "status_history": [
      {
        "avatar_url": null,
        "editor_fb": "2042723249341651",
        "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
        "name": "Hoang Anh",
        "old_status": 0,
        "status": 1,
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ],
    "duplicated_phone": true,
    "order_currency": "VND",
    "charged_by_vnpay": 1,
    "charged_by_qrpay": 1,
    "custom_id": null,
    "last_editor": {
      "id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "fb_id": "2042723249341651",
      "name": "Hoang Anh",
      "email": "hoang@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "last_editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
    "charged_by_momo": 1,
    "bank_transfer_images": [
      "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
    ],
    "transfer_money": 1,
    "lock_order_by_user": null,
    "assigning_care": {
      "id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
      "fb_id": "2042723249341651",
      "name": "Care Name",
      "email": "care@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "assigning_care_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
    "time_assign_care": "2024-01-01T00:00:00Z",
    "assigning_seller": {
      "id": "340644fc-314d-450e-a45f-33343678cab6",
      "fb_id": "2042723249341651",
      "name": "Seller Name",
      "email": "seller@example.com",
      "avatar_url": null,
      "phone_number": "0999999999"
    },
    "einvoices": [],
    "charged_by_card": 1,
    "estimate_delivery_date": "2024-01-01T00:00:00Z",
    "order_sources": "-1",
    "charged_by_fundiin": 1,
    "surcharge": 1,
    "is_linked_partner": true,
    "call_laters": [],
    "last_update_status_at": "2024-01-01T00:00:00Z",
    "discount_by_customer_level": 1,
    "viewing": [],
    "order_returned_ids": null,
    "cost_surcharge": 1,
    "time_send_partner": "2024-01-01T00:00:00Z",
    "charged_by_kredivo": 1,
    "discount": 1,
    "histories": [],
    "duplicated_customer": true,
    "tax": 1,
    "is_from_ecommerce": true,
    "note_image": [
      "https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
    ],
    "shopify_draft_order_id": null,
    "display_id": 1,
    "shop_partner_id": 1,
    "is_locked": true
  },
  "returned_items": [
    {
      "id": 1,
      "product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
      "variation_id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
      "returned_quantity": 1,
      "discount_each_product": 1,
      "is_discount_percent": true
    }
  ],
  "returned_fee": 1,
  "shop_customer_id": "96a8e283-3fba-492e-a35a-970f72a30a02",
  "shop_id": 1,
  "status": 1,
  "status_histories": [
    {
      "id": 1,
      "editor_id": "8fbe2a6f-b0b2-4227-a698-19d18c43f7c8",
      "old_status": 0,
      "status": 1,
      "inserted_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "tags": [
    1
  ],
  "warehouse_id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8"
}
```

## Partner list

`GET /shops/{SHOP_ID}/partners`

Get list of shipping partners

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Responses

- `200` Success (object)

```json
{
  "data": [
    {
      "id": 1,
      "name": "Giao hàng tiết kiệm",
      "country_code": "84",
      "accounts": [
        {
          "id": 46036,
          "name": "sonvu8910-224"
        }
      ]
    },
    {
      "id": 2,
      "name": "EMS",
      "country_code": "84",
      "accounts": []
    },
    {
      "id": 3,
      "name": "VTP",
      "country_code": "84",
      "accounts": [
        {
          "id": 10932,
          "name": "hà an"
        }
      ]
    },
    {
      "id": 4,
      "name": "247 Express",
      "country_code": "84",
      "accounts": []
    }
  ],
  "success": true
}
```

## Project list

`GET /shops/{SHOP_ID}/projects`

Get list of projects

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |

### Responses

- `200` Success (Project)

```json
{
  "data": [
    {
      "id": 19,
      "image": null,
      "inserted_at": "2025-12-13T10:01:51",
      "name": "Project 1",
      "nodes": [
        {
          "custom_id": null,
          "id": 292,
          "image": null,
          "inserted_at": "2024-03-28T04:52:28",
          "link_source_id": null,
          "name": "Source order 1",
          "nodes": [
            {
              "custom_id": null,
              "id": 366,
              "image": null,
              "inserted_at": "2024-11-08T02:18:52",
              "link_source_id": null,
              "name": "Source order 2",
              "nodes": [],
              "parent_id": 292,
              "project_id": null,
              "shop_id": 20,
              "updated_at": "2025-07-02T02:52:14"
            }
          ],
          "parent_id": null,
          "project_id": 19,
          "shop_id": 20,
          "updated_at": "2025-12-13T10:02:02"
        }
      ],
      "shop_id": 20,
      "updated_at": "2025-12-13T10:01:51"
    }
  ],
  "success": true
}
```
