Reputation: 111
I'm selling event tickets for a company, and I use the BlueSnap Extended API to sell the tickets.
I create a new catalog SKU each event with the corresponding price for a seat, following the BlueSnap documentation here: https://developers.bluesnap.com/v8976-Extended/docs/create-sku. These events have a given number of seats, and there are a few other promoters who can sell tickets to the same event.
I want to make sure we don't overbook the venue, and to know exactly how many seats are sold - minus refunds/cancellations if they happen. I thought of managing it on my side using IPNs, but it's not easy, especially if I need to cancel and restore the inventory. I researched the documentation and couldn't find a solution - Is there any built-in way to limit the units sold for a specific SKU?
Upvotes: 4
Views: 84
Reputation: 3275
This is an interesting hidden feature of BlueSnap's API - the inventory management. For some strange reason you cannot find it in their online documentation but it exists and it is working.
In order to create a SKU that has a specific inventory count, you need to use the create SKU API: https://developers.bluesnap.com/v8976-Extended/docs/create-sku, and add two lines to the request:
<catalog-sku xmlns="http://ws.plimus.com">
<contract-name>Seats for Show example</contract-name>
<product-id>307634</product-id>
<sku-type>DIGITAL</sku-type>
<enable-inventory-mgt>true</enable-inventory-mgt>
<inventory>1000</inventory>
<pricing-settings>
<charge-policy-type>ONE TIME PAYMENT</charge-policy-type>
<charge-policy>
<one-time-charge>
<catalog-prices>
<catalog-price>
<base-price>true</base-price>
<currency>USD</currency>
<amount>7.00</amount>
</catalog-price>
</catalog-prices>
</one-time-charge>
</charge-policy>
</pricing-settings>
</catalog-sku>
The two added lines enable-inventory-mgt and inventory dictate if the SKU will have inventory management, and if how many units the SKU has.
You can set the inventory management arbitrarily at any given time - but once the numbers are set, any purchase of this SKU will lower the inventory count, and any refund will recoup the inventory items automatically. Once you are out of inventory, no more sales will be allowed - and you can either stop there, or replenish the inventory by setting a new amount, or simply remove the inventory restriction if you so choose (using update SKU - https://developers.bluesnap.com/v8976-Extended/docs/update-sku)
In the scenario you describe, once the seats are all sold - you and your colleagues will not be able to sell any more tickets of that SKU, and you don't have to coordinate your sales - it's all done automatically.
Upvotes: 4