v1

latestOpenAPI 3.1.02026-07-132363652.9 MB
Embedded

Create a payment request and return a payment_token for iframe flow

Create a payment request and return a payment_token for iframe flow

post/api/v1/embedded/payment-requests

Request body

merchant_idstring uuid

Merchant ID. Defaults to the logged-in merchant if not provided. Required for admin tokens.

device_type'web' | 'ios' | 'android'

Platform/device type for the payment request

webhook_endpointsstring[]

Optional. Up to 10 registered webhook endpoints to fan this payment's webhooks out to, each signed with its own secret. An endpoint can be test-only, live-only, or both. Omit to use the no-reference precedence: the legacy default URL, then the merchant's default endpoint, then the single active endpoint.

Example request

{
  "merchant_id": "550e8400-e29b-41d4-a716-446655440000",
  "customer": {
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "+351960123456",
    "country": "GB"
  },
  "order": {
    "order_id": "ORD-123456",
    "amount": 9300,
    "currency": "GBP",
    "payment_reference": "Barcelona Tryp",
    "locale": "en-GB",
    "test_transaction": true,
    "rewards": {
      "extra_rewards": 150,
      "total_rewards": 300,
      "description": "Loyalty bonus + base rewards"
    }
  },
  "device_type": "ios",
  "billing_address": {
    "address_line1": "12 West Common Drive",
    "address_line2": "Flat 1",
    "apartment": "Apt 5B",
    "city": "London",
    "state_province": "Greater London",
    "country": "GB",
    "postal_code": "SE1 1AA",
    "company_name": "Acme Ltd"
  },
  "redirect_urls": {
    "success_url": "https://tryp.com/checkout/success",
    "failure_url": "https://tryp.com/checkout/error"
  },
  "webhook_endpoints": [
    "wizzair-prod"
  ]
}

Response

Created

successboolean required

Indicates if the request was successful

Example response

{
  "success": true,
  "data": {
    "payment_token": "ptok_efghijklm...",
    "expires_in": 900
  }
}