Embedded Checkout

Create Session

Create a new embedded checkout session. Returns session_id and checkout_url.

post/api/v1/embedded/session

Request body

merchant_api_keystring required

Merchant API key from Paylox

amountinteger required

Amount in minor units (e.g. 1000 = 10.00 TRY)

currencystring

ISO currency code

languagestring

Language code

customer_basketobject[]

Gateway payment customer basket

submerchant_external_idstring

Primary submerchant external identifier

is_submerchant_paymentboolean

Whether payment should be routed as submerchant

campaign_namestring

Campaign name for payment request

billing_tax_officestring

Billing tax office

billing_tax_numberstring

Billing tax number

success_urlstring

Merchant success callback URL

fail_urlstring

Merchant fail callback URL

metadataobject

Arbitrary metadata to pass through

Example request

{
  "merchant_api_key": "1x2cdaa3-35df-2eff-aeq2-5d74387701xd",
  "amount": 1000,
  "currency": "TRY",
  "language": "tr",
  "customer": {
    "email": "test@example.com",
    "name": "John",
    "surname": "Doe",
    "phone": "+905321234567",
    "address": "Example Street, No: 1",
    "postal_code": "34100",
    "city": "Istanbul",
    "country": "TR",
    "identity_number": "12345678910",
    "ip_address": "34.06.50.01",
    "customer_id": "CUST-001"
  },
  "basket_items": [
    {
      "id": "ITEM-001",
      "name": "Maintenance Services",
      "brand_name": "Brand",
      "qty": 1,
      "unit_price": 1000
    }
  ],
  "success_url": "https://example.com/success",
  "fail_url": "https://example.com/fail"
}

Response

Successful Response

statusinteger required

Response code, 0 means success

messagestring required

Response message

session_idstring

Unique session identifier

checkout_urlstring

URL to redirect for payment

expires_atstring

Session expiration datetime in ISO format

Example response

{
  "message": "Success",
  "session_id": "ses_abc123def456",
  "checkout_url": "https://example.com/embedded/checkout?session=ses_abc123",
  "expires_at": "2025-01-01T01:00:00+00:00"
}

Changes

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