---
updatedAt: 2026-02-10T11:30:26.000Z
---

# SDK & UI library

# Software Development Kits

Our SDKs remove the need to handle sensitive data by enabling you to validate and encrypt your data and finally create a checkout request. Check the out here:

[block:html]
{
  "html": "<style>\n  #tingg-checkout-sdks {\n  width: 100%;\n  margin: 1rem auto;\n\n  display: grid;\n  grid-gap: 1rem;\n  grid-auto-rows: minmax(1fr, auto);\n  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n}\n\n.tingg-checkout-sdk {\n  display: flex;\n  flex-direction: column;\n\n  position: relative;\n  border: 1px solid #eceff5;\n  border-radius: var(--border-radius);\n  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n.tingg-checkout-sdk a {\n  color: initial;\n  text-decoration: none !important;\n}\n\n.tingg-checkout-sdk:hover {\n  box-shadow:\n    0 1px 3px rgba(0, 0, 0, 0.12),\n    0 1px 2px rgba(0, 0, 0, 0.24);\n}\n\n.tingg-checkout-sdk-header {\n  flex: 1;\n  padding: 27px 12px 20px 12px;\n}\n\n.tingg-checkout-sdk-header .tingg-checkout-sdk-title {\n  margin: 0;\n}\n\n.tingg-checkout-sdk-title {\n  gap: 16px;\n  display: flex;\n  align-items: center;\n}\n\n.tingg-checkout-sdk-header .tingg-checkout-sdk-sub-title {\n  margin: 0;\n  padding-top: 12px;\n  padding-bottom: 24px;\n}\n\n.tingg-checkout-sdk-content {\n  padding: 8px;\n  padding-top: 0px;\n}\n\n@media (min-width: 576px) and (max-width: 767.98px) {\n  #tingg-checkout-sdks {\n    grid-gap: 1.2rem;\n    grid-template-columns: 1fr 1fr;\n  }\n}\n\n/* md - tablets */\n@media (min-width: 768px) and (max-width: 991.98px) {\n  #tingg-checkout-sdks {\n    grid-gap: 1.2rem;\n    grid-template-columns: 1fr 1fr;\n  }\n}\n\n/* lg - laptops */\n@media (min-width: 992px) and (max-width: 1199.98px) {\n  #tingg-checkout-sdks {\n    grid-gap: 1.2rem;\n    grid-template-columns: 1fr 1fr 1fr;\n  }\n}\n\n/* xl - desktops */\n@media (min-width: 1200px) and (max-width: 1399.98px) {\n  #tingg-checkout-sdks {\n    grid-gap: 1.2rem;\n    grid-template-columns: 1fr 1fr 1fr;\n  }\n}\n\n/* xxl - large screens */\n@media (min-width: 1400px) {\n  #tingg-checkout-sdks {\n    grid-gap: 2rem;\n    grid-template-columns: 1fr 1fr 1fr;\n  }\n}\n\n/* NOT mobile screens */\n@media (min-width: 576px) {\n  #tingg-checkout-call-to-action-lead {\n    width: 90%;\n  }\n}\n\n@media (prefers-color-scheme: dark) {\n  [data-color-mode=\"system\"] .tingg-checkout-sdk {\n    border-color: var(--grey) !important;\n  }\n}\n\n[data-color-mode=\"dark\"] .tingg-checkout-sdk {\n  border-color: var(--dark) !important;\n}\n</style>\n\n<main id=\"tingg-checkout-sdks\">\n      <div id=\"javascript-sdk\" class=\"tingg-checkout-sdk\">\n        <a target=\"_blank\" href=\"https://www.npmjs.com/package/@tingg-sdk/checkout\">\n          <div class=\"tingg-checkout-sdk-header\">\n            <h3 class=\"tingg-checkout-sdk-title\">\n              <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"32\" width=\"28\" viewBox=\"0 0 448 512\" fill=\"currentColor\"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path d=\"M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z\"/></svg>\n              <span>JavaScript</span>\n            </h3>\n\n            <p class=\"tingg-checkout-sdk-sub-title\">\n              View\n            </p>\n\n            <svg height=\"24\" viewbox=\"0 0 35 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n              <path d=\"M3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13V11ZM33.7071 12.7071C34.0976 12.3166 34.0976 11.6834 33.7071 11.2929L27.3431 4.92893C26.9526 4.53841 26.3195 4.53841 25.9289 4.92893C25.5384 5.31946 25.5384 5.95262 25.9289 6.34315L31.5858 12L25.9289 17.6569C25.5384 18.0474 25.5384 18.6805 25.9289 19.0711C26.3195 19.4616 26.9526 19.4616 27.3431 19.0711L33.7071 12.7071ZM3 13H33V11H3V13Z\" fill=\"currentColor\"></path>\n            </svg>\n          </div>\n        </a>\n      </div>\n\n      <div id=\"php-sdk\" class=\"tingg-checkout-sdk\">\n        <a target=\"_blank\" href=\"https://packagist.org/packages/tingg/checkout\">\n          <div class=\"tingg-checkout-sdk-header\">\n            \n            <h3 class=\"tingg-checkout-sdk-title\">\n              <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"32\" width=\"40\" viewBox=\"0 0 640 512\" fill=\"currentColor\"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path d=\"M320 104.5c171.4 0 303.2 72.2 303.2 151.5S491.3 407.5 320 407.5c-171.4 0-303.2-72.2-303.2-151.5S148.7 104.5 320 104.5m0-16.8C143.3 87.7 0 163 0 256s143.3 168.3 320 168.3S640 349 640 256 496.7 87.7 320 87.7zM218.2 242.5c-7.9 40.5-35.8 36.3-70.1 36.3l13.7-70.6c38 0 63.8-4.1 56.4 34.3zM97.4 350.3h36.7l8.7-44.8c41.1 0 66.6 3 90.2-19.1 26.1-24 32.9-66.7 14.3-88.1-9.7-11.2-25.3-16.7-46.5-16.7h-70.7L97.4 350.3zm185.7-213.6h36.5l-8.7 44.8c31.5 0 60.7-2.3 74.8 10.7 14.8 13.6 7.7 31-8.3 113.1h-37c15.4-79.4 18.3-86 12.7-92-5.4-5.8-17.7-4.6-47.4-4.6l-18.8 96.6h-36.5l32.7-168.6zM505 242.5c-8 41.1-36.7 36.3-70.1 36.3l13.7-70.6c38.2 0 63.8-4.1 56.4 34.3zM384.2 350.3H421l8.7-44.8c43.2 0 67.1 2.5 90.2-19.1 26.1-24 32.9-66.7 14.3-88.1-9.7-11.2-25.3-16.7-46.5-16.7H417l-32.8 168.7z\"/></svg>\n              <span>PHP</span>\n            </h3>\n            <p class=\"tingg-checkout-sdk-sub-title\">\n              View\n            </p>\n\n            <svg height=\"24\" viewbox=\"0 0 35 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n              <path d=\"M3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13V11ZM33.7071 12.7071C34.0976 12.3166 34.0976 11.6834 33.7071 11.2929L27.3431 4.92893C26.9526 4.53841 26.3195 4.53841 25.9289 4.92893C25.5384 5.31946 25.5384 5.95262 25.9289 6.34315L31.5858 12L25.9289 17.6569C25.5384 18.0474 25.5384 18.6805 25.9289 19.0711C26.3195 19.4616 26.9526 19.4616 27.3431 19.0711L33.7071 12.7071ZM3 13H33V11H3V13Z\" fill=\"currentColor\"></path>\n            </svg>\n          </div>\n        </a>\n      </div>\n\n      <div id=\"dotnet-sdk\" class=\"tingg-checkout-sdk\">\n        <a target=”_blank” href=\"https://www.nuget.org/packages/Tingg.Checkout.Net\">\n          <div class=\"tingg-checkout-sdk-header\">\n            <h3 class=\"tingg-checkout-sdk-title\">\n              <span>.NET</span>\n            </h3>\n            <p class=\"tingg-checkout-sdk-sub-title\">\n              View\n            </p>\n\n            <svg height=\"24\" viewbox=\"0 0 35 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n              <path d=\"M3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13V11ZM33.7071 12.7071C34.0976 12.3166 34.0976 11.6834 33.7071 11.2929L27.3431 4.92893C26.9526 4.53841 26.3195 4.53841 25.9289 4.92893C25.5384 5.31946 25.5384 5.95262 25.9289 6.34315L31.5858 12L25.9289 17.6569C25.5384 18.0474 25.5384 18.6805 25.9289 19.0711C26.3195 19.4616 26.9526 19.4616 27.3431 19.0711L33.7071 12.7071ZM3 13H33V11H3V13Z\" fill=\"currentColor\"></path>\n            </svg>\n          </div>\n        </a>\n      </div>\n\n  \t\t<!--\n      <div id=\"java-sdk\" class=\"tingg-checkout-sdk\">\n        <a target=”_blank” href=\"https://gitlab.com/cellulant-public/tingg-global-merchants/sdks/java-sdk\">\n          <div class=\"tingg-checkout-sdk-header\">\n            \n            <h3 class=\"tingg-checkout-sdk-title\">\n              <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"32\" width=\"24\" viewBox=\"0 0 384 512\" fill=\"currentColor\">\n  \t\t\t\t\t\t\t<path d=\"M277.7 312.9c9.8-6.7 23.4-12.5 23.4-12.5s-38.7 7-77.2 10.2c-47.1 3.9-97.7 4.7-123.1 1.3-60.1-8 33-30.1 33-30.1s-36.1-2.4-80.6 19c-52.5 25.4 130 37 224.5 12.1zm-85.4-32.1c-19-42.7-83.1-80.2 0-145.8C296 53.2 242.8 0 242.8 0c21.5 84.5-75.6 110.1-110.7 162.6-23.9 35.9 11.7 74.4 60.2 118.2zm114.6-176.2c.1 0-175.2 43.8-91.5 140.2 24.7 28.4-6.5 54-6.5 54s62.7-32.4 33.9-72.9c-26.9-37.8-47.5-56.6 64.1-121.3zm-6.1 270.5a12.2 12.2 0 0 1 -2 2.6c128.3-33.7 81.1-118.9 19.8-97.3a17.3 17.3 0 0 0 -8.2 6.3 70.5 70.5 0 0 1 11-3c31-6.5 75.5 41.5-20.6 91.4zM348 437.4s14.5 11.9-15.9 21.2c-57.9 17.5-240.8 22.8-291.6 .7-18.3-7.9 16-19 26.8-21.3 11.2-2.4 17.7-2 17.7-2-20.3-14.3-131.3 28.1-56.4 40.2C232.8 509.4 401 461.3 348 437.4zM124.4 396c-78.7 22 47.9 67.4 148.1 24.5a185.9 185.9 0 0 1 -28.2-13.8c-44.7 8.5-65.4 9.1-106 4.5-33.5-3.8-13.9-15.2-13.9-15.2zm179.8 97.2c-78.7 14.8-175.8 13.1-233.3 3.6 0-.1 11.8 9.7 72.4 13.6 92.2 5.9 233.8-3.3 237.1-46.9 0 0-6.4 16.5-76.2 29.7zM260.6 353c-59.2 11.4-93.5 11.1-136.8 6.6-33.5-3.5-11.6-19.7-11.6-19.7-86.8 28.8 48.2 61.4 169.5 25.9a60.4 60.4 0 0 1 -21.1-12.8z\"/>\n  \t\t\t\t\t\t</svg>\n              <span>Java</span>\n            </h3>\n            <p class=\"tingg-checkout-sdk-sub-title\">\n              View on GitLab\n            </p>\n\n            <svg height=\"24\" viewbox=\"0 0 35 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n              <path d=\"M3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13V11ZM33.7071 12.7071C34.0976 12.3166 34.0976 11.6834 33.7071 11.2929L27.3431 4.92893C26.9526 4.53841 26.3195 4.53841 25.9289 4.92893C25.5384 5.31946 25.5384 5.95262 25.9289 6.34315L31.5858 12L25.9289 17.6569C25.5384 18.0474 25.5384 18.6805 25.9289 19.0711C26.3195 19.4616 26.9526 19.4616 27.3431 19.0711L33.7071 12.7071ZM3 13H33V11H3V13Z\" fill=\"currentColor\"></path>\n            </svg>\n          </div>\n        </a>\n      </div>\n\t\t\t-->\n\n      <div id=\"python-sdk\" class=\"tingg-checkout-sdk\">\n        <a target=”_blank” href=\"https://pypi.org/project/Tingg/\">\n          <div class=\"tingg-checkout-sdk-header\">\n            \n            <h3 class=\"tingg-checkout-sdk-title\">\n              <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"32\" width=\"28\" viewBox=\"0 0 448 512\" fill=\"currentColor\"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path d=\"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4 .1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8 .1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3 .1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z\"/></svg>\n              <span>Python</span>\n            </h3>\n            <p class=\"tingg-checkout-sdk-sub-title\">\n              View\n            </p>\n\n            <svg height=\"24\" viewbox=\"0 0 35 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n              <path d=\"M3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13V11ZM33.7071 12.7071C34.0976 12.3166 34.0976 11.6834 33.7071 11.2929L27.3431 4.92893C26.9526 4.53841 26.3195 4.53841 25.9289 4.92893C25.5384 5.31946 25.5384 5.95262 25.9289 6.34315L31.5858 12L25.9289 17.6569C25.5384 18.0474 25.5384 18.6805 25.9289 19.0711C26.3195 19.4616 26.9526 19.4616 27.3431 19.0711L33.7071 12.7071ZM3 13H33V11H3V13Z\" fill=\"currentColor\"></path>\n            </svg>\n          </div>\n        </a>\n      </div>\n    </main>"
}
[/block]

# Checkout JavaScript Library

The Checkout JavaScript Library is small  library that makes creating an Express experience (modal / redirect) easier.

> 👍 For the best experience on Express modal checkout we highly recommend the use of this library.

### Installation

Adding the library is as easy as adding a JavaScript tag. Simply add the  CDN link **<https://cdn.cellulant.africa/js/tingg-checkout-library.js>**  via a JavaScript tag. See the example below:

```html HTML
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  
  <body>
    ...
    <script src="https://cdn.cellulant.africa/js/tingg-checkout-library.js"></script>
  </body>
</html>
```

The script adds a **`Tingg`**  object on the browser's **window object**. Accessing **`window.Tingg`** exposes some APIs used to render the Express checkout UI.

### Usage

After the CDN has been included, add a button i.e "PAY NOW" that will trigger a HTTP request to your back-end endpoint that returns a checkout URL.

```html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <main>
      <button id="pay-button" onclick="createCheckoutRequest()">
      PAY NOW!
      </button>
    </main>
    <script src="https://cdn.cellulant.africa/js/tingg-checkout-library.js"></script>
    <script>
      function createCheckoutRequest() {
         // 1. Create your checkout payload
         var payload = {
             customer_first_name: "John",
             customer_last_name: "Doe",
             msisdn: "254700000000",
             account_number: "ref-qwerty",
             request_amount: "100",
             merchant_transaction_id: "1234567890",
             service_code: "<YOUR TINGG SERVICE CODE>",
             country_code: "KEN",
             currency_code: "KES",
             callback_url: "https://webhook.site/...",
             fail_redirect_url: "https://webhook.site/...",
             success_redirect_url: "https://webhook.site/.."
      
         };
         
       	// 2. Create a payment URL on the server
         const req = window.fetch('<YOUR ENCRYPTION ENDPOINT>', {
           method: "POST", 
           body: JSON.stringify(payload)
         });
         
         if (!req.ok) {
         	console.log("Request failed. Payload could not be encrypted...");
           return;
         }
         
         req
           .then(fucntion (resp) {
           	 return resp.json()
         	})
           .then(function (data) {
           		window.Tingg.renderCheckout({            
                 environment: "testing",
                 checkout_type: "modal",
                 checkout_url: {
                   long_url: data.long_url,
                   short_url: data.short_url
                 },
                 onClose: () => {
                   console.log("Close called!");
                   window.Tingg.close();
                 },
                 onSuccess: (data) => {
                   console.log("Success", data);
                 },
                 onFailed: (data) => {
                   console.log("Failed", data);
                 }
               });
           }) 
       }
    </script>
  </body>
</html>
```

> 🚧 For the callback functions to take effect, the **`success_redirect_url`** & **`fail_redirect_url`** need to have the same domain origin with your e-commerce site.
>
> Example: If your e-commerce shop/ site has the domain <https://acme.example/checkout> then the `**success_redirect_url**` and `**fail_redirect_url**` should start with the SAME domain i.e <https://acme.example/...> for the onSuccess and onFailed callbacks to be triggered.

## `onClose()` function

This function is called when the close button is clicked. To close the modal, you'll have to explicitly call **`window.Tingg.close()`** after any business logic.

**NOTE:** **`window.Tingg.close()`** can be called anywhere & at any time you wish to close the modal in your custom pages, components & widgets.

## `onSuccess(data)` function

This function is called when the payment has been fully paid.

## `onFailed(data)` function

This function is called when the checkout request expires without it being fully paid.

Both onSuccess and onFailed receive a single parameter data with the follow fields:

```json
{
    "request_status_code": "178",
    "merchant_transaction_id": "skt3hf-3000.csb.app358",
    "checkout_request_id": 235815,
    "service_code": "JOHNDOEONLINE",
    "account_number": "skt3hf",
    "currency_code": "KES",
    "request_amount": "100",
    "amount_paid": "100.00",
    "payments": '[
        {
          "id": 48019,
          "msisdn": 254700000000,
          "payment_option_transaction_id": "25bb34d4-b4ad-40ae-aa1f-be0909eb2dbb",
          "account_number": "skt3hf",
          "customer_name": "Customer",
          "amount_paid": 100,
          "gateway_transaction_id": "542246309118099456",
          "date_payment_received": "2024-02-05 10:33:16",
          "gateway_overall_status": 139,
          "currency_id": "70",
          "country_id": "117",
          "service_id": "161",
          "payer_narration": "Simulate payment",
          "checkout_request_id": 235815,
          "merchant_receipt": "",
          "receiver_narration": "",
          "date_payment_acknowledged": null,
          "created_at": "2024-02-05 07:33:17",
          "payment_option_id": 1
        }
    ]',
    "failed_payments": "[]",
    "request_date": "2024-02-05 07:32:08",
    "payment_status_description": "Request fully paid",
    "msisdn": 2547000000000,
    "customer_email": "tingg.online@cellulant.io",
    "request_description": "",
    "type": "success"
}
```

| Field                            | Type                       | Description                                                                                                  |
| :------------------------------- | :------------------------- | :----------------------------------------------------------------------------------------------------------- |
| **request\_status\_code**        | **`string`**\|**`number`** | Overall request code indicating the status of the request                                                    |
| **merchant\_transaction\_id**    | **`string`**               | The unique merchant reference for the request you raised for the request as provided in the checkout payload |
| **checkout\_request\_id**        | **`string`**\|**`number`** | A unique identifier on Tingg’s end.                                                                          |
| **service\_code**                | **`string`**               | Unique Tingg code identifying the service the payment request was raised for                                 |
| **account\_number**              | **`string`**               | The reference the customer was paying for as provided in the checkout payload                                |
| **currency\_code**               | **`string`**               | ISO Currency code of the payment made                                                                        |
| **request\_amount**              | **`string`**\|**`number`** | The converted amount for the request raised by the merchant                                                  |
| **amount\_paid**                 | **`string`**\|**`number`** | Amount the customer paid for the request                                                                     |
| **payments**                     | **`array`**                | An array of successful payments made to the request                                                          |
| **failed\_payments**             | **`array`**                | An array of failed payments made to the request                                                              |
| **request\_date**                | **`string`**               | Date when the request was raised in                                                                          |
| **payment\_status\_description** | **`string`**               | Description of the status given back on the overall payment                                                  |
| **msisdn**                       | **`string`**               | The mobile number the person came with from the merchant site                                                |
| **customer\_email**              | **`string`**               | Customer's email address.                                                                                    |
| **request\_description**         | **`string`**               | Shows the description of the item being purchased.                                                           |
| **type**                         | **`string`**               | **`success`** or   **`failed`**                                                                              |

# CMS Plugins

## [WordPress Plugin](https://docs.tingg.africa/docs/checkout-v3-wordpress-plugins)

A WooCommerce plugin that allows businesses to collect from their WordPress shops / store. Read more about it on the [Wordpress Plugins store](https://wordpress.org/plugins/cellulant-tingg-checkout/)

## Shopify

> Coming soon