Hosted Checkout
'@internal'

Get session details

API to return details of a given session. <br><strong>Access Token Required scope:</strong> checkout/sessions/id/get

get/v2/checkout/sessions/{session_id}

Request

  • Base URL
    https://docs.teya.com (the document declares no server; this is the origin it was published from)
  • Auth
    • OAuth 2
      Authorization codehttps://id.teya.xyz/oauth/v2/oauth-authorize
      Client credentials
      Token URLhttps://id.teya.xyz/oauth/v2/oauth-token
    • or OAuth 2
      Authorization codehttps://id.teya.com/oauth/v2/oauth-authorize
      Client credentials
      Token URLhttps://id.teya.com/oauth/v2/oauth-token
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

session_idstring uuid required

This is the id of the session that has been created and will be used to interact across different systems

Example:14411456-79c8-4d8c-8498-f01907093b83

The session id

Headers

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.

Response

Session has been returned

cancel_urlstring

URL to bring back the customer to the cart. If included in the call we will render the “Back” button in the HostedCheckout UI

customer_success_emailstring

If present, an e-mail is sent to the merchant customer upon successful payment with the receipt.

enabled_card_brandsstring[]

List of enabled card brands for the session.

failure_urlstring

URL to redirect the customer once the transaction has finished with error

languagestring

The language to be used in the Hosted Checkout session. IETF BCP 47. If not provided we will use for rendering in HC the Accept-Language request header.

merchant_referencestring

An identifier that can be used to reference the transaction on the merchant's side. Overrides 'source_reference_id

merchant_success_emailstring

If present, an e-mail is sent to the merchant upon successful payment with the receipt.

metadataobject

Metadata key-value pairs for the session. Maximum 10 keys allowed. Keys must not exceed 40 characters and values must not exceed 500 characters.

payment_link_idstring uuid

A unique identifier for the created payment link

payment_link_type'SINGLE_USE' enum

Type of the payment link used to create the session

payment_status'NONE' | 'SUCCESS' | 'FAILED' enum required

Status of the payment, only present when the session status is COMPLETED.

post_success_payment'SHOW_SUCCESS_PAGE' | 'REDIRECT' enum

Where the customer browser will be sent after a successful transaction. Possible values: SHOW_SUCCESS_PAGE (Display the HostedCheckout payment completed page with a button to redirect to the success_url), REDIRECT (Redirect the customer browser directly to the success_url). Note: For transactions with Dynamic currency conversion (DCC), we will not redirect and will show success page if no customer_success_email is sent. Because we are required to show the rates to the customer.

session_idstring uuid required

This is the id of the session that has been created and will be used to interact across different systems

session_status'ACTIVE' | 'PROCESSING' | 'COMPLETED' | 'EXPIRED' enum required

Indicates whether the session is still available for use. New payments can only happen when the status is ACTIVE

required_customer_fieldsstring[]

Customer fields that must be collected during checkout

success_urlstring

URL to redirect the customer once the transaction has successfully finished

logo_urlstring

Public URL of the merchant's logo to display on the checkout page. Configured in the Teya Business Portal.

checkout_custom_notestring

Custom note to display on the checkout page. Maximum 1000 characters. Configured in the Teya Business Portal.

privacy_policy_urlstring

HTTPS URL linking to the merchant's privacy policy. Displayed on the checkout page. Configured in the Teya Business Portal.

terms_urlstring

HTTPS URL linking to the merchant's terms and conditions. Displayed on the checkout page. Configured in the Teya Business Portal.

transaction_idstring

The unique identifier for the new transaction

type'ACCOUNT_VERIFICATION' | 'PRE_AUTHORISATION' | 'SALE' enum required

Indicates the transaction type. Use SALE for standard payments, PRE_AUTHORISATION to reserve funds for later capture, or ACCOUNT_VERIFICATION to verify a card without charging it.

Example response

{
  "amount": {
    "currency": "USD",
    "value": 100
  },
  "billing_address": {
    "city": "London",
    "country": "GB",
    "state": "London",
    "street_address_line1": "Main Street",
    "street_address_line2": "No. 1",
    "street_address_line3": "Building 1",
    "zipcode": "10001"
  },
  "business_data": {
    "active": true,
    "address": {
      "city": "New York",
      "country": "US",
      "state": "NY",
      "street_address_line1": "123 Main St",
      "street_address_line2": "Suite 100",
      "street_address_line3": "Building 1",
      "zipcode": "10001"
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "My Business"
  },
  "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",
  "failure_url": "https://mywebsite.com/checkout/failure",
  "language": "en-GB",
  "line_items": [
    {
      "description": "Product 1",
      "quantity": 1,
      "unit_price": 50
    },
    {
      "description": "Product 2",
      "quantity": 2,
      "unit_price": 25
    }
  ],
  "merchant_reference": "1234567890",
  "merchant_success_email": "customer@mywebsite.com",
  "metadata": {
    "campaign": "summer_sale",
    "order_id": "12345"
  },
  "payment_link_id": "01960f72-872c-7894-a7da-98b0eaaf6588",
  "payment_link_type": "SINGLE_USE",
  "payment_status": "NONE",
  "post_success_payment": "SHOW_SUCCESS_PAGE",
  "required_customer_fields": [
    "SHIPPING_ADDRESS",
    "EMAIL",
    "PHONE"
  ],
  "session_id": "14411456-79c8-4d8c-8498-f01907093b83",
  "session_status": "ACTIVE",
  "source_reference_id": "1234567890",
  "success_url": "https://mywebsite.com/checkout/success",
  "transaction_id": "tr_72302a4d-b2f9-4663-93f8-d9260e5370c8",
  "type": "SALE",
  "logo_url": "https://example.cloudfront.net/stores/123/logo.png",
  "checkout_custom_note": "Thank you for shopping with us!",
  "privacy_policy_url": "https://mywebsite.com/privacy",
  "terms_url": "https://mywebsite.com/terms"
}

Changes

No recorded changes to this operation across all 1 revision of this API.