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.
Field | Description | Default Value |
---|---|---|
numberOfTransactions | The number of transactions to generate. | 1 |
status | The status of the transaction to generate. | CONFIRMED |
type | The type of transactions to generate. | PURCHASE |
amount | The 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 |
fxAmount | Optionally, 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 |
amountRange | A range to use when generating multiple transactions at once. | |
merchant | Details about the merchant. | Random String |
transactionCategory | A specific transaction category | Random 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
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 Type | PENDING | CONFIRMED | DECLINED | REVERSED |
---|---|---|---|---|
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.
Updated about 2 months ago