Shopify API:通过第三方收费流程销售商品

时间:2012-08-17 07:06:03

标签: shopify

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

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

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

我知道这是一个复杂的问题。任何见解都会非常感激。

由于

2 个答案:

答案 0 :(得分:1)

Shopify现在允许您使用API​​ create orders。一个简单的例子是:

POST到/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": [

]
 }
}

答案 1 :(得分:0)

如果通过Shopify跟踪订单并不是一件大事,只需通过Shopify API调整变量库存/产品可用性,这绝对可行。