Redemption Rule 🀝

APIs to create, update or delete Redemption Rules and Configurations

Available Endpoints

TypeDescriptionEndpoint

POST

integrations/client/redemption/rule

PUT

integrations/client/redemption/config/{ruleId}

PUT

integrations/client/redemption/config/rule

PUT

integrations/client/redemption/config

DELETE

integrations/client/redemption/config/{ruleId}

Object Documentation

Redemption Rule

AttributeTypeDescription

id

integer

Id of the redemption rule

pointsToRedeem

double

Points needed for the rule to be redeemed

valueOfPoint

double

In the case of a rule of type general_settings, this attribute specifies the monetary value of one point

ruleType

string

Indicates the type of the rule and can be one of the following:

  • free_shipping_settings

    • For rule that redeems a free shipping coupon

  • percentage_discount_settings

    • For rule that redeems a percentage based discount coupon

  • free_product_settings

    • For rule that redeems a free product coupon

  • fixed_rate_settings

    • For rule that redeems a coupon that discounts a fixed amount

  • general_settings

    • For general rule that allows user to trade points for their monetary value

  • custom

startDate

DateTime

Starting date when the rule can be applied (If null then it starts from the date it is created )

endDate

DateTime

Ending date when the rule will expire (If null then it will not expire)

coupon

Object

A coupon object describing the coupon that is awarded when the rule is redeemed

availableTo

Object

An AvailableTo object specifying the availability of the rule (To whom this rule will be available)

Coupon Object

AttributeTypeRequiredDescription

couponType

string

No

Coupon type, can be one of the following:

  • fixed_discount

  • percentage_discount

  • free_shipping

  • free_product

  • fixed_rate_discount

  • custom

discountValue

double

Yes, in case of coupon type percentage_discount and fixed_discount

Value of coupon, for example if the coupon rewards a fixed amount of points then the amount of points will be in discountValue

minOrderValue

double

No

Minimum order value that this coupon can be applied to

product

object

Yes, in case of coupon type free_product

In the case of a free product coupon this object indicates the details of the product,

The object has the the following attributes:

  • productId

  • productName

  • variantId

  • variantName

collections

array

No

Array of Collection objects in the case where the coupon can only be applied to specific collections, the collection object has the following attributes:

  • collectionId

    • integer

  • collectionName

    • string

group

Object

Yes, in case of coupon type custom

An object describing the coupon group in case of a custom

AvailableTo Object

AttributeTypeDescription

level

object

A Level object indicating the level that the rule is available to,

The Level object has the following attributes:

  • levelName

    • string

  • levelId

    • integer

tags

array

An array of tag names that the rule is available to

Coupon Group Object

AttributeTypeDescription

handle

string

Handle of the group

title

string

Title of the group

url

string

URL of the group

iconPath

string

A path indicating the Icon of the Coupon Group

description

string

Description of the group

maxPerPlayer

integer

Maximum number of times a player can achieve coupons from this group

startDate

DateTime

Date at which coupons can start to be redeemed from this group

expiryDate

DateTime

Date at which you can no longer redeem coupons from this group

isAvailable

boolean

A boolean flag indicating if there are coupon available to be redeemed from this group

isValid

boolean

Flag indicating if the group is valid (Current Date is between start and expiry dates)

isActive

boolean

Flag indicating if the group is active or not (Client marked the group as active or not and group’s dates are valid)

POST - Create Redemption Rule

https://api.gameball.co/api/v3.0/integrations/client/redemption/rule

This API is used to create a redemption rule for a client

Request

AttributeTypeRequiredDescription

Authorization

string

Yes

Partner Access Token, The token is of type Bearer

storeId

string

Yes

Id of the store on the partner's system

Body

A client can only have one free_shipping rule

AttributeTypeRequiredDescription

pointsToRedeem

double

Yes

Points needed for the rule to be redeemed

valueOfPoint

double

No

In the case of a rule of type general_settings, this attribute specifies the monetary value of one point

ruleType

string

Yes

Indicates the type of the rule and can be one of the following:

  • free_shipping_settings

    • For rule that redeems a free shipping coupon

  • percentage_discount_settings

    • For rule that redeems a percentage based discount coupon

  • free_product_settings

    • For rule that redeems a free product coupon

  • fixed_rate_settings

    • For rule that redeems a coupon that discounts a fixed amount

  • general_setting

    • For general rule that allows user to trade points for their monetary value

  • custom

startDate

DateTime

No

Starting date when the rule can be applied (If null then it starts from the date it is created )

endDate

DateTime

No

Ending date when the rule will expire (If null then it will not expire)

coupon

Object

Yes

A coupon object describing the coupon that is awarded when the rule is redeemed

availableTo

Object

No

An AvailableTo object specifying the availability of the rule (To whom this rule will be available)

Sample Request

{
  "pointsToRedeem": 100,
  "valueOfPoint": 0.0,
  "ruleType": "free_product_settings",
  "startDate": null,
  "endDate": null,
  "coupon": {
    "couponType": "free_product",
    "discountValue": null,
    "minOrderValue": 100.0,
    "product": {
      "productId": "6932183449758",
      "productName": "7 Shakra Bracelet",
      "productDisplayNames": [],
      "variantId": "40691241877662",
      "variantName": "Blue"
    },
    "applicableTo": {
      "collections": [],
      "productIds": null
    },
    "group":{
      "handle":"Free_Sundae"
    }   
  },
  "availableTo": {
    "level": {
      "levelId": 12345,
      "levelName": "Silver"
    },
    "tags": ["VIP"]
  }
}

Response

Body

Redemption Rule Object

Sample Response

{
  "id": 1234,
  "pointsToRedeem": 100,
  "valueOfPoint": 0.0,
  "ruleType": "free_product_settings",
  "startDate": null,
  "endDate": null,
  "coupon": {
    "couponType": "free_product",
    "discountValue": null,
    "minOrderValue": 100.0,
    "product": {
      "productId": "6932183449758",
      "productName": "7 Shakra Bracelet",
      "productDisplayNames": [],
      "variantId": "40691241877662",
      "variantName": "Blue"
    },
    "applicableTo": {
      "collections": [],
      "productIds": null
    },
    "group": {
      "handle": "Free_Sundae",
      "title": null,
      "url": null,
      "iconPath": null,
      "description": null,
      "maxPerPlayer": null,
      "startDate": null,
      "expiryDate": null,
      "isAvailable": false,
      "isValid": false,
      "isActive": false
    }
  },
  "availableTo": {
    "level": {
      "levelId": 12345,
      "levelName": "Silver"
    },
    "tags": ["VIP"]
  }
}

PUT - Update Redemption Rule

https://api.gameball.co/api/v3.0/integrations/client/redemption/config/rule/{ruleId}

This API is used to Update a client's redemption rule

Request

Header

AttributeTypeRequiredDescription

Authorization

string

Yes

Partner Access Token, The token is of type Bearer

storeId

string

Yes

Id of the store on the partner's system

Path Parameters

ParameterTypeDescription

ruleId

integer

Id of the redemption rule

Body

Only parameters that will be updated should be sent

Redemption Rule Object

{
  "pointsToRedeem": 500
}

Response

Body

Redemption Rule Object

{
  "id":1234,
  "pointsToRedeem": 500,
  "valueOfPoint": 0.0,
  "ruleType": "free_product_settings",
  "startDate": null,
  "endDate": null,
  "coupon": {
    "couponType": "free_product",
    "discountValue": null,
    "minOrderValue": 100.0,
    "product": {
      "productId": "6932183449758",
      "productName": "7 Shakra Bracelet",
      "productDisplayNames": [],
      "variantId": "40691241877662",
      "variantName": "Blue"
    },
    "applicableTo": {
      "collections": [],
      "productIds": null
    },
    "group": {
      "handle": "Free_Sundae",
      "title": null,
      "url": null,
      "iconPath": null,
      "description": null,
      "maxPerPlayer": null,
      "startDate": null,
      "expiryDate": null,
      "isAvailable": false,
      "isValid": false,
      "isActive": false
    }
  },
  "availableTo": {
    "level": {
      "levelId": 12345,
      "levelName": "Silver"
    },
    "tags": ["VIP"]
  }
}

PUT - Update Default Rule

https://api.gameball.co/api/v3.0/integrations/client/redemption/config/rule

This API is used to Update the default redemption rule.

The default redemption rule defines the value of a point and allows the player to exchange their points into monetary value based on the rule's configurations

Request

Header

AttributeTypeRequiredDescription

Authorization

string

Yes

Partner Access Token, The token is of type Bearer

storeId

string

Yes

Id of the store on the partner's system

Body

Only parameters that will be updated should be sent

AttributeTypeDescription

valueOfPoint

double

This attribute specifies the monetary value of one point

isActive

boolean

A Boolean indicating if the rule is active (Default value is true)

Sample Request

{
  "valueOfPoint": 111.0
}

Response

Body

valueOfPoint

double

This attribute specifies the monetary value of one point

isActive

boolean

A Boolean indicating if the rule is active (Default value is true)

id

integer

Id of the default rule

Sample Response

{
  "id": 1234,
  "valueOfPoint": 111.0,
  "isActive": true
}

PUT - Update Redemption Configurations

https://api.gameball.co/api/v3.0/integrations/client/redemption/config

This API allows you to edit a client's configurations

Request

Header

AttributeTypeRequiredDescription

Authorization

string

Yes

Partner Access Token, The token is of type Bearer

storeId

string

Yes

Id of the store on the partner's system

Body

Only parameters that will be updated should be sent

AttributeTypeDescription

isRedemptionActive

boolean

A boolean flag indicating if the Redemption program is active for the client

pointsExpiryPeriod

integer

Number of days that the points will expire after being rewarded

Sample Request

{
  "IsRedemptionActive": false,
  "PointsExpiryPeriod": 800
}

Response

Body

AttributeTypeDescription

isRedemptionActive

boolean

A boolean flag indicating if the Redemption program is active for the client

pointsExpiryPeriod

integer

Number of days that the points will expire after being rewarded

{
  "IsRedemptionActive": false,
  "PointsExpiryPeriod": 800
}

DELETE - Delete Redemption Rule

https://api.gameball.co/api/v3.0/integrations/client/redemption/config/{ruleId}

This API allows deletes a client's redemption rule

Request

Header

AttributeTypeRequiredDescription

Authorization

string

Yes

Partner Access Token, The token is of type Bearer

storeId

string

Yes

Id of the store on the partner's system

Path Parameters

Default rule cannot be deleted

ParameterTypeDescription

ruleId

integer

Id of the redemption rule

Response

No Response Body

Sample Response

true

Last updated