Skip to content

Product List

Products are the list of things that have well defined unit price.

Endpoint

sh
> GET ${BASE_URL}/product-list

Sample Request

sh
$  curl -H 'Content-Type: application/json' \
        -H 'x-api-token: ACCESS_TOKEN' \
        "BASE_URL/product-list"
Typescript
import * as axios from "axios";

axios
  .get("BASE_URL/product-list", {
    headers: {
      "Content-Type": "application/json",
      "x-api-token": "ACCESS_TOKEN"
    },
  })
  .then((response) => {
    console.log("Success:", response.data);
  })
  .catch((error) => {
    console.error(
      "Error:",
      error.response ? error.response.data : error.message,
    );
  });

Response Schema

Success: 200

ts
{
  success: boolean;
  message: string;
  statusCode: number;
  data: Array<{
    id: number;
    createdAt: string;
    updatedAt: string;
    productName: string;
    description: string;
    pricingType: 'COMISSION' | 'SERVICE_FEE';
    status: string;
    productCategory: {
      categoryName: string;
    };
    productPrice: {
        amount: number;
    };
  }>;
  meta: {
    itemsPerPage: number;
    totalItems: number;
    currentPage: number;
    totalPages: number;
    sortBy: Array<Array<string>>;
    filter: {
      'allowedProducts.partnerCompanyId': string;
    };
  };
  links: {
    current: string;
  };
};

Error: 404

ts
{
  statusCode: number;
  success: boolean;
  message: string;
  data: any;
}

Sample Response

json
{
    "success": true,
    "message": "Successful",
    "statusCode": 200,
    "data": [
        {
            "id": 1,
            "createdAt": "2025-01-24T06:59:02.290Z",
            "updatedAt": "2025-02-07T07:22:58.000Z",
            "productName": "Airtime",
            "description": null,
            "metadata": null,
            "pricingType": "COMISSION",
            "status": "ACTIVE",
            "productCategory": {
                "categoryName": "Airtime"
            },
            "productPrice": {
                "amount": "0.000000"
            }
        }
    ],
    "meta": {
        "itemsPerPage": 20,
        "totalItems": 13,
        "currentPage": 1,
        "totalPages": 1,
        "sortBy": [
            [
                "id",
                "DESC"
            ]
        ]
    },
    "links": {
        "current": "https://api.telesend.et/api/v1/client/product-list?page=1&limit=20&sortBy=id:DESC"
    }
}