Products

This page includes all endpoints available for the products module of Logiciel Actif.

List all products

GET https://app.gem-books.com/api/products

This endpoint allows you to get the list of your products. The products are returned sorted by creation date, with the most recent product appearing first.

Query Parameters

Name
Type
Description

page

integer

The number of the page you wish to see. Default is 1.

per_page

integer

The number of the desired result per page. Default is 20. Maximum values is 100.

Headers

Name
Type
Description

Authentication

string

Bearer token

Accept

string

Should be application/json

{
    "data": [
        {
            "id": 1,
            ...
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 4
    }
}

Retrieve a product

GET https://app.gem-books.com/api/products/:id

This endpoint allows you to get the details of the product.

Path Parameters

Name
Type
Description

id

integer

The ID of the product to retrieve.

Headers

Name
Type
Description

Authentication

string

Bearer token.

Accept

string

Should be application/json.

{
    "data": {
        "id": 1,
        ...
    }
}

Create a product

POST https://app.gem-books.com/api/products

This endpoint allows you to create a product. Returns the created product.

Headers

Name
Type
Description

Authentication

string

Bearer token.

Content-Type

string

Should be application/json.

Accept

string

Should be application/json.

Request Body

Name
Type
Description

code

string

Product code.

category_id

integer

Product categorie id.

name_fr

string

Product french name.

name_en

string

Product english name.

{
    "data": {
        "id": 1,
        ...
    }
}

Body example

{
    "code": "demo",
    "category_id": 1,
    "name_fr": "Produit démo",
    "name_en": "Demo Prodcut"
}

Update a product

PUT https://app.gem-books.com/api/products/:id

This endpoint allows you to update a specific product. Returns the updated product.

Path Parameters

Name
Type
Description

id

integer

Product id to update

Headers

Name
Type
Description

Authentication

string

Bearer token.

Content-Type

string

Should be application/json.

Accept

string

Should be application/json.

{
    "data": {
        "id": 1,
        ...
    }
}

Body example

{
    "name_fr": "Nouveau Produit démo",
    "name_en": "New Demo Prodcut"
}

Last updated