Update the Smart Transaction

These details of a Smart Transaction can be changed before it is started:

  • customer data and shipping address;

  • basket and total sum;

  • the purpose (transactionRef);

  • the order or customer ID (merchantRef);

  • the delivery options.

If you update an approved transaction, the payment authorization is lost, and it changes back to the created status. You must repeat the authorization process.

In order to update the Smart Transaction you have to address its PUT endpoint. You must send the full object representation, and to modify the needed values. Values managed by our system are ignored. You can send or leave them.

Request
PUT /api/v2/Smart/Transactions/STX_3K5NPEAFF2NT539D66NNSWC25VNVAZ HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"customer": {
"contact": {
"forename": "Raina",
"surname": "Mustermann",
"name": "Raina Mustermann",
"address": {
"street": "Musterstr.",
"street_number": "771",
"additional_address_data": "App. 197",
"postal_code": "09999",
"city": "North Alphonsofurt",
"country": "DE"
},
"email": "Jacinto_Daugherty@example.net",
"mobile": "+491775555555",
"phone": "+495555555555",
"dob": "1965-12-31T00:00:00+01:00"
}
},
"transactionRef": "Order at example.com, order 9/2020/000123",
"merchantRef": "Customer 5/000210/MR",
"basket": {
"products": [
{
"id": 1,
"articleNumber": 30037,
"desc": "Sandwich Romano",
"quantity": 1,
"priceOne": 349,
"tax": 7
},
{
"id": 2,
"articleNumber": 30200,
"desc": "Fruit salad, small bowl",
"quantity": 1,
"priceOne": 249,
"tax": 7
}
]
},
"basket_info": {
"sum": 598,
"currency": "EUR"
},
"delivery_options": {
"type": "collection",
"scheduled_slot": {
"start_date": "2020-07-06T12:45:00+02:00",
"end_date": "2020-07-06T14:45:00+02:00"
},
"store_id": "STO_WCH2ABG8T7U8WHWDF3EG5KV2P6C4PM"
}
}

In our example we change the basket and total, set a new customer and delivery options, and a purpose and your customer ID.

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

If everything is fine, the API responds with 200 OK and the new object representation:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "smart.transactions",
"id": "STX_3K5NPEAFF2NT539D66NNSWC25VNVAZ",
// ...
"customer": {
"object": "payment.customers",
"id": "PCU_3ZZ6598CB2NT543DSDZUH5CQGKQ4A2",
"contact": {
"forename": "Raina",
"surname": "Mustermann",
"name": "Raina Mustermann",
"address": {
"street": "Musterstr.",
"street_number": "771",
"additional_address_data": "App. 197",
"postal_code": "09999",
"city": "North Alphonsofurt",
"country": "DE"
},
"email": "Jacinto_Daugherty@example.net",
"mobile": "+491775555555",
"phone": "+495555555555",
"dob": "1965-12-31T00:00:00+01:00"
}
},
// ...
"updated_at": "2020-11-06T10:43:05+01:00",
"status": "created",
"transactionRef": "Order at example.com, order 9/2020/000123",
"merchantRef": "Customer 5/000210/MR",
// ...
"basket": {
"products": [
{
"id": 1,
"parent": null,
"articleNumber": "30037",
"ean": "",
"desc": "Sandwich Romano",
"quantity": 1,
"priceOne": 349,
"tax": 7,
"group": [],
"serialNumber": null,
"item_type": "article",
// ...
}, {
"id": 2,
"parent": null,
"articleNumber": "30200",
"ean": "",
"desc": "Fruit salad, small bowl",
"quantity": 1,
"priceOne": 249,
"tax": 7,
"group": [],
"serialNumber": null,
"item_type": "article",
// ...
            }
],
// ...
},
"basket_info": {
"sum": 598,
"gratuity": null,
"currency": "EUR"
},
"is_demo": true,
"delivery_options": {
"type": "collection",
"code": null,
"store_id": "STO_WCH2ABG8T7U8WHWDF3EG5KV2P6C4PM",
"scheduled_slot": {
"start_date": "2020-07-06T12:45:00+02:00",
"end_date": "2020-07-06T14:45:00+02:00"
},
"delivered_at": null
},
// ...
}

Most changes are straightforward. The customer details are put into a Payment Customer object, that can be reused.