Testing
Use the credentials provided on this page to test your solution.
When you sign up, you will be provided with a “live” account and a “test” account (the latter is prefixed with “test_”).
When testing, ensure requests submitted to Trust Payments reference your test sitereference.

Before you begin testing…
Please be aware of the following notes:
- Most fields submitted to our test system will be accepted. Any data breaching its defined specification will return an error message.
- Any test data that generates a successful response when submitted while a merchant is in test mode, will produce a declined response when a merchant is switched into live mode. In some cases, the test data may return an error response.
- Our test system attempts to simulate responses in a similar fashion to the live system. However, depending on your acquirer you may find some responses differ slightly from those given by the test system.
- In the interest of security, we recommend against using real payment details when using your test account.
- We recommend specifying the main amount “10.50” when testing. Other amounts can be used but may return unexpected responses.
- For those using Payment Pages, if you’re unsure where to start with your testing, you may find this resource helpful.
Test card details
The table below lists test card numbers and customer information that can be submitted to our test bank, along with the responses that should be expected in return.


- A baseamount of 70000 (£700.00) will always return a declined response from the test bank.
- A baseamount of 60010 (£600.10) will always return a bank system error from the test bank.
- Using baseamount 1050 (£10.50) will not generate an error.
3-D Secure v2
The following payment credentials can be used for testing 3-D Secure v2 (a form of SCA):
(3DSv2) Test Case 1: Successful Frictionless 3-D Secure Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001007 | THREEDQUERY Enrolled: Y Status: Y AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001002 | |
JCB | 3337000000000008 | |
MASTERCARD | 5200000000001005 | |
VISA (3-D Secure v2.1.0) | 4000000000001000 | |
VISA (3-D Secure v2.2.0) | 4000000000002701 |
(3DSv2) Test Case 2: Failed Frictionless 3-D Secure Authentication & Failed Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001015 | THREEDQUERY Enrolled: Y Status: N AUTH Error code: 60022 – Unauthenticated |
DINERS / DISCOVER | 6011000000001010 | |
JCB | 3337000000000990 | |
MASTERCARD | 5200000000001013 | |
VISA (3-D Secure v2.1.0) | 4000000000001018 | |
VISA (3-D Secure v2.2.0) | 4000000000002925 |
(3DSv2) Test Case 3: Attempts Stand-In Frictionless 3-D Secure Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001023 | THREEDQUERY Enrolled: Y Status: A AUTH Error code: 0 -Ok |
DINERS / DISCOVER | 6011000000001028 | |
JCB | 3337000000007045 | |
MASTERCARD | 5200000000001021 | |
VISA (3-D Secure v2.1.0) | 4000000000001026 | |
VISA (3-D Secure v2.2.0) | 4000000000002719 |
(3DSv2) Test Case 4: Unavailable Frictionless 3-D Secure Authentication from the Issuer & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001031 | THREEDQUERY Enrolled: Y Status: U AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001036 | |
JCB | 3337000000000735 | |
MASTERCARD | 5200000000001039 | |
VISA (3-D Secure v2.1.0) | 4000000000001034 | |
VISA (3-D Secure v2.2.0) | 4000000000002313 |
(3DSv2) Test Case 5: Rejected Frictionless 3-D Secure Authentication by the Issuer & Failed Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001049 | THREEDQUERY Enrolled: Y Status: R AUTH Error code: 60022 – Unauthenticated |
DINERS / DISCOVER | 6011000000001044 | |
JCB | 3337000000000321 | |
MASTERCARD | 5200000000001047 | |
VISA (3-D Secure v2.1.0) | 4000000000001042 | |
VISA (3-D Secure v2.2.0) | 4000000000002537 |
(3DSv2) Test Case 6: 3-D Secure Authentication Not Available on Lookup & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001056 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001051 | |
JCB | 3337000000006765 | |
MASTERCARD | 5200000000001054 | |
VISA (3-D Secure v2.1.0) | 4000000000001059 | |
VISA (3-D Secure v2.2.0) | 4000000000002990 |
(3DSv2) Test Case 7: Error on Lookup & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001064 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001069 | |
JCB | 3337000000000016 | |
MASTERCARD | 5200000000001062 | |
VISA (3-D Secure v2.1.0) | 4000000000001067 | |
VISA (3-D Secure v2.2.0) | 4000000000002446 |
(3DSv2) Test Case 8: Timeout on cmpi_lookup Transaction & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001072 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001077 | |
JCB | 3337000000000081 | |
MASTERCARD | 5200000000001070 | |
VISA (3-D Secure v2.1.0) | 4000000000001075 | |
VISA (3-D Secure v2.2.0) | 4000000000002354 |
(3DSv2) Test Case 9: Successful Step Up 3-D Secure Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001098 | THREEDQUERY Enrolled: Y Status: C AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001093 | |
JCB | 3337000000200004 | |
MASTERCARD | 5200000000001096 | |
VISA (3-D Secure v2.1.0) | 4000000000001091 | |
VISA (3-D Secure v2.2.0) | 4000000000002503 |
(3DSv2) Test Case 10: Failed Step Up 3-D Secure Authentication & No Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001106 | THREEDQUERY Enrolled: Y Status: C AUTH Not performed |
DINERS / DISCOVER | 6011000000001101 | |
JCB | 3337000000200087 | |
MASTERCARD | 5200000000001104 | |
VISA (3-D Secure v2.1.0) | 4000000000001109 | |
VISA (3-D Secure v2.2.0) | 4000000000002370 |
(3DSv2) Test Case 11: Step Up 3-D Secure Authentication is Unavailable & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001114 | THREEDQUERY Enrolled: Y Status: C AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001119 | |
JCB | 3337000000200079 | |
MASTERCARD | 5200000000001112 | |
VISA (3-D Secure v2.1.0) | 4000000000001117 | |
VISA (3-D Secure v2.2.0) | 4000000000002420 |
(3DSv2) Test Case 12: Error on 3-D Secure Authentication & No Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001122 | THREEDQUERY Enrolled: Y Status: C AUTH Not performed |
DINERS / DISCOVER | 6011000000001127 | |
JCB | 3337000000200046 | |
MASTERCARD | 5200000000001120 | |
VISA (3-D Secure v2.1.0) | 4000000000001125 | |
VISA (3-D Secure v2.2.0) | 4000000000002644 |
(3DSv2) Test Case 13: Bypassed 3-D Secure Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000001080 | THREEDQUERY Enrolled: B Status: None AUTH Error code: 0 – Ok |
DINERS / DISCOVER | 6011000000001085 | |
JCB | 3337000000000537 | |
MASTERCARD | 5200000000001088 | |
VISA (3-D Secure v2.1.0) | 4000000000001083 | |
VISA (3-D Secure v2.2.0) | 4000000000002560 |
3-D Secure v1
The following payment credentials can be used for testing 3-D Secure v1 (a form of SCA):
(3DSv1) Test Case 1: Successful 3-D Secure Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000003961 | THREEDQUERY Enrolled: Y Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000006246 | |
DISCOVER | 6011000000000004 | |
JCB | 3520000000000922 | |
MASTERCARD | 5200000000000007 | |
VISA | 4000000000000002 |
(3DSv1) Test Case 2: Failed Signature & No Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000006022 | THREEDQUERY Enrolled: Y Status: None AUTH Not performed |
DINERS | 3005000000004373 | |
DISCOVER | 6011000000000012 | |
JCB | 3520000000002811 | |
MASTERCARD | 5200000000000015 | |
VISA | 4000000000000010 |
(3DSv1) Test Case 3: Failed Authentication & No Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000000033 | THREEDQUERY Enrolled: Y Status: None AUTH Not performed |
DINERS | 3005000000005925 | |
DISCOVER | 6011000000000020 | |
JCB | 3520000000009931 | |
MASTERCARD | 5200000000000023 | |
VISA | 4000000000000028 |
(3DSv1) Test Case 4: Attempts/Non-Participating & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000003391 | THREEDQUERY Enrolled: Y Status: A AUTH Error code: 0 – Ok |
DINERS | 3005000000005271 | |
DISCOVER | 6011000000000038 | |
JCB | 3520000000004767 | |
MASTERCARD | 5200000000000908 | |
VISA | 4000000000000101 |
(3DSv1) Test Case 6: Not Enrolled & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000008135 | THREEDQUERY Enrolled: N Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000007269 | |
DISCOVER | 6011000000000053 | |
JCB | 3520000000006903 | |
MASTERCARD | 5200000000000056 | |
VISA | 4000000000000051 |
(3DSv1) Test Case 7: Unavailable & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000007780 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000006030 | |
DISCOVER | 6011000000000061 | |
JCB | 3520000000002423 | |
MASTERCARD | 5200000000000064 | |
VISA | 4000000000000069 |
(3DSv1) Test Case 8: Merchant Not Active & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000008416 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000004837 | |
DISCOVER | 6011000000000079 | |
JCB | 3520000000006549 | |
MASTERCARD | 5200000000000072 | |
VISA | 4000000000000077 |
(3DSv1) Test Case 9: cmpi_lookup error & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000006337 | THREEDQUERY Enrolled: U Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000009877 | |
DISCOVER | 6011000000000087 | |
JCB | 3520000000002175 | |
MASTERCARD | 5200000000000080 | |
VISA | 4000000000000085 |
(3DSv1) Test Case 10: cmpi_authenticate error & No Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000009299 | THREEDQUERY Enrolled: Y Status: None AUTH Not performed |
DINERS | 3005000000005602 | |
DISCOVER | 6011000000000095 | |
JCB | 3520000000006861 | |
MASTERCARD | 5200000000000098 | |
VISA | 4000000000000093 |
(3DSv1) Test Case 11: Authentication Unavailable & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340000000000116 | THREEDQUERY Enrolled: Y Status: None AUTH Error code: 0 – Ok |
DINERS | 3005000000007376 | |
DISCOVER | 6011000000000103 | |
JCB | 3520000000005780 | |
MASTERCARD | 5200000000000031 | |
VISA | 4000000000000036 |
(3DSv1) Test Case 12: Bypassed Authentication & Successful Authorisation |
||
Card type | PAN | Handling the response |
AMEX | 340099000000001 | THREEDQUERY Enrolled: B Status: None AUTH Error code: 0 – Ok |
DINERS | 3000990000000006 | |
DISCOVER | 6011990000000006 | |
JCB | 3500990000000001 | |
MASTERCARD | 5200990000000009 | |
VISA | 4000990000000004 |
3-D Secure status testing
To test for different 3-D Secure status values, follow the instructions displayed in the authentication prompt shown on the page (an example is shown below). In the textbox provided, you can enter different PIN values to test for different cases.

For Payment Pages:
With 3-D Secure enabled on your site reference, process a payment using one of the card numbers listed above and your browser will display an authentication prompt with instructions.
For JavaScript Library implementations:
After your payment form has been updated to reference our JavaScript library, process a payment using one of the card numbers listed above and your browser will display an authentication prompt with instructions.
For Mobile SDK implementations:
After your Android or iOS app has been updated to utilise our Mobile SDK, process a payment using one of the card numbers listed above and your app will display an authentication prompt with instructions.
The authentication prompt will only be displayed for non-frictionless test card details.
Frictionless cards will bypass authentication. In this case, the payment will be processed immediately (without being prompted by the browser for information).
Follow the instructions displayed within the authentication prompt to complete the payment:

Testing AVS and security code checks
If you haven’t already, please read our AVS and Security code documentation before testing:
Link to Payment Pages docs / Link to API docs
The following tables list test details that can be submitted to obtain different responses from the AVS and Security Code Checks. These details can be used with most major payment types.

Premise
Billing premise | Security response | Security response caption |
No 789 | 2 | Matched |
No 123 | 4 | Not Matched |
No 333 | 1 | Not Checked |
Leave blank | 0 | Not Given |
Postcode / ZIP code
Billing postcode | Security response | Security response caption | |
UK | US | ||
TE45 6ST | 55555 | 2 | Matched |
TE12 3ST | 12345 | 4 | Not Matched |
TE33 3ST | 33333 | 1 | Not Checked |
Leave blank | Leave blank | 0 | Not Given |
Security code
Security code | AMEX security code | Security response | Security response |
123 | 1234 | 2 | Matched |
214 | 2144 | 4 | Not Matched |
333 | 3333 | 1 | Not Checked |
Leave blank | Leave blank | 0 | Not Given |
Testing non-card payment methods

Link to Payment Pages docs / Link to Webservices API docs
Testing recurring payments
Testing for the acquirer advice code
When processing recurring payments, some acquirers may return an acquirer advice code in the response. The acquirer advice code is a numeric value used to indicate if further recurring payments can be processed for the given card.
Code | Description | Action |
0 | N/A | No action required |
1 | New account information available (Mastercard only) | Query customer for updated payment details |
2 | Cannot approve at this time | Try again later. If you are continuing to have difficulties, please contact your acquiring bank |
4 | Do not try again | Do not process further recurring transactions |
8 | Payment blocked by card scheme |
Where to find the acquirer advice code
- This code is returned in your daily subscription email report.
- It’s viewable within MyST by selecting the additional field to be displayed on the transaction search page. It can also be viewed on the single transaction view.
- Additionally, for those who have processed a recurring AUTH transaction using the API, the code is returned in the acquireradvicecode field in the response.
How to test for different acquirer advice codes
You can test that your system responds appropriately to different acquirer advice codes by processing transactions with the following attributes:
Visa | ||
Acquirer advice code returned | Card number | Base amount |
0 | 4111111111111111 | 1050 |
2 | 4000000000000671 | 1002 |
4 | 4000000000000671 | 1004 |
8 | 4000000000000671 | 1008 |

Mastercard | ||
Acquirer advice code returned | Card number | Base amount |
0 | 5100000000000511 | 1050 |
1 | 5100000000000271 | 1001 |
2 | 5100000000000271 | 1002 |
4 | 5100000000000271 | 1004 |
8 | 5100000000000271 | 1008 |
Testing Protect Plus
Please refer to the following resources when testing Protect Plus:
- Testing Protect Plus using Payment Pages
- Testing Protect Plus using JavaScript Library
- Testing Protect Plus using iOS SDK
Testing DCC
Please refer to the following resources when testing DCC:
Payouts

If you are unsure, please contact our Support Team for assistance.
Payouts are similar to standard refunds, except they can be performed independently of other transactions. The benefits of performing payouts include:
- The refund amount can be greater than the original payment, if required.
- The refund can be processed before the original payment has been settled into your bank account.


Requirements
You will need to have a CFT Merchant Number associated with your Trust Payments account. If you are unsure if your merchant number supports this, we recommend contacting your bank for clarification. Additionally, please ensure you are following any guidelines outlined by your bank before proceeding.
Payout request
Using parent transaction
- Payouts are performed by processing a REFUND request.
- Like a standard REFUND request, the requesttypedescriptions needs to be “REFUND”.
- The accounttypedescription submitted needs to be “CFT”.
- In this example, the parenttransactionreference is included, which references the original AUTH. This will inherit the payment, billing and customer details from the parent, so your system does not need to submit them again.
The following is an example of such a request:

#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) payout= { "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "accounttypedescription": "CFT", "parenttransactionreference": "1-2-345678" } strequest = securetrading.Request() strequest.update(payout) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('REFUND'), 'sitereference' => 'test_site12345', 'accounttypedescription' => 'CFT', 'parenttransactionreference' => '1-2-345678' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "accounttypedescription": "CFT", "parenttransactionreference": "1-2-345678" }]}'
{"alias":"[email protected]","version":"1.00","request":[{"requesttypedescriptions":["REFUND"],"sitereference":"test_site12345","accounttypedescription":"CFT","parenttransactionreference":"1-2-345678"}]}
<requestblock version="3.67"> <alias>[email protected]</alias> <request type="REFUND"> <operation> <sitereference>test_site12345</sitereference> <accounttypedescription>CFT</accounttypedescription> <parenttransactionreference>1-2-345678</parenttransactionreference> </operation> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Without parent
As an alternative to the above, you can also submit a payout request without reference to a parent transaction. In this scenario, you will instead need to submit the customer’s payment details in the payout request. Please see the following example:
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) payout= { "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "accounttypedescription": "CFT", "baseamount": "1050", "currencyiso3a": "GBP", "pan": "4111111111111111", "expirydate": "12/2020", "securitycode": "123" } strequest = securetrading.Request() strequest.update(payout) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('REFUND'), 'sitereference' => 'test_site12345', 'accounttypedescription' => 'CFT', 'baseamount' => '1050', 'currencyiso3a' => 'GBP', 'pan' => '4111111111111111', 'expirydate' => '12/2020', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "accounttypedescription": "CFT", "baseamount": "1050", "currencyiso3a": "GBP", "pan": "4111111111111111", "expirydate": "12/2020", "securitycode": "123" }]}'
{"alias":"[email protected]","version":"1.00","request":[{"requesttypedescriptions":["REFUND"],"sitereference":"test_site12345","accounttypedescription":"CFT","baseamount":"1050","currencyiso3a":"GBP","pan":"4111111111111111","expirydate":"12\/2020","securitycode":"123"}]}
<requestblock version="3.67"> <alias>[email protected]</alias> <request type="REFUND"> <billing> <payment> <expirydate>12/2020</expirydate> <pan>4111111111111111</pan> <securitycode>123</securitycode> </payment> <amount currencycode="GBP">1050</amount> </billing> <operation> <sitereference>test_site12345</sitereference> <accounttypedescription>CFT</accounttypedescription> </operation> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Field specification

Field | Format | Description | |
![]() |
accounttypedescription XPath: /operation/accounttypedescription |
Alpha (20) | Must be “CFT”. |
![]() |
baseamount XPath: /billing/amount |
Numeric (13) | The refund amount in base units, with no commas or decimal points. e.g. £10.99 would be submitted as “1099” but ¥246 would be submitted as “246”.
(Max length of amount may vary depending on your acquiring bank – Contact your bank for further info) |
![]() |
currencyiso3a XPath: /billing/amount/@currencycode |
Alpha (3) | The currency that the transaction will be processed in. |
![]() |
expirydate XPath: /billing/payment/expirydate |
Date MM/YYYY | If you would like to process a refund with an updated expiry date, the new value is submitted in this field. |
![]() |
orderreference XPath: /merchant/orderreference |
Alphanumeric including symbols (255) |
Your unique order reference that can be stored on Trust Payments’s system.
If this is not submitted, it is inherited from the parent AUTH request, provided a parenttransactionreference has been included. |
![]() |
pan XPath: /billing/payment/pan |
Numeric (12-19) | This is the long number printed on the front of the customer’s card.
We return a masked version of this PAN in the response, in the field maskedpan. e.g. “411111######1111” |
![]() |
parenttransactionreference XPath: /operation/parenttransactionreference |
Alphanumeric & hyphens (25) |
You can submit the transaction reference of the AUTH request that you would like to refund. |
![]() |
requesttypedescriptions XPath: /@type |
Alphanumeric & hyphens (25) |
The request type required is “REFUND”. |
![]() |
securitycode XPath: /security/securitycode |
Numeric (3-4) | This is the three digit security code printed on the back of the card.
(For AMEX cards, this is a 4 digit code found on the front of the card) We strongly recommend submitting this value for the processing of security code checks. Additionally, some banks may decline the payment if the security code is not present. |
![]() |
sitereference XPath: /operation/sitereference |
Alphanumeric & underscore (50) |
A unique reference that identifies your account. You receive this when you first sign up with us. |
Payout response
The response returned has the same structure as a standard REFUND, except that the accounttypedescription returned is “CFT”:
{ u 'requestreference': u 'Agv3epv31', u 'version': u '1.00', u 'response': [{ u 'transactionstartedtimestamp': u '2016-12-07 15:44:33', u 'parenttransactionreference': u '1-2-345678', u 'livestatus': u '0', u 'issuer': u 'SecureTrading Test Issuer1', u 'dccenabled': u '0', u 'settleduedate': u '2016-12-07', u 'errorcode': u '0', u 'orderreference': u 'My_Order_123', u 'tid': u '27880001', u 'merchantnumber': u '00000000', u 'merchantcountryiso2a': u 'GB', u 'transactionreference': u '1-2-345679', u 'merchantname': u 'Test Merchant', u 'paymenttypedescription': u 'VISA', u 'baseamount': u '1050', u 'accounttypedescription': u 'CFT', u 'acquirerresponsecode': u '00', u 'requesttypedescription': u 'REFUND', u 'securityresponsesecuritycode': u '0', u 'currencyiso3a': u 'GBP', u 'authcode': u 'TEST REFUND ACCEPTED', u 'errormessage': u 'Ok', u 'operatorname': u '[email protected]', u 'securityresponsepostcode': u '0', u 'maskedpan': u '411111######1111', u 'securityresponseaddress': u '0', u 'issuercountryiso2a': u 'US', u 'settlestatus': u '0' }] }
array(3) { ["requestreference"] => string(9) "A19beknpr" ["version"] => string(4) "1.00" ["response"] => array(1) { [0] => array(28) { ["transactionstartedtimestamp"] => string(19) "2016-12-09 10:21:13" ["parenttransactionreference"] => string(10) "1-2-345678" ["livestatus"] => string(1) "0" ["issuer"] => string(26) "SecureTrading Test Issuer1" ["dccenabled"] => string(1) "0" ["settleduedate"] => string(10) "2016-12-09" ["errorcode"] => string(1) "0" ["orderreference"] => string(12) "My_Order_123" ["tid"] => string(8) "27880001" ["merchantnumber"] => string(8) "00000000" ["securityresponsepostcode"] => string(1) "0" ["transactionreference"] => string(10) "1-2-345679" ["merchantname"] => string(13) "Test Merchant" ["paymenttypedescription"] => string(4) "VISA" ["baseamount"] => string(4) "1050" ["accounttypedescription"] => string(3) "CFT" ["acquirerresponsecode"] => string(2) "00" ["requesttypedescription"] => string(6) "REFUND" ["securityresponsesecuritycode"] => string(1) "0" ["currencyiso3a"] => string(3) "GBP" ["authcode"] => string(20) "TEST REFUND ACCEPTED" ["errormessage"] => string(2) "Ok" ["operatorname"] => string(23) "[email protected]" ["merchantcountryiso2a"] => string(2) "GB" ["maskedpan"] => string(16) "411111######1111" ["securityresponseaddress"] => string(1) "0" ["issuercountryiso2a"] => string(2) "US" ["settlestatus"] => string(1) "0" } } }
{"requestreference":"W23-qc7t4h8a","version":"1.00","response":[{"transactionstartedtimestamp":"2016-12-07 15:50:37","parenttransactionreference":"1-2-345678","livestatus":"0","issuer":"SecureTrading Test Issuer1","dccenabled":"0","settleduedate":"2016-12-07","errorcode":"0","baseamount":"1050","tid":"27880001","merchantnumber":"00000000","merchantcountryiso2a":"GB","transactionreference":"1-2-345679","merchantname":"Test Merchant","paymenttypedescription":"VISA","orderreference":"My_Order_123","accounttypedescription":"CFT","acquirerresponsecode":"00","requesttypedescription":"REFUND","securityresponsesecuritycode":"0","currencyiso3a":"GBP","authcode":"TEST REFUND ACCEPTED","errormessage":"Ok","operatorname":"[email protected]","securityresponsepostcode":"0","maskedpan":"411111######1111","securityresponseaddress":"0","issuercountryiso2a":"US","settlestatus":"0"}],"secrand":"0V2j6j0kl2R1UU"}
<?xml version='1.0' encoding='utf-8'?> <responseblock version="3.67"> <requestreference>X1u3u92dg</requestreference> <response type="REFUND"> <merchant> <tid>27880001</tid> <merchantnumber>00000000</merchantnumber> <merchantcountryiso2a>GB</merchantcountryiso2a> <merchantname>Test Merchant</merchantname> <orderreference>My_Order_123</orderreference> <operatorname>[email protected]</operatorname> </merchant> <transactionreference>1-2-345679</transactionreference> <billing> <amount currencycode="GBP">1050</amount> <payment type="VISA"> <pan>411111######1111</pan> <issuercountry>US</issuercountry> <issuer>SecureTrading Test Issuer1</issuer> </payment> <dcc enabled="0"/> </billing> <timestamp>2019-12-17 11:16:05</timestamp> <error> <message>Ok</message> <code>0</code> </error> <acquirerresponsecode>00</acquirerresponsecode> <live>0</live> <authcode>TEST REFUND ACCEPTED</authcode> <operation> <parenttransactionreference>1-2-345678</parenttransactionreference> <accounttypedescription>CFT</accounttypedescription> </operation> <settlement> <settleduedate>2019-12-17</settleduedate> <settlestatus>0</settlestatus> </settlement> <security> <address>0</address> <postcode>0</postcode> <securitycode>0</securitycode> </security> </response> <secrand>V1utOQ5A</secrand> </responseblock>
Refunds

If you are unsure, please contact our Support Team for assistance.
After processing a payment, it is possible to pay the customer back by submitting a REFUND request. This page will walk you through the process.
Process overview
- Merchant submits REFUND request.
- Trust Payments validates the request and contacts the bank.
- Trust Payments processes the refund with the relevant acquirer.
- Trust Payments receives results of the request and passes this back to the merchant.
- Merchant receives and interprets this response.
Requirements
- You cannot refund a payment until Settlement has been performed. You can track the status of a transaction by looking at its settle status. A refund can only be processed if the settle status is “100”, which indicates the funds have been successfully transferred onto your bank account. Click here for further information on settlement.
- You cannot refund a greater amount than was originally settled.
- A refund request will only be successful if the payment details are still valid (e.g. the request will not be successful if the card has passed its expiry date).
REFUND request
Full refund
The following example REFUND request performs a full refund on the specified AUTH:
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) refund= { "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678" } strequest = securetrading.Request() strequest.update(refund) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('REFUND'), 'sitereference' => 'test_site12345', 'parenttransactionreference' => '1-2-345678' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678" }]}'
{"alias":"[email protected]","version":"1.00","request":[{"requesttypedescriptions":["REFUND"],"sitereference":"test_site12345","parenttransactionreference":"1-2-345678"}]}
<requestblock version="3.67"> <alias>[email protected]</alias> <request type="REFUND"> <operation> <sitereference>test_site12345</sitereference> <parenttransactionreference>1-2-345678</parenttransactionreference> </operation> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Full refund with updated expiry date
The following example REFUND request performs a full refund on the specified AUTH, using a new card expiry date. The new expiry date is submitted in the expirydate field.
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) refund= { "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678", "expirydate": "05/2025" } strequest = securetrading.Request() strequest.update(refund) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('REFUND'), 'sitereference' => 'test_site12345', 'parenttransactionreference' => '1-2-345678', 'expirydate' => '05/2025' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d ' { "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678", "expirydate": "05/2025" }]}'
{"alias":"[email protected]","version":"1.00","request":[{"requesttypedescriptions":["REFUND"],"sitereference":"test_site12345","parenttransactionreference":"1-2-345678","expirydate":"05\/2025"}]}
<requestblock version="3.67"> <alias>[email protected]</alias> <request type="REFUND"> <billing> <payment> <expirydate>05/2025</expirydate> </payment> </billing> <operation> <sitereference>test_site12345</sitereference> <parenttransactionreference>1-2-345678</parenttransactionreference> </operation> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Partial refund
The following example REFUND request performs a partial refund on the specified AUTH. You can specify the amount to be refunded in the baseamount field.
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) refund= { "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678", "baseamount": "2001" } strequest = securetrading.Request() strequest.update(refund) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('REFUND'), 'sitereference' => 'test_site12345', 'parenttransactionreference' => '1-2-345678', 'baseamount' => '2001' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{"alias": "[email protected]", "version": "2001", "request": [{ "requesttypedescriptions": ["REFUND"], "sitereference": "test_site12345", "parenttransactionreference": "1-2-345678", "baseamount": "200" }]}'
{"alias":"[email protected]","version":"2001","request":[{"requesttypedescriptions":["REFUND"],"sitereference":"test_site12345","parenttransactionreference":"1-2-345678","baseamount":"200"}]}
<requestblock version="3.67"> <alias>[email protected]</alias> <request type="REFUND"> <billing> <amount>200</amount> </billing> <operation> <sitereference>test_site12345</sitereference> <parenttransactionreference>1-2-345678</parenttransactionreference> </operation> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Field specification

Field | Format | Description | |
![]() |
baseamount XPath: /billing/amount |
Numeric (13) | The refund amount in base units, with no commas or decimal points. e.g. £10.99 would be submitted as “1099” but ¥246 would be submitted as “246”.
This amount cannot be greater than the final amount settled into your bank account. You can opt to perform a partial refund by submitting a lower amount here. If this field is not present, the full amount of the transaction will be refunded. (Max length of amount may vary depending on your acquiring bank – Contact your bank for further info) |
![]() |
chargedescription XPath: /merchant/chargedescription |
Alphanumeric including symbols (25) |
This is a description of the payment that appears on the customer’s bank statement.
Only supported by certain acquiring banks. Specification of this field will depend on your acquiring bank. For further information, please contact our Support Team. Valid characters:
|
![]() |
expirydate XPath: /billing/payment/expirydate |
Date MM/YYYY | If you would like to process a refund with an updated expiry date, the new value is submitted in this field. |
![]() |
orderreference XPath: /merchant/orderreference |
Alphanumeric including symbols (255) |
Your unique order reference that can be stored on the Trust Payments system.
If this is not submitted, it is inherited from the parent AUTH request. |
![]() |
parenttransactionreference XPath: /operation/parenttransactionreference |
Alphanumeric & hyphens (25) |
This field must contain the transaction reference of the AUTH request that you would like to refund. |
![]() |
requesttypedescriptions XPath: /@type |
Alpha (20) | The request type required is “REFUND”. |
![]() |
sitereference XPath: /operation/sitereference |
Alphanumeric & underscore (50) |
A unique reference that identifies your account. You receive this when you first sign up with us.
The site reference submitted in the REFUND request must be the same as the site reference used to process the parent AUTH request. |
REFUND response
{ u 'requestreference': u 'Ak70u1ujh', u 'version': u '1.00', u 'response': [{ u 'transactionstartedtimestamp': u '2016-12-07 15:14:00', u 'parenttransactionreference': u '1-2-345678', u 'livestatus': u '0', u 'issuer': u 'SecureTrading Test Issuer1', u 'dccenabled': u '0', u 'settleduedate': u '2016-12-07', u 'errorcode': u '0', u 'orderreference': u 'My_Order_123', u 'tid': u '27882788', u 'merchantnumber': u '00000000', u 'merchantcountryiso2a': u 'GB', u 'transactionreference': u '1-2-345679', u 'merchantname': u 'Test Merchant', u 'paymenttypedescription': u 'VISA', u 'baseamount': u '2001', u 'accounttypedescription': u 'ECOM', u 'acquirerresponsecode': u '00', u 'requesttypedescription': u 'REFUND', u 'securityresponsesecuritycode': u '0', u 'currencyiso3a': u 'GBP', u 'authcode': u 'TEST REFUND ACCEPTED', u 'errormessage': u 'Ok', u 'securityresponsepostcode': u '0', u 'maskedpan': u '411111######1111', u 'securityresponseaddress': u '0', u 'issuercountryiso2a': u 'US', u 'operatorname': u '[email protected]', u 'settlestatus': u '0' }] }
array(3) { ["requestreference"] => string(9) "Acdefhwxy" ["version"] => string(4) "1.00" ["response"] => array(1) { [0] => array(28) { ["transactionstartedtimestamp"] => string(19) "2016-12-09 10:06:13" ["parenttransactionreference"] => string(10) "1-2-345678" ["livestatus"] => string(1) "0" ["issuer"] => string(26) "SecureTrading Test Issuer1" ["dccenabled"] => string(1) "0" ["settleduedate"] => string(10) "2016-12-09" ["errorcode"] => string(1) "0" ["orderreference"] => string(12) "My_Order_123" ["tid"] => string(8) "27882788" ["merchantnumber"] => string(8) "00000000" ["securityresponsepostcode"] => string(1) "0" ["transactionreference"] => string(10) "1-2-345679" ["merchantname"] => string(13) "Test Merchant" ["paymenttypedescription"] => string(4) "VISA" ["baseamount"] => string(4) "2001" ["accounttypedescription"] => string(4) "ECOM" ["acquirerresponsecode"] => string(2) "00" ["requesttypedescription"] => string(6) "REFUND" ["securityresponsesecuritycode"] => string(1) "0" ["currencyiso3a"] => string(3) "GBP" ["authcode"] => string(20) "TEST REFUND ACCEPTED" ["errormessage"] => string(2) "Ok" ["merchantcountryiso2a"] => string(2) "GB" ["maskedpan"] => string(16) "411111######1111" ["securityresponseaddress"] => string(1) "0" ["issuercountryiso2a"] => string(2) "US" ["operatorname"] => string(23) "[email protected]" ["settlestatus"] => string(1) "0" } } }
{"requestreference":"W23-22rd4301","version":"1.00","response":[{"transactionstartedtimestamp":"2016-12-07 15:31:48","parenttransactionreference":"1-2-345678","livestatus":"0","issuer":"SecureTrading Test Issuer1","dccenabled":"0","settleduedate":"2016-12-07","errorcode":"0","baseamount":"2001","tid":"27882788","merchantnumber":"00000000","merchantcountryiso2a":"GB","transactionreference":"1-2-345679","merchantname":"Test Merchant","paymenttypedescription":"VISA","orderreference":"My_Order_123","accounttypedescription":"ECOM","acquirerresponsecode":"00","requesttypedescription":"REFUND","securityresponsesecuritycode":"0","currencyiso3a":"GBP","authcode":"TEST REFUND ACCEPTED","errormessage":"Ok","securityresponsepostcode":"0","maskedpan":"411111######1111","securityresponseaddress":"0","issuercountryiso2a":"US","operatorname":"[email protected]","settlestatus":"0"}],"secrand":"SNQVg"}
<responseblock version="3.67"> <requestreference>Xk3mvyk5v</requestreference> <response type="REFUND"> <merchant> <merchantname>Test Merchant</merchantname> <orderreference>My_Order_123</orderreference> <tid>27882788</tid> <merchantnumber>00000000</merchantnumber> <merchantcountryiso2a>GB</merchantcountryiso2a> <operatorname>[email protected]</operatorname> </merchant> <transactionreference>1-2-345679</transactionreference> <billing> <amount currencycode="GBP">2001</amount> <payment type="VISA"> <issuer>SecureTrading Test Issuer1</issuer> <issuercountry>US</issuercountry> <pan>411111######1111</pan> </payment> <dcc enabled="0"/> </billing> <authcode>TEST REFUND ACCEPTED</authcode> <live>0</live> <error> <message>Ok</message> <code>0</code> </error> <timestamp>2012-10-08 12:46:11</timestamp> <acquirerresponsecode>00</acquirerresponsecode> <security> <address>0</address> <postcode>0</postcode> <securitycode>0</securitycode> </security> <settlement> <settleduedate>2012-10-08</settleduedate> <settlestatus>0</settlestatus> </settlement> <operation> <parenttransactionreference>1-2-345678</parenttransactionreference> <accounttypedescription>ECOM</accounttypedescription> </operation> </response> <secrand>f</secrand> </responseblock>
The specification of the REFUND response is the same as the standard AUTH response, except the requesttypedescription field has value “REFUND”. You will need to check the fields returned are correct. In particular, ensure the errorcode is “0” (indicating the request was processed successfully) and that the settlestatus is NOT “2” or “3” (indicating funds will not settle).
Additional resources

Transaction queries

If you are unsure, please contact our Support Team for assistance.
If you would like to retrieve information on requests and transactions you have previously submitted, you can submit a TRANSACTIONQUERY request.
Process overview
Your system will need to submit a TRANSACTIONQUERY request to Trust Payments. Trust Payments will then return a response containing the requested information, if a matching request has been found.
For example, you can request information on all transactions processed on your Site Reference between 6pm and 9pm, or find out whether or not a transaction has been settled.
Filters
The TRANSACTIONQUERY request consists primarily of filters. Think of filters as search criteria; the response returned will contain information meeting the specified filters.
For example, a filter with orderreference “100100” would return details of all matching requests with that reference (if any exist and have been processed on your site reference).
And specifying a starttimestamp and endtimestamp will return details of all requests processed on your account between the specified times.

Multiple records can be returned in a single response
We recommend being as specific as reasonably possible in your request, by submitting as many filters as required, in order to avoid returning an excessive number of records in the response.
You can also submit multiple values for each given filter. e.g. You can submit a filter for transactionreference values “23-9-1” and “23-9-2”, and any requests matching these values will be returned in the response. (We include an example of this case below)
TRANSACTIONQUERY request
For the TRANSACTIONQUERY request to be processed successfully, you need to submit at least one valid filter.
Request example
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) query = { "requesttypedescriptions": ["TRANSACTIONQUERY"], "filter":{ "sitereference": [{"value":"test_site12345"}], "currencyiso3a": [{"value":"GBP"}], "transactionreference": [{"value":"23-9-1"},{"value":"23-9-2"}] } } strequest = securetrading.Request() strequest.update(query) stresponse = st.process(strequest) #stresponse contains the transaction response
<?php if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) { throw new Exception('Composer autoloader file could not be found.'); } require_once($autoload); $configData = array( 'username' => '[email protected]', 'password' => 'Password1^', ); $requestData = array( 'requesttypedescriptions' => array('TRANSACTIONQUERY'), 'filter' => array( 'sitereference' => array(array('value' => 'test_site12345')), 'currencyiso3a' => array(array('value' => 'GBP')), 'transactionreference' => array(array('value' => '23-9-1'),array('value' => '23-9-2')) ) ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["TRANSACTIONQUERY"], "filter":{ "sitereference": [{"value":"test_site12345"}], "currencyiso3a": [{"value":"GBP"}], "transactionreference": [{"value":"23-9-1"},{"value":"23-9-2"}] } }]}'
{"alias":"[email protected]","version":"1.00","request":[{"requesttypedescriptions":["TRANSACTIONQUERY"],"filter":{"sitereference":[{"value":"test_site12345"}],"currencyiso3a":[{"value":"GBP"}],"transactionreference":[{"value":"23-9-1"},{"value":"23-9-2"}]}}]}
<?xml version="1.0" encoding="utf-8"?> <requestblock version="3.67"> <alias>[email protected]</alias> <request type="TRANSACTIONQUERY"> <filter> <sitereference>test_site12345</sitereference> <currencyiso3a>GBP</currencyiso3a> <transactionreference>23-9-1</transactionreference> <transactionreference>23-9-2</transactionreference> </filter> </request> </requestblock>
Replace <DOMAIN> with a supported domain. Click here for a full list.
Field specification
The following table lists all fields that you can include in the filter when processing a TRANSACTIONQUERY request.
Note that although none of the following filter fields are required, at least one filter must be submitted for the request to be processed successfully. For this reason, all fields have been marked below as conditional.
Field | Format | Description | |
![]() |
accounttypedescription XPath: /filter/accounttypedescription |
Alpha (20) | The source of the transaction.
|
![]() |
billingemail XPath: /filter/billingemail |
Email (255) | The customer’s billing email address.
Maximum length of 255 (maximum of 64 characters before the ”@” symbol). |
![]() |
billingfirstname XPath: /filter/billingfirstname |
Alphanumeric including symbols (127) | The customer’s billing first name. |
![]() |
billinglastname XPath: /filter/billinglastname |
Alphanumeric including symbols (127) | The customer’s billing last name. |
![]() |
billingpostcode XPath: /filter/billingpostcode |
Alphanumeric including symbols (25) | The customer’s billing postcode. |
![]() |
billingpremise XPath: /filter/billingpremise |
Alphanumeric including symbols (20) | The number or name of the premise of the customer’s billing address. |
![]() |
billingstreet XPath: /filter/billingstreet |
Alphanumeric including symbols (20) | The street name of the customer’s billing address. |
![]() |
currencyiso3a XPath: /filter/currencyiso3a |
Alpha (3) | The transaction currency. |
![]() |
customerip XPath: /filter/customerip |
IP address (39) | The customer’s IP address. |
![]() |
endtimestamp XPath: /filter/endtimestamp |
Date Time YYYY-MM-DD HH:MM:SS | Only requests processed before the timestamp specified will be returned.
(Unlike with other filters, you can only submit one endtimestamp in a request) |
![]() |
orderreference XPath: /filter/orderreference |
Alphanumeric including symbols (255) | Unique reference number supplied by the merchant for the request. |
![]() |
pan XPath: /filter/pan |
Numeric (12-19) | This is the card number printed on the front of the customer’s card. |
![]() |
parenttransactionreference XPath: /filter/parenttransactionreference |
Alphanumeric including hyphens (25) | Unique reference of the parent request. |
![]() |
paymenttypedescription XPath: /filter/paymenttypedescription |
Alpha (20) | The customer’s card type (e.g. “VISA” or “MASTERCARD”). |
![]() |
requesttypedescription XPath: /filter/requesttypedescription |
Alpha (20) | The request type associated with transaction. For example, “AUTH” or “REFUND”. |
![]() |
sitereference XPath: /filter/sitereference |
Alpha (50) | The site reference that processed the transaction. |
![]() |
starttimestamp XPath: /filter/starttimestamp |
Date Time YYYY-MM-DD HH:MM:SS | Only requests processed after the timestamp specified will be returned.
(Unlike with other filters, you can only submit one starttimestamp in a request) |
![]() |
transactionreference XPath: /filter/transactionreference |
Alphanumeric including hyphens (25) | The unique reference associated with the transaction, assigned by Trust Payments. |
TRANSACTIONQUERY response
Once you have successfully submitted a TRANSACTIONQUERY request, you will be returned a response that is divided into separate records.
Each record will contain a varying number of response fields, which depend on the request type indicated in the record. For example, if the record has a requesttypedescription of “AUTH“, then you would need to refer to the field specification in the Authorisation document.
Additionally, the response contains a field called found, which indicates the number of records that match the filters specified in the request. If found has a value of “0”, no records have been found using your specified filters.
For example, here is a simplified example of the structure of the response, consisting of 2 records (both are type “AUTH”):
{ u 'requestreference': u 'W72-pg3q2he9', u 'version': u '1.00', u 'response': [{ u 'transactionstartedtimestamp': u '2019-12-17 09:36:21', u 'errormessage': u 'Ok', u 'errorcode': u '0', u 'records': [{ u 'transactionstartedtimestamp': u '2019-12-17 09:35:03', u 'sitereference': u 'test_site12345', u 'interface': u 'PASS-JSON-JSON', u 'livestatus': u '0', u 'issuer': u 'SecureTrading Test Issuer1', u 'dccenabled': u '0', u 'settleduedate': u '2019-12-17', u 'errorcode': u '0', u 'baseamount': u '1050', u 'tid': u '27882788', u 'securityresponsepostcode': u '0', u 'transactionreference': u '72-9-80005', u 'merchantname': u 'Test Merchant', u 'paymenttypedescription': u 'VISA', u 'accounttypedescription': u 'ECOM', u 'fraudrating': u '0', u 'splitfinalnumber': u '1', u 'acquirerresponsecode': u '00', u 'requesttypedescription': u 'AUTH', u 'expirydate': u '10/2022', u 'securityresponsesecuritycode': u '2', u 'currencyiso3a': u 'GBP', u 'authcode': u 'TEST22', u 'settlebaseamount': u '1050', u 'errormessage': u 'Ok', u 'issuercountryiso2a': u 'US', u 'merchantcountryiso2a': u 'GB', u 'maskedpan': u '411111######1111', u 'securityresponseaddress': u '0', u 'operatorname': u '[email protected]', u 'settlestatus': u '0' }, { u 'transactionstartedtimestamp': u '2019-12-17 09:35:10', u 'sitereference': u 'test_site12345', u 'interface': u 'PASS-JSON-JSON', u 'livestatus': u '0', u 'issuer': u 'SecureTrading Test Issuer1', u 'dccenabled': u '0', u 'settleduedate': u '2019-12-17', u 'errorcode': u '0', u 'baseamount': u '1050', u 'tid': u '27882788', u 'securityresponsepostcode': u '0', u 'transactionreference': u '72-9-80006', u 'merchantname': u 'Test Merchant', u 'paymenttypedescription': u 'VISA', u 'accounttypedescription': u 'ECOM', u 'fraudrating': u '0', u 'splitfinalnumber': u '1', u 'acquirerresponsecode': u '00', u 'requesttypedescription': u 'AUTH', u 'expirydate': u '10/2022', u 'securityresponsesecuritycode': u '2', u 'currencyiso3a': u 'GBP', u 'authcode': u 'TEST03', u 'settlebaseamount': u '1050', u 'errormessage': u 'Ok', u 'issuercountryiso2a': u 'US', u 'merchantcountryiso2a': u 'GB', u 'maskedpan': u '411111######1111', u 'securityresponseaddress': u '0', u 'operatorname': u '[email protected]', u 'settlestatus': u '0' }], u 'found': u '2', u 'requesttypedescription': u 'TRANSACTIONQUERY' }] }
array(3) { ["requestreference"] => string(9) "W72-pg3q2he9" ["version"] => string(4) "1.00" ["response"] => array(1) { [0] => array(6) { ["transactionstartedtimestamp"] => string(19) "2019-12-17 09:36:21" ["errormessage"] => string(2) "Ok" ["errorcode"] => string(1) "0" ["records"] => array(2) { [0] => array(31) { ["transactionstartedtimestamp"] => string(19) "2019-12-17 09:35:03" ["sitereference"] => string(14) "test_site12345" ["interface"] => string(14) "PASS-JSON-JSON" ["livestatus"] => string(1) "0" ["issuer"] => string(26) "SecureTrading Test Issuer1" ["dccenabled"] => string(1) "0" ["settleduedate"] => string(10) "2019-12-17" ["errorcode"] => string(1) "0" ["baseamount"] => string(4) "1050" ["tid"] => string(8) "27882788" ["securityresponsepostcode"] => string(1) "0" ["transactionreference"] => string(10) "72-9-80005" ["merchantname"] => string(13) "Test Merchant" ["paymenttypedescription"] => string(4) "VISA" ["accounttypedescription"] => string(4) "ECOM" ["fraudrating"] => string(1) "0" ["splitfinalnumber"] => string(1) "1" ["acquirerresponsecode"] => string(2) "00" ["requesttypedescription"] => string(4) "AUTH" ["expirydate"] => string(7) "10/2022" ["securityresponsesecuritycode"] => string(1) "2" ["currencyiso3a"] => string(3) "GBP" ["authcode"] => string(6) "TEST22" ["settlebaseamount"] => string(4) "1050" ["errormessage"] => string(2) "Ok" ["issuercountryiso2a"] => string(2) "US" ["merchantcountryiso2a"] => string(2) "GB" ["maskedpan"] => string(16) "411111######1111" ["securityresponseaddress"] => string(1) "0" ["operatorname"] => string(23) "[email protected]" ["settlestatus"] => string(1) "0" } [1] => array(31) { ["transactionstartedtimestamp"] => string(19) "2019-12-17 09:35:10" ["sitereference"] => string(14) "test_site12345" ["interface"] => string(14) "PASS-JSON-JSON" ["livestatus"] => string(1) "0" ["issuer"] => string(26) "SecureTrading Test Issuer1" ["dccenabled"] => string(1) "0" ["settleduedate"] => string(10) "2019-12-17" ["errorcode"] => string(1) "0" ["baseamount"] => string(4) "1050" ["tid"] => string(8) "27882788" ["securityresponsepostcode"] => string(1) "0" ["transactionreference"] => string(10) "72-9-80006" ["merchantname"] => string(13) "Test Merchant" ["paymenttypedescription"] => string(4) "VISA" ["accounttypedescription"] => string(4) "ECOM" ["fraudrating"] => string(1) "0" ["splitfinalnumber"] => string(1) "1" ["acquirerresponsecode"] => string(2) "00" ["requesttypedescription"] => string(4) "AUTH" ["expirydate"] => string(7) "10/2022" ["securityresponsesecuritycode"] => string(1) "2" ["currencyiso3a"] => string(3) "GBP" ["authcode"] => string(6) "TEST03" ["settlebaseamount"] => string(4) "1050" ["errormessage"] => string(2) "Ok" ["issuercountryiso2a"] => string(2) "US" ["merchantcountryiso2a"] => string(2) "GB" ["maskedpan"] => string(16) "411111######1111" ["securityresponseaddress"] => string(1) "0" ["operatorname"] => string(23) "[email protected]" ["settlestatus"] => string(1) "0" } } ["found"] => string(1) "2" ["requesttypedescription"] => string(16) "TRANSACTIONQUERY" } } }
{"requestreference":"W72-pg3q2he9","version":"1.00","response":[{"transactionstartedtimestamp":"2019-12-17 09:36:21","errormessage":"Ok","errorcode":"0","records":[{"transactionstartedtimestamp":"2019-12-17 09:35:03","sitereference":"test_site12345","interface":"PASS-JSON-JSON","livestatus":"0","issuer":"SecureTrading Test Issuer1","dccenabled":"0","settleduedate":"2019-12-17","errorcode":"0","baseamount":"1050","tid":"27882788","securityresponsepostcode":"0","transactionreference":"72-9-80005","merchantname":"Test Merchant","paymenttypedescription":"VISA","accounttypedescription":"ECOM","fraudrating":"0","splitfinalnumber":"1","acquirerresponsecode":"00","requesttypedescription":"AUTH","expirydate":"10\/2022","securityresponsesecuritycode":"2","currencyiso3a":"GBP","authcode":"TEST22","settlebaseamount":"1050","errormessage":"Ok","issuercountryiso2a":"US","merchantcountryiso2a":"GB","maskedpan":"411111######1111","securityresponseaddress":"0","operatorname":"[email protected]","settlestatus":"0"},{"transactionstartedtimestamp":"2019-12-17 09:35:10","sitereference":"test_site12345","interface":"PASS-JSON-JSON","livestatus":"0","issuer":"SecureTrading Test Issuer1","dccenabled":"0","settleduedate":"2019-12-17","errorcode":"0","baseamount":"1050","tid":"27882788","securityresponsepostcode":"0","transactionreference":"72-9-80006","merchantname":"Test Merchant","paymenttypedescription":"VISA","accounttypedescription":"ECOM","fraudrating":"0","splitfinalnumber":"1","acquirerresponsecode":"00","requesttypedescription":"AUTH","expirydate":"10\/2022","securityresponsesecuritycode":"2","currencyiso3a":"GBP","authcode":"TEST03","settlebaseamount":"1050","errormessage":"Ok","issuercountryiso2a":"US","merchantcountryiso2a":"GB","maskedpan":"411111######1111","securityresponseaddress":"0","operatorname":"[email protected]","settlestatus":"0"}],"found":"2","requesttypedescription":"TRANSACTIONQUERY"}],"secrand":"uISZfw8wKWR"}
<?xml version='1.0' encoding='utf-8'?> <responseblock version="3.67"> <requestreference>Xv18xwv52</requestreference> <response type="TRANSACTIONQUERY"> <record type="AUTH"> <acquirerresponsecode>00</acquirerresponsecode> <operation> <splitfinalnumber>1</splitfinalnumber> <sitereference>test_site12345</sitereference> <interface>CERT-XML-XML</interface> <accounttypedescription>ECOM</accounttypedescription> </operation> <settlement> <settleduedate>2019-12-17</settleduedate> <settlebaseamount>1050</settlebaseamount> <settlestatus>0</settlestatus> </settlement> <billing> <dcc enabled="0"/> <amount currencycode="GBP">1050</amount> <payment type="VISA"> <issuer>SecureTrading Test Issuer1</issuer> <expirydate>10/2022</expirydate> <pan>411111######1111</pan> <issuercountry>US</issuercountry> </payment> </billing> <live>0</live> <merchant> <tid>27882788</tid> <merchantcountryiso2a>GB</merchantcountryiso2a> <merchantname>Test Merchant</merchantname> <operatorname>[email protected]</operatorname> </merchant> <transactionreference>72-9-80003</transactionreference> <timestamp>2019-12-17 09:17:58</timestamp> <error> <message>Ok</message> <code>0</code> </error> <fraud> <rating>0</rating> </fraud> <authcode>TEST35</authcode> <security> <postcode>0</postcode> <securitycode>2</securitycode> <address>0</address> </security> </record> <record type="AUTH"> <acquirerresponsecode>00</acquirerresponsecode> <operation> <splitfinalnumber>1</splitfinalnumber> <sitereference>test_site12345</sitereference> <interface>CERT-XML-XML</interface> <accounttypedescription>ECOM</accounttypedescription> </operation> <settlement> <settleduedate>2019-12-17</settleduedate> <settlebaseamount>1050</settlebaseamount> <settlestatus>0</settlestatus> </settlement> <billing> <dcc enabled="0"/> <amount currencycode="GBP">1050</amount> <payment type="VISA"> <issuer>SecureTrading Test Issuer1</issuer> <expirydate>10/2022</expirydate> <pan>411111######1111</pan> <issuercountry>US</issuercountry> </payment> </billing> <live>0</live> <merchant> <tid>27882788</tid> <merchantcountryiso2a>GB</merchantcountryiso2a> <merchantname>Test Merchant</merchantname> <operatorname>[email protected]</operatorname> </merchant> <transactionreference>72-9-80004</transactionreference> <timestamp>2019-12-17 09:18:00</timestamp> <error> <message>Ok</message> <code>0</code> </error> <fraud> <rating>0</rating> </fraud> <authcode>TEST06</authcode> <security> <postcode>0</postcode> <securitycode>2</securitycode> <address>0</address> </security> </record> <found>2</found> <error> <message>Ok</message> <code>0</code> </error> <timestamp>2019-12-17 09:19:00</timestamp> </response> <secrand>IDBpVj</secrand> </responseblock>

A maximum of 500 records can be returned per response.
The found field will never return a value higher than 500, even if more than 500 requests meet the specified criteria.
Understanding errors
Please ensure you understand the Error Codes returned in the response:
- At the highest level of the response, along with transactionstartedtimestamp and found, there is an errorcode. This indicates whether or not the TRANSACTIONQUERY request was successful. If the error code here is not “0”, the TRANSACTIONQUERY request was not successful. You must address the problem and try again.
- In addition to this, each record will contain their own errorcode. This indicates whether or not the request represented in the record was successful.
- For a full list of error codes used by Trust Payments please click here.