使用 PayPal API 更新数字订单的运送详细信息

问题描述 投票:0回答:1

我正在使用 Paypal 标准结账,使用 Rest API 进行数字订单。客户付款后,订单就会标记为“已完成”。现在,我必须通过转到 txn 页面 => 添加跟踪信息 => 选择订单状态 => 订单已处理(不需要跟踪号)=> 提交来更新运输详细信息。

我尝试使用 API 来执行此操作,首先从 https://api.paypal.com/v2/ payments/captures/{ payment ID} 获取 orderID,然后从 https://api 获取订单详细信息。 paypal.com/v2/checkout/orders/{order_id};

但无法理解如何更新此状态以及哪个端点可以工作?手动更新大量订单非常繁琐。

paypal paypal-sandbox paypal-rest-sdk
1个回答
0
投票

请参阅添加包裹跟踪文档。

以下是一个向订单添加跟踪的 API 请求示例。发送的商品与原始创建/捕获订单中的商品相同(sku 值必须匹配)

发布到 https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T/track

{ 
"capture_id": "8MC585209K746392H", 
"tracking_number": "443844607820", 
"carrier": "FEDEX", 
"notify_payer": true, 
"items": [{
  "sku": "sku01",
  "quantity": "1",
  "name": "T-Shirt",
  "description": "Green T-Shirt",
  "image_url": "https://example.com/static/images/items/1/tshirt_green.jpg",
  "url": "https://example.com/url-to-the-item-being-purchased-1",
  "upc": {
    "type": "UPC-A",
    "code": "123456789012"
  }
}, {
  "sku": "sku02",
  "quantity": "2",
  "name": "Shoes",
  "description": "Running, Size 10.5",
  "image_url": "https://example.com/static/images/items/1/shoes_running.jpg",
  "url": "https://example.com/url-to-the-item-being-purchased-2",
  "upc": {
    "type": "UPC-A",
    "code": "987654321012"
  }
}]
}
© www.soinside.com 2019 - 2024. All rights reserved.