首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Square API:创建Checkout API错误

Square API:创建Checkout API错误
EN

Stack Overflow用户
提问于 2017-06-17 09:45:48
回答 0查看 437关注 0票数 0

使用示例邮递员请求时:

代码语言:javascript
运行
复制
{
  "idempotency_key": "74ae1696-b1e3-4328-af6d-f1e04d947a13",
  "order": {
    "reference_id": "my-order-001",
    "line_items": [
    {
      "name": "line-item-1",
      "quantity": "1",
      "base_price_money": {
        "amount": 1599,
        "currency": "USD"
      }
    },
    {
      "name": "line-item-2",
      "quantity": "2",
      "base_price_money": {
        "amount": 799,
        "currency": "USD"
      }
    }]
  },
  "ask_for_shipping_address": true,
  "merchant_support_email": "merchant+support@website.com",
  "pre_populate_buyer_email": "buyer@email.com",
  "pre_populate_shipping_address": {
    "address_line_1": "500 Electric Ave",
    "address_line_2": "Suite 600",
    "locality": "New York",
    "administrative_district_level_1": "NY",
    "postal_code": "10003",
    "first_name": "Jane",
    "last_name": "Doe"
  },
  "redirect_url": "https://merchant.website.com/order-confirm"
}

我得到了以下响应:

代码语言:javascript
运行
复制
{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "INVALID_VALUE",
      "detail": "The order must have at least one line item.",
        "field": "line_items"
    }]
}

这只是执行可通过https://docs.connect.squareup.com/api/connect/v2/#runningpostman获得的示例邮递员请求

EN

回答

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

https://stackoverflow.com/questions/44600019

复制
相关文章

相似问题

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