Skip to end of banner
Go to start of banner

POST /purchases

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

Version 1 Next »

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

Resource URL

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

idString

The customer event unique Identifier (GUID)

contact_idString
cim

accounts_receivable_identifier

(mandatory)

Accounts receivable Identifier

The related accounts receivable. 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

From CRM.COM R15.0.0, access_token_identifier is supported

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

classification_identifier

(optional)

Customer Event Classification Identifier
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_identifier

(semi-optional)

Business Unit Identifier
The business unit that initiated the customer event. The allowed identifier fields are the following

Name

Type

Description

id

(semi-optional)

String

The ID of the business unit

name

(semi-optional)

String

The code of the business unit

code

(semi-optional)

String

The code of the business unit

Available from CRM.COM R18.0.0

performed_by_unit_identifier

(semi-optional)

Unit Identifier
The unit that initiated the customer event. The allowed identifier fields are the following

Name

Type

Description

id

(semi-optional)

String

The ID of the Unit

name

(semi-optional)

String

The name of the Unit

alternative_code

(semi-optional)

String

The alternative code of  the Unit

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

(semi-optional)

Transaction Acquiring Point Identifier

The unit's transaction acquiring point that initiated the customer event. The allowed identifier fields are the following

Name

Type

Description

id

(semi-optional)

String

The ID of the transaction acquiring point

name

(semi-optional)

String

The name of the transaction acquiring point

code

(semi-optional)

StringThe code of the transaction acquiring point

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:

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

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 Products

The purchase products 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.

Response Data

200

Name

Type

Description

idStringThe purchase customer event GUID

Examples

 Example 1

HTTP Method: POST


Request:

Body:

 


Response:

 
  • No labels