api/v1/customer/manufacturer/swag-shop/products/{id}/purchase

POST

/api/v1/customer/manufacturer/swag-shop/products/{id}/purchase

This API method allows the customer to purchase a swag item with any of the allowed balances of the product.

Optionally, we can pass a parameter of "is_gift", which will mark this as a gift purchase. This will require you to enter the alt_customer_id which is the receiver of the gift's customer ID. We can also attach a message to the gift.

Request Parameters

ParameterValue / TypeRequired
quantityINTEGERtrue
details_idSTRINGfalse (true if product has attributes)
shipping_address_idSTRINGtrue (not required with gift)
balancesARRAYtrue
is_giftBOOLEAN (1 or 0)false (required with gift)
messageSTRINGfalse
alt_customer_idSTRINGfalse (required with gift)
show_atDATETIME (Y-m-d H:i:s)false

Sample Response

{
    "status": true,
    "message": "Successfully completed transaction"
}
{
    "status": false,
    "message": "You do not have enough points to complete this transaction"
}
{
    "status": false,
    "message": "Max quantity per purchase exceeded"
}
{
    "status": false,
    "message": "Invalid transaction. You must submit the exact sale amount in points."
}
{
    "status": false,
    "message": "This item has expired and cannot be purchased"
}
{
    "status": false,
    "message": "Max quantity per day exceeded"
}
{
    "status": false,
    "message": "Failed to complete transaction"
}
{
    "status": false,
    "errorCode": "AGE_RESTRICTION",
    "message": "Failed to purchase item, you do not meet the age requirements necessary for this item"
}