首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PayPal Invoicing VALIDATION_ERROR

PayPal Invoicing VALIDATION_ERROR
EN

Stack Overflow用户
提问于 2022-05-28 14:44:29
回答 1查看 149关注 0票数 0

我正在开发一个应用程序,与PayPal的API通信,以创建发票。

这是我的请求机构:

代码语言:javascript
复制
{
  "detail": {
    "currency_code": "USD",
    "note": "Thank you for using my services!"
  },
  "invoicer": {
    "name": {
      "given_name": "Shreyas",
      "surname": "Ayyengar"
    },
    "email_address": "{email}",
    "website": "{website}"
  },
  "primary_recipients": [
    {
      "billing_info": {
        "email_address": "{client_email}"
      }
    }
  ],
  "items": [
    {
      "name": "{invoice_name}",
      "description": "{invoice_description}",
      "quantity": "1",
      "unit_amount": {
        "currency_code": "USD",
        "value": "{invoice_amount}"
      },
      "tax": {
        "name": "PayPal Service Tax",
        "percent": "7.25"
      }
    }
  ],
  "configuration": {
    "partial_payment": {
      "allow_partial_payment": false
    },
    "allow_tip": true
  }
}

虽然有像:{client_email}这样的占位符,但我可以保证它们正在按预期正确地替换。

然而,我被抛出了一个我无法理解的VALIDATION_ERROR{"name":"VALIDATION_ERROR","message":"Invalid request - see details.","information_link":"https://developer.paypal.com/docs/api/invoicing/#errors","details":[{"field":"merchant_info","issue":"cannot be null."},{"field":"items[0].unit_price","issue":"null"}]}

据我所能理解的,这个错误说我丢失了像Items[].unit_pricemerchant_info这样的信息,但是我不知道它应该在我的请求体中的位置。我正在跟踪直接文档这里,但我看不到提到unit_pricemerchant_info的任何内容。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-28 14:49:38

将请求提交到正确的API端点https://api-m.sandbox.paypal.com/v2/invoicing/invoices

注意主版本号。有关细节,请参阅发票API参考

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72416591

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档