Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Tip

Available from CRM.COM R10R17.10.0


Excerpt

This method calculates the total awarded amount that was provided to a specific rewards participant accounts receivable and the amount that was awarded by each scheme that the rewards participant accounts receivable participated to. A single rewards participant 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's participant for which the awarded amount will be calculated for. The allowed accounts receivable identifier fields are the following:

Include Page
V4:accounts_receivable_identifier_post
V4:accounts_receivable_identifier_post

reward_scheme_identifier
(optional)

Reward Scheme Identifier
 The

The reward scheme that awarded the calculated amount. If specified then the calculation will include only awards provided by the specified reward scheme. The allowed reward scheme identifier fields are the following:

Include Page
V4:reward_scheme_identifier
V4:reward_scheme_identifier

from_date

(optional)

DateIf specified then the calculation will include only awards that were provided on that date or on a date after that date will be

to_date

(optional)

DateIf specified then the calculation will include only awards that were provided on that date or on a date before that date will be

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

Include Page
V4:accounts receivable_rewards_participant_awarded_amount_complete
V4:accounts receivable_rewards_participant_awarded_amount_complete

Examples

Expand
titleExample 1

HTTP Method: POST


Request

Code Block
{{server}}/crmapi/rest/v2/accounts_receivable/rewards/calculate_total_awarded_amount


Body

Code Block
languagejavascript
themeConfluence
linenumberstrue
{
   "token":"{{token}}",
     "accounts_receivable_identifier": {"id":"5274C9686C2940C5A9A2F399C01BEE80"},    
    "from_date":"2016-03-23T12:00:40",
	"to_date":"2019-07-29T09:00:00"
}


Response

Code Block
{
    "data": {
        "total_awarded_alternative_amount": 256.95,
        "from_date": "2019-07-05T13:07:04",
        "to_date": "2019-07-23T09:44:24",
        "currency": {
            "suffix_symbol": null,
            "prefix_symbol": "€",
            "decimal_part_name": null,
            "code": "EUR",
            "integer_part_name": null,
            "id": "BC91",
            "life_cycle_state": "EFFECTIVE"
        },
        "alternative_currency": {
            "suffix_symbol": null,
            "prefix_symbol": "Pts",
            "decimal_part_name": null,
            "code": "Pts",
            "integer_part_name": null,
            "id": "1968",
            "life_cycle_state": "EFFECTIVE"
        },
        "reward_scheme_awards_set": [
            {
                "scheme": null,
                "total_awarded_amount": 15
            },
            {
                "scheme": {
                    "alternative_code": "MRS",
                    "name": "Main Rewards Scheme",
                    "description": "hello8",
                    "id": "827918B0190B466FA578B14C080F02B8",
                    "life_cycle_state": "EFFECTIVE"
                },
                "total_awarded_amount": 318.25
            }
        ],
        "total_awarded_amount": 333.25
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}