Skip to end of banner
Go to start of banner

POST accounts_receivable/rewards/calculate_total_awarded_amount

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Available from CRM.COM R17.0.0

This method calculates the total awarded amount that was provided to a specific accounts receivable and the amount that was awarded by each scheme that the accounts receivable participated to. 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's participant for which the awarded amount 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)

StringThe 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)

StringThe 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

Available from CRM.COM R13.0.0

Available from CRM.COM R8.0.0

Deprecated from CRM.COM R18.0.0

reward_scheme_identifier
(optional)

Reward Scheme Identifier

 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:

Name

Type

Description

id

(semi-optional)

String

The ID of the reward scheme

name

(semi-optional)

String

The name of the reward scheme

alternative_code

(semi-optional)

String

The alternative code of  the reward scheme

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

Unable to render {include} The included page could not be found.

Examples

 Example 1

HTTP Method: POST


Request

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


Body

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


Response

{
    "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": ""
    }
}
  • No labels