[英]PayPal JSON format updating order
我知道我已經很接近了,錯誤消息越來越好。 目前,我可以通過 Postman 撥打類似的電話來更新賣家的 email no issue,目前正在更新金額和相關對象。 我的請求格式中的某些內容已關閉。
我的細分部分是否在正確的位置? amount_breakdown 文檔看起來與 value 和 currency_code 處於同一級別,因此是否需要移至該部分。
這是我通過 Postman 請求 JSON:
[
{
"op": "replace",
"path": "/purchase_units/@reference_id=='default'/amount",
"value": {
"currency_code": "CAD",
"value": "2",
"amount": {
"currency_code": "CAD",
"value": "2",
"breakdown": {
"item_total": {
"currency_code": "CAD",
"value": "2"
},
"tax_total": {
"value": "0",
"currency_code": "CAD"
}
}
},
"items": [
{
"name": "First Product Name",
"description": "Optional descriptive text..",
"unit_amount": {
"currency_code": "CAD",
"value": "2"
},
"tax": {
"value": "0",
"currency_code": "CAD"
},
"quantity": "1"
}
]
}
}
]
回復:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"field": "/purchase_units/@reference_id=='default'/amount/breakdown/item_total",
"location": "body",
"issue": "ITEM_TOTAL_REQUIRED",
"description": "If item details are specified (items.unit_amount and items.quantity) corresponding amount.breakdown.item_total is required."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "acecd3643c994",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-ITEM_TOTAL_REQUIRED",
"rel": "information_link",
"method": "GET"
}
]
}
謝謝你的幫助!
對象的不同變化。 我可以讓其他 PATCH 操作正常工作,但在 object 結構中要簡單得多
/amount 路徑下不應有amount
鍵,並且items
數組也不屬於該 /amount 路徑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.