Basic Call Setup: Transaction vs Account-Transaction
Basic Call Setup: Transaction vs Account-Transaction
Digital receipts sent to Convercus may (or may not) have a Loyalty-Connection. Thus, Convercus API differentiates between Transactions (no Loyalty-connection; Bon is only stored in database for later purposes) and Account-Transactions (Loyalty-connection). While for the same purchase, the body of both transaction-types will stay the same (as will be the subject of the next chapter), the headers and endpoints deviate from each other, as we will see in the next two subchapters.
Transaction
Transactions without Loyalty-connect can be sent with the following request
curl --location --request POST '{{api_url}}/transactions' \
--header 'Authorization: {{jwt_token}}' \
--header 'interaction-id: {{interactionId}}' \
--header 'Content-Type: application/json' \
--data-raw '{{body}}'
with the following variables:
Variable | Description |
---|---|
api_url | Endpoint of the API. https://staging.convercus.io (Staging) https://api.convercus.io (Production) |
jwt_token | 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 bon-to-store is made. |
body | Body with Bon-Information as explained in the next chapter. |
Account-Transaction
If a transaction has to be connected to a loyalty-account, the following request should be sent:
curl --location --request POST '{{api_url}}/accounts/{{accountId}}/transactions' \
--header 'Authorization: {{jwt_token}}' \
--header 'interaction-id: {{interactionId}}' \
--header 'id-type: {{idType}}' \
--header 'Content-Type: application/json' \o
--data-raw '{{body}}'
Note the different endpoint (accounts instead of transactions) and the position of the Loyalty-information identifierCode and idType.
The used variables are the following:
Variable | Description |
---|---|
api_ur | Endpoint of the API. https://staging.convercus.io (Staging) https://api.convercus.io (Production) |
accountId | ID of the account that will receive the transaction. 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 bon-to-store 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 ) |
body | Body with Bon-Information as explained in the next chapter. |
Updated 2 months ago