Reference

Checkout Page

Create a secure, customizable checkout page session to capture payments with cards, bank transfers, and other payment methods. Supports 3D Secure authentication, cards storage for recurring billing, order management, customer creation, and webhook notifications.

Request

Request to get a checkout page session with URL

Path

POST /checkout/page

Request Body (Basic example)

Basic example to create a payment link with all the required fields

{
  "mode": "ONE_TIME", // RECURRING or SAVE
  "amount": "1200.00"
  // or create a new order
  "order": {
    "description": "Monthly plan + setup"
  }
}

Request Body (Save card)

Create a link to save the customer's card for future recurring payments or as a backup card. A R2 will be charged to verify that the card is valid.

{
  "mode": "SAVE"
  // if no customer object or customer_id passed then a form will show on the payment link to create a customer. Add the customer_fields parameter to specify what fields should be captured.
}

Request Body (Advanced example)

Advanced example with all the fields

{
  "mode": "ONE_TIME", // RECURRING or SAVE
  "amount": "1200.00",
  "currency": "ZA",
  // [options for order records]
  // [option 1: use the order_id of an existing order record]
  "order_id": "ord_12345",
  // [option 2: use the order.description field to create an order, if no order.reference passed then one will be created]
  "order": {
    "reference": "ORD0045",
    "description": "Monthly plan + setup",
    "amount_subtotal": "1100.00",
    "amount_discount": "0.00",
    "amount_shipping": "0.00",
    "amount_tax": "100.00",
    "amount_total": "1200.00",
    "items": [
      {
        "sku": "SKU00567",
        "name": "Pro Plan (Monthly)",
        "quantity": 1,
        "unit_amount": "1200.00",
        "tax_amount": 0,
        "discount_amount": 0,
        "currency": "ZA",
        "metadata": {
          "custom_field_1": "custom data 1",
          "custom_field_2": "custom data 2"
        }
      }
    ]
  },
  // [options for customer records]
  // [option 1: use the customer_id of an existing customer record]
  "customer_id": "cus_abc123...",
   // [option 2: if no customer id or customer object is passed then a form will show, here you can specify the fields to capture, name and surname will always show]
  "customer_fields": "reference,id_number,email,contact_number,billing,shipping",
  // [option 3: create a new customer]
  "customer": {
    "reference": "CLN240919000001",
    "company_name": null,
    "person_name": "John",
    "person_surname": "Doe",
    "client_type": "RESIDENT_INDIVIDUAL", // [optional]
    "id_type": "SAID",
    "id_number": "900112....",
    "email": "johndoe@mail.com",
    "contact_number": "+27831234567",
    "billing_address": {
        "line1": "1 Loop Street",
        "line2": "Floor 5",
        "city_or_town": "Cape Town",
        "province_or_state": "Western Cape",
        "postal_or_zip_code": "8001",
        "country": "ZA"
    },
    "shipping": {
      "contact_name": "Jane Doe",
      "contact_number": "+27820000000",
      "address": {
        "line1": "1 Loop Street",
        "line2": "Floor 5",
        "city_or_town": "Cape Town",
        "province_or_state": "Western Cape",
        "postal_or_zip_code": "8001",
        "country": "ZA"
      },
    },
    "metadata": {
      "custom_field_1": "custom data 1",
      "custom_field_2": "custom data 2"
    },
  },
  "redirects": {
    "success_url": "https://merchant.example/success?order=ord_12345",
    "cancel_url": "https://merchant.example/cancel?order=ord_12345",
    "notify_url": "https://merchant.example/webhooks/payments"
  },
  "payment": {
    "payment_methods": ["CARD", "ZAPPER"], // [optional: populate to specify payment methods to show else all will show]
    "payment_type": "DB" // [optional: Direct Debit (DB) or Pre-Authorization PA, defaults to DB
  },
  "cards": {
    "save_cards": true, // [optional: save cards for recurring or on click checkouts]
    "show_cards": true // [optional: show previous saved cards for use to select from]
  },
  "notifications": {
    "send_invoice": true,
    "send_confirmation_email": true,
    "confirmation_email_override": "accounts@example.com"
  },
  "customization": {
    "locale": "EN_ZA",
    "theme": "LIGHT",
    "type": "PAGE", // or EMBED
    "display_cancel_button": true,
    "display_total": true,
    "display_cart": true,
    "brand": {
      "primary": "#00DC82",
    }
  }
}

Request Parameters

Field
RequiredType
Description
Example
modeYENUMPayment mode (ONE_TIME, RECURRING, SAVE)ONE_TIME
amountYStringPayment amount1200.00
currencyNString(3)ISO 4217 currency codeZAR
order_idCString(32)Either pass order_id OR order object of existing order, see ordersord_abc123...
order.referenceCString(35)Order reference identifierORD0045
order.descriptionCStringDescription of the orderMonthly plan + setup
order.amount_subtotalNStringSubtotal amount before tax, shipping, and discounts1100.00
order.amount_discountNStringTotal discount amount applied0.00
order.amount_shippingNStringShipping cost amount0.00
order.amount_taxNStringTax amount applied100.00
order.amount_totalNStringTotal order amount including all fees1200.00
order.items.skuCStringProduct SKUSKU00567
order.items.nameCStringProduct namePro Plan (Monthly)
order.items.quantityCIntegerItem quantity1
order.items.unit_amountCStringUnit price1200.00
order.items.tax_amountNNumberTax amount0
order.items.discount_amountNNumberDiscount amount0
order.items.currencyNString(2)ISO 4217 currency codeZAR
order.items.metadataNObjectAdditional metadata for this item, only 30 object entries allowed and max key length is 128 characters, max value length is 1024 characters{"custom_field_1": "custom data 1"}
customer_fieldsNStringComma-separated list of customer fields to capture in form (if no customer_id or customer object is specified)reference,id_number,email,contact_number,billing,shipping
customer_idCString(32)Either pass customer_id OR customer object of existing customer, see customerscus_abc123...
customer.referenceCString(35)Reference to identify a specific customerCLN240919000001
customer.company_nameCString(64)Company name if the customer is a companynull
customer.person_nameCString(32)Customer's first nameJohn
customer.person_surnameCString(32)Customer's surnameDoe
customer.client_typeNENUMClient type (RESIDENT_INDIVIDUAL, NON_RESIDENT_INDIVIDUAL, DOMESTIC_COMPANY, FOREIGN_COMPANY, FINANCIAL_INSTITUTION)RESIDENT_INDIVIDUAL
customer.id_typeNENUMID type (SAID, PASSPORT, TEMPORARY_RESIDENCE, COMPANY_REGISTRATION_NUMBER)SAID
customer.id_numberNString(13)ID number900112....
customer.emailCString(128)Customer email addressjohndoe@mail.com
customer.contact_numberCString(16)Customer contact number+27831234567
customer.billing_address.line1NStringBilling address line 11 Loop Street
customer.billing_address.line2NStringBilling address line 2Floor 5
customer.billing_address.city_or_townNStringBilling cityCape Town
customer.billing_address.province_or_stateNStringBilling province/stateWestern Cape
customer.billing_address.postal_or_zip_codeNStringPostal code8001
customer.billing_address.countryNString(2)ISO 3166-1 alpha-2 country codeZA
customer.shipping.contact_nameNStringShipping contact nameJane Doe
customer.shipping.contact_numberNString(16)Shipping contact number+27820000000
customer.shipping.address.line1NStringShipping address line 11 Loop Street
customer.shipping.address.line2NStringShipping address line 2Floor 5
customer.shipping.address.city_or_townNStringShipping cityCape Town
customer.shipping.address.province_or_stateNStringShipping province/stateWestern Cape
customer.shipping.address.postal_or_zip_codeNStringShipping postal code8001
customer.shipping.address.countryNString(2)ISO 3166-1 alpha-2ZA
customer.metadataNObjectAdditional customer metadata, only 30 object entries allowed and max key length is 128 characters, max value length is 1024 characters{"custom_field_1": "custom data 1"}
redirects.success_urlNStringURL to redirect on successful paymenthttps://merchant.example/success?order=ord_12345
redirects.cancel_urlNStringURL to redirect on cancelled paymenthttps://merchant.example/cancel?order=ord_12345
redirects.notify_urlNStringWebhook URL for payment notificationshttps://merchant.example/webhooks/payments
payment.payment_methodsNArrayArray of allowed payment methods: (CARD, ZAPPER, SNAPSCAN, APPLE_PAY, GOOGLE_PAY, SCAN_TO_PAY, 1VOUCHER, SCODE, MONEY_BADGER)[CARD, ZAPPER]
payment.payment_typeNString(2)Direct Debit (DB) or Pre-Authorization (PA), defaults to DBDB
cards.save_cardsNBooleanSave cards for recurring or on click checkoutstrue
cards.show_cardsNBooleanShow previous saved cards for user to select fromtrue
notifications.send_invoiceNBooleanWhether to send invoicetrue
notifications.send_confirmation_emailNBooleanWhether to send confirmation emailtrue
notifications.confirmation_email_overrideNStringOverride email for confirmationsaccounts@example.com
customization.localeNENUMUI localeEN_ZA
customization.themeNENUMUI theme: (LIGHT or DARK)LIGHT
customization.typeNENUMDisplay type: (PAGE or EMBED)PAGE
customization.display_cancel_buttonNBooleanWhether to display the cancel buttontrue
customization.display_totalNBooleanWhether to display the total amounttrue
customization.display_cartNBooleanWhether to display the cart/order itemstrue
customization.brand.primaryNStringPrimary brand color in hex format#00DC82

Response Body

{
    "status": true,
    "result": {
      "id": "chk_abc123...",
      "session_id": "ses_abc123...",
      "amount": "1200.00",
      "currency": "ZA",
      "order_id": "ord_12345",
      "customer_id": "cus_abc123...",
      "page_url": "https://pay.kwik.co.za/checkout/cs_test_a1b2c3",
      "expires_at": "2025-09-13T12:30:00Z"
    }
}

Response Parameters

Field
Type
Description
Example
statusBooleanIndicates if the request was successfultrue
result.idStringUnique checkout session identifierchk_abc123...
result.session_idStringSession identifier for the checkoutses_abc123...
result.amountStringCheckout amount1200.00
result.currencyString(32)ISO 4217 currency codeZAR
result.order_idString(32)Associated order IDord_12345
result.customer_idString(32)Associated customer IDcus_abc123...
result.page_urlStringURL to redirect user to complete checkouthttps://pay.kwik.co.za/checkout/cs_test_a1b2c3
result.expires_atStringISO timestamp when the checkout session expires2025-09-13T12:30:00Z

Webhook

When a checkout session is completed, updated, or expires, a webhook notification is sent to the notify_url specified in the request.

Webhook Payload

{
  "event": "checkout.completed", // checkout.expired, checkout.failed
  "data": [{
    "checkout": {
      "id": "chk_abc123...",
      "session_id": "ses_abc123...",
      "amount": "1200.00",
      "currency": "ZA",
      "order_id": "ord_12345",
      "customer_id": "cus_abc123...",
      "card_id": "crd_abc123...", // return a card id if a card payment was made
      "transaction_id": "tra_abc123...",
      "transaction_status": "RUNNING",
      "expires_at": "2025-09-13T12:30:00Z",
      "completed_at": "2025-09-13T10:15:30Z"
    },
    // return a payment only if a recurring payment was created
    "payment": {
      "id": "pay_abc123...",
      "amount": "1200.00",
      "currency": "ZA",
      "payment_status": "COMPLETED",
      "payment_method": "CARD",
      "payment_method_id": "pam_abc123...",
      "created_at": "2025-09-13T10:15:30Z"
    }
  }],
  "created_at": "2025-09-13T10:15:30Z"
}

Webhook Payload Parameters

Field
Type
Description
Example
eventStringType of webhook event that occurredcheckout.completed
dataArrayArray containing checkout and payment data...
data.checkout.idStringUnique checkout session identifierchk_abc123...
data.checkout.session_idStringSession identifier for the checkoutses_abc123...
data.checkout.amountStringCheckout amount1200.00
data.checkout.currencyString(3)ISO 4217 currency codeZAR
data.checkout.order_idString(32)Associated order IDord_12345
data.checkout.customer_idString(32)Associated customer IDcus_abc123...
data.checkout.card.tokenStringCard token if card was saved60d678e2465b5b6c4fd5e847ef39c70c4b0c22d1b826f39eb80a107b3b8433ad
data.checkout.transaction_idStringTransaction identifiertra_abc123...
data.checkout.transaction_statusENUMTransaction status, see lookupsRUNNING
data.checkout.expires_atStringISO timestamp when checkout session expires2025-09-13T12:30:00Z
data.checkout.completed_atStringISO timestamp when checkout was completed2025-09-13T10:15:30Z
data.payment.idStringPayment identifierpay_abc123...
data.payment.amountStringPayment amount1200.00
data.payment.currencyString(3)ISO 4217 currency codeZAR
data.payment.statusENUMPayment status, see lookupsRUNNING
data.payment.statusStringPayment statuspaid
data.payment.payment_methodStringPayment method usedCARD
data.payment.payment_method_idStringPayment method id usedpam_abc123...
data.payment.created_atStringISO timestamp when payment was created2025-09-13T10:15:30Z
created_atStringISO timestamp when webhook was created2025-09-13T10:15:30Z

Webhook Events

EventDescriptionTrigger ConditionData Included
checkout.completedCheckout session was successfully completed with paymentWhen customer completes payment successfullyCheckout details, payment information, transaction data
checkout.expiredCheckout session expired without completionWhen checkout session reaches expiry time without paymentCheckout details only, no payment data
checkout.failedCheckout session failed due to payment failureWhen payment processing fails (declined card, insufficient funds, etc.)Checkout details, failed payment attempt, error information
checkout.abandonedCustomer abandoned the checkout processWhen customer leaves checkout page without completingCheckout details, abandonment timestamp
checkout.pendingPayment is pending additional verificationWhen payment requires manual review or 3DS authenticationCheckout details, pending payment status
checkout.cancelledCheckout was cancelled by customer or systemWhen cancel button is used or system cancels due to fraudCheckout details, cancellation reason

Webhook Security

All webhooks are sent with the following headers for verification:

  • X-Signature: HMAC-SHA256 signature of the payload
  • X-Timestamp: Unix timestamp of when the webhook was sent
  • User-Agent: Kwik-Webhooks/1.0

Webhook Response

Your endpoint should respond with a 200 status code to acknowledge receipt. Failed webhooks will be retried up to 3 times with exponential backoff.


Copyright © 2025 Kwik