如何使用admin / orders.json在shopify中创建订单?

时间:2017-04-25 04:48:55

标签: json shopify postman

我尝试使用邮递员的orders.json创建订单,但它正在返回登录页面作为回应 有什么我想念的吗?
我使用了API URL和order-json,如下所示。

API网址:
https://a472274900fb234caa5934af0301c96f:5ad3266cfabffe98052e261263fa30f6@kathacafetest1.myshopify.com/admin/orders.json

在体内使用以下JSON

{
  "order": {
    "email": "sunil@gmail.com",
    "fulfillment_status": "fulfilled",
    "send_receipt": true,
    "send_fulfillment_receipt": true,
    "line_items": [
      {
        "variant_id": 34747634826,
        "quantity": 1
      }
    ]
  }
}

enter image description here


修改
我在邮递员中使用了以下请求

POST /admin/orders.json HTTP/1.1
Host: a472274900fb234caa5934af0301c96f:5ad3266cfabffe98052e261263fa30f6@kathacafetest1.myshopify.com
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: ee88ee69-f444-de8c-5eaf-e1a8d3f6d195

{
  "order": {
    "email": "sunil@iprospl.com",
    "fulfillment_status": "fulfilled",
    "send_receipt": true,
    "send_fulfillment_receipt": true,
    "line_items": [
      {
        "variant_id": 33433316417,
        "quantity": 1
      }
    ]
  }
}

1 个答案:

答案 0 :(得分:0)

我使用https://www.hurl.it/#top提出请求。

邮寄:https://a472274900fb234caa5934af0301c96f:5ad3266cfabffe98052e261263fa30f6@kathacafetest1.myshopify.com/admin/orders.json

标题:
"内容类型":"应用/ JSON"

身体:

{
  "order": {
    "email": "sunil@iprospl.com",
    "fulfillment_status": "fulfilled",
    "send_receipt": true,
    "send_fulfillment_receipt": true,
    "line_items": [
      {
        "variant_id": 33433316417,
        "quantity": 1
      }
    ]
  }
}

已成功创建订单"。