1

我正在为 Shopify 构建一个拍卖应用程序。它的工作方式是使用像 Stripe 这样的支付网关来捕获投标的支付细节,然后在拍卖结束时执行中标,取消剩余的投标。然后它会通过 API 通知 Shopify 商店产品变体已售出。

由于使用传统支付网关(不使用支付令牌化系统)无法实现延迟的捕获授权工作流程,因此该应用程序需要商家在应用程序(而不是 Shopify)中输入他们的 Stripe 凭据。然后,该应用程序会自行为中标创建收费,而不是通过 Shopify 的收费流程。

我的问题是,是否可以标记通过 Shopify API 销售的产品变体,而无需创建 Shopify 费用,或者通过创建虚拟费用(因为现在应用程序不是 Shopify 向客户收费)而不更改商家的订单处理工作流程。

我知道这是一个复杂的问题。任何见解将不胜感激。

谢谢

4

3 回答 3

2

您目前无法使用 API 创建订单。没有“将变体标记为已售”之类的东西。

于 2012-08-17T12:30:17.187 回答
2

Shopify 现在允许您使用 API创建订单。一个简单的例子是:

发布到 /admin/orders.json

{
  "order": {
    "line_items": [
      {
        "variant_id": 447654529,
        "quantity": 1
      }
    ]
  }
}

回复:

HTTP/1.1 201 Created

{
"order": {
"buyer_accepts_marketing": false,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": null,
"checkout_token": null,
"closed_at": null,
"confirmed": true,
"created_at": "2014-05-23T14:17:59-04:00",
"currency": "USD",
"email": "",
"financial_status": "paid",
"fulfillment_status": null,
"gateway": "",
"id": 1073460004,
"landing_site": null,
"location_id": null,
"name": "#1002",
"note": null,
"number": 2,
"reference": null,
"referring_site": null,
"source": "api",
"source_identifier": null,
"source_name": "api",
"source_url": null,
"subtotal_price": "199.00",
"taxes_included": false,
"test": false,
"token": "c9afa7b7ecb0cc1a3e60652658c4c76c",
"total_discounts": "0.00",
"total_line_items_price": "199.00",
"total_price": "199.00",
"total_price_usd": "199.00",
"total_tax": "0.00",
"total_weight": 0,
"updated_at": "2014-05-23T14:17:59-04:00",
"user_id": null,
"browser_ip": null,
"landing_site_ref": null,
"order_number": 1002,
"discount_codes": [

],
"note_attributes": [

],
"processing_method": "",
"checkout_id": null,
"tax_lines": [

],
"tags": "",
"line_items": [
  {
    "fulfillment_service": "manual",
    "fulfillment_status": null,
    "gift_card": false,
    "grams": 0,
    "id": 1071823214,
    "price": "199.00",
    "product_id": 921728736,
    "quantity": 1,
    "requires_shipping": true,
    "sku": null,
    "taxable": true,
    "title": "IPod Touch 8GB",
    "variant_id": 447654529,
    "variant_title": null,
    "vendor": null,
    "name": "IPod Touch 8GB",
    "variant_inventory_management": "shopify",
    "properties": [

    ],
    "product_exists": true,
    "fulfillable_quantity": 1,
    "tax_lines": [

    ]
  }
],
"shipping_lines": [

],
"fulfillments": [

],
"refunds": [

]
 }
}
于 2014-06-30T10:26:25.990 回答
0

如果通过 Shopify 跟踪订单不是什么大问题,只需通过 Shopify API 调整变体库存/产品可用性,这绝对是可行的。

于 2012-08-17T17:59:25.690 回答