Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ozura.com/llms.txt

Use this file to discover all available pages before exploring further.

Before a customer can pay, you create a “session” that holds all the payment details.

Quick Start (30 seconds)

Create a session and redirect your customer:
curl -X POST https://checkout.ozura.com/api/sessions/create \
  -H "X-API-KEY: your_vault_key" \
  -H "X-OZURA-API-KEY: your_merchant_key" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantId": "your_merchant_id",
    "merchantName": "My Store",
    "amount": "25.00",
    "currency": "USD",
    "successUrl": "https://yoursite.com/success",
    "cancelUrl": "https://yoursite.com/cancel",
    "errorUrl": "https://yoursite.com/error"
  }'
Then redirect your customer to the returned checkoutUrl. Done!

The Basics

WhatValue
API URLPOST https://checkout.ozura.com/api/sessions/create
Content-Typeapplication/json
Called FromYour server (never from browser JavaScript)
What’s “your server”? Backend code like Node.js, PHP, Python, Ruby, etc. If you’re using a website builder (Shopify, Wix), check if they offer serverless functions. If you only have static HTML, use Payment Links instead.

Required Headers

Every request needs these two headers:
X-API-KEY: your_vault_api_key
X-OZURA-API-KEY: your_merchant_api_key
What’s a header? Headers are extra information sent with your request (like an ID badge). They’re set separately from the request body — see the code examples below.Vault API Key: Provided when you signed up. If you didn’t save it, contact Ozura support.Merchant API Key: Dashboard → Settings → API Keys.

Required Fields

Your request body must include these fields:
{
  "merchantId": "your_merchant_id",
  "merchantName": "Your Store Name",
  "amount": "25.00",
  "successUrl": "https://yoursite.com/success",
  "cancelUrl": "https://yoursite.com/cancel",
  "errorUrl": "https://yoursite.com/error"
}
FieldWhat to PutExample
merchantIdYour Merchant ID from Dashboard"merchant_abc123"
merchantNameYour business name (customer sees this)"Bob's Coffee Shop"
amountHow much to charge (string or number)*"25.00" or 25.00
successUrlConfirmation page after payment"https://yoursite.com/thank-you"
cancelUrlReturn destination (cart page)"https://yoursite.com/cart"
errorUrlSystem error handler"https://yoursite.com/cart?checkoutError=true"
Why full URLs? Use absolute URLs like https://yoursite.com/success, not just /success. The redirect happens from Ozura’s servers, so we need the full URL to find your website.
*amount is required for standard payments. Accepts string (e.g., "25.00") or number (e.g., 25.00). Not needed when using items or checkoutMode: "donation".

Understanding the Three URLs

These three URLs control where customers end up after checkout.

Quick Summary

URLPurposeWhen UsedWhat You Receive
successUrlShow receipt/confirmationPayment successfulTransaction details, card info
cancelUrlReturn to shoppingUser cancels OR session expiresNothing (just a return path)
errorUrlHandle system errorsServer/connectivity failuresError code, message, return URL

successUrl – Your Confirmation Page

Purpose: Where customers land after successful payment to see their receipt/confirmation. When it’s used: After payment is processed and confirmed. What you receive: Transaction details and card info as URL parameters:
https://yoursite.com/success?success=true&sessionId=session_xxx&checkoutMode=payment&transactionId=2603130000113B86C&transactionType=sale&amount=25.00&currency=USD&ozuraMerchantId=ozu_abc&cardLastFour=4242&cardBrand=VISA
See Handle the Payment Result for the full parameter reference.

cancelUrl – Your “Go Back” Destination

Purpose: Where customers return when they don’t complete checkout. When it’s used: Customer clicks “Cancel”, session expires (30 min), or customer visits old/bookmarked checkout URL. What you receive: Nothing – it’s just a return path. Best Practice: Point to your cart page or wherever the customer was before checkout.

errorUrl – Your System Error Handler

Purpose: Handle unrecoverable errors (NOT card declines). When it’s used: Server failures, connectivity issues, authentication errors. NOT for card declines – those show inline messages and let customers retry. What you receive: Error details as URL parameters:
https://yoursite.com/error?success=false&errorCode=SYSTEM_ERROR&error=Payment+service+unavailable&cancelUrl=https://yoursite.com/cart

Optional Fields

Common Options

FieldDefaultWhat It Does
currency"USD"Currency code (e.g., "USD", "EUR", "GBP", "CAD")
metadata{}Your custom data (JSON object, returned in success URL)
appearance{}Custom styling (see Appearance)
checkoutMode"payment""payment", "donation", or "recurring"
embedMode"redirect""redirect", "popup", "iframe", or "new_tab". See Integration Modes
parentOriginRequired when embedMode is "popup" or "iframe". Must be a valid URL
allowPopuptrueWhen false, disables the popup upgrade path if iframe is blocked
hideHeaderfalseHides the merchant name and logo strip at the top of checkout
surchargePercentCredit card surcharge passed to the processor. String or number, max "3.00" (Florida cap). E.g. "2.50" adds a 2.5% surcharge line to the order summary.
transactionChannel"ecommerce""ecommerce" (customer self-serve) or "moto" (merchant-entered on customer’s behalf). Forwarded directly to the payment processor — the checkout UI is identical for both.
taxExemptfalseSkip sales tax calculation for this session
idempotencyKeyUnique string for network retry protection — replaying a request with the same key returns the original response without creating a duplicate session
recurringConfigRequired when checkoutMode: "recurring". See Recurring Mode for the full field reference.
donationConfigDonation preset amounts and configuration. See Donation Mode.

Cart Items (Alternative to Amount)

Instead of a flat amount, you can send an array of cart items for a rich, itemized checkout display.
{
  "items": [
    {
      "productId": "sku_001",
      "name": "Blue T-Shirt",
      "price": 29.99,
      "quantity": 2,
      "imageUrl": "https://cdn.example.com/tshirt.jpg"
    }
  ]
}
Limits: Maximum 100 items per cart, maximum cart total: $999,999,999.99. See the full Cart Item Fields section below for all options.

Checkout Modes

ModeHow to UseBest For
Simple AmountPass amount onlyQuick payments, invoices
Itemized CartPass items array onlyE-commerce with multiple products
DonationcheckoutMode: "donation"Charities, non-profits, tips
RecurringcheckoutMode: "recurring" + recurringConfigSubscriptions, memberships
Mutual exclusivity rules:
  • Cannot use amount + items together
  • Cannot use items + checkoutMode: "donation" together
  • Cannot use items + checkoutMode: "recurring" — recurring requires a scalar amount
  • Can use amount + checkoutMode: "donation" (sets the default pre-selected donation amount)
See Donation Mode and Recurring Mode for full guides.

Cart Item Fields

Each item in the items array supports:

Required Fields

FieldTypeDescription
productIdstringYour product SKU or ID (max 100 chars)
namestringProduct name shown to customer (max 200 chars)
pricenumberUnit price (e.g., 29.99). Must be ≥ 0
quantityintegerQuantity (1-10,000)

Visual Display Fields (Optional)

FieldTypeDescription
imageUrlstringProduct image URL (HTTPS recommended)
descriptionstringShort product description (max 500 chars)
variantstringVariant details, e.g., "Size: L, Color: Blue"
brandstringBrand name displayed above product name
categorystringProduct category shown as a badge on the item
skustringInternal SKU or barcode shown beneath the item name (max 100 chars)
urlstringURL that the product name links to (HTTPS, opens in new tab)

Pricing & Discount Fields (Optional)

FieldTypeDescription
originalPricenumberOriginal price before discount (renders as strikethrough next to the final price)
discountLabelstringDiscount badge text shown beside the item name, e.g., "SALE", "20% OFF"
taxExemptbooleanIf true, item displays a “Tax Free” badge
discountobjectShorthand to compute the discounted price automatically — see below
discount object — pass this instead of computing price/originalPrice/discountLabel yourself:
Sub-fieldTypeDescription
typestring"percentage" or "fixed"
valuenumberFor percentage: 0–100. For fixed: amount to subtract in currency units
labelstringBadge text. Auto-generated (e.g. "20% OFF") if omitted
When discount is provided, the price field is treated as the original price. Checkout computes the final charge price, sets the strikethrough originalPrice, and generates a discountLabel badge automatically.
{
  "productId": "prod_annual",
  "name": "Annual Plan",
  "price": 99.00,
  "quantity": 1,
  "discount": {
    "type": "percentage",
    "value": 20,
    "label": "SAVE 20%"
  }
}

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": 25.00,
      "tax": 0,
      "shipping": 0,
      "total": 25.00,
      "currency": "USD"
    }
  }
}
FieldWhat It Is
checkoutUrlSend your customer here! This is the payment page URL.
sessionIdSave this – you’ll need it to verify the payment later.
expiresAtWhen the session expires (customer must pay before this).
embedCodeReady-to-use HTML/JS for popup/iframe modes.
pricingCalculated totals (subtotal, tax, shipping, total).

What’s Next?

You have a checkoutUrl. Now redirect your customer to checkout.