PayPal 订单 purchase_units:reference_id 与 custom_id?

PayPal Orders purchase_units: reference_id vs custom_id?

我正在努力设置订单,对文档感到有点困惑,特别是给 purchase_units 的这两个单独的 ID。

文档列出:

reference_id string
The API caller-provided external ID for the purchase unit. Required for multiple purchase units when you must update the order through PATCH. If you omit this value and the order contains only one purchase unit, PayPal sets this value to default.

custom_id string
The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer.

它们都具有相同的 The API caller-provided external ID 位,这让我感到困惑。似乎其中一个是我想要传递的 id 以跟踪另一侧的订单,custom_id 听起来更像这样,但是 reference_id 应该是什么是?这听起来几乎是一回事,只是我想给它的 id,这样我以后可以跟踪它。

如果我的所有订单都只有一个 purchase_item 是否有任何理由使用 reference_id

reference_id的目的是区分单个订单中的多个purchase_item。因为你所有的都只有一个,所以没有理由使用它。

使用 custom_id 满足任何对帐需求,因为它将作为 PayPal 交易的一部分存储。