HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Get Purchase Orders

Function

To get purchase orders
取得進貨單

URL

GET <<api_domain>>/v1/pos/purchase_orders

Request Parameters

ParameterTypeDescriptionExample
queryStringPurchase order number or Custom ID20230321085431306
typeStringPurchase order Type
(purchase or return)
purchase
start_dateStringDate Range Start At2018-01-10T06:33:45.231+00:00
end_dateStringDate Range End At2018-01-10T06:33:45.231+00:00
statusesArrayPurchase order status
pending
received
completed
cancelled
['completed']
arrival_statusesArrayPurchase order arrival status
pending_to_receive
partial
all_received
all_returned
['all_received']
channel_idStringPurchase order channel ID6049d431709478001d7c496b
item_detailBooleanIs Show Item Detail Required
default: false
true
pageIntegerPage Number
頁數
(Default: 1)
1
per_pageIntegerNumbers of Orders per Page
每頁顯示 n 筆資料
(Default: 24)
20

Request Example

curl --location --request GET 'https://open.shoplineapp.com/v1/pos/purchase_orders?item_detail=true' \
--header 'Authorization: Bearer ${token}'

Response Body

{
    "pagination": {
        "current_page": 1,
        "per_page": 24,
        "total_pages": 1,
        "total_count": 1
    },
    "items": [
        {
            "created_at": "2023-03-21T08:10:06.774Z",
            "updated_at": "2023-03-21T08:10:06.774Z",
            "type": "purchase",
            "number": "20230321081006571",
            "custom_number": "",
            "status": "pending",
            "arrival_status": "pending_to_receive",
            "scheduled_time": null,
            "actual_time": null,
            "other_fee": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0.0
            },
            "total_amount": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0.0
            },
            "current_amount": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0.0
            },
            "total_quantity": 1,
            "current_quantity": 0,
            "note": "",
            "child_id": null,
            "group_id": null,
            "wapos_id": null,
            "id": "6419665ee39bf300377cc5a4",
            "issuer": null,
            "executor": null,
            "channel": null,
            "items": [
                {
                    "product_id": "6404a28b9843a60036e3e802",
                    "variation_id": "",
                    "product_name": {
                        "zh-hant": "png"
                    },
                    "variation_titles": null,
                    "variation_name": null,
                    "image_url": "https://img-shoplineapp-com.s3.amazonaws.com/media/image_clips/64058ac09843a60039e3e803/original.png?1678084797",
                    "sku": "fku6900",
                    "gtin": "54522008",
                    "total_quantity": 1,
                    "current_quantity": 0,
                    "purchase_price": {
                        "cents": 0,
                        "currency_symbol": "NT$",
                        "currency_iso": "TWD",
                        "label": "",
                        "dollars": 0.0
                    },
                    "supplier_id": null,
                    "subtotal": {
                        "cents": 0,
                        "currency_symbol": "NT$",
                        "currency_iso": "TWD",
                        "label": "",
                        "dollars": 0.0
                    },
                    "price": {
                        "cents": 100,
                        "currency_symbol": "NT$",
                        "currency_iso": "TWD",
                        "label": "NT$100",
                        "dollars": 100.0
                    },
                    "product_removed": false,
                    "id": "6419665ee39bf300377cc5a3",
                    "same_price": null,
                    "supplier_name": null
                }
            ],
            "has_removed_items": false
        }
    ],
    "removed_item_ids": []
}