Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...


Tip

Available from CRM.COM R9.0.0

Deprecate from CRM.COM R17.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

Resource URL

Parameters

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_post
V4:rewards_participants_identifier_post

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 1

HTTP Method: POST 


Request:

Body:

Code Block
languagejavascript
themeConfluencelanguagejavascript
linenumberstrue
{
    "token":"{{token}}",
    "accounts_receivable_identifier":{"number":"ACR001101"},
    "performed_by_unit_identifier":{"name":"Admin Unit"},
    "performed_on":"2016-06-22T15:00:00",
    "process_immediately":1,
    "purchase_customer_event":
    {
        "reference_number":"RF00002",
        "payment_medium_brand_identifier":{"id":"A01DB55EE5624E80ADA3CD7AF166AF30"},
        "payment_medium_type_identifier":{"alternative_code":"CC"},
        "payment_medium_identifier":"PI000003",
        "total_amount":88,
        "net_amount":80,
        "vat_amount":8,
        "products_set":
        [
            {
                "product_identifier":{"code":"Serendipity"},
                "total_amount":88,
                "net_amount":80,
                "vat_amount":8
            }
        ]
    },
    "spend_request_customer_event":
    {
        "product_identifier":{"name":"Spend Request Classification"}
    }
}


Response:

Code Block
languagejavascript
themeConfluence
languagejavascript
linenumberstrue
 {
  "status": {
    "message": "",
    "description": "",
    "code": "OK"
  },
  "data": {
    "purchase_customer_event": {
      "award_reward_transactions_set": [],
      "classification": null,
      "number": "862",
      "payment_medium_type": {
        "id": "0EC912D6358341B4BAE55CFA70FE0F2D",
        "name": "Credit Card",
        "description": "Payment Medium Type 1: Credit Card",
        "alternative_code": "CC"
      },
      "performed_by_unit": {
        "community_name": "Internal Community",
        "id": "48305F8849E3C18B227C5BE3A27BA6DF",
        "name": "Admin Unit",
        "group_name": "Main Group",
        "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
        "alternative_code": "MG"
      },
      "process_immediately": 1,
      "vat_amount": 8,
      "log_information": {
        "updated_date": "2016-06-22T16:18:25",
        "created_date": "2016-06-22T16:18:25",
        "created_by_unit": {
          "community_name": "Internal Community",
          "id": "48305F8849E3C18B227C5BE3A27BA6DF",
          "name": "Admin Unit",
          "group_name": "Main Group",
          "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
          "alternative_code": "MG"
        },
        "updated_by_unit": {
          "community_name": "Internal Community",
          "id": "48305F8849E3C18B227C5BE3A27BA6DF",
          "name": "Admin Unit",
          "group_name": "Main Group",
          "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
          "alternative_code": "MG"
        },
        "created_by_user": {
          "person_name": "Marios Lannister",
          "username": "MPAdministrator",
          "id": "1",
          "email": "sakkascy1986@hotmail.com"
        },
        "updated_by_user": {
          "person_name": "Marios Lannister",
          "username": "MPAdministrator",
          "id": "1",
          "email": "sakkascy1986@hotmail.com"
        }
      },
      "total_amount": 88,
      "accounts_receivable": {
        "account_owner": {
          "last_name": "Ioannou212",
          "middle_name": null,
          "life_cycle_state": "FINANCIAL",
          "company_profile": null,
          "title": null,
          "first_name": "Marios",
          "type": "PERSON",
          "id": "028657D9E5E74F4EAAB25C9DD0EBB69C",
          "name": null,
          "company_name": null,
          "demographics": {
            "gender": null,
            "passport_issued_by_country": null,
            "social_security_number": null,
            "passport_number": null,
            "industry_sector": null,
            "country_of_residence": {
              "three_character_code": "CYP",
              "two_character_code": "CY",
              "id": "181",
              "name": "CYPRUS",
              "alternative_code": null
            },
            "name_day": {
              "month": null,
              "day": null
            },
            "date_of_birth": {
              "month": null,
              "day": null,
              "year": null
            },
            "id_number": null,
            "industry": null,
            "id_issued_by_country": null
          }
        },
        "life_cycle_state": "ACTIVE",
        "number": "ACR001101",
        "id": "0F0638457F2D4133BC6FAD1A4DBACF26",
        "name": "ACR001101"
      },
      "life_cycle_state": "POSTED",
      "payment_medium_brand": {
        "id": "A01DB55EE5624E80ADA3CD7AF166AF30",
        "name": "AMERICAN EXPRESS",
        "description": "Payment Medium Brand 2: American Express",
        "alternative_code": "AE"
      },
      "net_amount": 80,
      "payment_medium_identifier": "PI000003",
      "type": "PURCHASE",
      "id": "E295AE4AFA15410DBAF8B17E502785AD",
      "description": null,
      "reference_number": "RF00002",
      "performed_on": "2016-06-22T15:00:00"
    },
    "spend_request_customer_event": {
      "classification": null,
      "number": "105",
      "performed_by_unit": {
        "community_name": "Internal Community",
        "id": "48305F8849E3C18B227C5BE3A27BA6DF",
        "name": "Admin Unit",
        "group_name": "Main Group",
        "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
        "alternative_code": "MG"
      },
      "process_immediately": 1,
      "spend_reward_transaction": null,
      "log_information": {
        "updated_date": "2016-06-22T16:18:25",
        "created_date": "2016-06-22T16:18:25",
        "created_by_unit": {
          "community_name": "Internal Community",
          "id": "48305F8849E3C18B227C5BE3A27BA6DF",
          "name": "Admin Unit",
          "group_name": "Main Group",
          "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
          "alternative_code": "MG"
        },
        "updated_by_unit": {
          "community_name": "Internal Community",
          "id": "48305F8849E3C18B227C5BE3A27BA6DF",
          "name": "Admin Unit",
          "group_name": "Main Group",
          "description": "r1 Test Description for resource  request tab.Test Description for resource  request tab.",
          "alternative_code": "MG"
        },
        "created_by_user": {
          "person_name": "Marios Lannister",
          "username": "MPAdministrator",
          "id": "1",
          "email": "sakkascy1986@hotmail.com"
        },
        "updated_by_user": {
          "person_name": "Marios Lannister",
          "username": "MPAdministrator",
          "id": "1",
          "email": "sakkascy1986@hotmail.com"
        }
      },
      "life_cycle_state": "POSTED",
      "accounts_receivable": {
        "account_owner": {
          "last_name": "Ioannou212",
          "middle_name": null,
          "life_cycle_state": "FINANCIAL",
          "company_profile": null,
          "title": null,
          "first_name": "Marios",
          "type": "PERSON",
          "id": "028657D9E5E74F4EAAB25C9DD0EBB69C",
          "name": null,
          "company_name": null,
          "demographics": {
            "gender": null,
            "passport_issued_by_country": null,
            "social_security_number": null,
            "passport_number": null,
            "industry_sector": null,
            "country_of_residence": {
              "three_character_code": "CYP",
              "two_character_code": "CY",
              "id": "181",
              "name": "CYPRUS",
              "alternative_code": null
            },
            "name_day": {
              "month": null,
              "day": null
            },
            "date_of_birth": {
              "month": null,
              "day": null,
              "year": null
            },
            "id_number": null,
            "industry": null,
            "id_issued_by_country": null
          }
        },
        "life_cycle_state": "ACTIVE",
        "number": "ACR001101",
        "id": "0F0638457F2D4133BC6FAD1A4DBACF26",
        "name": "ACR001101"
      },
      "spend_amount": null,
      "type": "SPEND_REQUEST",
      "id": "27277BB77DCC44F28307419D57BAB750",
      "description": null,
      "performed_on": "2016-06-22T15:00:00"
    }
  }
}


...

Expand
titleExample 2

HTTP Method: POST

 


Request:

Body:

Code Block
languagejavascript
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
languagejavascript
themeConfluencelanguagejavascript
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-07T15:18:52",
                "updated_date": "2018-09-07T15:18:56",
                "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": null,
                    "last_name": "Mich",
                    "id": "EE15F92F5AD9487692DA4DD34D35CA09",
                    "life_cycle_state": "FINANCIAL",
                    "middle_name": null,
                    "title": null,
                    "type": "PERSON",
                    "first_name": "Eleni",
                    "demographics": {
                        "id_number": "451232",
                        "gender": null,
                        "country_of_residence": {
                            "alternative_code": "IRN",
                            "three_character_code": null,
                            "name": "IRAN (ISLAMIC REPUBLIC OF)",
                            "id": "231",
                            "two_character_code": null
                        },
                        "date_of_birth": {
                            "month": null,
                            "year": null,
                            "day": null
                        },
                        "industry_sector": null,
                        "industry": null,
                        "name_day": {
                            "month": 5,
                            "day": 21
                        },
                        "passport_number_expiration_date": null,
                        "id_number_expiration_date": null,
                        "passport_number": null,
                        "social_security_number": null,
                        "id_issued_by_country": null,
                        "passport_issued_by_country": null
                    }
                }
            },
            "life_cycle_state": "POSTED",
            "type": "PURCHASE",
            "classification": null,
            "performed_on": "2018-09-07T13:09:00",
            "reference_number": "RF00002",
            "process_immediately": true,
            "number": "1612",
            "payment_medium_type": null,
            "payment_medium_identifier": null,
            "vat_amount": 0,
            "award_reward_transactions_set": [],
            "total_amount": 3,
            "instant_spend_request": null,
            "disable_instant_spend": true,
            "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": "CBA94D9893744161862EFE34006C26CB",
            "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": {}
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}


...