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 popup and iframe
metadataobjectNo{}Custom data (max 10KB)
appearanceobjectNo{}Styling options — see Customize Appearance and Appearance Reference
itemsarrayNoCart items (alternative to amount)
checkoutModestringNo"payment""payment" or "donation"
donationConfigobjectNoDonation settings
idempotencyKeystringNoUnique key for retry protection
*Required if items is not provided and checkoutMode is "payment".

Response

{
  "success": true,
  "data": {
    "sessionId": "session_xxxxxxxxxxxxxx",
    "checkoutUrl": "https://checkout.ozura.com/checkout/session_xxxxxxxxxxxxxx",
    "expiresAt": "2025-01-07T12:15:00.000Z",
    "embedCode": "<script>...</script>",
    "pricing": {
      "subtotal": 55.00,
      "tax": 0,
      "shipping": 0,
      "total": 55.00,
      "currency": "USD"
    }
  }
}

Get Session

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

Response

{
  "success": true,
  "data": {
    "session": {
      "id": "session_xxxxxxxxxxxxxx",
      "status": "pending",
      "amount": "25.00",
      "currency": "USD",
      "merchantId": "your_merchant_id",
      "merchantName": "My Store"
    },
    "pricing": {
      "subtotal": 25.00,
      "tax": 0,
      "shipping": 0,
      "total": 25.00,
      "currency": "USD"
    }
  }
}

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
amountstringYes*Payment amount
currencystringNo"USD"Currency code
successUrlstringYesRedirect after payment
cancelUrlstringYesRedirect if cancelled
errorUrlstringYesRedirect if failed
expiresInDaysnumberNo7Days until link expires
usageLimitnumberNonullMax payments (null = unlimited)
*Not required for donation mode or when using items.

Response

{
  "success": true,
  "data": {
    "paymentLinkId": "pl_xxxxxxxxxxxxxx",
    "url": "https://checkout.ozura.com/pay/pl_xxxxxxxxxxxxxx",
    "expiresAt": "2025-01-14T00:00:00.000Z"
  }
}
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": "Error message",
  "details": ["Optional array of specific errors"]
}

Common Error Codes

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