This guide is for e-commerce platforms with a custom checkout. There are other guides for simple webshops, or internet marketplaces. And there are also guides for our Smart Checkout.
Prerequisites
As a prerequisite, you should have read and understand:
Create a Smart Transaction
The API endpoint to create a Smart Transaction is POST
/api/v2/Smart/Transactions
.
In contrast to webshops, you must also pass stakeholder payments for the marketplace fees.
POST /api/v2/Smart/Transactions HTTP/1.1
Host: connect-testing.secuconnect.com
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
{
"is_demo"
:
true
,
"contract"
: {
"id"
:
"GCR_9OIH9JOL8KIV5PFJBEOS2NN8TCM1DF"
},
"customer"
: {
"contact"
: {
"forename"
:
"Markus"
,
"surname"
:
"Mustermann"
,
"phone"
:
"+49 555 5555555"
,
"mobile"
:
"+49 177 5555555"
,
"address"
: {
"street"
:
"Musterstr."
,
"street_number"
:
"12 b"
,
"additional_address_data"
:
"Whg. 202"
,
"postal_code"
:
"09999"
,
"city"
:
"Musterstadt"
,
"country"
:
"DE"
},
"email"
:
"markus@example.net"
,
"dob"
:
"1965-12-31"
}
},
"intent"
:
"sale"
,
"basket"
: {
"products"
: [
{
"id"
: 1,
"articleNumber"
: 1,
"desc"
:
"Coffee maker with remote control"
,
"quantity"
: 1,
"priceOne"
: 5000,
"tax"
: 19
},
{
"id"
: 1000,
"item_type"
:
"shipping"
,
"name"
:
"Standard delivery 2-3 days"
,
"quantity"
: 1,
"priceOne"
: 350,
"tax"
:
"19"
},
{
"item_type"
:
"stakeholder_payment"
,
"desc"
:
"Platform fee"
,
"sum"
: 161,
"reference_id"
:
"fee"
,
"contract_id"
:
"GCR_ZPMJGRH4SU3X0H3Y3WYB69XVXAG8PJ"
}
]
},
"basket_info"
: {
"sum"
: 5350,
"currency"
:
"EUR"
},
"payment_context"
: {
"auto_capture"
:
true
},
"application_context"
: {
"return_urls"
: {
"url_push"
:
"https://shop.example.org/PUSH?order=12345"
}
}
}
This creates a demo for a coffee maker about €53.50 including shipping cost. The platform earns a fee of €1.61. The auto_capture
setting saves an additional API call, if it fits the flow.
If everything is fine, the API responds with 200 OK
: and a representation of the newly created Smart Transaction:
HTTP/1.1 200 OK
Content-Type: application/json
{
"object"
:
"smart.transactions"
,
"id"
:
"STX_2UYAHWYC32X2GT37V32E8BPRNUA2A3"
,
"merchant"
: {
"object"
:
"general.merchants"
,
"id"
:
"MRC_G8SE48FRHVITKILAPNCEDU0NUD55W8"
,
"companyname"
:
"Secupay Test-Shop"
},
"contract"
: {
"object"
:
"general.contracts"
,
"id"
:
"GCR_9OIH9JOL8KIV5PFJBEOS2NN8TCM1DF"
},
"customer"
: {
"object"
:
"payment.customers"
,
"id"
:
"PCU_3J7GCMPPE2X2GT37V32E8BPRNUA2AW"
,
"contact"
: {
"forename"
:
"Markus"
,
"surname"
:
"Mustermann"
,
"name"
:
"Markus Mustermann"
,
"phone"
:
"+49 555 5555555"
,
"mobile"
:
"+49 177 5555555"
,
"address"
: {
"street"
:
"Musterstr."
,
"street_number"
:
"12 b"
,
"additional_address_data"
:
"Whg. 202"
,
"postal_code"
:
"09999"
,
"city"
:
"Musterstadt"
,
"country"
:
"DE"
},
"email"
:
"markus@example.net"
,
"dob"
:
"1965-12-31T00:00:00+01:00"
}
},
// ...
"created"
:
"2021-03-16T18:20:15+01:00"
,
"status"
:
"created"
,
// ...
"intent"
:
"sale"
,
"basket"
: {
"products"
: [
{
"id"
: 1,
"item_type"
:
"article"
,
"desc"
:
"Coffee maker with remote control"
,
"articleNumber"
:
"1"
,
"quantity"
: 2,
"priceOne"
: 5000,
"tax"
: 19
},
{
"id"
: 1000,
"item_type"
:
"shipping"
,
"desc"
:
"Standard delivery 2-3 days"
,
"quantity"
: 1,
"priceOne"
: 350,
"tax"
:
"19"
},
{
"item_type"
:
"stakeholder_payment"
,
"desc"
:
"Platform fee"
,
"reference_id"
:
"fee"
,
"contract_id"
:
"GCR_ZPMJGRH4SU3X0H3Y3WYB69XVXAG8PJ"
,
"sum"
: 161
}
],
// ...
},
"basket_info"
: {
"sum"
: 5350,
"currency"
:
"EUR"
},
"is_demo"
:
true
,
// ...
"payment_context"
: {
"auto_capture"
:
true
},
"application_context"
: {
"return_urls"
: {
"url_push"
:
"https://shop.example.org/PUSH?order=12345"
}
}
}
Important fields are:
Field | Type | Meaning |
---|---|---|
|
| The object ID of the new Smart Transaction. |
|
| The status of the Smart Transaction. |
Most interesting is the ID of the Smart Transaction. Your application may need it for subsequent calls.
For further explanation of the fields, see our API Reference: link