To make a payment we need a Smart Transaction.
The API endpoint to create a Smart Transaction is POST /api/v2/Smart/Transactions
:
POST /api/v2/Smart/Transactions HTTP/1.1
Host: connect-testing.secuconnect.com
Authenticate: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
{
"intent"
:
"sale"
,
"basket"
: {
"products"
: [
{
"id"
: 1,
"item_type"
:
"article"
,
"desc"
:
"BRÖTCHENANGEBOT 8 Stück"
,
"articleNumber"
:
"70000"
,
"ean"
:
null
,
"quantity"
: 1,
"priceOne"
: 1,
"tax"
: 7,
"group"
: [
{
"id"
:
"1"
,
"desc"
:
"Backwaren"
,
"level"
: 1
},
{
"id"
:
"2"
,
"desc"
:
"Brötchen"
,
"level"
: 2
}
]
}
],
},
"basket_info"
: {
"sum"
: 1,
"currency"
:
"EUR"
},
"merchantRef"
:
"Kundennr. 101"
,
"transactionRef"
:
"Belegnr. 55501"
,
}
This creates a Smart Transaction about €0.01.
Monetary amounts are expressed in the smallest currency unit (e. g. Euro Cent).
These are the parameters:
Field | Type | Details |
---|---|---|
|
| Always |
|
| Optional simple or mixed basket (here a simple one) |
|
| Array with the basket items |
|
| Summary of the basket |
|
| Basket total (must equal the sum of all item totals) |
|
| ISO 4217 currency code such as |
|
| Optional customer reference by the merchant |
|
| Optional transaction reference by the merchant |
The basket items within basket/products
in more detail:
Field | Type | Details |
---|---|---|
|
| Unique identifier for the position |
|
| Always Coupons lower the basket total instead of increasing it. There are more item types in conjunction with feature not explained in this guide. |
|
| Article name |
|
| Optional merchant article number |
|
| Optional manufacturer EAN / GTIN of the product |
|
| Number of items sold |
|
| Gross unit price of this article (the price of one piece including taxes) |
|
| Tax rate in percent |
|
| Optional product groups |
If everything is fine, the API responds with 200 OK
, and the representation of the newly created Smart Transaction:
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"object"
:
"smart.transactions"
,
"id"
:
"STX_3HXQQBSVK2XWNAX7ESCZH9NZY3YZAZ"
,
"merchant"
: {
"object"
:
"general.merchants"
,
"id"
:
"MRC_8GTCKFB97SR4GET4KGAB6Y59K4PGO8"
,
"companyname"
:
"Musterfirma GmbH"
},
"device_source"
: {
"object"
:
"smart.devices"
,
"id"
:
"SDV_2T23JN7KS2NVMPJ76SPZV9HGWXFHA2"
},
"created"
:
"2021-02-25T08:47:25+01:00"
,
"status"
:
"created"
,
// ...
"merchantRef"
:
"Kundennr. 101"
,
"transactionRef"
:
"Belegnr. 55501"
,
"basket"
: {
"products"
: [
{
"id"
: 1,
"parent"
:
null
,
"item_type"
:
"article"
,
"desc"
:
"BRÖTCHENANGEBOT 8 Stück"
,
"articleNumber"
:
"70000"
,
"ean"
:
null
,
"quantity"
: 1,
"priceOne"
: 1,
"tax"
: 7,
"reference_id"
:
null
,
"group"
: [
{
"id"
:
"1"
,
"desc"
:
"Backwaren"
,
"level"
: 1
},
{
"id"
:
"2"
,
"desc"
:
"Brötchen"
,
"level"
: 2
}
]
}
],
"type"
:
"default"
,
"texts"
: []
},
"basket_info"
: {
"sum"
: 1,
"currency"
:
"EUR"
,
// ...
},
"is_demo"
:
false
,
// ...
}
The new Smart Transaction has the initial status created
. The API also adds some information about the merchant and the device.