TBNS
  • Welcome to TBNS!
  • Getting Started
    • Quickstart
  • Basics
  • References
    • Get Auth Token
    • Get Partner Details
    • User Management API
    • User Creation API
    • Points Management API
Powered by GitBook
On this page
  • Prerequisites
  • Environments
  • Authentication
  • Creating Users
  • Points Management
  • Best Practices
  • Integration Flow
  1. Getting Started

Quickstart

PreviousWelcome to TBNS!NextReferences

Last updated 4 months ago

TBNS is a powerful loyalty and rewards platform that helps businesses increase customer retention and revenue through a flexible points-based system. This guide will walk you through the basic integration process.

Prerequisites

  • A TBNS account (sign up at partner.tbns.io)

  • Payment information set up

  • Your system's API integration capabilities

Environments

Sandbox Environment

  • Sign up URL:

  • API Base URL:

Production Environment

  • Sign up URL:

  • API Base URL:

Authentication

To get your authentication token, make the following request:

curl --location '.../wf/login' \
--header 'Authorization: Bearer 7d5120b63cf397ef5a72801245231f7f' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "your-email",
    "password": "your-password"
}'

Creating Users

To create a new user in the system:

curl --location '.../obj/user' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "user@example.com",
    "Last Name": "User Last Name",
    "First Name": "User First Name",
    "Tenant List": [
        "YOUR_TENANT_ID"
    ],
    "User Type": "User"
}'

Important: Save the returned user ID for future point assignments.

Points Management

Creating Points

You can create points with an initial "Open" status:

curl --location '.../obj/point_mint_history' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "Tenant": "YOUR_TENANT_ID",
    "Tenant_Subid": "YOUR_SUB_ID",
    "Amount": 50,
    "User_View_Text": "Points description",
    "User": "USER_ID",
    "Status": "Open"
}'

Approving Points

To approve pending points, use the PATCH endpoint:

curl --location --request PATCH '.../obj/point_mint_history/MINT_ID' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "Status": "Approved"
}'

Important Note: Once points are approved, their status cannot be changed.

Best Practices

  1. Authentication

    • Store authentication tokens securely

    • Implement token refresh mechanisms

    • Handle authentication errors appropriately

  2. User Management

    • Store user IDs in your system

    • Validate user creation responses

    • Maintain proper tenant associations

  3. Points System

    • Implement proper error handling for point creation

    • Keep track of point mint IDs

    • Consider implementing a queue system for point approval

    • Remember that approved points cannot be modified

Integration Flow

  1. Authenticate with the system

  2. Create user accounts as needed

  3. Generate points in "Open" status

  4. Approve points when appropriate

  5. Monitor point status changes

https://app.tbns.io/sign_up?v=tenant
https://app.tbns.io/version-test/api/1.1
https://app.tbns.io/sign_up?v=tenant
https://app.tbns.io/api/1.1