Versions Compared

Key

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


Excerpt

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

Resource URL

Path Variables

N/A

Headers

NameTypeDescription
api_keyString

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

, such key can be retrieved as the auth token

Body

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 id that unique identifier (GUID) that the customer event is created for

  • Conditions: Either contact_id or cim must be specified
  • 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_identifier

(optional)

Customer Event Classification IdentifierObject
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


currency_code

(optional)

String

The currency code that the customer event 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)

Object

The 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

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


productsArray of ProductsObjects

The purchase products purchased items of this customer event

Name

Type

Description

product_sku

(mandatory)

Products Identifier
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_requestObject

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.

...

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
{
    "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
languagejs
themeConfluence
linenumberstrue
{
    "id": "PCE12345678909876544GUID"
}


...