Order
The order endpoints are used to track a new order. They are designed specifically for E-Commerce Solutions.
Available Endpoints
Type | Description | Endpoint |
POST | /integrations/order | |
POST | /integrations/order/cashback |
POST - Order
After successfully placing a new order on your system, this endpoint can be used to track order details, optionally redeem points, and finally rewarding the customer for the placed order.
This endpoint performs multiple operations internally including sending an event, reward wallet points, redeem wallet points as per your configured programs. It offers a hassle-free single point of integration for e-commerce cases.
Order endpoint internally triggers a "place_order" event, so no need to manually send such event to Gameball after placing an order
For more information about tracking orders and cashback reward, check checkout integration example tutorial
mobile
or email
should be sent along with the playerUniqueId
in case (only if) your account supports channel merging.
In cases where channel merging is supported, you have the flexibility to identify users by their mobile number or email. For accounts utilizing separate systems for online and offline channels, it's advisable to consider changing the customer's unique ID to either their mobile number or email address for enhanced efficiency.
Request
Header
Attribute | Type | Required | Description |
| string | Yes | Client API key |
| string | Yes | Client Secret Key |
Body
Attribute | Type | Required | Description |
| string | Yes | Unique identifier for the customer in your database. |
| string | No | Customer's unique mobile number. (Sent in case your account supports channel merging) |
| string | No | Customer's unique email. (Sent in case your account supports channel merging) |
| string | Yes | Unique order ID which identifies the underlying order in your system, e.g. order number, invoice number. It will be used for reversing any reward or redemption transaction on Gameball. |
| string | Yes | The date this order was placed, as an ISO8601 timestamp. Defaults to now if not provided. Example: |
| number | Yes | The actual paid amount to the store. (Based on this amount, the customer will be rewarded. Also, According to the Cashback Configuration). Must be positive. |
| number | No | The sum of all order items' prices, including discounts, shipping, taxes, and tips. (Note: Example:
|
| number | No | The total shipping price of the order. Must be positive. |
| number | No | The sum of all the taxes applied to the order in the shop currency. Must be positive. |
| number | No | Total discount applied on this order. Must be positive. |
| array | No | A list of line item objects, each containing information about an item in the order. |
| array | No | An array of discount codes. Example: |
| object | No | Key value pair(s) of any extra information about the order. The key values must be of type string or number Example:
|
| number | No | Monetary value of the redeemed points to be used by that customer while placing his order. Note: If this field is set, then the |
| string | No | Hold reference ID is received after calling Hold Points API. This is used in case you want to use already held points Note: If this field is set, then the |
| boolean | No | A boolean value indicating if the customer who placed this order is a guest. The default is false. |
| object | No | Merchant object describes the merchant itself. |
lineItems
Object
lineItems
ObjectAttribute | Type | Required | Description |
| string | No | The ID of the product that the line item belongs to |
| string | No | The item's SKU (stock keeping unit). |
| string | No | The title of the product. |
| array | No | Product category (fashion, electronics.. etc). It can be one category or multiple categories. Example: |
| array | No | Collection ID(s) to which the product belongs. It can be one collection or multiple collections. This will be also based on the available collections in your store. Example: |
| array | No | Tag(s) attached to the item in the order. Example: |
| number | No | Item weight. Must be positive. |
| string | No | The name of the item's supplier. Example: |
| number | No | Number of items purchased of this line item. Must be positive. |
| number | Yes * | The original price of the product before adding tax or discount. Note that: it should reflect the price of a single product ignoring quantity |
| number | Yes * | The sum of all the taxes applied to the line item in the shop currency. Must be positive. Note that: It should reflect total taxes for line item considering quantity |
| number | Yes * | Total discount applied on this line item. Must be positive. Note that: This value should reflect total discounts for line item considering quantity |
The (*) in the required column denotes that this value is required only if you wish to use the Custom Cashback configurations.
merchant
object
merchant
objectAttribute | Type | Description |
| string | Merchant unique id or code |
| string | Merchant name |
| object | Optional branch information |
| string | Branch unique id or code |
| string | Branch name |
In case the customer doesn't exist on Gameball before sending the Orders API call, the customer will be created automatically on Gameball.
Sample Request Body
Response
Parameter | Type | Description |
| string | Unique identifier for the customer in your database. |
| integer | The number of points redeemed by the customer while placing his order |
| integer | The number of points rewarded to the customer for the paid amount. (Based on your Cashback configuration) |
| array | Array of lineItem response objects, for each lineItem response object, the |
lineItem
response object
lineItem
response objectAttribute | Type | Description |
| string | The ID of the product that the line item belongs to. |
| integer | The rewarded points for one product only and can be redeemed later with monetary value for discounts or free items. |
| float | The rewarded points for one product only as a decimal number. |
| integer | The rewarded score for one product only and it can allow customers to advance to the next VIP tier. |
| integer | The number of items purchased of this line item. |
Sample Response Body
Usage Example
POST - Calculate Order Cashback
This API is used to calculate the order cashback points to be rewarded based on your cashback config. It can be also used to show the cashback points to be rewarded for a single product by providing a single line item in the request.
mobile
or email
should be sent along with the playerUniqueId
in case (only if) your account supports channel merging.
Request
Header
Attribute | Type | Required | Description |
| string | Yes | Client API key |
Body
Attribute | Type | Required | Description |
| string | No | Unique identifier for the customer in your database (Note :While the |
| string | No | Customer's unique mobile number. (Sent in case your account supports channel merging) |
| string | No | Customer's unique email. (Sent in case your account supports channel merging) |
| number | Yes | The actual paid amount to the store. (Based on this amount, the customer will be rewarded. Also, According to the Cashback Configuration). Must be positive. |
| number | No | The sum of all order items' prices, including discounts, shipping, taxes, and tips. (Note: Example:
|
| number | No | The total shipping price of the order. Must be positive. |
| number | No | The sum of all the taxes applied to the order in the shop currency. Must be positive. |
| number | No | Total discount applied on this order. Must be positive. |
| array | No | A list of lineItem objects, each containing information about an item in the order. |
| object | No | Merchant object describes the merchant itself. |
lineItems
Object
lineItems
ObjectAttribute | Type | Required | Description |
| string | No | The ID of the product that the line item belongs to |
| array | No | Collection ID(s) to which the product belongs. It can be one collection or multiple collections. This will be also based on the available collections in your store. Example: |
| number | No | Number of items purchased of this line item. Must be positive. |
| number | Yes * | The original price of the product before adding tax or discount. Note that: it should reflect the price of a single product ignoring quantity |
| number | Yes * | The sum of all the taxes applied to the line item in the shop currency. Must be positive. Note that: It should reflect total taxes for line item considering quantity |
| number | Yes * | Total discount applied on this line item. Must be positive. Note that: This value should reflect total discounts for line item considering quantity |
The (*) in the required column denotes that this value is required only if you wish to use the Custom Cashback configurations.
merchant
object
merchant
objectAttribute | Type | Description |
| string | Merchant unique id or code |
| string | Merchant name |
| object | Optional branch information |
| string | Branch unique id or code |
| string | Branch name |
Sample Request Body
Response
Parameter | Type | Description |
| integer | The total rewarded points by the order |
| integer | The total rewarded score by the order. |
| array | Array of lineItem response objects, for each lineItem response object, the |
lineItem
response object
lineItem
response objectAttribute | Type | Description |
| string | The ID of the product that the line item belongs to. |
| integer | The rewarded points for a one product only |
| float | The rewarded points for a one product only as a decimal number |
| integer | The rewarded score for a one product only |
| integer | The number of items purchased of this line item. |
Sample Response
Usage Example
Last updated