Order
This endpoint is used to track a new order. This endpoint is designed specifically for E-Commerce Solutions.
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 player 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.
For more information about tracking orders and cashback reward, check checkout integration example tutorial

POST - Order

1
https://api.gameball.co/api/v3.0/integrations/order
Copied!

Request

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key
secretKey
string
Yes
Client Secret Key

Body

Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player in your database.
orderId
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.
orderDate
string
Yes
The date this order was placed, as an ISO8601 timestamp. Defaults to now if not provided.
Example:"2019-09-21T16:53:28.190Z"
totalPaid
number
Yes
The actual paid amount to the store. (Based on this amount, the player will be rewarded. Also, According to the Cashback Configuration). Must be positive.
totaPrice
number
Yes
The sum of all order items' prices, including discounts, shipping, taxes, and tips. (Note: totalPaid is part of the totalAmount). Must be positive.
Example:
"totalPaid": 22,
"totalAmount": 30
totalShipping
number
No
The total shipping price of the order. Must be positive.
totalTax
number
No
The sum of all the taxes applied to the order in the shop currency. Must be positive.
totalDiscount
number
No
Total discount applied on this order. Must be positive.
lineItems
object
No
A list of line item, each containing information about an item in the order.
discountCodes
array
No
An array of discount codes.
Example:["AU7X-8Q7L", "BY3V-22GK"]
extra
object
No
Key value pair(s) of any extra information about the order. The key values must be of type string or number
Example: "extra": {
"paymentMethod": "credit card"
}
redeemedAmount
number
No
Monetary value of the redeemed points to be used by that player while placing his order.
Note: If this field is set, then the holdReference value should be null. Also, both fields could be null.
holdReference
string
No
Hold reference ID 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 redeemedAmount value should be null. Also, both fields could be null.
guest
boolean
No
A boolean value indicating if the customer who placed this order is a guest. The default is false.
merchant
object
No
Merchant object describes the merchant itself.

lineItems Object

Attribute
Type
Required
Description
productId
string
No
The ID of the product that the line item belongs to
sku
string
No
The item's SKU (stock keeping unit).
title
string
No
The title of the product.
category
array
No
Product category (fashion, electronics.. etc). It can be one category or multiple categories.
Example:["natural","cosmetics"]
collection
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:["14313","4343"]
tags
array
No
Tag(s) attached to the item in the order.
Example:["VIP", "Elite"]
weight
number
No
Item weight. Must be positive.
vendor
string
No
The name of the item's supplier.
Example:"nike"
quantity
number
No
Number of items purchased of this line item. Must be positive.

merchant object

Attribute
Type
Description
uniqueId
string
Merchant unique id or code
name
string
Merchant name
branch
object
Optional branch information
branch.uniqueId
string
Branch unique id or code
branch.name
string
Branch name
In case the player doesn't exist on Gameball before sending the Orders API call, the player will be created automatically on Gameball.

Sample Request Body

1
{
2
"playerUniqueId":"player456",
3
"orderId": "6253e03b",
4
"orderDate":"2019-09-21T16:53:28.190Z",
5
"totalPrice": "100",
6
"totalPaid": "90",
7
"totalDiscount": "0",
8
"totalShipping": "0",
9
"totalTax": "0",
10
"lineItems":[
11
{
12
"productId":"197765",
13
"tag": ["VIP"],
14
"category": [
15
"natural",
16
"cosmetics"
17
],
18
"weight": "20",
19
"vendor": "nike",
20
"collection": ["14313", "4343"],
21
},
22
{
23
"productId":"875511",
24
"title": "XPS-15s",
25
"category": [
26
"electronics"
27
],
28
"vendor": "Dell"
29
}
30
]
31
"discountCodes": [
32
"AU7X-8Q7L",
33
"BY3V-22GK"
34
],
35
"extra": {
36
"paymentMethod": "credit card",
37
"billingAddress": "Alabama"
38
},
39
"redeemedAmount": 20,
40
"holdReference": null,
41
"guest": false
42
}
Copied!

Response

Parameter
Type
Description
playerUniqueId
string
Unique identifier for the player in your database.
redeemedPoints
integer
The number of points redeemed by the player while placing his order
rewardedPoints
integer
The number of points rewarded to the player for the paid amount. (Based on your Cashback configuration)

Sample Response Body

1
{
2
"playerUniqueId": "player123",
3
"redeemedPoints": 300,
4
"rewardedPoints": 1000
5
}
Copied!

Usage Example

cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' \
2
-H 'secretKey: klmb041b7d354259l3u4ft35e1q2r3703' -d '{
3
"playerUniqueId":"player456",
4
"orderId": "6253e03b",
5
"orderDate":"2019-09-21T16:53:28.190Z",
6
"totalPrice": "100",
7
"totalPaid": "90",
8
"totalDiscount": "0",
9
"totalShipping": "0",
10
"totalTax": "0",
11
"lineItems":[
12
{
13
"productId":"197765",
14
"tag": ["VIP"],
15
"category": [
16
"natural",
17
"cosmetics"
18
],
19
"weight": "20",
20
"vendor": "nike",
21
"collection": ["14313", "4343"],
22
},
23
{
24
"productId":"875511",
25
"title": "XPS-15s",
26
"category": [
27
"electronics"
28
],
29
"vendor": "Dell"
30
}
31
]
32
"discountCodes": [
33
"AU7X-8Q7L",
34
"BY3V-22GK"
35
],
36
"extra": {
37
"paymentMethod": "credit card",
38
"billingAddress": "Alabama"
39
},
40
"redeemedAmount": 20,
41
"holdReference": null,
42
"guest": false
43
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/order'
Copied!
Last modified 24d ago