Transactions
Process an online transaction v3
API to process an online transaction v3. <br><strong>Access Token Required scope:</strong> transactions/online/create
post/v3/transactions/online
Request
- Base URLhttps://docs.teya.com (the document declares no server; this is the origin it was published from)
- AuthOAuth 2Authorization codehttps://id.teya.com/oauth/v2/oauth-authorizeClient credentialsToken URLhttps://id.teya.com/oauth/v2/oauth-token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Idempotency-Keystring required
A unique key to identify the request. If the request is repeated with the same key, the same response will be returned. If the request is repeated with a different key or without a key, a new transaction will be created.
User-Agentstring required
Example:YourCompany-Integration/1.0
Identifies your integration, for example YourCompany-Integration/1.0. Requests without a User-Agent can be blocked by our firewall before they reach the API.
Request body
Example request
{
"amount": {
"currency": "GBP",
"value": 100
},
"browser_data": {
"accept_language": "en-GB,en;q=0.9,pt;q=0.8,pt-PT;q=0.7,nl;q=0.6",
"ip_address": "127.0.0.1",
"screen_height": 1080,
"screen_width": 1920,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"billing_address": {
"name": "John Doe",
"country": "GB",
"city": "London",
"state": "Greater London",
"street_address_line1": "123 High Street",
"street_address_line2": "Flat 4",
"zipcode": "SW1A 1AA"
},
"cardholder": {
"name": "John Doe"
},
"customer_contact": {
"phone_number": "+447123456789",
"email": "john.doe@example.com"
},
"initiator": "CUSTOMER",
"line_items": [
{
"description": "Product Name",
"id": "550e8400-e29b-41d4-a716-446655440000",
"quantity": 2,
"unit_price": 1000
}
],
"merchant_reference_id": "1234567890",
"payment_method": {
"card": {
"cvc": "123",
"expiry_month": "02",
"expiry_year": "2030",
"number": "4111111111111111"
},
"type": "CARD"
},
"redirect_url": "https://mywebsite.com/processing",
"shipping_address": {
"name": "Jane Doe",
"country": "GB",
"city": "Manchester",
"state": "Greater Manchester",
"street_address_line1": "456 Oak Avenue",
"zipcode": "M1 1AA"
},
"store_id": "7a3f2c21-5d6e-4637-8d8a-1f178d4d2a0e",
"store_payment_method": true,
"transaction_context": {
"payment_link_id": "1e2d4f80-9c3e-4f5b-83aa-9e8d2b6a6c49",
"session_id": "1e2d4f80-9c3e-4f5b-83aa-9e8d2b6a6c49"
},
"type": "SALE"
}Response
New transaction has been created and processed by host
Example response
{
"online_transaction": {
"authentication_id": "5f7b1a3a-3b7a-4b1a-9b1a-3a3b7a4b1a9b",
"created_at": "2022-03-01T15:29:59Z",
"issuer_result": {
"approval_code": "123456",
"response_code": "00"
},
"status": "SUCCESS",
"token_response": {
"token_id": "5f7b1a3a-3b7a-4b1a-9b1a-3a3b7a4b1a9b",
"token_status": "SUCCESS"
},
"transaction_id": "5f7b1a3a-3b7a-4b1a-9b1a-3a3b7a4b1a9b",
"updated_at": "2022-03-01T15:35:00Z"
},
"type": "ONLINE_TRANSACTION"
}