Generate Test Data

The test data generator lets you easily create one or several credit card transactions for a card to test API functionality around transactions. You can create every other important entity in the system through the normal API: cards, cardholders, receipts, etc.

If you need a new test organization in our test environment, please contact Pliant directly.

📘

Test data generation is only available in the sandbox!

Usage

The only required field is cardToken to identify which card the transactions should be assigned to. All other fields are optional and have sensible default values.

FieldDescriptionDefault Value
numberOfTransactionsThe number of transactions to generate.1
statusThe status of the transaction to generate.CONFIRMED
typeThe type of transactions to generate.PURCHASE
amountThe EUR amount of the transaction. No other currency is allowed here.between -1 and +1 EUR depending on type and status. Has higher precedence than amountRange
fxAmountOptionally, a non-EUR amount if needed, e.g. USD. If used, you also need to provide the amount.can be used to simulate transactions in currencies other than EUR. Please note that you must also define the amount in EUR
amountRangeA range to use when generating multiple transactions at once.
merchantDetails about the merchant.Random String
transactionCategoryA specific transaction categoryRandom category

Example

{
  "cardToken": "123456",
  "numberOfTransactions": 1
  "status": "CONFIRMED",
  "type": "PURCHASE",
  "amount":{
    "value": 1000,
    "currency": "EUR"
  },
  "fxAmount":{
    "value": 998,
    "currency": "USD"
  },
  "amountRange": {
    "from": 100,
    "to": 1000,
    "currency": "EUR"
  },
  "merchant": {
    "name": "AWS",
    "mcc": "9876"
  },
  "transactionCategory": "ADVERTISING_AND_MARKETING"
}

Common Use Cases

Generate a confirmed purchase transaction with a specific amount

Confirmed transactions appear as PENDING in Pliant since they're not BOOKED yet. This happens automatically after 2 bank business days at most. You cannot create booked transactions directly.

{
  "cardToken": "103202894",
  "amount":{
    "value": -54677,
    "currency": "EUR"
  }
}

Generate several purchase transactions with amounts in a range

{
  "cardToken": "103202894",
  "numberOfTransactions": 5,
  "amountRange": {
    "from": -15000,
    "to": -1000,
    "currency": "EUR"
  }
}

Generate a transaction with specific merchant details

{
  "cardToken": "103202894",
  "amount":{
    "value": -2347,
    "currency": "EUR"
  },
  "merchant": {
    "name": "Custom merchant"
  }
}

Generate a 1 EUR card check

Some merchants perform card checks by starting and reversing a 1 EUR transaction on the card. You can simulate this with the following example.

{
    "cardToken": "103202894",
    "numberOfTransactions": 1,
    "status": "REVERSED",
    "type": "STATUS_INQUIRY",
    "amount": {
        "value": -100,
        "currency": "EUR"
    },
    "merchant": {
        "name": "Custom Merchant"
    }
}

Currently supported combinations of type and status

You can use the marked combinations below. Note that the transaction types shown here differ slightly from those we expose through our API due to the internal structure of the test data service.

Transaction TypePENDINGCONFIRMEDDECLINEDREVERSED
PURCHASE
PURCHASE_CHARGEBACK (=CHARGEBACK)
PURCHASE_REFUND (=REFUND)
STATUS_INQUIRY

Different transaction statuses

You can generate declined transactions according to normal Pliant rules (e.g., when the card or organization limit is reached) or via the endpoint here. To trigger a decline by the Pliant platform, create the test transaction with status PENDING. When the transaction amount exceeds the card limit, the platform will decline this transaction.

{
    "cardToken": "103202894",
    "numberOfTransactions": 1,
    "amount": {
        "value": -111200, // higher than the card limit itself
        "currency": "EUR"
    },
    "status": "PENDING",
    "type": "PURCHASE"
}

In general, you can use the endpoint to move transactions between different statuses.

In the test environment, it can take 1-2 days for transactions to be fully booked. During this time, they'll appear as PENDING in our web app even when they're already CONFIRMED. The API always shows the exact status.

Unlike purchases, refunds don't generate an authorization request. As a result, refunds are immediately created with CONFIRMED status and don't receive updates. Therefore, no TRANSACTION_UPDATED callback is sent.

Adding money to a prefund account

You can use the test endpoint here to send money to a prefund organization and top up the account.