Skip to main content
POST
cURL

Automatic Coupons

The API call applies a predefined automatic coupon that aligns with specific promotional criteria and reward structures. It enables seamless integration with promotional campaigns, ensuring coupons are issued based on predefined eligibility conditions, enhancing customer engagement and marketing efforts.
Channel Merging Available
If your system uses different customer IDs across multiple channels (e.g., online and offline), Gameball’s channel merging feature helps unify customer profiles. By including the customer’s mobile number or email (based on your merging configuration) with each request, Gameball will combine activities into a single profile.
For more information, head to the Omni-Channel Handling Guide.

Request Body

string
required
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.
string
Customer’s email address.
This is required if your account uses email-based channel merging.
string
Customer’s mobile number.
This is required if your account uses mobile-based channel merging.
string
required
Identifier for the shopping cart associated with the order.
float
The total cost of the order, including all item prices, shipping, taxes, and tips. This value does not account for any discounts or coupons applied and is not used for calculations in Gameball; it is solely saved as historical data linked to the order. Must be a positive value.Example: A customer purchases items worth 120,includingtaxesandshipping.Evenifa120, including taxes and shipping. Even if a 20 coupon is applied, the totalPrice remains $120 as it represents the original cost of the order before any discounts are applied.
float
The total shipping cost associated with the order. This should be included when a Free Shipping promotion is configured in your account, enabling the system to calculate and apply the appropriate discount to the cart.
array
An array containing details about each product in the order. If not provided, the calculation will only consider the total order values.
string
Unique identifier for the product or service being purchased.
float
Number of units purchased for this product or service.
float
The original price of a single product before any tax or discount is applied. This reflects the cost of one unit of the item, not the total for multiple quantities in an order.Example: If the original price of a product is 50andacustomerbuystwounits,thepriceforeachitemwouldstillberecordedas50 and a customer buys two units, the **price** for each item would still be recorded as 50, regardless of quantity.
string
Stock Keeping Unit (SKU) for the product.
array
Tags associated with the product for categorization or promotional purposes.
array
Product category, such as fashion or electronics. It can include one or multiple categories. Example: ["natural", "cosmetics"]
float
Weight of the product.
string
Vendor or manufacturer of the product.
array
Collection ID(s) to which the product belongs. It can include one or multiple collections. Example: ["14313", "4343"]
string
Product title or name.
float
The total amount of taxes applied to the line item, expressed in the shop’s currency. This amount must be positive and reflects the total taxes based on the quantity of the item.
float
The total discount applied to this line item, expressed as a positive value. This amount should reflect the total discounts based on the quantity of the item.
object
Key-value pairs containing any extra information about the product, such as size, color, or other custom attributes. The values must be of type string or number.
object
This object contains details about the specific merchant involved in the transaction, which is particularly important for businesses managing multiple merchants or branches under the same Gameball account. This object can provide identifying information about both the main merchant and any associated branch where the transaction took place.
string
Unique identifier for the merchant.
string
Name of the merchant.
string
required
Unique identifier for the branch where the order took place.
string
Name of the branch where the order took place.

Response

boolean
A boolean indicating whether a coupon was successfully applied to the order (true if applied, false otherwise).
string
The name of the applied coupon.
number
The total discount value applied to the order.
string
Type of the coupon, such as fixed amount, percentage discount, free shipping, or product-specific coupon.Possible Values:
  • shipping
  • fixed
  • percentage
  • product
  • buyXgetY
array
A list of affected items, detailing their price, quantity, and applied discount.
string
Unique identifier for the product or service.
number
Number of units purchased for this product or service.
float
The total discount applied to this line item.
float
The original price of a single product.

Authorizations

apikey
string
header
required

Body

application/json
customerId
string
required
cartId
string
required
email
string
mobile
string
totalPrice
number
totalShipping
number
lineItems
object[]
merchant
object

Response

200 - application/json

Automatic coupon applied successfully

isApplied
boolean
couponName
string
discountAmount
number
discountType
enum<string>
Available options:
shipping,
fixed,
percentage,
product,
buyXgetY
discountedItems
object[]