跳至內容
ShopentlyLearn

取得 — 訂單

讀取「訂單」的資料。結果取決於此操作的參數。

GET/api/v1/orders/{order_id}

身份驗證
Bearer
最低方案
BASIC
所需權限
orders.order:read

程式碼範例

請求示例

cURL

: "${SHOPENTLY_SHOP_URL:?}"

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 30 \
  --request GET \
  --header "Authorization: Bearer ${SHOPENTLY_ACCESS_TOKEN:?}" \
  --url "${SHOPENTLY_SHOP_URL%/}"/api/v1/orders/example

PHP

<?php
declare(strict_types=1);

$baseUrl = rtrim(getenv('SHOPENTLY_SHOP_URL') ?: '', '/');
$origin = parse_url($baseUrl);
if (!$origin || ($origin['scheme'] ?? '') !== 'https' || empty($origin['host']) ||
    isset($origin['user'], $origin['pass']) || isset($origin['user']) || isset($origin['path']) ||
    isset($origin['query']) || isset($origin['fragment'])) {
    throw new RuntimeException('SHOPENTLY_SHOP_URL must be an HTTPS origin');
}
$credential = getenv('SHOPENTLY_ACCESS_TOKEN') ?: '';
if ($credential === '' || strpbrk($credential, "\r\n") !== false) {
    throw new RuntimeException('Invalid credential');
}
$headers = [];
$headers[] = 'Authorization: Bearer ' . $credential;
$responseHeaders = [];
$handle = curl_init($baseUrl . '/api/v1/orders/example');
curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_PROTOCOLS => CURLPROTO_HTTPS,
    CURLOPT_SSL_VERIFYPEER => true,
    CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_CONNECTTIMEOUT => 5,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HEADERFUNCTION => static function ($handle, string $line) use (&$responseHeaders): int {
        if (str_contains($line, ':')) {
            [$name, $value] = explode(':', $line, 2);
            $responseHeaders[strtolower(trim($name))] = trim($value);
        }
        return strlen($line);
    },
]);
$raw = curl_exec($handle);
$status = curl_getinfo($handle, CURLINFO_RESPONSE_CODE);
$error = curl_error($handle);
curl_close($handle);
if ($raw === false) {
    throw new RuntimeException('Transport error: ' . $error);
}
if ($status < 200 || $status >= 300) {
    throw new RuntimeException('HTTP ' . $status . '; request_id=' .
        ($responseHeaders['x-request-id'] ?? '') . '; retry_after=' . ($responseHeaders['retry-after'] ?? ''));
}
$result = $raw === '' ? null : json_decode($raw, true, 512, JSON_THROW_ON_ERROR | JSON_BIGINT_AS_STRING);
echo json_encode($result, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE), PHP_EOL;

Python

from contextlib import ExitStack
import json
import os
from urllib.parse import urlsplit

import requests  # python -m pip install requests

base_url = os.environ["SHOPENTLY_SHOP_URL"].rstrip("/")
origin = urlsplit(base_url)
if origin.scheme != "https" or not origin.hostname or origin.username or origin.password or origin.path or origin.query or origin.fragment:
    raise ValueError("SHOPENTLY_SHOP_URL must be an HTTPS origin")
credential = os.environ['SHOPENTLY_ACCESS_TOKEN']
if not credential or "\r" in credential or "\n" in credential:
    raise ValueError("Invalid credential")
headers = {}
headers["Authorization"] = 'Bearer' + " " + credential
body = None
if body is not None:
    headers["Content-Type"] = "application/json"

with ExitStack() as stack:
    session = stack.enter_context(requests.Session())
    files = None
    if False:
        image = stack.enter_context(open(os.environ["SHOPENTLY_IMAGE_FILE"], "rb"))
        if os.fstat(image.fileno()).st_size > 5242880:
            raise ValueError("Image exceeds 5 MiB")
        files = {"file": ("article.png", image, "image/png")}
    response = session.request(
        'GET', base_url + '/api/v1/orders/example', headers=headers,
        data=body.encode("utf-8") if body is not None else None, files=files,
        timeout=(5, 30), allow_redirects=False,
    )
    if not 200 <= response.status_code < 300:
        raise RuntimeError(f"HTTP {response.status_code}; request_id={response.headers.get('X-Request-ID', '')}; retry_after={response.headers.get('Retry-After', '')}")
    if False:
        if response.headers.get("Content-Type") != "image/webp" or len(response.content) > 5242880:
            raise ValueError("Unexpected image response")
        with open(os.environ["SHOPENTLY_OUTPUT_FILE"], "xb") as output:
            output.write(response.content)
    else:
        result = response.json() if response.content else None
        print(json.dumps(result, ensure_ascii=False, indent=2))

回應示例 200

JSON
{
  "data": {
    "created_at": "2026-10-19T10:00:00Z",
    "customer": {
      "email": "customer@example.invalid",
      "first_name": "Example",
      "last_name": "Example",
      "phone": null
    },
    "delivery": {
      "amount": {
        "amount": "0.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "dates": {
        "dispatch_timezone": "Europe/Warsaw",
        "estimated_delivery_from": "2026-10-20",
        "estimated_delivery_to": "2026-10-21",
        "planned_dispatch_on": "2026-10-19"
      },
      "discount_gross": {
        "amount": "24.60",
        "currency": "PLN",
        "minor_units": 2
      },
      "discount_net": {
        "amount": "20.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "discount_tax": {
        "amount": "4.60",
        "currency": "PLN",
        "minor_units": 2
      },
      "discounts": [
        {
          "amount": {
            "amount": "24.60",
            "currency": "PLN",
            "minor_units": 2
          },
          "campaign_id": "saved-coupon",
          "code": "SAVE",
          "kind": "coupon",
          "name": "Saved coupon",
          "sequence": 1,
          "version": 3
        }
      ],
      "gross": {
        "amount": "0.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "method_code": "shipping-old",
      "method_name": "Historic carrier",
      "net": {
        "amount": "0.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "original_gross": {
        "amount": "24.60",
        "currency": "PLN",
        "minor_units": 2
      },
      "original_net": {
        "amount": "20.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "original_tax": {
        "amount": "4.60",
        "currency": "PLN",
        "minor_units": 2
      },
      "pickup_point": null,
      "recipient_mode": "full_address",
      "tax": {
        "amount": "0.00",
        "currency": "PLN",
        "minor_units": 2
      },
      "tax_category_id": "standard",
      "tax_category_name": "VAT 23%",
      "tax_rate": "0.23"
    },
    "discount_amount": {
      "amount": "24.60",
      "currency": "PLN",
      "minor_units": 2
    },
    "discounts": [
      {
        "amount": {
          "amount": "12.30",
          "currency": "PLN",
          "minor_units": 2
        },
        "campaign_id": "saved-coupon",
        "code": "SAVE",
        "kind": "coupon",
        "name": "Saved coupon",
        "sequence": 1,
        "shipping_amount": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "version": 3
      }
    ],
    "id": "order-0000",
    "invoice": null,
    "invoice_requested": false,
    "lifecycle_state": "placed",
    "lines": [
      {
        "discount_amount": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_gross": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_net": {
          "amount": "20.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_tax": {
          "amount": "4.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "discounts": [
          {
            "amount": {
              "amount": "12.30",
              "currency": "PLN",
              "minor_units": 2
            },
            "campaign_id": "saved-coupon",
            "code": "SAVE",
            "kind": "coupon",
            "name": "Saved coupon",
            "sequence": 1,
            "shipping_amount": null,
            "version": 3
          }
        ],
        "identifiers": {},
        "image": null,
        "line_id": "saved-line-a",
        "manual_discount": {
          "amount": {
            "amount": "12.30",
            "currency": "PLN",
            "minor_units": 2
          },
          "kind": "fixed",
          "value": "12.30"
        },
        "name": "Saved A",
        "original_total": {
          "amount": "246.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_gross": {
          "amount": "246.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_net": {
          "amount": "200.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_tax": {
          "amount": "46.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "position": 1,
        "product_id": "product-api",
        "quantity": 2,
        "sku": "A",
        "tax": {
          "amount": "20.70",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax_category_id": "standard",
        "tax_category_name": "VAT 23%",
        "tax_rate": "0.23",
        "total": {
          "amount": "221.40",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_gross": {
          "amount": "221.40",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_net": {
          "amount": "180.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_tax": {
          "amount": "41.40",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_gross": {
          "amount": "123.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_net": {
          "amount": "100.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_price": {
          "amount": "123.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_tax": {
          "amount": "23.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "variant_id": null,
        "variant_options": []
      },
      {
        "discount_amount": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_gross": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_net": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "discount_tax": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "discounts": [],
        "identifiers": {},
        "image": null,
        "line_id": "b548a171-c331-505f-98f8-db3a06070998",
        "manual_discount": null,
        "name": "Saved B",
        "original_total": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_gross": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_net": {
          "amount": "100.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "original_total_tax": {
          "amount": "8.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "position": 2,
        "product_id": "deleted-product",
        "quantity": 1,
        "sku": "B",
        "tax": null,
        "tax_category_id": "reduced",
        "tax_category_name": "VAT 8%",
        "tax_rate": "0.08",
        "total": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_gross": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_net": {
          "amount": "100.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "total_tax": {
          "amount": "8.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_gross": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_net": {
          "amount": "100.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_price": {
          "amount": "108.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "unit_tax": {
          "amount": "8.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "variant_id": null,
        "variant_options": []
      }
    ],
    "locale": "pl",
    "market_id": "market-pl",
    "number": "0001",
    "payment": {
      "amount": {
        "amount": "329.40",
        "currency": "PLN",
        "minor_units": 2
      },
      "environment": "live",
      "method_code": "payment-old",
      "method_name": "Historic method",
      "paid_at": null,
      "status": "unpaid",
      "updated_at": "2026-10-19T10:00:00Z",
      "version": 0
    },
    "pickup_point": null,
    "prices_include_tax": true,
    "shipping_address": null,
    "shipping_discount_amount": {
      "amount": "24.60",
      "currency": "PLN",
      "minor_units": 2
    },
    "status": {
      "id": "status-0",
      "name": "Status 0",
      "updated_at": "2026-10-19T10:00:00Z",
      "version": 1
    },
    "subtotal": {
      "amount": "329.40",
      "currency": "PLN",
      "minor_units": 2
    },
    "tax": {
      "amount": "49.40",
      "currency": "PLN",
      "minor_units": 2
    },
    "tax_breakdown": {
      "groups": [
        {
          "gross": {
            "amount": "221.40",
            "currency": "PLN",
            "minor_units": 2
          },
          "net": {
            "amount": "180.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "source": "products",
          "tax": {
            "amount": "41.40",
            "currency": "PLN",
            "minor_units": 2
          },
          "tax_rate": "0.23"
        },
        {
          "gross": {
            "amount": "108.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "net": {
            "amount": "100.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "source": "products",
          "tax": {
            "amount": "8.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "tax_rate": "0.08"
        },
        {
          "gross": {
            "amount": "0.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "net": {
            "amount": "0.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "source": "shipping",
          "tax": {
            "amount": "0.00",
            "currency": "PLN",
            "minor_units": 2
          },
          "tax_rate": "0.23"
        }
      ],
      "unallocated_tax": {
        "amount": "0.00",
        "currency": "PLN",
        "minor_units": 2
      }
    },
    "tax_country_code": "PL",
    "total": {
      "amount": "329.40",
      "currency": "PLN",
      "minor_units": 2
    },
    "totals": {
      "before_discounts": {
        "gross": {
          "amount": "378.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "320.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "58.60",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "discounts": {
        "gross": {
          "amount": "49.20",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "40.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "9.20",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "order": {
        "gross": {
          "amount": "329.40",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "280.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "49.40",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "product_discounts": {
        "gross": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "20.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "4.60",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "products": {
        "gross": {
          "amount": "329.40",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "280.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "49.40",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "products_before_discounts": {
        "gross": {
          "amount": "354.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "300.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "54.00",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "shipping": {
        "gross": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "0.00",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "shipping_before_discounts": {
        "gross": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "20.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "4.60",
          "currency": "PLN",
          "minor_units": 2
        }
      },
      "shipping_discounts": {
        "gross": {
          "amount": "24.60",
          "currency": "PLN",
          "minor_units": 2
        },
        "net": {
          "amount": "20.00",
          "currency": "PLN",
          "minor_units": 2
        },
        "tax": {
          "amount": "4.60",
          "currency": "PLN",
          "minor_units": 2
        }
      }
    }
  },
  "meta": {
    "request_id": "example-request"
  }
}

工作原理

  • 集合提供訂單摘要,以及訂單號、狀態、支付狀態和建立時間篩選。
  • 訂單列表和詳細資料均包含 delivery.dates。YYYY-MM-DD 格式的日期為計畫日期,不代表已出貨。目前日期優先;舊訂單使用已儲存的估計。已清除或未知的值為 null。詳細資料還包含所有訂單項目和商品圖片。
  • 從 /api/v1/order-statuses 取得有效狀態識別碼。
  • 訂單狀態和支付狀態使用不同的 PATCH 端點及權限。
  • 修改記錄中的支付狀態不會從銀行卡扣款,也不會通過支付服務商發起退款。

訂單 · 合計

金額和稅率取自已儲存的訂單,包括訂單項目的更正。缺少的歷史資料為 null,不會用目前商品目錄的稅率補齊。金額始終維持為十進位字串。

清單傳回摘要。針對每個結果取得 GET /api/v1/orders/{order_id},以匯出完整的金額明細。GET 重試次數有限,並遵循 Retry-After。依建立日期匯出不會同步之後的更正。

  • tax_country_code · 課稅國家 · 已儲存的訂單資料 · ISO 3166-1 alpha-2; null.
  • lines[].unit_* · 單件 · 折扣前; lines[].original_total_* · 折扣前; lines[].total_* · 折扣後.
  • lines[].discount_* · 折扣; manual_discount · 手動折扣; percentage "10" = 10%.
  • delivery.net / tax / gross · 折扣後; delivery.original_* · 折扣前; delivery.discount_* · 折扣.
  • tax_rate: "0.23" = 23%; "0" ≠ null. 未知:null;已知零值:0.
  • totals · 合計; tax_breakdown.groups · 稅務分組; 未分配稅額 = order.tax − Σ groups.tax; ±.

payment.amount 是訂單總額。付款狀態無法確定已付、已退款或待付金額。

參數

路徑參數

order_id字串必填

相關訂單識別碼。

約束
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
示例: "example"

此操作不接受 JSON 請求本文。

回應

回應 200

dataOrderDetailData 必填

成功回應的資料。

欄位 · data
created_at字串必填

建立時間。

format: "date-time"
customerCustomerData 必填

此資源記錄的客戶資訊。

欄位 · customer
email字串必填

電子郵箱位址。

first_name字串 null必填

名。

last_name字串 null必填

姓。

phone字串 null必填

電話號碼。

deliveryShippingDetailData 必填

配送方式及相關資訊。

欄位 · delivery
amountMoneyData 必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

datesDeliveryDatesData 必填

出貨及預計送達日期

discount_grossMoneyData 必填

含稅金額 · 折扣; 未知:null;已知零值:0.

discount_netMoneyData null必填

未稅金額 · 折扣; 未知:null;已知零值:0.

discount_taxMoneyData null必填

稅額 · 折扣; 未知:null;已知零值:0.

discounts陣列 <OrderDeliveryDiscountData > null必填

折扣

grossMoneyData 必填

含稅金額 · 折扣後; 未知:null;已知零值:0.

method_code字串 null必填

配送或支付方式代碼。

method_name字串 null必填

配送或支付方式名稱。

netMoneyData null必填

未稅金額 · 折扣後; 未知:null;已知零值:0.

original_grossMoneyData 必填

含稅金額 · 配送 · 折扣前; 未知:null;已知零值:0.

original_netMoneyData null必填

未稅金額 · 配送 · 折扣前; 未知:null;已知零值:0.

original_taxMoneyData null必填

稅額 · 配送 · 折扣前; 未知:null;已知零值:0.

pickup_pointDeliveryPickupPointData null必填

取件地點

recipient_mode字串必填

由允許值說明的資料結構變體。

約束
enum
["full_address", "pickup_contact"]
taxMoneyData null必填

稅務資訊。

tax_category_id字串 null必填

稅務類別識別碼。

tax_category_name字串 null必填

已儲存的稅務類別名稱; null.

tax_rate字串 null必填

tax_rate · 已儲存的訂單資料: "0.23" = 23%; "0" ≠ null.

discount_amountMoneyData 必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

欄位 · discount_amount
amount字串必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

currency字串必填

金額的幣種代碼。

約束
pattern
"^[A-Z]{3}$"
minor_units整數必填

幣種使用的小數位數。

minimum: 0maximum: 4
discounts陣列 <OrderDiscountData > 必填

折扣

欄位 · discounts
id字串必填

資源識別碼;請保留回傳的原值。

invoiceInvoiceData null必填

發票資訊。

欄位 · invoice
invoice_requested布林值必填

是否要求開具發票。

lifecycle_stateOrderLifecycleState 必填

業務生命週期狀態。

lines陣列 <OrderLineData > 必填

訂單行快照。

欄位 · lines
locale字串必填

本次請求選擇的語言。

market_id字串必填

上下文端點回傳的市場識別碼。

number字串必填

面向使用者的訂單號或申請編號。

paymentPaymentData 必填

訂單中記錄的支付詳情。

欄位 · payment
amountMoneyData 必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

environment字串必填

附加到記錄的環境資訊。

約束
enum
["live", "sandbox"]
method_code字串 null必填

配送或支付方式代碼。

method_name字串 null必填

配送或支付方式名稱。

paid_at字串 null必填

支付被標記為已付的日期和時間。

字串:format: "date-time"
statusOrderPaymentStatus 必填

此操作接受的狀態。

updated_at字串必填

最近更新時間。

format: "date-time"
version整數必填

用於並行控制的資源版本。

pickup_pointPickupPointData null必填

取件地點

欄位 · pickup_point
prices_include_tax布林值必填

列出的價格是否含稅。

shipping_addressAddressData null必填

收貨位址。

欄位 · shipping_address
shipping_discount_amountMoneyData 必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

欄位 · shipping_discount_amount
amount字串必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

currency字串必填

金額的幣種代碼。

約束
pattern
"^[A-Z]{3}$"
minor_units整數必填

幣種使用的小數位數。

minimum: 0maximum: 4
statusOrderStatusData 必填

此操作接受的狀態。

欄位 · status
id字串必填

資源識別碼;請保留回傳的原值。

name字串必填

對應上下文中的資源名稱。

updated_at字串必填

最近更新時間。

format: "date-time"
version整數必填

用於並行控制的資源版本。

subtotalMoneyData 必填

加入回應中所示附加組成部分之前的金額。

欄位 · subtotal
amount字串必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

currency字串必填

金額的幣種代碼。

約束
pattern
"^[A-Z]{3}$"
minor_units整數必填

幣種使用的小數位數。

minimum: 0maximum: 4
taxMoneyData 必填

稅務資訊。

欄位 · tax
amount字串必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

currency字串必填

金額的幣種代碼。

約束
pattern
"^[A-Z]{3}$"
minor_units整數必填

幣種使用的小數位數。

minimum: 0maximum: 4
tax_breakdownOrderTaxBreakdownData 必填

稅務分組 · source + tax_rate; unallocated_tax.

欄位 · tax_breakdown
groups陣列 <OrderTaxGroupData > 必填

稅務分組 · source + tax_rate; 未知:null;已知零值:0.

unallocated_taxMoneyData 必填

未分配稅額 = order.tax − Σ groups.tax; ±.

tax_country_code字串 null必填

課稅國家 · 已儲存的訂單資料 · ISO 3166-1 alpha-2; null.

totalMoneyData 必填

總金額。

欄位 · total
amount字串必填

以 JSON 字串編碼的十進位金額;僅在允許時使用 null。

currency字串必填

金額的幣種代碼。

約束
pattern
"^[A-Z]{3}$"
minor_units整數必填

幣種使用的小數位數。

minimum: 0maximum: 4
totalsOrderTotalsData 必填

合計 · net / tax / gross; 折扣前 / 折扣後.

欄位 · totals
before_discountsOrderAmountBreakdownData 必填

訂單 · 折扣前 · net / tax / gross.

discountsOrderAmountBreakdownData 必填

折扣

orderOrderAmountBreakdownData 必填

訂單 · 折扣後 · net / tax / gross.

product_discountsOrderAmountBreakdownData 必填

商品 · 折扣 · net / tax / gross.

productsOrderAmountBreakdownData 必填

商品 · 折扣後 · net / tax / gross.

products_before_discountsOrderAmountBreakdownData 必填

商品 · 折扣前 · net / tax / gross.

shippingOrderAmountBreakdownData 必填

配送 · 折扣後 · net / tax / gross.

shipping_before_discountsOrderAmountBreakdownData 必填

配送 · 折扣前 · net / tax / gross.

shipping_discountsOrderAmountBreakdownData 必填

配送 · 折扣 · net / tax / gross.

metaContextPageMeta ContextMeta PageMeta RequestMeta 必填

回應元資料。

欄位 · meta

ContextPageMeta

locale字串必填

本次請求選擇的語言。

market_code字串必填

上下文端點回傳的市場代碼。

market_id字串必填

上下文端點回傳的市場識別碼。

paginationPagination 必填

遊標分頁元資料。

request_id字串必填

申請識別碼;在回應元資料中表示 HTTP 請求識別碼。

minLength: 1maxLength: 100

ContextMeta

locale字串必填

本次請求選擇的語言。

market_code字串必填

上下文端點回傳的市場代碼。

market_id字串必填

上下文端點回傳的市場識別碼。

request_id字串必填

申請識別碼;在回應元資料中表示 HTTP 請求識別碼。

minLength: 1maxLength: 100

PageMeta

paginationPagination 必填

遊標分頁元資料。

request_id字串必填

申請識別碼;在回應元資料中表示 HTTP 請求識別碼。

minLength: 1maxLength: 100

RequestMeta

request_id字串必填

申請識別碼;在回應元資料中表示 HTTP 請求識別碼。

minLength: 1maxLength: 100
回應示例

HTTP 狀態

200
請求成功 架構
400
無效請求
401
需要身分驗證
403
權限不足
404
找不到資源
409
版本衝突
422
驗證失敗
429
超出請求限制
其他 HTTP 狀態 (7)
405
不允許的方法
413
請求過大
415
不支援的格式
500
伺服器錯誤
502
API 閘道錯誤
503
服務無法使用
504
閘道逾時

錯誤目錄: ErrorResponse

請求標頭與回應標頭

401

WWW-Authenticate字串選填

伺服器要求的身份驗證方案。

405

Allow字串選填

此資源支援的 HTTP 方法。

429, 503

Retry-After整數選填

重試前最少等待的秒數。

minimum: 0