PayByLink
Creates a new payment link
API to create a new payment link. <br><strong>Access Token Required scope:</strong> payment-links/create
post/v2/payment-links
Request
- Base URLhttps://docs.teya.com (the document declares no server; this is the origin it was published from)
- Auth
- OAuth 2Authorization codehttps://id.teya.xyz/oauth/v2/oauth-authorizeClient credentialsToken URLhttps://id.teya.xyz/oauth/v2/oauth-token
- or OAuth 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 session 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": "USD",
"value": 100
},
"billing_address": {
"city": "London",
"country": "GB",
"street_address_line1": "Main Street",
"zipcode": "SW1A1AA"
},
"cancel_url": "https://mywebsite.com/checkout/cart",
"customer": {
"email": "emailaddress@example.com",
"name": "John Doe",
"phone_number": "+447911123456"
},
"customer_success_email": "john.doe@example.com",
"delivery_info": {
"email": "emailaddress@example.com",
"phone_number": "+447700900123"
},
"expires_at": "2024-07-03T13:37:58.709Z",
"language": "en-GB",
"line_items": [
{
"description": "Product 1",
"quantity": 1,
"unit_price": 100
}
],
"merchant_reference": "12345678",
"merchant_success_email": "merchant@example.com",
"metadata": {
"order_id": "12345",
"table_number": "5"
},
"post_success_payment": "REDIRECT",
"required_customer_fields": [
"EMAIL",
"PHONE"
],
"store_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success_url": "https://mywebsite.com/checkout/success",
"supported_card_brands": [
"VISA",
"MASTERCARD"
],
"supported_payment_methods": [
"CARD",
"APPLE_PAY"
],
"transaction_type": "SALE",
"type": "SINGLE_USE"
}Response
New payment link has been created
Example response
{
"payment_link": "https://pbl.teya.com/20eb276c-5b6b-4474-a5a1-49bcd6193148",
"payment_link_id": "20eb276c-5b6b-4474-a5a1-49bcd6193148"
}Changes
No recorded changes to this operation across all 1 revision of this API.