Sale Request
To initiate a payment within the Payment Platform, utilize the "SALE" request.
API Endpoint
Request URL: {{API_HOST}}
Request Method: POST
Request Body: x-www-form-urlencoded
Response Body: JSON
tip
- {{API_HOST}}
- To send a payment to a particular sub-account (channel), you must utilize the
channel_id. - The request should be initiated in the background (e.g. through PHP CURL).
Request Parameters
| Parameter | Description | Limitations | Required |
|---|---|---|---|
action | Action to perform (=SALE) | = SALE | Y |
client_key | Merchnat Key provided by TESS Payments | Y | |
channel_id | Payment channel (Sub-account) | String up to 16 characters | N |
brand | Brand through which the transaction is performed | String up to 36 characters(Appendix B) | Y |
order_id | Transaction ID in the Clients system | String up to 255 characters | Y |
order_amount | The amount of the transaction | Numbers in the format XXXX.XX Pay attention that amount format depends on currency exponent. If exponent = 0, then amount is integer (without decimals). It used for currencies: CLP, VND, ISK, UGX, KRW, JPY. If exponent = 3, then format: XXXX.XXX (with 3 decimals). It used for currencies: BHD, JOD, KWD, OMR, TND. | Y |
order_currency | Currency | 3-letter code | Y |
order_description | Description of the transaction (product name) | String (Maximum 1024 characters) [a-zA-Z0-9,] | Y |
payer_first_name | Customer's name | String up to 32 characters | N |
payer_last_name | Customer's surname | String up to 32 characters | N |
payer_address | Customer's address | String up to 255 characters | N |
payer_country | Customer's country | 2-letter code | N |
payer_state | Customer's state | String up to 32 characters | N |
payer_city | Customer's city | String up to 32 characters | N |
payer_zip | ZIP-code of the Customer | String up to 32 characters | N |
payer_email | Customer's email | String up to 256 characters | N |
payer_phone | Customer's phone | String up to 32 characters | N |
payer_birth_date | Customer's birthday | Date format is "YYYY-MM-DD" | N |
payer_ip | IP-address of the Customer | XXX.XXX.XXX.XXX | Y |
return_url | URL to which Customer should be returned after operation in third-party system | String up to 1024 characters | Y |
identifier | Extra parameter for transaction. It could be token, account information, additional descriptor etc | String up to 255 characters | Y |
hash | Special signature to validate your request to Payment Platform | See Appendix A, Sale signature. | Y |
Response Parameters
| Parameter | Description |
|---|---|
action | SALE |
result | REDIRECT |
status | REDIRECT |
order_id | Transaction ID in the Merchant's system |
trans_id | Transaction ID in the TESS Payments' system |
trans_date | Transaction date in the Payment Platform |
redirect_url | URL to which the Merchant should redirect the Customer |
redirect_params | Array parameters |
redirect_method | The method of transferring parameters (POST/GET) |
hash | Special signature to validate callback. See Appendix A, Callback signature. |
Examples
Sample - Sale Request
curl --location '{{API_HOST}}/post-va' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: PHPSESSID=2bmc5tj4r8uiur21fh2em9nfhf' \
--data-urlencode 'hash={{session_hash}}' \
--data-urlencode 'action=SALE' \
--data-urlencode 'client_key=xxxxx-xxxxx-xxxxx' \
--data-urlencode 'order_id=order-1234' \
--data-urlencode 'order_amount=1.00' \
--data-urlencode 'order_currency=QAR' \
--data-urlencode 'order_description=NAPS Test Order' \
--data-urlencode 'payer_ip=192.168.0.1' \
--data-urlencode 'return_url=https://example.com/return' \
--data-urlencode 'identifier=testing' \
--data-urlencode 'brand=naps'
'
Sample - Sale Response
{
"action": "SALE",
"result": "REDIRECT",
"status": "REDIRECT",
"order_id": "order-1234",
"trans_id": "47f8466c-1341-11ee-9709-be2339f163bc",
"trans_date": "2023-06-25 10:16:00",
"amount": "1.00",
"currency": "QAR",
"redirect_url": "https://checkout.tesspayments.com/interaction/47f8466c-1341-11ee-9709-be2339f163bc",
"redirect_params": {
"body": "blI4dDZUeUlib2pXK2xJNmprbU9GNndmRnZaakdVVTRaTkdxc1BHU1RJWWVXNS9BekFrL0locWhFME5YWCtUaTVqTkpLRnFxUnJ4a2FVYXNMMldFOWc4MVMvdGwzeThnL05FVkQ4ek00eUNWNDdHdExqNGNVeWt4a1RLRjFYazc1cERYZ1lpV0c3NlFCZWh2dEE0ZU82c25ZNW5saDZyUlFuNThPTHQyWGVrNUtDdjROZnNsREhSTldBdE9GNnpnZkVqdVlHb2x1VWpjbkcrbWlxR2FSczBXNW1Cakl2b0dQZHRhOERTOEIra1JyeUNUUVpZb0RsTy93OEdMeUpqOTJ4RGJncURKU3BKU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