Example HTTP Requests
Hosted Integration
Transaction Request HTTP Headers
The following HTTP headers are sent for transaction request:
content-type
Y
Content type of the request. This must be ‘application/x-www-form-urlencoded’, A charset parameter is optional and any non UTF-8 request will be converted to UTF-8.
Transaction Response HTTP Headers
The following HTTP headers are received for a transaction response:
Status
HTTP status header. Possible value are:
200 – Transaction request processed
500 – Internal Server Error
503 – Service Temporarily Unavailable
content-type
Content type of the response. This will be ‘application/x-www-form-urlencoded’
Submission Example
The following shows an example of a transaction request:
HTTP/1.1 200 OK
POST /hosted/ HTTP/1.1
Host: gateway.example.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=ba12b0766a3412782448f154be15e8f61eea390387b1b23d4688c82c9f28f81df593de5890426546cca365943cc7b5c4897c9721b663a0e17680e1e796f1ad55The following shows an example of a transaction response:
Direct Integration
Transaction Request HTTP Headers
The following HTTP headers are sent for transaction request:
content-type
Y
Content type of the request. This must be ‘application/x-www-form-urlencoded’, A charset parameter is optional and any none UTF-8 request will be converted to UTF-8.
Transaction Response HTTP Headers
The following HTTP headers are received for a transaction response:
Status
HTTP status header. Possible value are:
200 – Hosted Payment Form returned
500 – Internal Server Error
503 – Service Temporarily Unavailable
content-type
Content type of the response. This will be ‘text/html’
Submission Example
The following shows an example of a transaction request:
The following shows an example of a transaction response:
Batch Integration
Submission Request HTTP Headers
The following HTTP headers are sent for batch submission request:
content-type
Y
Content type of the batch request. This must be ‘multipart/mixed’ and contain a boundary parameter to separate each transaction request. A charset parameter is optional and any none UTF-8 request will be converted to UTF-8.
content-encoding
N
Optional content encoding applied to the request. The value should be a comma separated list of one or more: x-gzip, gzip, base64.
authorization
N
Optional username and password to authenticate the submitter
The following HTTP headers are sent on each individual part request:
content-type
Y
Content type of the individual request. This must be ‘application/x-www-form-urlencoded’, A charset parameter is optional and any none UTF-8 request will be converted to UTF-8.
content-encoding
N
Optional content encoding applied to the request. The value should be a comma separated list of one or more: x-gzip, gzip, base64.
content-id
N
Optional identifier for each individual transaction with the batch. The Gateway will return this identifier in the submission response.
If not sent, the Gateway will generate a unique identifier for each transaction.
Submission Response HTTP Headers
The following HTTP headers are received for batch submission response:
status
HTTP status header. Possible value are:
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
location
URL to use to monitor the status of the batch. A unique batch reference number will be provided in the URL in the format: XXXX-XXXX-XXXX-XXXX (eg 1A23-B4C5-DEF6-G7HI)
This reference number is used to request information about the status of a batch via HTTP GET requests to the URL endpoint as outlined in the Batch Integration section.
x-p3-token
If user authentication was sent in the initial request, this header will contain a token that can be used for future requests for the status of the batch instead of having to use a username/password.
content-type
Content type of the HTTP batch request. This will be ‘multipart/mixed’ and contain a boundary parameter to separate each transaction request.
The following HTTP headers are received on each individual part response:
content-type
Content type of the individual request. This will be ‘application/x-www-form-urlencoded’, A charset parameter is optional and any none UTF-8 request will be converted to UTF-8.
content-id
The content ID sent in the initial request as outlined in the Submission Request HTTP Headers section. If no content-id header was sent, the Gateway will return a unique content ID per transaction.
x-transaction-id
The Gateway transaction ID. This will be empty if the transaction is currently pending in this stage.
x-transaction-response
A message containing the current status of the transaction.
Possible value are:
skipped – insufficient permissions to view transaction
pending – queued for processing
success – (Response Message)
failure – (Response Message)
Status Request HTTP Headers
The following HTTP headers are used during a batch status request:
authorization
Y
Mandatory username and password to authenticate the submitter.
Status Response HTTP Headers
The batch status response is identical to the submission status response as detailed in the Submission Response HTTP Headers section .
Submission Example
The following shows an example of a batch submission request:
The following shows an example of a batch submission response:
Was this helpful?