This method calculates an accounts receivable's value units (period and lifetime) and the (new) reward tier that should be assigned against it on the next reward tier evaluation. A single accounts receivable can be specified in each call.
Resource URL
Parameters
Name | Type | Description |
token | String | The token retrieved from the login method |
accounts_receivable_identifier (mandatory) | Accounts Receivable Identifier | The accounts receivable for which the value units will be calculated for. The allowed accounts receivable identifier fields are the following: Name | Type | Description |
---|
id (semi-optional) | String | The ID of the accounts receivable | number (semi-optional) | String | The number of the accounts receivable | name (semi-optional) | String | The name of the accounts receivable | access_token_identifier (semi-optional) | Access Token Identifier | The identifier of the access token which is related with the accounts receivable. Only effective access tokens can be used to identify an accounts receivable. The allowed access token identifier fields are the following Name | Type | Description |
---|
authentication_code (semi-optional) | String | The authentication code of the access token | identifier (semi-optional) | String | The identifier of the access token. If the identifier is specified then it will be validated against the specified pass code | pass_code (mandatory on conditions) | String | The pass code of the access token, which is applicable and mandatory if the identifier is specified | one_time_password (semi-optional) | Integer | The one-time password (OTP) of the access token |
|
|
fields_set (optional) | List of Strings, comma separated | A list of fields that should be included in the results. If not specified then all the available fields will be returned |
Restrictions
- It is mandatory to specify one of the semi-optional parameters. Only one of those parameters is allowed to be specified.
Response Data
Name | Type | Description |
---|
period_value_units | Number | The participant's value units that accumulated during the last rolling period |
lifetime_value_units | Number | The participant's value units that accumulated overall |
next_tier_progression | Number | The progression percentage until the next reward tier is reached |
reward_tier | Reward Tier Object | The accounts receivable's tier based on the period value units |
Referred Objects Response Data
reward_tier_information object response data
Name | Type | Description |
---|
id | String | The id of the retrieved reward tier |
name | String | The name of the retrieved reward tier |
code | String | The code of the retrieved reward tier |
marketing_information | Reward Tier Marketing Information Object | The reward tier's marketing information |
Referred Objects Response Data
reward tier marketing information object response data
Name | Type | Description |
---|
tier_color | String | The hexadecimal value of the tier's color |
Examples
Example 1
HTTP Method: POST
Request
{{server}}/crmapi/rest/v2/accounts_receivable/rewards/calculate_value_units
Body
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOiJtcGFkbWluaXN0cmF0b3IiLCJvcmciOiJzdGFnaW5nIiwib3VuIjoiMSIsImV4cCI6IjE1Njc1MDgzMDAiLCJpYXQiOiIxNTY3NTAxMTAwIiwianRpIjoiM0JFODBCRTMyNTgwNERERDk1NEVBMTY3MEM2OTdGQTcifQ.nqwHwSXyyQPrIV3SRZhOgrXztGvdn5RXUa9C5YziPC4",
"accounts_receivable_identifier":{"number":"470"}
}
Response
{
"data": {
"lifetime_value_units": 4200,
"next_tier_progression": 1.551,
"reward_tier": {
"code": "C",
"name": "Cobalt",
"id": "04FDAA9119654BCEA223122AF5CE3707",
"marketing_information": {
"tier_color": "3eafd1"
}
},
"period_value_units": 4200
},
"status": {
"code": "OK",
"description": "",
"message": ""
}
}