Versions Compared

Key

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


Tip

Available from CRM.COM R16.12.0


Excerpt

This method is used to create a purchase customer event in a posted life cycle state

Resource URL

...

Path Variables

N/A

Headers

id
NameTypeDescription
tokenapi_keyString

The token retrieved from the login method

api key for API calls to ensure that the client is trusted

  • Providing an API Key, the system should issue an auth token that should be kept until expiration
  • Such auth token should not be passed as part of any of the two APIs, but should be used in order to post such purchase customer event

Body

The related accounts receivable. The allowed accounts receivable identifier fields are the following:

Name

Type

Description

id

(optional)

String

The customer event unique Identifier (GUID)

  • If not specified, one will be created by the system automatically

contact_id

(semi-optional)

String

The contact unique identifier (GUID) that the customer event is created for

classification_identifier

(optional)

Customer Event Classification Identifier
  • Conditions: Either contact_id or cim must be specified

accounts_receivable_identifier

(mandatory)

Accounts receivable Identifier
Include Page
V4:accounts_receivable_identifier_postV4:accounts_receivable_identifier_post
Tip

From CRM.COM R15.0.0, access_token_identifier is supported

For releases prior CRM.COM R17.0.0, this field was semi-optional

  • If a contact has multiple accounts, then the purchase customer event will be created against the primary one

cim

(semi-optional)

String

The value for a single contact identification medium representing the customer event is created for

  • Conditions: Either contact_id or cim must be specified
  • Customer Identification Medium will be mapped to the Access Token Authentication Code

reference_number

(mandatory)

StringThe external system’s (unique) reference number that submitted the customer event

classification

(optional)

Object
The classification of the customer event.
The allowed identifier fields are the following

Name

Type

Description

id

(semi-optional)

String

The ID of the customer event classification

code

(semi-optional)

String

The code of  the customer event classification


performed_by_business_unit_identifiercurrency_code

(semi-optional)

Business Unit IdentifierStringThe unit that initiated the customer event. The allowed identifier fields are the following
Include PageV4:unit_identifierV4:unit_identifier
Tip

For releases prior CRM.COM R17.0.0, this attribute was mandatory

From CRM.COM R17.0.0, this attribute will be set automatically if the performed_by_tap_identifier is specified

Deprecated from CRM.COM R18.0.0

performed_by_tap_identifier

The

business unit

currency code that

initiated

the customer event

. The allowed identifier fields are the following
Include PageV4:business_unit_identifierV4:business_unit_identifier
Tip

Available from CRM.COM R18.0.0

performed_by_unit_identifier

(semi-optional)

Unit Identifier

is created against

  • Mapped to previous intended_currency_identifier, but only the "code" attribute will be used for identification purposes

payment_medium_identifier

(optional)

String

The payment medium identifier with which the purchase customer event has been made (e.g. first credit card digits)

performed_on

(optional)

Integer

The date that the customer event was actually performed (in epoch format)

  • If not specified, then the current date-time will be set

merchant_tap

(semi-optional)

Transaction Acquiring Point IdentifierObject

The

unit's transaction acquiring point that initiated the customer event.

merchant that captured the purchase customer event

  • Conditions: At least merchant_tap or outlet_tap should be specified

The allowed identifier fields are the following

Include PageV4:transaction_acquiring_point_identifierV4:transaction_acquiring_point_identifier
Tip

Available from CRM.COM R17.0.0

From CRM.COM R17.0.0, this attribute will be set automatically if the performed_by_unit_identifier is specified

From CRM.COM R18.0.0, this attribute will be set automatically if the performed_by_business_unit_identifier is specified

performed_on

(mandatory)

IntegerThe date that the customer event was actually performed (in epoch format)

reference_number

(mandatory)

StringThe reference number of the retrieved purchase customer event

payment_medium_identifier

(optional)

String

The payment medium identifier with which the purchase customer event has been made (e.g. first credit card digits)

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 PageV4:access_token_identifierV4:access_token_identifier
Tip

Available from CRM.COM R15.0.0

Deprecated from CRM.COM R18.0.0

currency_code

(optional)

String

The currency code that the customer event is created against (mapped to intended_currency_identifier)

productsArray of ProductsThe purchase products

Name

Type

Description

id

(semi-optional)

String

The merchant identifier that captured the purchase customer event

  • Mapped to the business unit identifier

code

(semi-optional)

String

The merchant code that captured the purchase customer event

  • Mapped to the business unit code


outlet_tap

(semi-optional)

Object

The merchant's outlet that captured the purchase customer event

  • Conditions: At least merchant_tap or outlet_tap should be specified. The outlet (business unit) should have the specified merchant as parent business unit

The allowed identifier fields are the following

Name

Type

Description

id

(semi-optional)

String

The outlet identifier that captured the purchase customer event

  • Mapped to the business unit identifier

code

(semi-optional)

String

The outlet code that captured the purchase customer event

  • Mapped to the business unit code


products

(mandatory)

Array of Objects

The purchased items of this customer event

Name

Type

Description

product_sku

(mandatory)

Products Identifier
String
The purchased product sku (code)

quantity

(optional)

Number

The quantity of the specified purchase customer event product (defaults to 1, if not specified)

net_amount

(mandatory)

NumberThe net amount of the specified purchase customer event product

tax_amount

(mandatory)

NumberThe Tax amount of the specified purchase customer event product

total_amount

(mandatory)

NumberThe total amount of the specified purchase customer event product


spend_request

(optional)

Object

Information related with the spend request that should be created as part of the purchase customer event

Name

Type

Description

amount

(semi-optional)

Number
The amount in real currency that is requested to be spend

alternative_amount

(semi-optional)

Number

The amount in alternative currency that is requested to be spend


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

idStringThe purchase customer event identifier (GUID)

Examples

Expand
titleExample 1

HTTP Method: POST


Request

Header

Code Block
languagejs
themeConfluence
linenumberstrue
api_key: 8c54d563-b991-4b76-8a83-557c08166f95

Body:

Code Block
languagejavascript
themeConfluence
linenumberstrue
Response:
{
    "cim": "4A30966F684B0269AD91",
    "reference_number": "RF000001",
    "classification": {
        "code": "CCC"
    },
    "payment_medium_identifier": "42424242",
    "performed_on": 1572423477,
    "currency_code": "EUR",
    "products": [
        {
            "product_sku": "FREDESPR001",
            "net_amount": 14.15,
            "tax_amount": 1.04,
            "total_amount": 15.19,
            "quantity": 2
        }
    ],
    "spend_request": {
        "amount": 2.12
    },
    "merchant_tap": {
        "code": "EK123456"
    },
    "outlet_tap": {
        "code": "CD123456"
    }
}

Response

Code Block
languagejavascriptjs
themeConfluence
linenumberstrue
{
    "id": "PCE12345678909876544GUID"
}