RESTful Web Services Guide

    RESTful Web Services Guide

    Payment Backend API Documentation

    This document provides a comprehensive reference for the RESTful web services related to the payment backend system. It details available API endpoints, request and response formats, expected behaviors, and error handling.

    Table of Contents

    Login API

    Logs in a user using email and name.

    Method: POST

    API Path

    /auth/login

    Base URL

    https://api.credett.com

    Headers

    Content-Type: application/json

    Authorization

    Bearer {token}

    Request Body

    {
      "email": "example@gmail.com",
      "name": "John Doe"
    }

    Response Body

    {
      "status": "success",
      "message": "User logged in successfully",
      "token": "jwt-token-string"
    }

    Error Responses

    Status Code Message
    400 Invalid email or name
    401 Unauthorized access

    Get All Tokens

    Retrieves all tokens available for the user.

    Method: POST

    API Path

    /txn/get-all-tokens

    Base URL

    https://api.credett.com

    Response Body

    {
      "tokens": [
        "token1",
        "token2"
      ]
    }

    Check Server

    Checks if the server is running.

    Method: GET

    API Path

    /

    Response Body

    {
      "status": "running"
    }

    Create API

    Creates a new API for a merchant.

    Method: POST

    API Path

    /merchant/createapi

    Request Body

    {
      "mid": 1,
      "tokenids": "1",
      "wallet": "0xD7b126d15d3d158dF7a7A90040F5839567C09320"
    }

    Create Token

    Creates a token for a specific network.

    Method: POST

    API Path

    /merchant/createtoken

    Request Body

    {
      "networkid": 80002,
      "networkname": "AMOY CHAIN",
      "tokenname": "USDT"
    }

    Generate Invoice

    Generates an invoice for a transaction.

    Method: POST

    API Path

    /txn/generateinvoice

    Request Body

    {
      "api": "93ed9cc18019c813be0aa402161a3adb",
      "amount": "10",
      "networkid": "11155111"
    }

    Transaction Status

    Checks the status of a transaction.

    Method: POST

    API Path

    /txn/get-txn-status

    Request Body

    {
      "order_id": "1"
    }

    ©2025, Credett. All rights reserved.