Skip to main content
Complete reference for all Ozura Checkout API endpoints.

Base URL

https://checkout.ozura.com
Environments: Use https://checkout.ozura.com for production. For staging, use the URL provided by your Ozura representative.

Authentication

All requests require these headers:
HeaderDescription
X-API-KEYYour Vault API Key
X-OZURA-API-KEYYour Merchant API Key
Content-Typeapplication/json

Rate Limits

Rate limits are applied per API key to ensure fair usage. If you exceed rate limits, you’ll receive a 429 Too Many Requests response.

Create Session

Creates a checkout session and returns a checkout URL.
POST /api/sessions/create

Request Body

FieldTypeRequiredDefaultDescription
merchantIdstringYesYour Merchant ID
merchantNamestringYesBusiness name shown to customer
amountstring/numberYes*Payment amount
currencystringNo"USD"Currency code
successUrlstringYesRedirect after successful payment
cancelUrlstringYes“Go back” destination
errorUrlstringYesRedirect if payment fails
embedModestringNo"redirect""redirect", "popup", "iframe", "new_tab"
parentOriginstringCond.Required for embedMode: "popup" and "iframe"
checkoutModestringNo"payment""payment", "donation", or "recurring"
recurringConfigobjectCond.Required when checkoutMode: "recurring". See Recurring Mode
donationConfigobjectNoDonation settings. See Donation Mode
surchargePercentstring/numberNoNo surcharge (treated as 0% at charge time)Credit card surcharge, max "3.00" (3%). Shown as a line item when set
transactionChannelstringNo"ecommerce""ecommerce" or "moto". Forwarded to the payment processor
taxExemptbooleanNofalseSkip sales tax calculation for this session
itemsarrayNoCart items (alternative to amount). Not allowed with recurring mode
metadataobjectNo{}Custom data (max 10KB), returned in the success URL
appearanceobjectNo{}Styling options — see Appearance Reference
idempotencyKeystringNoUnique key for network retry protection
allowPopupbooleanNotrueAllow popup-mode upgrade when iframe is blocked
hideHeaderbooleanNofalseHide the merchant name / logo header
donationConfigobjectNoDonation preset amounts and limits. See Donation Mode
*amount is required when checkoutMode is "payment" or "recurring" and items is not provided. Not required for "donation" mode.
Deprecated fields: taxRate and shippingCost are accepted and validated but ignored — they have no effect on pricing. Do not send these fields in new integrations.

Response

{
  "success": true,
  "data": {
    "sessionId": "session_xxxxxxxxxxxxxx",
    "checkoutUrl": "https://checkout.ozura.com/checkout/session_xxxxxxxxxxxxxx",
    "expiresAt": "2025-01-07T12:15:00.000Z",
    "embedCode": "<!-- HTML embed snippet based on embedMode -->",
    "pricing": {
      "subtotal": 55.00,
      "tax": 0,
      "shipping": 0,
      "total": 55.00,
      "currency": "USD"
    }
  }
}
The response may also include a top-level "warnings" array with advisory messages. On an idempotent replay (same idempotencyKey), "cached": true is added at the top level and a new session is not created.

Get Session

Retrieve session details. The session ID acts as the access token — no additional authentication headers are required.
GET /api/sessions/{sessionId}

Response

The full session object is returned. Key fields include:
{
  "success": true,
  "data": {
    "session": {
      "id": "session_xxxxxxxxxxxxxx",
      "status": "pending",
      "amount": "25.00",
      "currency": "USD",
      "merchantId": "your_merchant_id",
      "checkoutMode": "payment",
      "embedMode": "redirect",
      "taxExempt": false,
      "appearance": {},
      "metadata": {
        "merchantName": "My Store",
        "orderId": "order_123"
      },
      "recurringConfig": null,
      "surchargePercent": null,
      "transactionChannel": "ecommerce",
      "expiresAt": "2025-01-07T12:15:00.000Z",
      "createdAt": "2025-01-07T11:45:00.000Z"
    },
    "pricing": {
      "subtotal": 25.00,
      "tax": 0,
      "shipping": 0,
      "total": 25.00,
      "currency": "USD"
    },
    "items": []
  }
}
merchantName is stored inside metadata, not as a top-level session field. For recurring sessions, recurringConfig contains the full plan config object. The metadata object may contain internal fields used by the checkout page — do not expose, log, or forward the full metadata object to clients.

Session Statuses

StatusDescription
pendingAwaiting payment
completedPayment successful
cancelledCustomer cancelled
expiredSession timed out
failedPayment failed

Cancel Session

Cancels a pending session. This endpoint is called automatically by the Ozura checkout page when the customer clicks “Cancel” — you do not need to call it from your server.
POST /api/sessions/{sessionId}/cancel
This endpoint is browser-facing. It is called by the checkout page using a short-lived internal session credential. It cannot be called from your server using your Vault API Key — requests with X-API-KEY are rejected. If a session is not cancelled explicitly, it expires automatically after 30 minutes.

Response

{
  "success": true
}
Creates a reusable payment URL.
POST /api/payment-links/create

Request Body

FieldTypeRequiredDefaultDescription
merchantIdstringYesYour Merchant ID
merchantNamestringYesBusiness name shown to customer
amountstringYes*Payment amount
currencystringNo"USD"Currency code
successUrlstringYesRedirect after payment
cancelUrlstringYesRedirect if cancelled
errorUrlstringYesRedirect if failed
checkoutModestringNo"payment""payment", "donation", or "recurring"
recurringConfigobjectCond.Required when checkoutMode: "recurring". See Recurring Mode
donationConfigobjectNoDonation settings. See Donation Mode
surchargePercentstring/numberNoNo surchargeCredit card surcharge, max "3.00" (3%)
transactionChannelstringNo"ecommerce""ecommerce" or "moto"
taxExemptbooleanNofalseSkip sales tax calculation for this link’s sessions
embedModestringNo"redirect""redirect", "popup", "iframe", "new_tab". Stored on the link but payment links always open checkout as redirect — this field is persisted for informational purposes only
parentOriginstringCond.Required if embedMode is "popup" or "iframe"
allowPopupbooleanNotrueAllow popup-mode upgrade when iframe is blocked
hideHeaderbooleanNofalseHide the merchant name / logo header
itemsarrayNoCart items (alternative to amount)
metadataobjectNo{}Custom data (max 10KB)
appearanceobjectNo{}Styling options — see Appearance Reference
idempotencyKeystringNoUnique key for network retry protection
expiresInDaysnumberNo7Days until link expires
usageLimitnumberNonull (unlimited)Max successful payments before the link is deactivated
*Required when checkoutMode is "payment" or "recurring" and items is not provided. Not required for donation mode.

Response

{
  "success": true,
  "data": {
    "paymentLinkId": "pl_xxxxxxxxxxxxxx",
    "url": "https://checkout.ozura.com/pay/pl_xxxxxxxxxxxxxx",
    "expiresAt": "2025-01-14T00:00:00.000Z"
  }
}
On an idempotent replay (same idempotencyKey), the response also includes "cached": true. Either response may include a top-level "warnings" array with merchant-facing advisory messages. Check if a payment link is still valid. No authentication required.
GET /api/payment-links/{linkId}/check-availability

Response (Available)

{
  "success": true,
  "available": true,
  "message": "Payment link is available"
}

Response (Unavailable)

{
  "success": false,
  "available": false,
  "error": "Payment link usage limit reached"
}

Error Responses

All errors follow this format:
{
  "success": false,
  "error": "Human-readable error message",
  "details": ["Field-level detail — only present for validation errors"]
}
details is only included when there are multiple specific validation failures (e.g. several invalid fields at once). Single-field and non-validation errors return error only.

Common Error Codes

CodeMeaning
400Bad request (validation failed)
401Invalid or missing API credentials
404Session not found
409Conflict — session already completed, or idempotencyKey reuse rejected (see below)
410Session expired
429Too many requests (rate limit exceeded)
500Server error (retry recommended)

Idempotency Conflict Codes

When you replay a request with an idempotencyKey that does not match the original active session, the API returns 409 with one of these machine-readable errorCode values:
errorCodeMeaning
IDEMPOTENCY_KEY_EXPIRED_SESSIONThe session previously created with this idempotencyKey has expired. Use a new idempotencyKey to create a fresh session
IDEMPOTENCY_KEY_TERMINAL_SESSIONThe session for this idempotencyKey is in a terminal state (cancelled or failed). Use a new idempotencyKey