1
votes

I'm building an auctions app for Shopify. The way it would work is that it would use a payment gateway like Stripe to capture the payment details of a bid and then execute the winning bid at the end of the auction, cancelling the remaining bids. It would then notify the Shopify store through the API, that the product variant has been sold.

Since a delayed capture-authorization workflow is not possible using the conventional payment gateways(which don't use a payment tokenization system), the app would need the merchant to enter their Stripe credentials in the app (not Shopify). The app would then create a charge by itself for winning bid, and not go through Shopify's Charge process.

My question is that, is it possible to mark an product variant sold through the Shopify API, without creating a Shopify Charge, or by creating a dummy charge (since now the app not Shopify charges the customer) without changing the merchant's order processing workflow.

I know its kind of a complicated question. Any insights would be much appreciated.

Thanks

3
Like answers to this question state, its currently not possible to build an app like that. Hence I've taken a different approach to building auctionful.com - Akshay Rawat

3 Answers

2
votes

You cannot create orders using the API at this time. There is no such thing as "Marking a variant as sold".

2
votes

Shopify now allows you to create orders using the API. A simple example is:

POST to /admin/orders.json

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

Response:

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": [

]
 }
}
0
votes

If tracking orders through Shopify isn't a big deal just adjust the variant inventory/product availability through the Shopify API, which is definitely doable.