屬性
請求正文中的 JSON 鍵值對
POST https://api.iglobalstores.com/v1/createTempCart
| 欄位↕ | 備註↕ |
|---|---|
boxCount | 範例值:22x15x15(1),8x8x4(2),32x22x14(1) 格式:以逗號分隔的箱子尺寸和數量清單。在上面的範例中,總共有 4 個箱子。清單中的第一個箱子將為 22 英吋長、15 英吋寬、15 英吋高。只會使用一個該尺寸的箱子。將有兩個尺寸為 8x8x4 英吋的箱子。如果對您來說較容易,可以接受多次傳入相同的箱子尺寸,例如:"22x15x15(1),22x15x15(1)",表示 2 個 22x15x15 英吋的箱子。此欄位說明將用於運送訂單的箱子。預期商家在下訂單時可能不知道這一點;但如果已知,可以以 string 格式傳入。 |
contShoppingURL | 此欄位用於傳入 URL,以覆蓋 Zonos Checkout 內「繼續購物」按鈕的 HREF。string |
domesticShippingCharge | 此欄位用於將國內運費傳入至 Zonos Checkout,金額將被添加至運費。此欄位可設定為添加運費總額或作為單獨的行項目。positive floating point, two decimal places |
externalConfirmationPageURL | 此欄位用於傳入您訂單確認/感謝頁面的 URL。客戶在 Zonos Checkout 內完成付款後,將被重定向至此 URL 進行訂單確認。此 URL 通常用於觸發對 Zonos「orderDetail」API 服務端點的呼叫,以檢索訂單詳細資訊,並將訂單匯入系統。string |
footerHTML | 此欄位用於傳入 URL 編碼的 HTML 字串。此 HTML 字串將被解碼並放置在結帳頁面的 body 結束標籤前。通常用於傳入再行銷、分析等的程式碼。URL encoded string |
items 必填 | 此欄位是項目對應的清單。JSON string |
items[index].countryOfOrigin | 此欄位用於傳入項目原產國。參數必須是國家 兩位字母 ISO 代碼。string |
items[index].description 必填 | 此欄位用於傳入購物車行項目的完整項目說明,包括任何項目選項、顏色等。string |
items[index].height | 此欄位用於傳入項目高度,強烈建議用於準確的運費報價。高度單位 必填 string - positive floating point, two decimal places / integer (inches) |
items[index].imageURL 必填 | 此欄位用於傳入項目產品影像的 URL。URL 必須是 HTTPS 才能在 Zonos Checkout 內顯示。string / HTTPS URL |
items[index]itemBrand | 此欄位用於傳入項目品牌。string |
items[index]itemCategory | 此欄位用於傳入項目類別,如果項目有多個類別,可以用管道符號分隔傳入。 範例值:"shoes" 或 "shoes|sport-shoes|discount-shoes" string |
items[index]itemCustomization | 此欄位用於傳入關於項目的其他詳細資訊,這些詳細資訊不在 Zonos Checkout 中顯示;但可以透過「orderDetail」API 服務端點檢索。 |
items[index]itemHSCode | 此欄位用於傳入項目 HS 代碼,可以有或沒有句號。 範例值:"3926901000" 或 "3926.90.1000" string |
items[index].itemURL | 此欄位用於傳入項目產品頁面的 URL。string / URL |
items[index].length | 此欄位用於傳入項目長度,強烈建議用於準確的運費報價。長度單位 必填 string - positive floating point, two decimal places / integer (inches) |
items[index].nonShippable | 此欄位用於指示項目是否應包含在運費、稅務和稅務計算中。數位下載、折扣代碼、處理費等應以 "true" 值傳入。boolean: true or false |
items[index].productId | 此欄位用於傳入行項目數量。string |
items[index].quantity 必填 | 此欄位用於傳入行項目數量。string |
items[index].sku | 此欄位用於傳入項目 SKU / UPC 等。string |
items[index].unitPrice 必填 | 此欄位用於傳入行項目單價。positive floating point, two decimal places / integer |
items[index].weight | 此欄位用於傳入項目重量,強烈建議用於準確的運費報價。重量單位預設為 "LBS",除非在 items[index].itemWeightUnits 中傳入其他重量單位。string - positive floating point, two decimal places / integer |
items[index].weightUnits | 此欄位用於覆蓋預設的項目重量單位。項目重量單位預設為 "LBS",除非在此欄位中傳入其他重量單位。string - "LB", "OZ", "KG", or "G" |
items[index].width | 此欄位用於傳入項目寬度,強烈建議用於準確的運費報價。寬度單位 必填 string - positive floating point, two decimal places / integer (inches) |
misc1 - misc6 | 此欄位用於傳入與訂單相關的雜項資料,透過 Zonos API 一起檢索,該資料與從 Zonos「orderDetail」API 服務端點返回的訂單資料一起檢索。string |
referenceId | 此欄位用於傳入您系統中的購物車/工作階段等的唯一參考識別值。這可用於透過 Zonos「orderDetail」API 服務端點查詢 Zonos 訂單 ID。string |
storeId 必填 | Zonos 提供的商店 ID。integer |
其他字串資料型別
items[index].itemDescriptionLongitems[index].itemDescriptionDetaileditems[index].itemFabricContentitems[index].itemColoritems[index].itemLtlClassitems[index].statusitems[index].itemMaterial
折扣、優惠券和促銷代碼
要透過伺服器 post 將折扣、優惠券和促銷代碼發送至 Zonos,必須將其作為單獨的項目傳入,並為參數 "unitPrice" 和 "nonShippable":true 傳入負值。
1
{2
"description": "Discount (10OFF) - 10% OFF",3
"unitPrice": -15.5,4
"quantity": 1,5
"nonShippable": true6
}HTTPS 回應
成功的 HTTP 回應
訊息格式:JSON
1
{2
"tempCartUUID": "826b8f22-0de6-4717-90c7-366def7d0782"3
}回應 JSON 定義
| 欄位↕ | 備註↕ |
|---|---|
tempCartUUID | 此參數將包含分配給客戶國際購物車的 GUID,並在 Zonos 系統中建立。此欄位將作為 URL 查詢 string 參數,在將使用者的瀏覽器重定向至 Zonos Checkout 時傳入。 |
錯誤 HTTP 回應
| 錯誤代碼↕ | 意義↕ |
|---|---|
| 400 | 請求正文中出現了意外字元。 |
| 406 | 不可接受。「Accept」的 HTTP 標頭無效。 |
| 415 | 不支援的媒體類型。「Content-Type」的 HTTP 標頭無效。 |
| 422 | 無法處理的實體。 |
| 500 | 「storeId」不正確或無法解析 JSON 正文。 |
1
2
3
4
5
6
7
Error 422 Unprocessable Entity 8
9
10
11
12
13
HTTP ERROR 422
14
15
16
Problem accessing /v2/createTempCart. Reason:17
Unprocessable Entity
18
19
20
21
The request entity had the following errors:
22
23
24
25
items may not be empty (was null) 26
27
items may not be null (was null) 28
29
30
31
32
33
重定向至 Zonos Checkout
收到包含 tempCartUUID 的成功回應後,您的伺服器將從客戶的瀏覽器向下面涵蓋的相應 URL 查詢字串參數的 Zonos Checkout 發送重定向。
重定向 URL 範例:https://[yourassignedsubdomain].iglobalstores.com/?tempCartUUID=826b8f22-0de6-4717-90c7-366def7d0782&country=CA
備註:[yourassignedsubdomain] - 聯絡您的 Zonos 實施團隊成員以取得您的 Zonos.com 子網域。
URL 請求參數
| 欄位↕ | 備註↕ |
|---|---|
tempCartUUID 必填 | 此值透過呼叫 Zonos createTempCart API 服務端點取得。string / GUID |
country | 目的地國家的 兩位字母 ISO 代碼。我們強烈建議傳入此參數以改善使用者體驗。country 參數將在 Zonos Checkout 內預選目的地國家。使用網站上的 Zonos Hello JS (JavaScript) 時,您可以呼叫 JavaScript 方法來取得此值:zonos.country()。string (Length: 2) |
其他字串資料型別
customerNamecustomerCompanycustomerEmailcustomerPhonecustomerAltPhonecustomerAddress1customerAddress2customerCitycustomerStatecustomerZip
建立結帳
探索建立結帳所涉及的鍵值對。
此 API 端點用於將購物車資訊和客戶購物車中的商品發送至 Zonos API。
您將收到包含
tempCartUUID的 JSON 回應,這是 Zonos 系統中的唯一購物車識別碼。這將用於將客戶重定向到 Zonos Checkout,以完成訂單。