Versions Compared

Key

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

Available from CRM.COM R9.0.0

Excerpt

This method is used to create a purchase customer event in a posted life cycle state, and a spend request customer event related with that purchase customer event. In case of an error none of the customer events is created

...

Name

Type

Description

token

String

The token retrieved from the login method

accounts_receivable_identifier

(semi-optional)

Accounts receivable Identifier

The accounts receivable that will be related with both the purchase customer event and the spend request customer event that will be created. The allowed accounts receivable identifier fields are the following:

Include Page
V4:accounts_receivable_identifier_post
V4:accounts_receivable_identifier_post

Tip

From CRM.COM R15.0.0, access_token_identifier is supported

rewards_participant_identifier

(semi-optional)

Rewards Participant IdentifierThe rewards participant that will be related with both the purchase customer event and the spend request customer event that will be created. The allowed rewards participant identifier fields are the following:

Include Page
V4:rewards_participants_identifier
V4:rewards_participants_identifier

performed_by_unit_identifier

(mandatory)

Unit IdentifierThe unit that initiated both the purchase customer event and the spend request customer event that will be created. The allowed unit identifier fields are the following:

Include Page
V4:unit_identifier
V4:unit_identifier

performed_on

(mandatory)

DateThe date that both the purchase customer event and the spend request customer event that will be created were actually performed

process_immediately

(optional)

boolean

Defines if the customer events should be processed immediately by various business processes or not

Tip

Deprecated from CRM.COM R15.0.0

external_system

(optional)

String

Defines the third party system that generates the customer event

Tip

Available from CRM.COM R10.0.0

authorized_by_access_token_identifier

(optional)

Access Token Identifier

The access token that was used to identify and authorized the customer. This information will be overridden if the customer was identified via an access token through this Web API call. The allowed access token identifier fields are the following:

Include Page
V4:access_token_identifier
V4:access_token_identifier

Tip

Available from CRM.COM R15.0.0

intended_currency_identifier

(optional)

Currency Identifier

The currency that the user was intended to use for the customer event. If specified then it is validated against the currency of the related performed by unit (i.e. the default currency) and if they don't match then an error is throw. Note that the intended currency is not saved within CRM.COM; it is just used for validation purposes. The allowed currency identifier fields are the following:

Include Page
V4:currency_identifier
V4:currency_identifier

Tip

Available from CRM.COM R11.0.0

purchase_customer_event

(mandatory)

Purchase Customer Event ObjectInformation related with the purchase customer event to be created

spend_request_customer_event

(mandatory)

Spend Request Customer Event ObjectInformation related with the spend request that should be created. The spend request will automatically be related with the specified purchase customer event.

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

Tip

Available from CRM.COM R10.0.0

Anchor
create spend purchase customer event referred parameters
create spend purchase customer event referred parameters
Referred Parameter Objects

...

Expand
titleExample 2

HTTP Method: POST

 

Request:

Body:

Code Block
themeConfluence
languagejavascript
linenumberstrue
{
	"token":"{{token}}",
	"accounts_receivable_identifier":{"name":"0000000001 Eleni M"},
	"performed_by_unit_identifier":{"name":"Merchant A unit"},
	"performed_on":"2018-09-07T13:09:00",
	"process_immediately":1,
	"purchase_customer_event":
	{
	"disable_instant_spend":true,
		"reference_number":"RF00002",
		"total_amount":3,
		"net_amount":3,
		"vat_amount":0,
	  "products_set":
	   [
	     {
	       "product_identifier":{"code":"Serendipity"},
	      "total_amount":3,
			"net_amount":3,
			"vat_amount":0,
	       "quantity":1
	     }
	   ]
	},
	"spend_request_customer_event":
	{
		"product_identifier":{"name":"Spend Request Classification"}
	}
}


Response:

Code Block
themeConfluence
languagejavascript
linenumberstrue
 {
    "data": {
        "purchase_customer_event": {
            "log_information": {
                "created_by_unit": {
                    "alternative_code": "adminunit",
                    "group_name": "Main Group",
                    "community_name": "Community",
                    "name": "Admin Unit",
                    "description": "admin unit",
                    "id": "1"
                },
                "updated_by_unit": {
                    "alternative_code": "adminunit",
                    "group_name": "Main Group",
                    "community_name": "Community",
                    "name": "Admin Unit",
                    "description": "admin unit",
                    "id": "1"
                },
                "created_date": "2018-09-07T1307T15:3518:1752",
                "updated_date": "2018-09-07T1307T15:3518:2756",
                "updated_by_user": {
                    "person_name": "CRM COM",
                    "id": "1",
                    "email": "test@crm.com",
                    "username": "MPAdministrator"
                },
                "created_by_user": {
                    "person_name": "CRM COM",
                    "id": "1",
                    "email": "test@crm.com",
                    "username": "MPAdministrator"
                }
            },
            "payment_medium_brand": null,
            "description": null,
            "accounts_receivable": {
                "number": "0000000001",
                "name": "0000000001 Eleni M",
                "id": "8DDDA5F17D9641FC97A32FEAEE1F8AC6",
                "life_cycle_state": "ACTIVE",
                "account_owner": {
                    "company_profile": null,
                    "company_name": null,
                    "name": "Eleni Mich"null,
                    "last_name": "Mich",
                    "id": "EE15F92F5AD9487692DA4DD34D35CA09",
                    "life_cycle_state": "FINANCIAL",
                    "middle_name": null,
                    "title": null,
                    "type": "PERSON",
                    "first_name": "Eleni",
                    "demographics": {
                        "nameid_daynumber": {"451232",
                            "monthgender": 5null,
                        "country_of_residence": {
   "day": 21                         },"alternative_code": "IRN",
                            "idthree_character_numbercode": "451232",null,
                           "passport_number_expiration_date": null, "name": "IRAN (ISLAMIC REPUBLIC OF)",
                            "genderid": null"231",
                            "datetwo_ofcharacter_birthcode": {null
                        },
   "month": null,                    "date_of_birth": {
       "year": null,                    "month": null,
       "day": null                    "year": null,
   },                         "id_number_expiration_dateday": null,
                        "industry_sector": null},
                        "passportindustry_numbersector": null,
                        "industry": null,
                        "socialname_security_numberday": null, {
                            "id_issued_by_countrymonth": null5,
                            "passport_issued_by_countryday": 21
 null                       },
                }        "passport_number_expiration_date": null,
   },             "life_cycle_state": "POSTED",
            "type"id_number_expiration_date": "PURCHASE"null,
 
          "classification": null,             "performedpassport_onnumber": "2018-09-07T13:09:00",
 null,
          "reference_number": "RF00002",             "processsocial_security_immediatelynumber": truenull,
            "number": "1611",
            "paymentid_issued_mediumby_typecountry": null,
            "payment_medium_identifier": null,             "vat_amount": 0,
            "award_reward_transactions_set": [
                {
                    "number": "3734",
                    "amount": 0.75,
                    "currency_rate_period": {
                        "from_date": "2018-08-07 00:00:00.0",
                        "to_date": null,
                        "rate": 5,
                        "inverse_rate": 0.2,
                        "currency": null,
                        "id": "71996F27996C44DC9E2FD4C2F05AE563"
                    },
                    "id": "907CCE43511844C19E871600EEB89673",
                    "life_cycle_state": "POSTED",
                    "contribution_percentage": null,
                    "rewards_participant": {
                        "number": "1",
                        "accounts_receivable": {
                            "number": "0000000001",
                            "name": "0000000001 Eleni M",
                            "id": "8DDDA5F17D9641FC97A32FEAEE1F8AC6",
                            "life_cycle_state": "ACTIVE",
                            "account_owner": {
                                "company_profile": null,
                                "company_name": null,
                                "name": "Eleni Mich",
                                "last_name": "Mich",
                                "id": "EE15F92F5AD9487692DA4DD34D35CA09",
                                "life_cycle_state": "FINANCIAL",
                                "middle_name": null,
                                "title": null,
                                "type": "PERSON",
                                "first_name": "Eleni",
                                "demographics": {
                                    "name_day": {
                                        "month": 5,
                                        "day": 21
                                    },
                                    "id_number": "451232",
                                    "passport_number_expiration_date": null,
                                    "gender": null,
                                    "date_of_birth": {
                                        "month": null,
                                        "year": null,
                                        "day": null
                                    },
                                    "id_number_expiration_date": null,
                                    "industry_sector": null,
                                    "passport_number": null,
                                    "industry": null,
                                    "social_security_number": null,
                                    "id_issued_by_country": null,
                                    "passport_issued_by_country": null
                                }
                            }
                        },
                        "id": "57A9AC82559149019061B743F13CD39B",
                        "life_cycle_state": "EFFECTIVE"
                    }
                }
            ],
            "total_amount": 3,
            "instant_spend_request": null,
            "automatic_spend_request": null,
            "currency": {
                "suffix_symbol": "N/A",
                "prefix_symbol": "€",
                "decimal_part_name": "cents",
                "code": "EUR",
                "integer_part_name": "euro",
                "id": "2",
                "life_cycle_state": "EFFECTIVE"
            },
            "id": "687479C3899C4EFF8A6A7450C86725EE",
            "net_amount": 3,
            "performed_by_unit": {
                "alternative_code": "MRAU",
                "group_name": "Merchant ABCD",
                "community_name": "CommunityB",
                "name": "Merchant A unit",
                "description": null,
                "id": "AB18F69E3CA84413BABEF07713D410CB"
            }
        },
        "spend_request_customer_event": {
            "log_information": {
                "created_by_unit": {
                    "alternative_code": "adminunit",
                    "group_name": "Main Group",
                    "community_name": "Community",
                    "name": "Admin Unit",
                    "description": "admin unit",
                    "id": "1"
                },
                "updated_by_unit": {
                    "alternative_code": "adminunit",
                    "group_name": "Main Group",
                    "community_name": "Community",
                    "name": "Admin Unit",
                    "description": "admin unit",
                    "id": "1"
                },
                "created_date": "2018-09-07T13:35:27",
                "updated_date": "2018-09-07T13:35:27",
                "updated_by_user": {
                    "person_name": "CRM COM",
                    "id": "1",
                    "email": "test@crm.com",
                    "username": "MPAdministrator"
                },
                "created_by_user": {
                    "person_name": "CRM COM",
                    "id": "1",
                    "email": "test@crm.com",
                    "username": "MPAdministrator"
                }
            },
            "spend_amount": 3,
            "description": null,
            "accounts_receivable": {
                "number": "0000000001",
                "name": "0000000001 Eleni M",
                "id": "8DDDA5F17D9641FC97A32FEAEE1F8AC6",
                "life_cycle_state": "ACTIVE",
                "account_owner": {
                    "company_profile": null,
                    "company_name": null,
                    "name": "Eleni Mich",
                    "last_name": "Mich",
                    "id": "EE15F92F5AD9487692DA4DD34D35CA09",
                    "life_cycle_state": "FINANCIAL",
                    "middle_name": null,
                    "title": null,
                    "type": "PERSON",
                    "first_name": "Eleni",
                    "demographics": {
                        "name_day": {
                            "month": 5,
                            "day": 21
                        },
                        "id_number": "451232",
                        "passport_number_expiration_date": null,
                        "gender": null,
                        "date_of_birth": {
                            "month": null,
                            "year": null,
                            "day": null
                        },
                        "id_number_expiration_date": null,
                        "industry_sector": null,
                        "passport_number": null,
                        "industry": null,
                        "social_security_number": null,
                        "id_issued_by_country": null,
                        "passport_issued_by_country": null
                    }
                }
            },
            "life_cycle_state": "POSTED",
            "type": "SPEND_REQUEST",
            "performed_on": "2018-09-07T13:09:00",
            "automatic_spend": false,
            "reduction_method": "FRONT_END_REDUCTION",
            "classification": null,
            "process_immediately": true,
            "spend_reward_transaction": {
                "number": "470",
                "vat_amount": 0,
                "total_amount": 15,
                "currency_rate_period": {
                    "from_date": "2018-08-07 00:00:00.0",
                    "to_date": null,
                    "rate": 5,
                    "inverse_rate": 0.2,
                    "currency": null,
                    "id": "71996F27996C44DC9E2FD4C2F05AE563"
                },
                "id": "5866580210454ABAB5A8EF971C1872A7",
                "net_amount": 15,
                "life_cycle_state": "POSTED",
                "rewards_participant": {
                    "number": "1",
                    "accounts_receivable": {
                        "number": "0000000001",
                        "name": "0000000001 Eleni M",
                        "id": "8DDDA5F17D9641FC97A32FEAEE1F8AC6",
                        "life_cycle_state": "ACTIVE",
                        "account_owner": {
                            "company_profile": null,
                            "company_name": null,
                            "name": "Eleni Mich",
                            "last_name": "Mich",
                            "id": "EE15F92F5AD9487692DA4DD34D35CA09",
                            "life_cycle_state": "FINANCIAL",
                            "middle_name": null,
                            "title": null,
                            "type": "PERSON",
                            "first_name": "Eleni",
                            "demographics": {
                                "name_day": {
                                    "month": 5,
                                    "day": 21
                                },
                                "id_number": "451232",
                                "passport_number_expiration_date": null,
                                "gender": null,
                                "date_of_birth": {
                                    "month": null,
                                    "year": null,
                                    "day": null
                                },
                                "id_number_expiration_date": null,
                                "industry_sector": null,
                                "passport_number": null,
                      "passport_issued_by_country": null
         "industry": null,          }
                }
     "social_security_number": null,      },
            "life_cycle_state": "POSTED",
            "id_issued_by_countrytype": null"PURCHASE",
                 "classification": null,
              "passport_issued_by_countryperformed_on": null"2018-09-07T13:09:00",
            "reference_number": "RF00002",
            "process_immediately": true,
 }           "number": "1612",
            }
"payment_medium_type": null,
            "payment_medium_identifier": null,
     },       "vat_amount": 0,
            "idaward_reward_transactions_set": "57A9AC82559149019061B743F13CD39B",
  [],
                 "lifetotal_cycle_stateamount": "EFFECTIVE"3,
            "instant_spend_request": null,
  }             }"disable_instant_spend": true,
            "numberautomatic_spend_request": "550"null,
            "currency": {
                "suffix_symbol": "N/A",
                "prefix_symbol": "€",
                "decimal_part_name": "cents",
                "code": "EUR",
                "integer_part_name": "euro",
                "id": "2",
                "life_cycle_state": "EFFECTIVE"
            },
            "id": "0E36B9248D7A4C59B2215CFD3F27FE78CBA94D9893744161862EFE34006C26CB",
            "instantnet_spendamount": false3,
            "performed_by_unit": {
                "alternative_code": "MRAU",
                "group_name": "Merchant ABCD",
                "community_name": "CommunityB",
                "name": "Merchant A unit",
                "description": null,
                "id": "AB18F69E3CA84413BABEF07713D410CB"
            }
        },
        "spend_request_customer_event": {}
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}