Request types (Webservices API)

A valid requesttypedescription must be included in every request submitted to Secure Trading using the Webservices API. We use the value of this field to determine the type of request required in order to process the request. Please refer to the table below for a summary of the request types that we support.

The following content assumes you have obtained the necessary PCI certification to process and submit sensitive cardholder data in the request to our Webservices API.
If you are unsure, please contact our Support Team for assistance.
Overview
Request type | Supported account types | Description |
ACCOUNTCHECK |
|
Performs basic checks on the card and billing address details submitted. Learn more |
AUTH |
|
Performs a payment, which debits funds from the customer’s account. Learn more |
(Combined) AUTH SUBSCRIPTION |
For the AUTH:
For the SUBSCRIPTION:
|
Performs a payment, which debits funds from the customer’s account, then schedules an automated subscription in our subscription engine. Learn more |
CURRENCYRATE |
|
For retrieving the currency associated with the customer’s card, and calculating the amount in this currency. Learn more |
ORDER |
|
Initiate a new payment with PayPal. Learn more |
ORDERDETAILS |
|
Retrieve the order details from PayPal, after the customer has signed in to their account and agreed to the payment on PayPal’s servers. Learn more |
REFUND Standard / Payout |
|
For transferring funds back to the customer. Learn more |
RISKDEC |
|
For processing requests to our Protect Plus system, for purposes of highlighting payments with suspicious characteristics. Learn more |
STORE |
|
For storing card details in our records for future purchases. Learn more |
THREEDQUERY |
|
For querying a card’s 3-D secure enrolment status. Learn more |
ACCOUNTCHECK

Perform checks on the cardholder’s first line of address, the cardholder’s postcode and the security code, without reserving funds on the customer’s account.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) accountcheck= { "currencyiso3a": "GBP", "requesttypedescriptions": ["ACCOUNTCHECK"], "sitereference": "test_site12345", "baseamount": "0", "orderreference": "My_Order_123", "accounttypedescription": "ECOM", "billingpremise": "789", "billingpostcode": "TE45 6ST", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(accountcheck) 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( 'currencyiso3a' => 'GBP', 'requesttypedescriptions' => array('ACCOUNTCHECK'), 'sitereference' => 'test_site12345', 'baseamount' => '0', 'orderreference' => 'My_Order_123', 'accounttypedescription' => 'ECOM', 'billingpremise' => '789', 'billingpostcode' => 'TE45 6ST', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "currencyiso3a": "GBP", "requesttypedescriptions": ["ACCOUNTCHECK"], "sitereference": "test_site12345", "baseamount": "0", "orderreference": "My_Order_123", "accounttypedescription": "ECOM", "billingpremise": "789", "billingpostcode": "TE45 6ST", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
AUTH

Performs a payment, which debits funds from the customer’s account.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) auth = { "sitereference": "test_site12345", "requesttypedescriptions": ["AUTH"], "accounttypedescription": "ECOM", "currencyiso3a": "GBP", "baseamount": "1050", "orderreference": "My_Order_123", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(auth) 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( 'sitereference' => 'test_site12345', 'requesttypedescriptions' => array('AUTH'), 'accounttypedescription' => 'ECOM', 'currencyiso3a' => 'GBP', 'baseamount' => '1050', 'orderreference' => 'My_Order_123', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias":"[email protected]", "version": "1.00", "request": [{ "currencyiso3a": "GBP", "requesttypedescriptions": ["AUTH"], "sitereference": "test_site12345", "baseamount": "1050", "orderreference": "My_Order_123", "accounttypedescription": "ECOM", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
AUTH SUBSCRIPTION (Combined)

Performs a payment, which debits funds from the customer’s account, then schedules an automated subscription in our subscription engine.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) authsub = { "sitereference": "test_site12345", "requesttypedescriptions": ["AUTH","SUBSCRIPTION"], "accounttypedescription": "ECOM", "currencyiso3a": "GBP", "baseamount": "1050", "orderreference": "My_Order_123", "subscriptiontype": "RECURRING", "subscriptionunit": "MONTH", "subscriptionfrequency": "1", "subscriptionnumber": "1", "subscriptionfinalnumber": "12", "subscriptionbegindate": "2018-01-01", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(authsub) 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( 'sitereference' => 'test_site12345', 'requesttypedescriptions' => array('AUTH','SUBSCRIPTION'), 'accounttypedescription' => 'ECOM', 'currencyiso3a' => 'GBP', 'baseamount' => '1050', 'orderreference' => 'My_Order_123', 'subscriptiontype' => 'RECURRING', 'subscriptionunit' => 'MONTH', 'subscriptionfrequency' => '1', 'subscriptionnumber' => '1', 'subscriptionfinalnumber' => '12', 'subscriptionbegindate' => '2018-01-01', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias":"[email protected]", "version": "1.00", "request": [{ "currencyiso3a": "GBP", "requesttypedescriptions": ["AUTH","SUBSCRIPTION"], "sitereference": "test_site12345", "baseamount": "1050", "orderreference": "My_Order_123", "accounttypedescription": "ECOM", "subscriptiontype": "RECURRING", "subscriptionunit": "MONTH", "subscriptionfrequency": "1", "subscriptionnumber": "1", "subscriptionfinalnumber": "12", "subscriptionbegindate": "2018-01-01", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
CURRENCYRATE

For retrieving the currency associated with the customer’s card, and calculating the amount in this currency.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) currencyrate = { "sitereference": "test_site12345", "requesttypedescriptions": ["CURRENCYRATE"], "accounttypedescription": "CURRENCYRATE", "dcctype": "DCC", "dccbaseamount": "1050", "dcccurrencyiso3a": "GBP", "orderreference": "My_Order_123", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(currencyrate) 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( 'sitereference' => 'test_site12345', 'requesttypedescriptions' => array('CURRENCYRATE'), 'accounttypedescription' => 'CURRENCYRATE', 'dcctype' => 'DCC', 'dccbaseamount' => '1050', 'dcccurrencyiso3a' => 'GBP', 'orderreference' => 'My_Order_123', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias":"[email protected]", "version": "1.00", "request": [{ "sitereference": "test_site12345", "requesttypedescriptions": ["CURRENCYRATE"], "accounttypedescription": "CURRENCYRATE", "dcctype": "DCC", "dccbaseamount": "1050", "dcccurrencyiso3a": "GBP", "orderreference": "My_Order_123", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
ORDER

Initiate a new payment with PayPal.
Learn more about PayPal
Learn more about PayPal
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) order = { "currencyiso3a": "GBP", "requesttypedescriptions": ["ORDER"], "accounttypedescription": "ECOM", "sitereference": "test_site12345", "baseamount": "2001", "paymenttypedescription": "PAYPAL", "returnurl": "https://yourwebsite.com", "cancelurl": "https://yourwebsite.com", "paypallocale": "GB", "paypaladdressoverride": "1", "paypalemail": "[email protected]" } strequest = securetrading.Request() strequest.update(order) 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( 'currencyiso3a' => 'GBP', 'requesttypedescriptions' => array('ORDER'), 'accounttypedescription' => 'ECOM', 'sitereference' => 'test_site12345', 'baseamount' => '2001', 'paymenttypedescription' => 'PAYPAL', 'returnurl' => 'https://yourwebsite.com', 'cancelurl' => 'https://yourwebsite.com', 'paypallocale' => 'GB', 'paypaladdressoverride' => '1', 'paypalemail' => '[email protected]' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "currencyiso3a": "GBP", "requesttypedescriptions": ["ORDER"], "accounttypedescription": "ECOM", "sitereference": "test_site12345", "baseamount": "2001", "paymenttypedescription": "PAYPAL", "returnurl": "https://yourwebsite.com", "cancelurl": "https://yourwebsite.com", "paypallocale": "GB", "paypaladdressoverride": "1", "paypalemail": "[email protected]" }]}'
ORDERDETAILS

Retrieve the order details from PayPal, after the customer has signed in to their account and agreed to the payment on PayPal’s servers.
Learn more about PayPal
Learn more about PayPal
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) orderdetails = { "requesttypedescriptions": ["ORDERDETAILS"], "sitereference": "test_site12345", "parenttransactionreference": "72-32-20002" } strequest = securetrading.Request() strequest.update(orderdetails) 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('ORDERDETAILS'), 'sitereference' => 'test_site12345', 'parenttransactionreference' => '72-32-20002' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "requesttypedescriptions": ["ORDERDETAILS"], "sitereference": "test_site12345", "parenttransactionreference": "72-32-20002" }] }'
REFUND

For transferring funds back to the customer.
Learn more about standard refunds / Learn more about payouts
Learn more about standard refunds / Learn more about payouts
#!/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^ https://webservices.securetrading.net/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" }]}'
RISKDEC

To process requests to Protect Plus, our sophisticated counter-fraud service. It makes use of the industry’s largest negative database to perform a comprehensive suite of fraud assessments, including identity checks against the UK electoral roll and BT databases.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) auth= { "sitereference": "test_site12345", "requesttypedescriptions": ["RISKDEC","AUTH"], "accounttypedescription": "ECOM", "currencyiso3a": "GBP", "baseamount": "1011", "orderreference": "My_Order_123", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(auth) 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( 'sitereference' => 'test_site12345', 'requesttypedescriptions' => array('RISKDEC','AUTH'), 'accounttypedescription' => 'ECOM', 'currencyiso3a' => 'GBP', 'baseamount' => '1011', 'orderreference' => 'My_Order_123', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "currencyiso3a": "GBP", "requesttypedescriptions": ["RISKDEC","AUTH"], "sitereference": "test_site12345", "baseamount": "1011", "orderreference": "My_Order_123", "accounttypedescription": "ECOM", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
STORE

To store a customer’s card details on our system for use in future requests, without the need to take an initial payment from their card, or needing to store the data on your own server.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) store = { "sitereference": "test_site12345", "requesttypedescriptions": ["STORE"], "accounttypedescription": "ECOM", "orderreference": "EXAMPLE CARDSTORE", "accounttypedescription": "CARDSTORE", "billingprefix": "Mr", "billingfirstname": "Joe", "billinglastname": "Bloggs", "billingpremise": "789", "billingstreet": "Test Street", "billingtown": "Bangor", "billingcounty": "Gwynedd", "billingcountryiso2a": "GB", "billingemail": "[email protected]", "billingtelephone": "01234567890", "billingtelephonetype": "H", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(auth) 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( 'sitereference' => 'test_site12345', 'requesttypedescriptions' => array('STORE'), 'accounttypedescription' => 'ECOM', 'orderreference' => 'EXAMPLE CARDSTORE', 'accounttypedescription' => 'CARDSTORE', 'billingprefix' => 'Mr', 'billingfirstname' => 'Joe', 'billinglastname' => 'Bloggs', 'billingpremise' => '789', 'billingstreet' => 'Test Street', 'billingtown' => 'Bangor', 'billingcounty' => 'Gwynedd', 'billingcountryiso2a' => 'GB', 'billingemail' => '[email protected]', 'billingtelephone' => '01234567890', 'billingtelephonetype' => 'H', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "sitereference": "test_site12345", "requesttypedescriptions": ["STORE"], "accounttypedescription": "ECOM", "orderreference": "EXAMPLE CARDSTORE", "accounttypedescription": "CARDSTORE", "billingprefix": "Mr", "billingfirstname": "Joe", "billinglastname": "Bloggs", "billingpremise": "789", "billingstreet": "Test Street", "billingtown": "Bangor", "billingcounty": "Gwynedd", "billingcountryiso2a": "GB", "billingemail": "[email protected]", "billingtelephone": "01234567890", "billingtelephonetype": "H", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'
THREEDQUERY

For querying a card’s 3-D secure enrolment status.
Learn more
Learn more
#!/usr/bin/python import securetrading stconfig = securetrading.Config() stconfig.username = "[email protected]" stconfig.password = "Password1^" st = securetrading.Api(stconfig) threedquery= { "termurl":"https://termurl.com", "accept":"text/html,*/*", "paymenttypedescription":"VISA", "currencyiso3a":"GBP", "requesttypedescriptions": ["THREEDQUERY"], "accounttypedescription":"ECOM", "sitereference": "test_site12345", "baseamount": "1050", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" } strequest = securetrading.Request() strequest.update(threedquery) 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( 'termurl' => 'https://termurl.com', 'accept' => 'text/html,*/*', 'paymenttypedescription' => 'VISA', 'currencyiso3a' => 'GBP', 'requesttypedescriptions' => array('THREEDQUERY'), 'accounttypedescription' => 'ECOM', 'sitereference' => 'test_site12345', 'baseamount' => '1050', 'pan' => '4111111111111111', 'expirydate' => '12/2022', 'securitycode' => '123' ); $api = \Securetrading\api($configData); $response = $api->process($requestData); var_dump($response->toArray()); ?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{ "alias": "[email protected]", "version": "1.00", "request": [{ "termurl":"https://termurl.com", "accept":"text/html,*/*", "paymenttypedescription":"VISA", "currencyiso3a":"GBP", "requesttypedescriptions": ["THREEDQUERY"], "accounttypedescription":"ECOM", "sitereference": "test_site12345", "baseamount": "1050", "pan": "4111111111111111", "expirydate": "12/2022", "securitycode": "123" }]}'