NAV Navbar
json
中文
English

Webhook(en)

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Indroduction

This is Boxful WEBHOOK API document, only for Boxful fulfillment merchant.

Region

Hook Post Unified Format

The main data is placed in the payload parameter. Please refer to the response format for each event type.


If you want to verify the reliability of the data source, decode the validator_code to obtain the complete payload.

{
  "timestamp": 1608202713,
  "region": "tw",
  "event_type": "shipment_logistics",
  "event": "update",
  "payload": {},
  "validator_code": "..."
}

Reliability Verification

Reliability verification use AES-256-CBC encryption Fill the number 0 to 16 digits to the left The final result is the timestamp of the data uploaded by Hook

function decryptValidatorCode($data = "", $token = "", $handle = "")
{
    $output = '';
    $handle = str_pad($handle, 16, '0', STR_PAD_LEFT);
    $string = openssl_decrypt(hex2bin($data), 'AES-256-CBC', $token, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING,
        $handle);
    $string_ascii = ord(substr($string, -1));
    $stringing_chr = chr($string_ascii);
    if (preg_match("/$stringing_chr{" . $string_ascii . "}/", $string)) {
        $string = substr($string, 0, strlen($string) - $string_ascii);
        parse_str($string, $output);
    }
    return $output;
}

Event URL Configuration

Please provide the event category, event item, and the target URL to Boxful. Example: shipment_logistics.create http://api.boxful.com/webhook_url

Event List

Event List

HEAD /Webhook-Description

Inbound

EventType
pickup
Event Description Response Format Ref.
main_update Inbound PL Update pickup_main_update
item_update Inbound Item Status Update pickup_item_update

pickup_main_update Response Format

{
  "timestamp": 1608726044,
  "region": "tw",
  "event_type": "pickup",
  "event": "main_update",
  "payload": {
    "packing_order_id": "1601283742",
    "name": "OwenShih",
    "phone": "0800050777",
    "address": "台北市松山區光復北路11巷44號11樓",
    "email": "owen@boxful.com.tw",
    "logistics_date": "2020-12-20",
    "logistics_time_slot": "1100-1200",
    "logistics_code": "own-self",
    "logistics_label": "自行出貨",
    "is_container": 0,
    "is_custom": 0,
    "status_code": 1,
    "status_label": "Packing已抵達倉庫"
  },
  "validator_code": "9455f62917ba803bdafa4ddd3112d90a0360729"
}

pickup_item_update Response Format

{
  "timestamp": 1612346367,
  "region": "tw",
  "event_type": "pickup",
  "event": "item_update",
  "payload": {
    "id": 48897,
    "label": "Demo product",
    "description": null,
    "sku": "A001(132777)",
    "barcode": "4711769132777",
    "expiry_date": null,
    "status": "machining",
    "status_description": "加工中",
    "logistics_date": "2021-02-03",
    "packing_list_order_id": "1616676633",
    "out_bound_total_count": 200,
    "receive": [
      {
        "expected_entering_type": "item_out",
        "expected_entering_type_label": "箱出",
        "expected_entering_count": 10,
        "actual_entering_type": "item_out",
        "actual_entering_type_label": "箱出",
        "actual_entering_count": 10,
        "receive_detail": [
          {
            "count": 10,
            "unit_count": 20,
            "total_count": 200,
            "is_defective": 0
          }
        ]
      }
    ]
  },
  "validator_code": "b3fe1376718eb05e1a0b21e2ec412712"
}

Inventory

EventType
inventory
Event Description Response Format Ref.
low_warning Notify once daily when a product reaches the inventory threshold alert inventory_low_warning

inventory_low_warning Response Format


{
  "timestamp": 1612410721,
  "region": "tw",
  "event_type": "inventory",
  "event": "low_warning",
  "payload": {
    "label": "demo001",
    "barcode": "15893383605698102",
    "sku": "demo001",
    "safety_stock": 99999999,
    "retrieving_type": "piece_out"
  },
  "validator_code": "546a8aa577c091eb53017b46f95d8a5be5cb310c8"
}

Logistics

EventType
logistics
Event Description Response Format Ref.
create Trigger this event when new logistics is created shipment_and_logistics
update Trigger this event when logistics status or tracking code is updated shipment_and_logistics

shipment_and_logistics Response Format


{
  "timestamp": 1344544545,
  "region": "tw",
  "event_type": "shipment_logistics",
  "event": "update",
  "payload": {
    "logistics_date": "2019-07-29",
    "address": "Address",
    "name": "香港商便利存",
    "phone": "03-4569170",
    "instruction": "付單",
    "remark": null,
    "order_id": "1496",
    "collect_amount": 0,
    "vendor_order_id": "7142",
    "wms_order_id": "15641381475151991034",
    "status": "closed",
    "logistics": [
      {
        "logistics_vendor": "Boxful跨境配",
        "logistics": "boxful_corss",
        "logistics_status": "shipment",
        "service_at": "2019-07-28 12:00:00",
        "logistics_status_label": "shipment",
        "logistics_code": "xdJ5jc",
        "tracking_url": "https://t.boxful.tw/1TDPGE"
      }
    ]
  },
  "validator_code": "92a2124ba634da84fb343514cc78cebfc8"
}

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK successful operation Inline

Response Schema

Status Code 200

empty object

Name Type Required Restrictions Description