You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PayPal REST API支付详情接口疑问:是否仅支持未完成支付?

PayPal /v1/payments/payment/{payment_id}: Clarifying "that has yet to complete" & Checking Payment Status

Let me break this down clearly for you—first, that confusing phrase in the documentation, then how to actually use this interface (and others) to verify if a transaction is complete.

What "that has yet to complete" means

The key takeaway here is: this interface is designed to return details for payments that haven't reached their final, completed state yet.

Think of PayPal's payment flow as having distinct stages. A payment might be created (created state), approved by the user (approved state), but not yet "completed"—like when a merchant hasn't captured the funds, or the transaction is still pending. This endpoint is built for those in-progress payments. If the payment has fully finished (funds captured, transaction finalized), this endpoint won't give you the full picture of its completed status—and in some cases, might not return the data you expect.

How to check payment status with this endpoint

Even though it's focused on in-progress payments, you can still get critical state info from the response:

  • Look for the top-level state field:
    • created: Payment was created but no user action has been taken yet
    • approved: User has authorized the payment, but funds haven't been captured (so the transaction isn't fully complete yet)
    • failed: The payment attempt failed
  • If the payment has been captured (i.e., completed), the transactions[].related_resources array will include a sale object. That sale object has its own state field—look for completed here to confirm funds have been successfully captured.

Example response snippet for an approved, captured payment:

{
  "id": "PAY-123456789",
  "state": "approved",
  "transactions": [
    {
      "related_resources": [
        {
          "sale": {
            "id": "SALE-987654321",
            "state": "completed",
            "amount": {
              "total": "10.00",
              "currency": "USD"
            }
          }
        }
      ]
    }
  ]
}

For fully completed transactions: Use the Sale endpoint

If you know the payment is done and want definitive status details, use the /v1/payments/sale/{sale_id} endpoint instead. You can grab the sale_id from the related_resources section of the payment response (like in the example above). This endpoint is purpose-built for completed transactions and will give you all finalized details, including settlement info, refunds, etc.

Quick recap

  • "that has yet to complete" = this endpoint focuses on payments still in the workflow (not fully finalized)
  • To check if a payment is complete via this endpoint: Verify the sale object exists and its state is completed
  • For finalized transactions, use the Sale endpoint for the most accurate, complete data

内容的提问来源于stack exchange,提问作者KayakinKoder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:44:24