Create the Smart Transaction

We prepare a Smart Transaction for a known customer. Instead of an existing card, you would pass a card creation request together with the card group ID in the idents parameter.

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_3ZSETWCS62X06V7FT64RS8W3KU9EAZ"
},
"intent": "sale",
"idents": [
{
"type": "create_card",
"value": "CRG_442AC7B8XCVU3XG2NX9E5XHJWH4CRK"
}
],
"basket": {
"products": [
{
"id": 1,
"articleNumber": 30200,
"desc": "Dining service Puslnitz, 26 pieces",
"quantity": 1,
"priceOne": 5900,
"tax": 19
}
]
},
"basket_info": {
"sum": 5900,
"currency": "EUR"
}
}

If you were to create a gift card, you would use another card program configuration. You then needed to add a special card loading article in the basket (s. Load the Loyalty Card with Cash Balance).

If everthing is fine, the API responds with 200 OK, and the representation of the Smart Transaction:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "smart.transactions",
"id": "STX_27V90VC9K2X06V7GD5NYYWYHKHT3AZ",
   "merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8",
"companyname": "Secupay Test-Shop"
},
"contract": {
"object": "general.contracts",
"id": "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0"
},
    "customer": {
"object": "payment.customers",
"id": "PCU_3ZSETWCS62X06V7FT64RS8W3KU9EAZ",
"contact": {
"forename": "Laisha",
"surname": "Mustermann",
"name": "Laisha Mustermann",
"address": {
"street": "Musterstr.",
"street_number": "994",
"additional_address_data": "App. 848",
"postal_code": "09999",
"city": "Port Keelyton",
"country": "DE"
},
"email": "Hubert69@example.org",
"mobile": "+491775555555",
"phone": "+495555555555",
"dob": "1965-12-31T00:00:00+01:00"
}
},
"device_source": {
"object": "smart.devices",
"id": "SDV_WPX6NU09Q2NDF0KJD3H584EXJR3XA2"
},
"transactions": [],
"created": "2021-01-19T16:25:20+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": []
}],
"type": "default",
"texts": []
},
"basket_info": {
"sum": 5900,
"gratuity": null,
"currency": "EUR"
},
"idents": [{
"object": "smart.idents",
"id": "smi_3",
"prefix": "CRG_",
"name": "secucard Kundenkarte erstellen",
"type": "create_card",
"value": "CRG_442AC7B8XCVU3XG2NX9E5XHJWH4CRK",
"valid": true,
"merchantcard": {
"id": "auto_create",
"cardgroup": {
"id": "CRG_442AC7B8XCVU3XG2NX9E5XHJWH4CRK"
},
"merchant": {
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
"contract": {
"id": "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0"
},
"lock_status": "unlocked"
}
}],
"is_demo": true,
"application_context": {
"locks": {
"customer": false
},
"return_urls": null,
"iframe_opts": null
},
"checkout_links": null,
"payment_links": {
"creditcard": "https://checkout-dev.secuconnect.com?...",
"debit": "https://checkout-dev.secuconnect.com?...",
"invoice": "https://checkout-dev.secuconnect.com?...",
"general": "https://checkout-dev.secuconnect.com?..."
}
}

The new card is already considered, but is not actually created yet.