SPI Discount Cards
Look up a discount card
post /discount-cards/lookupLooks up discount card details by card number
Eshop ID
The external ID of the store the register belongs to.
The external ID of the staff.
The ID of the register used.
A unique ID for the request, used for tracing and debugging.
{ "card_number": "1234567890"}{ "currency_code": "USD", "card_name": "My Discount Card", "card_number": "1234567890", "card_number_display": "**********7890", "card_type": "Type of Card", "active": true, "original_balance": "100.00", "limit_type": "hard", "balance": "50.00", "discount_percentage": 10, "alternate_discount": { "alternate_discount_percentage": 5, "product_attribute_id": "low_margin", "product_attribute_value": "true" }, "date_expires": 1704067200, "requires_pin": false}| HTTP Status Code Summary | |
|---|---|
| 200 | Discount Card object with transaction ID. |
| 400 | Bad request |
| 404 | Not found |
| 500 | Internal server error |
Post a discount card transaction
post /discount-cards/transactionsPost a discount card transaction
Eshop ID
The external ID of the store the register belongs to.
The external ID of the staff.
The ID of the register used.
A unique ID for the request, used for tracing and debugging.
{ "card_number": "1234567890", "pin_input": "1234", "date": 1704067200, "discount_amount": "10.00", "total_amount": "123.00", "transaction_type": "sale", "transaction_reference": "123e4567-e89b-12d3-a456-426614174000", "transaction_code": "456"}{ "currency_code": "USD", "card_name": "My Discount Card", "card_number": "1234567890", "card_number_display": "**********7890", "card_type": "Type of Card", "active": true, "original_balance": "100.00", "limit_type": "hard", "balance": "50.00", "discount_percentage": 10, "alternate_discount": { "alternate_discount_percentage": 5, "product_attribute_id": "low_margin", "product_attribute_value": "true" }, "date_expires": 1704067200, "requires_pin": false, "transaction_id": "txn_1234567890"}| HTTP Status Code Summary | |
|---|---|
| 201 | Transaction created |
| 400 | Bad request |
| 404 | Not found |
| 422 | Invalid PIN |
| 500 | Internal server error |
Revert a discount card transaction
post /discount-cards/transactions/{transaction_id}/revertReverts a discount card transaction. Used if something went wrong during purchase. For refunds, use the post transaction endpoint with type 'refund'.
The unique id of the transaction to revert.
Eshop ID
The external ID of the store the register belongs to.
The external ID of the staff.
The ID of the register used.
A unique ID for the request, used for tracing and debugging.
{ "card_number": "1234567890", "pin_input": "1234"}{ "currency_code": "USD", "card_name": "My Discount Card", "card_number": "1234567890", "card_number_display": "**********7890", "card_type": "Type of Card", "active": true, "original_balance": "100.00", "limit_type": "hard", "balance": "50.00", "discount_percentage": 10, "alternate_discount": { "alternate_discount_percentage": 5, "product_attribute_id": "low_margin", "product_attribute_value": "true" }, "date_expires": 1704067200, "requires_pin": false, "transaction_id": "txn_1234567890"}| HTTP Status Code Summary | |
|---|---|
| 200 | Transaction reverted |
| 400 | Bad request |
| 404 | Not found |
| 422 | Invalid PIN |
| 500 | Internal server error |
Objects
Errorobject
Lookupobject
The unique id of the discount card (card number).
LookupResponseobject
Currency for the giftcard. (ISO 4217, alpha-3)
The name of the discount card.
The unique id of the gift card (card number).
The masked card number, used for public display.
Type of card according to the provider.
If true, the discount card is active and can be used for a transaction.
Original monetary limit of discount card. Optional since unlimited cards have no original balance set.
Type of limit for the discount card.
| VALUES |
|---|
| soft |
| hard |
| unlimited |
Current monetary value left of the discount card. If not provided no value limits will be applied.
Discount percentage for full price products.
Optional object for applying alternative discount.
Alternative discount percentage to apply.
The product attribute id that triggers the alternative discount. Targeted in combination with product_attribute_value.
A product attribute allowed value that triggers the alternative discount.
The date for the expiration of the discount card. Only used for presentation, active flag decides if card could be used or not.
If true, a PIN is required in order to use the discount card.
RevertTransactionobject
The unique id of the gift card (card number).
Discount card PIN to verify
Transactionobject
The unique id of the discount card (card number).
PIN code for the discount card. Required if the card requires a PIN.
Unix timestamp of the transaction.
Total discount amount that has been granted by the involved discount card, excludes any other promotions or manual discounts from this value.
Total amount the customer is due to pay, which can include multiple discount sources.
Type of transaction.
| VALUES |
|---|
| sale |
| return |
An optional reference for the transaction, e.g. receipt id.
Required if transaction_type is 'refund'. The transaction_id of the original transaction.
An optional code for the transaction.
TransactionResponse
Currency for the giftcard. (ISO 4217, alpha-3)
The name of the discount card.
The unique id of the gift card (card number).
The masked card number, used for public display.
Type of card according to the provider.
If true, the discount card is active and can be used for a transaction.
Original monetary limit of discount card. Optional since unlimited cards have no original balance set.
Type of limit for the discount card.
| VALUES |
|---|
| soft |
| hard |
| unlimited |
Current monetary value left of the discount card. If not provided no value limits will be applied.
Discount percentage for full price products.
Optional object for applying alternative discount.
Alternative discount percentage to apply.
The product attribute id that triggers the alternative discount. Targeted in combination with product_attribute_value.
A product attribute allowed value that triggers the alternative discount.
The date for the expiration of the discount card. Only used for presentation, active flag decides if card could be used or not.
If true, a PIN is required in order to use the discount card.
The unique id of the transaction.