Create a Smart Transaction with Minimal Data

The endpoint to create a Smart Transaction is POST /api/v2/Smart/Transactions:

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_2YJDXYESB2YBHECVB5GQGSYPNM8UA6"
},
"customer": {
"contact": {
"salutation": "Mr.",
"title": "Dr.",
"forename": "Max",
"surname": "Mustermann",
"address": {
"street": "Musterstr.",
"street_number": "25 b",
"additional_address_data": "Whg. 123",
"postal_code": "99999",
"city": "Musterstadt",
"country": "DE"
},
"email": "max123@example.org",
"phone": "+49 555 5555555",
"mobile": "+49 177 5555555",
"dob": "1901-02-03"
}
},
    "intent": "sale",
"basket_info": {
"sum": 0,
"currency": "EUR"
}
}

These three things are special:

  • The contract ID is only needed in e-commerce, but not in a POS device context.

  • The source device ID is only needed for loyalty in e-commerce.

  • The card number. It could also be set later, using PUT /api/v2/Smart/Transactions/STX_WHCJCB3SD2NSZZ73E33NP3TJJ4RKA2.

You could also set the Payment Customer ID in order to reuse it.

If everything is fine, the API responds with 200 OK and the representation of the Payment Transaction:

Reponse
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "smart.transactions",
"id": "STX_KJXJDUN542NR3WMRHRVU5WWM6ZQEA2",
"merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8",
"companyname": "Secupay Test-Shop"
},
"contract": {
"object": "general.contracts",
"id": "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0"
},
    "device_source": {
"object": "smart.devices",
"id": "SDV_2YJDXYESB2YBHECVB5GQGSYPNM8UA6"
},
"customer": {
"object": "payment.customers",
"id": "PCU_24XQFBSAS2NSZZPUYR9F20330GX6AZ",
"contact": {
"forename": "Max",
"surname": "Mustermann",
"name": "Max Mustermann",
"salutation": "Mr.",
"title": "Dr.",
"address": {
"street": "Musterstr.",
"street_number": "25 b",
"additional_address_data": "Whg. 123",
"postal_code": "99999",
"city": "Musterstadt",
"country": "DE"
},
"email": "max123@example.org",
"mobile": "+491775555555",
"phone": "+495555555555",
"dob": "1901-02-03T00:00:00+01:00"
}
},
    "transactions": [],
"created": "2020-09-22T13:53:44+02:00",
"status": "created",
// ...
"basket": {
"products": [],
// ...
},
"basket_info": {
"sum": 0,
"currency": "EUR",
// ...
},
"is_demo": true,
// ...
}

When you authenticate as device, the merchant is resolved automatically.