Simulate transaction events
How to create transaction events in sandbox environment
For testing purposes, Imprint’s sandbox environment is not connected to card networks. This means that the sandbox environment does not receive or process real transaction messages.
Imprint offers a sandbox endpoint to simulate transaction events as though they came through the network (e.g., related to a specific payment method, merchant, etc.). Simulated transactions trigger Imprint’s systems, such as transaction event notifications, transaction-based rewards, etc. - so it is a very helpful mirror of the Imprint production environment.
Below, we have detailed how to simulate different common transaction scenarios:
Simulate an APPROVED
transaction
- In the request, do not include a
transaction_id
value. The endpoint will create a newAPPROVED
transaction and return the correspondingtransaction_id
andevent_id
Simulate a VOIDED
transaction
-
You can void an
APPROVED
transaction -
The example voids an approved authorization.
Simulate an UPDATED
transaction
-
The request must include an existing
transaction_id
that will be updated -
Below, the example updates an
APPROVED
transaction amount from $50.00 to $35.46
Simulate a CAPTURED
transaction
-
In the request, you can create one or multiple captures against the same
transaction_id
inAPPROVED
orUPDATED
status. -
The example creates a $4 capture linked to a previous $4 approved authorization.
-
Alternatively, you can create a standalone capture (e.g., “force capture”) by omitting
transaction_id
from the request. -
The example creates a standalone $4 capture.
Simulate a REFUNDED
transaction
-
In the request, you can create one or multiple refunds against the same transaction in
CAPTURED
status. You will need to provide theevent_id
of the related capture. The API will return an error if the refunded amount exceeds the captured amount for the transaction. -
The example creates a $4 refund linked to a previous $4 capture.
-
Alternatively, you can create a standalone refund (e.g., “blind return”) by omitting
transaction_id
from the request. -
The example creates a standalone $5 refund.