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

POST

/api/v1/customer/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

Parameter

Value / Type

Required

quantity

INTEGER

true

details_id

STRING

false (true if product has attributes)

shipping_address_id

STRING

true (not required with gift)

balances

ARRAY

true

is_gift

BOOLEAN (1 or 0)

false (required with gift)

message

STRING

false

alt_customer_id

STRING

false (required with gift)

show_at

DATETIME (Y-m-d H:i:s)

false

shipping_selection

BOOLEAN (1 or 0)

false

shipping_location_id

STRING

false

isFreeItem

BOOLEAN(1 or 0)

false

rewardHistoryId

STRING

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"
}
{
    "status": false,
    "message": "Could not complete purchase. Your account was temporarily locked"
}
{
    "status": false,
    "message": "Could not complete purchase. Your account was locked"
}
{
    "status": false,
    "message": "For a free item, you can not purhase more then one quantity."
}