Update a transaction

Use the Patch transaction API to update the amount or currency for an already initialized transaction.

Call the Patch transaction API endpoint after calling secureFields.init() and before calling secureFields.submit().

patch
Transaction

https://api.sandbox.datatrans.com/v1/transactions/secureFields/{transactionId}
Update the amount or currency of an already initialized transaction.
Request
Response
Request
Path Parameters
transactionId
required
string
The transactionId obtained via initial /v1/transactions/secureFields call
Headers
Authorization
required
string
Basic MTEwMDAyNjUyfDrtSwty5fdstEtodDZpQU1O
Content-type
required
string
application/json; charset=UTF-8
Body Parameters
amount
optional
integer
The new amount in the currency's smallest unit. For example use 1000 for EUR 10.00
currency
optional
integer
Three letter ISO-4217 character code. For example GBP
Response
204: No Content
Amount or currency successfully updated
400: Bad Request
Invalid property
{
"error": {
"code": "INVALID_PROPERTY",
"message": "update at least one property (e.g. amount or currency)"
}
}
404: Not Found
Transaction not found
{
"error": {
"code": "TRANSACTION_NOT_FOUND"
}
}

Example

Request
Response
Request
curl -L -X PATCH 'https://api.sandbox.datatrans.com/v1/transactions/secureFields/201110094904976728' \
-H 'merchantId:password' \
-H 'Content-Type: application/json; charset=UTF-8' \
--data-raw '{
"amount": 5000,
"currency": "GBP"
}'
Response
204 No content