
Example HTTP Requests
Quick Find
Go straight to the section you need.
1.0 Gateway Integration →
2.0 New Transactions →
3.0 Management Requests →
4.0 AVS/CV2 Checking →
5.0 3-D Secure Authentication →
11 Receipts and Notifications →
17 Advanced Data →
17.7 Device Information Fields
19 Gateway Wallet →
26 Digital Wallet Transactions →
Appendix
A-1 Response Codes
A-1.1 Authorisation Response Codes
A-2 AVS / CV2 Check Response Codes
A-3 Secure Authentication Data
A-4 3-D Secure Enrolment/Authentication Only
A-9 Duplicate Transaction Checking
A-10 Capture Delay
A-13 Sample Signature Calculation
A-14 Transaction Life cycle
A-14.1 Authorise, Capture and Settlement
A-15.2 Mail Order/Telephone Order (MOTO)
A-15.3 Continuous Authority (CA)
A-16 Payment Tokenisation
A-16.1 PREAUTH, SALE, REFUND, VERIFY requests
A-16.3 CANCEL or CAPTURE requests
A-16.5 SALE or REFUND Referred Authorisation requests
A-18 PSD2 SCA Compliance
A-18.1 Obtaining Strong Customer Authentication
A-18.3 Exemptions to Strong Customer Authentication
A-19 Hosted Payment Page Options
A-20 Integration Libraries
A-20.1 Gateway Integration Library
A-20.2 Hosted Payment Page Library
A-20.3 Hosted Payment Fields Library
A-21 Example HTTP Requests
A-22 Example Integration Code
A-23 Example Library Code
A-23.1 Gateway Integration Library
A-21 Example HTTP Requests
A-21.1 Hosted Integration
A-21.1.1 Transaction Request HTTP Headers
The following HTTP headers are sent for transaction request:
HTTP Header
Mandatory
Description
A-21.1.2 Transaction Response HTTP Headers
The following HTTP headers are received for a transaction response:
HTTP Header
Description
200 – Transaction request processed
500 – Internal Server Error
503 – Service Temporarily Unavailable
HTTP Header
Description
A-21.1.3 Submission Example
The following shows an example of a transaction request:
- HTTP/1.1 200 OK
- POST /hosted/ HTTP/1.1
- Host: gateway.swipen.com
- Accept: */*
- Content-Length: 314
- Content-Type: application/x-www-form-urlencoded
- merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de651c7c5379&orderRef=Test+Transaction&redirectURL=https%3A%2F%2Fmyshop.com&signature=ba12b0766a3412782448f154be15e8f61eea390387b1b23d4688c82c9f28f81df593de5890426546cca365943cc7b5c4897c9721b663a0e17680e1e796f1ad55
The following shows an example of a transaction response:
- HTTP/1.1 200 OK
- Date: Tue, 01 Jan 2019 09:30:45 GMT
- Server: Apache/2.4.23 (Win64) OpenSSL/1.0.2k-fips PHP/5.4.12
- Vary: Host
- X-Powered-By: PHP/5.4.12
- Expires: Thu, 19 Nov 1981 08:52:00 GMT
- Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
- Pragma: no-cache
- Content-Length: 4129
- Content-Type: text/html
- <!DOCTYPE html>
- <html>
- — Hosted Payment Page HTML Removed —
15. </html>
A-21.2 Direct Integration
The following HTTP headers are sent for transaction request:
HTTP Header
Mandatory
Description
A-21.1.2 Transaction Response HTTP Headers
The following HTTP headers are received for a transaction response:
HTTP Header
Description
200 – Hosted Payment Form returned
500 – Internal Server Error
503 – Service Temporarily Unavailable
HTTP Header
Description
A-21.2.3 Submission Example
The following shows an example of a transaction request:
- POST /direct/ HTTP/1.1
- Host: gateway.swipen.com
- Accept: */*
- Content-Length: 397
- Content-Type: application/x-www-form-urlencoded
7.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de65b552499e&orderRef=Test+Transaction&cardNumber=4929+4212+3460+0821&cardCVV=356&cardExpiryDate=1219&threeDSRequired=N&avscv2CheckRequired=N&duplicateDelay=0&signature=06b01e06c8fc761943d676d5f3aa2e9264758fed72e7bcb058a2a35cf23e8e45403099537bb0363054d6bc8ea951ce1ad86e582dbf0b435855b9c97507fcf844
The following shows an example of a transaction response:
- HTTP/1.1 200 OK
- Date: Tue, 01 Jan 2019 09:30:45 GMT
- Server: Apache/2.4.23 (Win64) OpenSSL/1.0.2k-fips PHP/5.4.12
- Vary: Host
- X-Powered-By: PHP/5.4.12
- Content-Length: 2449
- Content-Type: text/html
9.merchantID=100001&threeDSEnabled=Y&avscv2CheckEnabled=Y&riskCheckEnabled=N&caEnabled=Y&rtsEnabled=Y&cftEnabled=Y&threeDSCheckPref=not+known%2Cnot+checked%2Cauthenticated%2Cattempted+authentication&cv2CheckPref=matched&addressCheckPref=not+known%2Cnot+checked%2Cmatched%2Cpartially+matched&postcodeCheckPref=not+known%2Cnot+checked%2Cmatched%2Cpartially+matched&cardCVVMandatory=Y&riskCheckPref=not+known%3Dfinished%2Cnot+checked%3Ddecline2%2Capprove%3Dcontinue%2Cdecline%3Ddecline1%2Creview%3Ddecline2%2Cescalate%3Dfinished¬ifyEmail=an.operator%40merchant.com&customerReceiptsRequired=Y&merchantCategoryCode=6013&surchargeEnabled=Y&surchargeRequired=N&surchargeRules%5B0%5D%5BcardType%5D=CC&surchargeRules%5B0%5D%5Bsurcharge%5D=10.1235&surchargeRules%5B1%5D%5BcardType%5D=CC&surchargeRules%5B1%5D%5Bcurrency%5D=GBP&surchargeRules%5B1%5D%5Bsurcharge%5D=2.5000&surchargeRules%5B2%5D%5BcardType%5D=VC&surchargeRules%5B2%5D%5Bsurcharge%5D=3.5000&surchargeRules%5B3%5D%5BcardType%5D=VC&surchargeRules%5B3%5D%5Bcurrency%5D=GBP&surchargeRules%5B3%5D%5Bsurcharge%5D=4.5000&surchargeRules%5B4%5D%5BcardType%5D=DD&surchargeRules%5B4%5D%5Bsurcharge%5D=5.5000&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de65b552499e&orderRef=Test+Transaction&cardExpiryDate=1219&threeDSRequired=N&avscv2CheckRequired=N&duplicateDelay=0&requestID=5de65b562496f&responseCode=0&responseMessage=AUTHCODE%3A347414&state=captured&requestMerchantID=100001&processMerchantID=100001&paymentMethod=card&cardType=Visa+Credit&cardTypeCode=VC&cardScheme=Visa+&cardSchemeCode=VC&cardIssuer=BARCLAYS+BANK+PLC&cardIssuerCountry=United+Kingdom&cardIssuerCountryCode=GBR&cardFlags=8323072&cardNumberMask=492942%2A%2A%2A%2A%2A%2A0821&cardNumberValid=Y&xref=19120312NG55CM51QH35JRL&cardExpiryMonth=12&cardExpiryYear=19&authorisationCode=347414&transactionID=10018201&responseStatus=0×tamp=2019-12-03+12%3A55%3A52&amountApproved=680&amountReceived=680&amountRetained=680&avscv2ResponseCode=244100&avscv2ResponseMessage=SECURITY+CODE+MATCH+ONLY&avscv2AuthEntity=merchant+host&cv2Check=matched&addressCheck=not+matched&postcodeCheck=not+matched¬ifyEmailResponseCode=0¬ifyEmailResponseMessage=Email+successfully+queued&vcsResponseCode=0&vcsResponseMessage=Success+-+no+velocity+check+rules+applied¤cyExponent=2&signature=e5c65e5d0340e0ec0de8782affcb6caba2e4d202a6873a1677ddbf6415cb1dd52cc597e43c758b233afd121367d300a57d0faade7abf6b4b88a1a1b974e55d33
A-21.3 Batch Integration
A-21.3.1 Submission Request HTTP Headers
The following HTTP headers are sent for batch submission request:
HTTP Header
Mandatory?
Description
HTTP Header
Mandatory?
Description
HTTP Header
Mandatory?
Description
The following HTTP headers are sent on each individual part request:
HTTP Header
Description
HTTP Header
Description
HTTP Header
Description
A-21.3.2 Submission Response HTTP Headers
The following HTTP headers are received for batch submission response:
HTTP header
Description
200 – Batch submission status response ok
201 – Batch submission received and stored
400 – Batch submission invalid
401 – Unauthorised (none or incorrect credentials)
405 – HTTP method was not POST/PUT or GET
500 – Internal Gateway error
HTTP header
Description
HTTP header
Description
HTTP header
Description
The following HTTP headers are received on each individual part response:
HTTP header
Description
HTTP header
Description
HTTP header
Description
HTTP header
Description
skipped – insufficient permissions to view transaction
pending – queued for processing
success – (Response Message)
failure – (Response Message)
A-21.3.3 Status Request HTTP Headers
The following HTTP headers are used during a batch status request:
HTTP Header
Mandatory
Description
A-21.3.4 Status Response HTTP Headers
The batch status response is identical to the submission status response as documented in section A-21.3.2.
A-21.3.5 Submission Example
The following shows an example of a batch submission request:
- PUT /batch/?validate=0 HTTP/1.1
- Authorization: Basic bmljay50dXJuZXI6dGVzdGluZzI=
- Host: gateway.swipen.com
- Accept: */*
- Content-type: multipart/mixed; charset=UTF-8; boundary=5de63a42507a9
- Content-length: 1404
- –5de63a42507a9
- Content-Id: TX5de63a42507ac
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
12.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de63a42507ac&orderRef=Test+Transaction&cardNumber=4929+4212+3460+0821&cardExpiryDate=1219&duplicateDelay=0&signature=3cd686fdd40449ef33534baa62732c95fc127ff591fae3b5b611ccb38573ad921d199396e27cffd14faa4f46df8dde310252920fd1b33607b029b9b6ff669e2b
- –5de63a42507a9
- Content-Id: TX5de63a42af062
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
18.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=681&transactionUnique=5de63a42af062&orderRef=Test+Transaction&cardNumber=4929+4212+3460+0821&cardExpiryDate=1219&duplicateDelay=0&signature=55f411d40954be7f7089e84fe489438f09fc1b37c0964e46b0fab8bdcb44e13ed3ea11b9deb9da89a6d7b45133709a126bd3581f6329bf888b83231184597231
- –5de63a42507a9
- Content-Id: TX5de63a42ca9cd
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
24.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=682&transactionUnique=5de63a42ca9cd&orderRef=Test+Transaction&cardNumber=4929+4212+3460+0821&cardExpiryDate=1219&duplicateDelay=0&signature=c296266cb9bc8082957c700da9651d98add176dd8bd62eb3b7098566c7d8e23a3426b776de815e99149c6681978b1addedac762339563732d8a449b6cca3a3c2
- –5de63a42507a9–
The following shows an example of a batch submission response:
- HTTP/1.1 201 Created
- Date: Tue, 01 Jan 2019 09:30:45 GMT
- Server: Apache/2.4.23 (Win64) OpenSSL/1.0.2k-fips PHP/5.4.12
- X-Powered-By: PHP/5.4.12
- x-p3-token: YTo1OntzOjc6InZlcnNpb24iO3M6ODoiUDNUSy8yLjAiO3M6NzoicHVycG9zZSI7czo0OiJhdXRoIjtzOjc6ImNyZWF0b3IiO3M6NToiQkFUQ0giO3M6NzoiY3JlYXRlZCI7aToxNTc1MzY5Mjg1O3M6NzoiZXhwaXJlcyI7aToxNTc1MzcyODg1O30.czozOiI2MjkiOw.zdfxxXYtC2Wc4yyk-lEos-wZ99pEJtPGYpXR4KCiWW_56nmOysarOaMucrWPIt-NzwFzgq3-7u4Ud6uYkQcWBQ
- Location: /batch/2D6D-AC2C-BF55-2A8C
- Content-disposition: attachment; filename=”batch-2D6D-AC2C-BF55-2A8C”
- Content-Length: 1857
- Content-Type: multipart/mixed; charset=UTF-8; boundary=5de63a5c1a071
- Transaction ‘TX5de63a42507ac’ – pending – queued for processing
- Transaction ‘TX5de63a42af062’ – pending – queued for processing
- Transaction ‘TX5de63a42ca9cd’ – pending – queued for processing
- –5de63a5c1a071
- Content-Id: TX5de63a42507ac
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
- X-Transaction-ID:
- X-Transaction-Response: pending – queued for processing
21.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de63a42507ac&orderRef=Test+Transaction&cardNumber=492942%2A%2A%2A%2A%2A%2A0821&cardExpiryDate=1219&duplicateDelay=0&signature=0384bbf6ca0fc153e1e27a0cfc51f3b1cd1c2cff7a49aa4e9439bba38262183e9ac7d156f218eba1ef8d04f9e6a7fa6fbc9c2b3ab990c70e06dc7c6923e5b27b
- –5de63a5c1a071
- Content-Id: TX5de63a42af062
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
- X-Transaction-ID:
- X-Transaction-Response: pending – queued for processing
29.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=681&transactionUnique=5de63a42af062&orderRef=Test+Transaction&cardNumber=492942%2A%2A%2A%2A%2A%2A0821&cardExpiryDate=1219&duplicateDelay=0&signature=1e13e23c2b90a30f4403d604ac20302b5504b886b0b5c9ace0764fc8d966d120f5a1beca975805292780c22953b4e6ca71f67f499804f19d2718518463a598c4
- –5de63a5c1a071
- Content-Id: TX5de63a42ca9cd
- Content-Type: application/x-www-form-urlencoded; charset=UTF-8
- X-Transaction-ID:
- X-Transaction-Response: pending – queued for processing
37.merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=682&transactionUnique=5de63a42ca9cd&orderRef=Test+Transaction&cardNumber=492942%2A%2A%2A%2A%2A%2A0821&cardExpiryDate=1219&duplicateDelay=0&signature=c456aa211f8e3e568a40051bfd38406be02566fcd72d3bb1547f4d43e75db1d069eaa4158aa035337cac084633df945a13471db6b1a3fcd6c0749626d9bc0044
- –5de63a5c1a071–