Accounts

Creating Accounts

To earn points with the loyalty system, the customer needs an account. This account can later be linked (with a membership) to a user profile that contains user data. However, this is optional and loyalty points can be obtained and spent with an (anoymous) account by itself.

To create an account, use:

curl --location --request POST '{{api_url}}/accounts' \ 
--header 'interaction-id: {{interactionId}}' \ 
--header 'Authorization: {{jwt_token}}' \ 
--header 'Content-Type: application/json' \ 

with


Variable

Description

{{api_url}}

Endpoint of the api.

{{jwt_token}}

The JWT-token, which has been generated by authentication.

{{interactionId}}

Unique Identifier of the cash machine (or virtual equivalent, e.g. online-shop), which produced the receipt. This ID has to be listed in the Convercus System as with this ID, the connection to the call origin is made.

The account will be created in the database and is assigned an accountId, which can be obtained from the response’s header section Location:

Location{{api_url}}/accounts/accountId

Getting Account Details

As stated before, the account is the center of the whole loyalty system. The accountId can be used as common connection ID for practically all loyalty connections.

You can get the basic account information with the following request:

curl --location --request GET '{{api_url}}/accounts/{{accountId}}' \ 
--header 'Authorization: {{jwt_token}}' \ 
--header 'interaction-id: {{interactionId}}' \ 
--header 'id-type: {{idType}}' \ 
--header 'Content-Type: application/json' \ 

with variables


Variable

Description

{{api_url}}

Endpoint of the api.

{{accountId}}

ID of the account that needs to be checked. The ID has to be given in the format, that is dictated by the {{idType}},

{{jwt_token}}

The JWT-token, which has been generated by authentication.

{{interactionId}}

Unique Identifier of the cash machine (or virtual equivalent, e.g. online-shop), which produced the receipt. This ID has to be listed in the Convercus System as with this ID, the connection to the call origin is made.

{{idType}}

Identifier-Type (corresponding to the {{accountId}}). Available values: APPCODE (e.g. A1B2C3D4E5) CARDCODE (e.g. V1W2X3Y4Z5) EXTERNALCODE (e.g. 123456780123) ID (account-identifier, e.g. 7d123457-bfa1-4a83-8213-123456789763 )


Note, that it’s possible to get the account-object using the identifier code (e.g. {{idType}}=CARDCODE, {{accountId}}=V1W2X3Y4Z5) or the accountId itself (e.g. {{idType}}=ID, {{accountId}}=7d123457-bfa1-4a83-8213-123456789763). Thus, the request may also be used to extract an accountId from a given Identifier.

The account-object per se is rather slender, only containing an ID (accountId), a program reference and a status of the account.

{ 
  "id": "550e8400-e29b-11d4-a716-446655440000", 
  "program": "Pgr-A", 
  "status": "ACTIVE" 
} 

If your program allows deactivation or locking of accounts, you should make sure, that accounts which don’t have the status ACTIVE cannot proceed with the following earn- and burn-processes. Deleted Accounts will not be responded at all.


Getting Account Balance

The account’s balance can be checked with the following command:

curl --location --request GET '{{api_url}}/accounts/{{accountId}}/balance' \ 
--header 'Authorization: {{jwt_token}}' \ 
--header 'interaction-id: {{interactionId}}' \ 
--header 'id-type: {{idType}}' \ 
--header 'Content-Type: application/json' \ 

with variables


Variable

Description

{{api_url}}

Endpoint of the api.

{{accountId}}

ID of the account that needs to be checked. The ID has to be given in the format, that is dictated by the {{idType}}.

{{jwt_token}}

The JWT-token, which has been generated by authentication.

{{interactionId}}

Unique Identifier of the cash machine (or virtual equivalent, e.g. online-shop), which produced the receipt. This ID has to be listed in the Convercus System as with this ID, the connection to the call origin is made.

{{idType}}

Identifier-Type (corresponding to the {{accountId}}). Available values: APPCODE (e.g. A1B2C3D4E5) CARDCODE (e.g. V1W2X3Y4Z5) EXTERNALCODE (e.g. 123456780123) ID (account-identifier, e.g. 7d123457-bfa1-4a83-8213-123456789763 )

This will return the value of points available to the account. Loyalty points can be locked, due to refund periods or individual reasons:

{ 
    "points": 100, 
    "lockedPoints": 0 
}