In order to actually pay, you need to call one of the endpoints:
start/loyalty
if there is no missing sum;start/cash
if the remainder is paid at the cash register (ECR) without our terminals;start/cashless
if the remainder is paid at the ECR with one of our terminals;prepare/debit
andstart
if the remainder is paid with SEPA direct debit;prepare/creditcard
andstart
if the remainder is paid with a credit card.
There is a remainder in our example, and we track an ECR payment:
Request
POST /api/v2/Smart/Transactions/STX_KJXJDUN542NR3WMRHRVU5WWM6ZQEA2/start/cash HTTP/1.1
Host: connect-testing.secuconnect.com
Authenticate: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Accept: application/json
If everything is fine, the API responds with 200 OK
, and the updated representation of Smart Transaction:
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"object"
:
"smart.transactions"
,
"id"
:
"STX_KJXJDUN542NR3WMRHRVU5WWM6ZQEA2"
,
// ...
"transactions"
: [
{
"object"
:
"loyalty.transactions"
,
"id"
:
"LTX_CN5CGYUR9SP8RTU7ZZJDDZ4KZ30AN3"
}
],
"created"
:
"2020-09-25T08:06:32+02:00"
,
"updated"
:
"2020-09-25T08:10:36+02:00"
,
"status"
:
"ok"
,
// ...
"receipt"
: [
{
"type"
:
"separator"
,
"value"
: {
"caption"
:
"Kundenkarte"
}
},
{
"type"
:
"name-value"
,
"value"
: {
"name"
:
"Kartennummer:"
,
"value"
:
"9276004424644352"
,
"decoration"
: []
}
},
{
"type"
:
"name-value"
,
"value"
: {
"name"
:
"TA Code:"
,
"value"
:
"29218141"
,
"decoration"
: []
}
},
{
"type"
:
"space"
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"Zahlung über:"
,
"decoration"
: []
}
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"2,20 EUR"
,
"decoration"
: [
"important"
]
}
},
{
"type"
:
"space"
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"Umsatz erfasst:"
,
"decoration"
: []
}
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"7,76 EUR"
,
"decoration"
: [
"important"
]
}
},
{
"type"
:
"space"
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"Bonus:"
,
"decoration"
: []
}
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"0,77 EUR"
,
"decoration"
: [
"important"
]
}
},
{
"type"
:
"space"
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"Aktuelles Guthaben"
,
"decoration"
: []
}
},
{
"type"
:
"textline"
,
"value"
: {
"text"
:
"0,77 EUR"
,
"decoration"
: [
"important"
]
}
}
],
// ...
"idents"
: [
{
"object"
:
"smart.idents"
,
"id"
:
"smi_1"
,
"prefix"
:
"9276"
,
"name"
:
"secucard Kundenkarte"
,
"type"
:
"card"
,
"value"
:
"9276004424644352"
,
"valid"
:
true
,
"merchantcard"
: {
"object"
:
"loyalty.merchantcards"
,
"id"
:
"MCD_2UXQJ84A62MENH7UWH6QXDYJSBNAA9"
,
"merchant"
: {
"object"
:
"general.merchants"
,
"id"
:
"MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
"created_for_merchant"
: {
"object"
:
"general.merchants"
,
"id"
:
"MRC_F40KSJYW5AAJHHC93TQ6C7A8X76WO6"
},
"card"
: {
"object"
:
"loyalty.cards"
,
"id"
:
"CRD_22H4H5D47Q44URN2K8KTP876H6M3PM"
,
"cardnumber"
:
"9276004424644352"
,
"created"
:
"2015-02-20T08:51:46+01:00"
},
"cardgroup"
: {
"object"
:
"loyalty.cardgroups"
,
"id"
:
"CRG_4VA6040D2DWRYHJKCWXZEW24654PRH"
,
"display_name"
:
"Stammkunde"
,
"display_name_raw"
:
"Stammkunde"
,
"stock_warn_limit"
: 0,
"picture"
:
"https://connect.secucard.com/ds_g/8e79737df1e2513db48908b342c3cc436edf501a"
},
"created_for_store"
: {
"object"
:
"general.stores"
,
"id"
:
"STO_3522R8MS2MSHCN7D37UVJYR4P6C4PX"
},
"is_base_card"
:
false
,
"points"
: 0,
"cash_balance"
: 200,
"bonus_balance"
: 20,
"balance"
: 220,
"last_usage"
:
"2017-10-11T09:34:42+02:00"
,
"last_charge"
:
"2017-10-11T09:34:42+02:00"
,
"stock_status"
:
"inactive"
,
"lock_status"
:
"unlocked"
,
"passcode"
: 1,
"expiry_date"
:
null
}
}
],
"payment_method"
:
"cash"
,
"trans_id"
:
"29218143"
,
// ...
}
In our case the transaction has status ok
now.
The receipt gives the buyer some additional information:
- €2.20 are paid with the loyalty card;
- €7.76 of the revenue are considered are entitled to collect new bonus balance;
- €0.77 bonus was collected.
Why was the revenue recorded with €7.76, and not €7.96? You would need to exclude the bonus articles from bonus collection, so that the discount itself is ignored. To achieve this, you can add the bonus products to your blacklist, or leave them off your whitelist. The redeemed cash balance of €2.00 is always considered, since it is no discount on the article prices.