Generate Test Data

The test data generator lets you easily create one or several credit card transactions for a card to test the API functionality around transactions. Every other important entity in the system can be created via the normal API: like cards or cardholders or receipts.

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

📘

Test data generation is only available within the sandbox!

Usage

The only required field is cardToken to be able 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 a 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 if you want to simulate transactions in currencies other than EUR. Please keep in mind that the amount has to be additionally defined 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 certain amount

Confirmed transactions are shown as PENDING on Pliant, since they are not BOOKED yet. This happens automatically after 2 band working days at latest. Booked transactions cannot be created directly.

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

Generate several purchase transactions with the amount in range

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

Generate a transaction with a specific set of merchant details

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

Generate a 1 EUR card check

Some merchants do card checks by starting and reversing a 1 EUR transaction on the card. This can be simulated 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 combinations of the marked types below. Please keep in mind, that the status transaction types shown here are a bit different to the ones we expose through our API. This is due to the internal structure of the test data service.

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

Different transaction status

Declined transactions can be generated according to normal Pliant rules (e.g. the card or organization limit is reached), or via the endpoint here.

In general, the endpoint can be used to move transactions between different status.

In the test environment, it can take 1-2 days for transactions to be fully booked, during which time they will appear as PENDING in our web app even if they are already CONFIRMED. The API always shows the exact status.

Unlike purchases, refunds do not generate an authorization request. As a result, refunds are immediately created with a CONFIRMED status, and they do not receive updates. Therefore, no TRANSACTION_UPDATED callback is sent out.

Adding money to a prefund account

Via the test endpoint here you can send money to a prefund organization to top up the account.