Skip to main content
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 new APPROVED transaction and return the corresponding transaction_id and event_id
{
  "transaction_id": "",
  "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
  "customer_id": "e0549550-90e9-4acb-b7e9-2e4738b7def2",
  "status": "APPROVED",
  "amount": 5000,
  "currency": "USD",
  "authorization_code": "645432",
  "network_transaction_id": "txn-789456",
  "purchase_method": "CHIP",
  "merchant": {
    "network_id": "234923454545",
    "name": "Target",
    "category": "Grocery Stores",
    "category_code": "5411",
    "address": {
      "city": "New York",
      "country": "USA",
      "postal_code": "10002",
      "state": "NY",
      "street_line1": "",
      "street_line2": ""
    }
  }
}

Simulate a VOIDED transaction

  • You can void an APPROVED transaction
  • The example voids an approved authorization.
{
  "transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
  "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
  "status": "VOIDED"
}

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
{
  "transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
  "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
  "status": "UPDATED",
  "amount": 3456
}

Simulate a CAPTURED transaction

  • In the request, you can create one or multiple captures against the same transaction_id in APPROVED or UPDATED status.
  • The example creates a $4 capture linked to a previous $4 approved authorization.
{
    "transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
    "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
    "customer_id": "e0549550-90e9-4acb-b7e9-2e4738b7def2",
    "status": "CAPTURED",
    "amount": 400
}
  • 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.
{
    "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
    "transaction_id": "",
    "amount": 400,
    "status": "CAPTURED"
}

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 the event_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.
{
    "transaction_id": "e2806932-5f1b-4518-8b15-156d773e9496",
    "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
    "event_id": "57d8cbfd-ef76-48e7-98fd-1a5cc3e2a82e",
    "amount": 400,
    "status": "REFUNDED"
}
  • 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.
{
    "transaction_id": "",
    "payment_method_id": "7f754378-dd84-4a9a-b1ce-0646bb769c29",
    "status": "REFUNDED",
    "amount": 5000,
    "currency": "USD",
    "authorization_code": "645432",
    "network_transaction_id": "txn-789456",
    "purchase_method": "CHIP",
    "merchant": {
        "network_id": "234923454545",
        "name": "Target",
        "category": "Grocery Stores",
        "category_code": "5411",
        "address": {
            "city": "New York",
            "country": "USA",
            "postal_code": "10002",
            "state": "NY",
            "street_line1": "",
            "street_line2": ""
        }
    }
}