Create the Smart Transaction

Firstly we create a Smart Transaction. It contains the card, and a the special pasket item to load it. We save the customer details, and assume he is already known.

Request
POST /api/v2/Smart/Transactions HTTP/1.1
Host: connect-testing.secupay-ag.de
Authenticate: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"is_demo": true,
"contract": {
"id": "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0"
},
"device_source": {
"id": "SDV_WPX6NU09Q2NDF0KJD3H584EXJR3XA2"
},
"customer": {
"id": "PCU_H8ZQSFS9G2X07TF5JF89V55H645UA2"
},
"intent": "sale",
"idents": [
{
"type": "card",
"value": "9276004424644352"
}
],
"basket": {
"products": [
{
"id": 1,
"articleNumber": 30200,
"desc": "Dining service Puslnitz, 26 pieces",
"quantity": 1,
"priceOne": 5900, // €59
"tax": 19
},
{
"id": 2,
"ean": "4260447149502",
"articleNumber": null,
"desc": "Kartenaufladung 20 EUR",
"quantity": 1,
"priceOne": 2000, // €20
"tax": 0
}
]
},
"basket_info": {
"sum": 7900, // €79
"currency": "EUR"
}
}

This creates a Smart Transaction with a basket total of €79. The special article carries the special EAN 4260447149502 to load the card.

Monetary amounts are expressed in the smallest currency unit (e. g. Euro Cent).

Successful response:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "smart.transactions",
"id": "STX_W28QKGS8H2X07TF64EDJ8DZEJN9RA2",
    "merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8",
"companyname": "Secupay Test-Shop"
},
"contract": {
"object": "general.contracts",
"id": "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0"
},
    "customer": {
"object": "payment.customers",
"id": "PCU_H8ZQSFS9G2X07TF5JF89V55H645UA2",
"contact": {
"forename": "Demond",
"surname": "Mustermann",
"name": "Demond Mustermann",
// ...
}
},
"device_source": {
"object": "smart.devices",
"id": "SDV_WPX6NU09Q2NDF0KJD3H584EXJR3XA2"
},
"transactions": [],
"created": "2021-01-20T09:37:32+01:00",
"status": "created",
"transactionRef": null,
"merchantRef": null,
"intent": "sale",
"basket": {
"products": [{
"id": 1,
"parent": null,
"item_type": "article",
"desc": "Dining service Puslnitz, 26 pieces",
"articleNumber": "30200",
"ean": "",
"quantity": 1,
"priceOne": 5900,
"tax": 19,
"reference_id": null,
"group": []
}, {
"id": 2,
"parent": null,
"item_type": "article",
"desc": "Kartenaufladung 20 EUR",
"articleNumber": "",
"ean": "4260447149502",
"quantity": 1,
"priceOne": 2000,
"tax": 0,
"reference_id": null,
"group": []
}],
"type": "default",
"texts": []
},
"basket_info": {
"sum": 7900,
"gratuity": null,
"currency": "EUR"
},
"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": "Bonus",
"display_name_raw": "Bonus",
"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, // €2.00
"bonus_balance": 20, // €0.20
"balance": 220, // €2.20
"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
}
}],
"is_demo": true,
// ...
}

The card has not yet been charged. This is done in the next step, when the payment is made.