# Introduction

This documentation will help you understand how you can interact with GEM-BOOKS and GEM-CAR by using our REST API. With this API, you will be able to get, update and add data to the system.

### Documentation

The API is organized around the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) standard. It is the recommended way to interact with your data.\
To begin the integration, you should start by understanding the `Authentification`process in the menu from the same name. \
All endpoints available are listed in the `Resources` menu. \
The objects returned from the endpoint are listed in the `Objects` menu.

### JSON returned

Every call to an endpoint will return a JSON object. \
The object will always contain the `success` value which will either be `false` or `true`. \
If `success` is `true`, the data will be contained in the `data` value.\
If `success` is `false`, the error will be contained in the `error` value.


# Authentication

This page explains the authentication process required to make a call to any endpoint.

To authenticate a request, you must include an `Authorization` header like so:

```http
Authorization: Bearer {your_key}
```

The Bearer token is generated inside GEM-SUITE. Every user that have access to GEM-SUITE have their specific token accessible in the user management section. To access these tokens, you need to be logged in as the account's manager (user that created the system). The bearer token has the same rights to the data as the user linked to the token. For example, if you use a token of a user who does not have the right to add new transactions, the `create transaction` endpoint will not be accessible.

To create a Bearer token, you must access the platform with an administrator account or an account that has the rights to modify other access. On the top right of the home screen, click on your name, and then click on `Actif account management` (`Users management` if not an administrator account). Then, click on the `Users` tab. You will now need to choose which access will be linked to the token. This is important because actions made through this token will be considered as if made by the user selected. The rights of the token will also be dictated by the role linked to the user selected. Once you have chosen the user, click on it. The token will be displayed in the `REST API access key` field.


# Resources

All API access is executed over HTTPS. All data is sent and received as JSON.

### Base URL production

`https://app.gem-books.com/api`

## Delete endpoint

In Logiciel Actif, they are no delete endpoint. All information is stocked with a status active or inactive.


# Company

This page includes all endpoints available for the company information.

## List all branches

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/company`

This endpoint allows you to get the list of your branches.\
The branches are returned, sorted by name (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | string | The number of page you wish to see. Default is 1.                        |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | string | Should be `application/json`. |
|                                                  |        |                               |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 1,
            "nom": "LOS POLLOS HERMANOS",
            "other_nom": "LPH ALBUQUERQUE",
            "no_entreprise": "0123456789",
            "no_entreprise_prov": "NEQ123456",
            "date_debut": null,
            "adresse": "197 rue sainte-therese a",
            "ville": "Charlemagne",
            "country": 1,
            "prov": "QC",
            "cp": "J5Z 1B7",
            "tel": "5147941744",
            "email": "fsam@v2v.ca",
            "fax": "",
            "neq": "",
            "autoserve1_id": "",
            "km_mile": 0,
            "punch_choices": 2,
            "rate_km": "0.00",
            "timezone": "America/New_York",
            "date_format": 1,
            "time_format": 20,
            "default_selected_signature_pad": "T-S460",
            "timeout": "15",
            "uppercase": 1,
            "force_sms": 0,
            "auto_code": 0,
            "auto_code_clients": 1,
            "auto_code_suppliers": 0,
            "hide_menu_promo": 0,
            "attributs": 1,
            "send_confirmation": 0,
            "use_client_account": 0,
            "avoid_highways": 0,
            "avoid_tolls": 0,
            "avoid_ferries": 0,
            "notUseAi": 0,
            "notApplyPriceList": 0,
            "prevent_price_update": 0,
            "zendesk_hide": 0,
            "succursales": 0,
            "details": 0,
            "scheduler_dates": 0,
            "login_bg": "/images/info/dark_desolate_landscape_wallpaper.jpg",
            "logo": "/images/info/gemcar-logo.png",
            "logo_menu": "",
            "invoice_logo": "/images/info/lego_logo.svg-2.png",
            "facture_model": 4,
            "soumission_model": 10,
            "color_model": "#ffa8a8",
            "bondelivraison_model": 11,
            "commande_model": 18,
            "reception_model": 21,
            "statement_model": 57,
            "email_model": 48,
            "workorder_model": 189,
            "tire_storage_model": 225,
            "location_embarcation_model": 223,
            "cheque_model": 1,
            "cheque_date_format": "DDMMYYYY",
            "cheque_date": 0,
            "cheque_number": 0,
            "custom_menu": 0,
            "custom_menu_name": "",
            "custom_menu_link": "",
            "fields_overrides": 0,
            "text_overrides": 0,
            "inventory_method": "1",
            "unites": 0,
            "decimal_qte": 0,
            "four_decimals": 0,
            "four_decimals_qty": 0,
            "inventaire_auto": 0,
            "max_achat": "0.00",
            "consigne": 84,
            "only_qte_purchases": 0,
            "secure_purchase": 0,
            "consigne_good": 0,
            "use_billing_address": 0,
            "auto_print_purchase": 0,
            "compte_comptant": 114,
            "compte_pourboire": 153,
            "default_product_id": 7,
            "default_client": 1,
            "default_job_rate": "75.99",
            "appointment_offset": "0.25",
            "default_service_reminder": 0,
            "default_service_franchise": 33,
            "clients_excluded": "6",
            "default_service_deposit": 96,
            "default_service_deposit_notax": 101,
            "shipping_cost_account": 323,
            "cash_round": "0.05",
            "table_terminals": 0,
            "shop_product": 0,
            "categorie_excluded": "",
            "shop_mo": "0.00",
            "shop_parts": "0.00",
            "shop_min": "0.00",
            "shop_max": "0.00",
            "shop_margin": "0.00",
            "shop_auto": 1,
            "no_vehicle": 0,
            "always_succ_taxes": 0,
            "correct_taxes": 0,
            "default_po_client": 0,
            "recurrents_only_invoices": 0,
            "rebate_display": 0,
            "only_qte": 0,
            "prevent_verification_price": 0,
            "invoice_show_rate": 1,
            "term_ventes": 0,
            "block_missing_inventory": 0,
            "client_counter_auto": 0,
            "sale_no_car_question": 0,
            "invoice_show_hours": 1,
            "cup_ventes": 1,
            "use_multiple_qte": 0,
            "use_multiple_qte2": 0,
            "hide_client_liv": 0,
            "vente_hide_taxes": 0,
            "vente_hide_esc": 1,
            "vente_hide_produit": 0,
            "vente_show_4": 0,
            "soumission_signature": 1,
            "facture_signature": 1,
            "total_string": 1,
            "group_product_purchase": 0,
            "add_vente_to_purchase": 0,
            "block_affacturage": 0,
            "auto_print_facture": 1,
            "auto_print_soumission": 1,
            "auto_print_workorder": 1,
            "envoi_email_soumission": 1,
            "envoi_email_facture": 1,
            "title_totals": 1,
            "notifications_auto_client": 0,
            "notifications_auto_users": 0,
            "last_sale": 0,
            "odometer_in": 1,
            "odometer_in_required": 1,
            "unsync_jobs": 0,
            "pos_hours": 1,
            "multiple_close": 0,
            "override_num_fact": 0,
            "override_num_fact_term": "Devis",
            "block_closings": 0,
            "auto_open_recall": 0,
            "retirer_code_client": 0,
            "send_close": 0,
            "send_close_emails": "nomistim9000@gmail.com",
            "fixed_job_qty": 0,
            "no_repeat_subheader": 1,
            "hide_price_proposed": 0,
            "no_rec_empty": 0,
            "prevent_date": 1,
            "no_product_code": 0,
            "authorize_receivable": 1,
            "secure_invoice": 0,
            "delivery_no_inventory": 0,
            "total_round": 0,
            "is_delivered": 0,
            "show_inventory_loc": 0,
            "hide_returns": 0,
            "print_invoice_copy": 0,
            "no_dept_associated": 1,
            "allow_unavailable_qty_delivery": 1,
            "display_po_number_in_email_subject": 1,
            "display_schedule_date_on_invoice": 0,
            "display_cash_account_balances": 0,
            "show_warranty": 0,
            "new_pos": 0,
            "custom_title_on": 1,
            "custom_titles": "Estimé, Contrat, Budgétaire, Soumission budgétaire",
            "taxes_rules_id": 8,
            "taxes_report_id": 1,
            "tax_adjustments": 0,
            "tax_period": 1,
            "taxes": 0,
            "devises": 0,
            "checking_account": 630,
            "compte_benefice": 685,
            "issued_invoices_account": 32,
            "received_invoices_account": 41,
            "compte_credit": 2,
            "compte_cartes": 19,
            "compte_recevable": 637,
            "compte_payable": 655,
            "compte_esccl": 40,
            "compte_escfo": 49,
            "compte_transitoire": 780,
            "compte_comm": 148,
            "compte_acquisition": "96",
            "compte_variable": "41",
            "compte_cashround": 114,
            "start_date": "2024-12-01",
            "term": 37,
            "termf": 0,
            "current_period_delay_in": 30,
            "next_period_1_in": 37,
            "next_period_2_in": 45,
            "next_period_3_in": 60,
            "next_period_4_in": 90,
            "current_period_delay_out": 7,
            "next_period_1_out": 14,
            "next_period_2_out": 21,
            "next_period_3_out": 28,
            "next_period_4_out": 35,
            "igrf": 0,
            "transaction_colonnes": 1,
            "activate_coupon": 1,
            "generate_marchand": 1,
            "coupon_thermal": 0,
            "coupon_thermal_type": 1,
            "coupon_width": 80,
            "coupon_height": 297,
            "nb_payes": 52,
            "paye_banque": 114,
            "paye_salaire": 16,
            "compte_csst_payer": 19,
            "compte_fss": 13,
            "compte_cnt": 13,
            "compte_ftq": 149,
            "compte_deplacement": 63,
            "paye_remiseP": 18,
            "no_paye_prov": "",
            "paye_remiseF": 17,
            "no_paye_fed": "",
            "employer_qc_id": "1245678904",
            "num_preparateur": "",
            "num_preparateur_fed": "",
            "num_preparateur_tel": "",
            "num_sequence_xml": 12345678,
            "vacance_percent": "4.00",
            "maladie_percent": "0.80",
            "use_punch_paie": 0,
            "zip_payment": 1,
            "nas_pwd": 0,
            "bday_pwd": 1,
            "table_taux_paye": 0,
            "calendars": 0,
            "login_link": "https://farid.gem-books.com/?system_id=NrsqmrOeUbsIHQHEEcTcdKt56jGa5w88ZQ0TNyxTPyU%3D",
            "signup_link": "https://farid.gem-books.com/externe/signup.html?system_id=NrsqmrOeUbsIHQHEEcTcdKt56jGa5w88ZQ0TNyxTPyU%3D",
            "calendar_link": "https://farid.gem-books.com/externe/calendar.html?system_id=NrsqmrOeUbsIHQHEEcTcdKt56jGa5w88ZQ0TNyxTPyU%3D",
            "review_link": 0,
            "mailchimp_key": "3947794b5944914fbe85236ff1033fe5-us1",
            "mailchimp_listid": "255be16f45",
            "payment_merchants": 0,
            "payment_prevent_email": 0,
            "tracking_instructions": 0,
            "trackingID": 4,
            "tracking_username": "simon.provencher",
            "tracking_password": "201LJPD!",
            "tracking_server": "my.geotab.com",
            "tracking_database": "Transport_Lou_Mac",
            "tracking_key": "74CC5BC82121F5B02578348919B91E0D",
            "tracking_goroute": 0,
            "tracking_users": 0,
            "progisync_instructions": 0,
            "progisync_username": "",
            "progisync_password": "",
            "autopro_instructions": 0,
            "autopro_url": "autoprodev.digitalweb.solutions",
            "autopro_key": "=boX;&ruXF;=9<HQ#Z7m63N+xv}GtSWjzr0",
            "rest_instructions": 0,
            "rest_webhook": "https://64.187.182.47/api/webhooks/gemsuite/demodb11",
            "rappel": 7,
            "delete_date": 6,
            "delete_date_client": 0,
            "doc_see_all": 0,
            "note_adminuser": "<p>Voici vos documents! (rh)</p>",
            "note_client": "<p>Voci vos documents (client)!</p>",
            "default_charge_de_compte": 0,
            "client_type": 1,
            "is_a_client": 0,
            "adress_required": 0,
            "enable_reviews_tracking": 1,
            "reviews_tracking_interval": 1,
            "reviews_tracking_interval_period": 3,
            "reviews_tracking_link_google": "",
            "facebook_token": "",
            "reviews_tracking_link_facebook": "",
            "instagram_token": "",
            "product_service_letter": 0,
            "default_pm": 0,
            "tasks_manager": "205",
            "tasks_tester": "205",
            "project_template": "",
            "tasks_default": "",
            "all_users_projets": 0,
            "projet_invoice_note": 0,
            "task_keep_status": 0,
            "tache_time": 0,
            "auto_code_projets": 1,
            "auto_projets": 0,
            "choisir_type_travaux": 0,
            "not_billable": 0,
            "lock_tasks": 0,
            "lock_assign": 0,
            "task_client_required": 0,
            "website_domain": "gem-logiciel-garage.com",
            "website_link": "https://site.farid.gem-books.com/actif_farid",
            "website_ns1": "3.162.3.47",
            "website_model": 179,
            "website_theme_color": "#7af202",
            "website_facebook": "www.google.com",
            "website_instagram": "www.google.com",
            "website_linkedin": "www.google.com",
            "website_twitter": "www.google.com",
            "website_youtube": "",
            "website_tiktok": "",
            "google_analytics": "",
            "recaptcha_site_key": "",
            "recaptcha_private_key": "",
            "google_places_id": "",
            "google_maps_api_key": "",
            "website_banner": "",
            "website_cta": "",
            "website_about": "",
            "website_shop": "/images/info/image004-1.jpg",
            "website_favicon": "/765dc4ae84bc9e91789cced7629424c8/7a5f59fcf7608b2719b80c8a9c506fae/favicon.ico",
            "website_logo1": "/images/info/captureerreur.png",
            "website_logo2": "/images/info/la-parasis-inc.jpg",
            "website_intro_text1": "<p><em>banner </em>text <strong>test 1</strong></p>",
            "website_intro_text2": "<p>this is a test <strong>yo</strong>!</p>",
            "website_services_intro": "<p>Services - Intro/Text</p>",
            "website_cta_header": "<p>Call to action - Intro</p>",
            "website_cta_text": "<p>Call to action - Text</p>",
            "website_about_intro": "<p>About us - Intro</p>",
            "website_about_text": "<p>About us - Text</p>",
            "website_footer_text": "<p>Footer - Text</p>",
            "website_terms": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae pretium tortor. Pellentesque consequat tempus dolor in vestibulum. Sed ut commodo urna, et gravida erat. Proin nec sodales tellus. Vivamus quis eros in urna vehicula ornare. Suspendisse tincidunt, mauris et interdum porta, enim sem pulvinar lorem, vel consectetur sapien magna lacinia nisl. Praesent sed vehicula metus. Pellentesque nisl ex, bibendum eget lectus pharetra, faucibus euismod arcu. Nam rutrum mi id ullamcorper elementum.</p><p>Duis faucibus non nisl ut efficitur. Maecenas at nisl posuere, congue est et, porta elit. Duis scelerisque vehicula ligula sit amet convallis. Nam facilisis consectetur diam eu rutrum. Pellentesque porta libero et leo vestibulum, sed suscipit mi interdum. Suspendisse eu sollicitudin odio, sit amet consequat eros. Suspendisse tincidunt dapibus orci vitae vulputate. Aliquam eget odio ante. Curabitur aliquet accumsan ante, hendrerit ultricies sem lacinia id. Nulla facilisi. Sed eget turpis hendrerit orci gravida accumsan.</p><p>Aliquam erat volutpat. Sed ut risus pellentesque, feugiat quam vel, maximus nulla. Fusce varius ante eget nibh aliquet, at dapibus leo blandit. Pellentesque laoreet mauris augue, et fringilla sapien scelerisque a. Proin tempus massa tellus, quis pretium odio molestie eu. Phasellus sodales neque non diam fermentum tincidunt. Suspendisse hendrerit laoreet eros at accumsan. Vestibulum commodo vel nisl sed tempor. Ut aliquet sapien a odio tincidunt semper. Suspendisse semper eleifend elit a ullamcorper. Aliquam sapien felis, lobortis in magna id, volutpat rhoncus sem. Aliquam at elementum metus. Etiam et efficitur quam, id accumsan nulla.</p><p>Phasellus placerat lobortis euismod. Donec pharetra diam vel tortor congue, id varius mi posuere. Sed sed convallis ex, a cursus diam. Nulla viverra nisl est, in euismod purus eleifend in. Praesent ante neque, vulputate eu mi sed, feugiat porttitor magna. Vestibulum ac nisl sed nibh tempus sagittis ut at dui. Vivamus lobortis porta nulla, eget mattis sapien sodales sit amet. Sed ut nisl nisl.</p><p>Nullam nec magna eros. In varius eget urna at pulvinar. Cras id vehicula lorem. Cras porttitor tempor augue, sit amet tempus neque. Quisque at sapien a nunc gravida suscipit. Nam lobortis eros sed vehicula pharetra. Vivamus lacinia nisi vitae massa tempus elementum.</p><p></p>",
            "website_conf": "",
            "website_langs": "1,2",
            "website_abouts": "analysis",
            "website_rdv_notifiers": "205,632,709",
            "enable_privacy_warning": 0,
            "enable_external_appointment_button": 1,
            "shop_image": "/images/info/213970263_10159005829846144_8479644790577451652_n.jpg",
            "website_css": "*{\r\n color:red;\r\n}",
            "use_gem_portal": 1,
            "use_gem_payment": 103,
            "website_shipping": 0,
            "gemportal_use_video_banner": 0,
            "gemportal_banner1": "",
            "gemportal_banner2": "",
            "gemportal_banner3": "",
            "gemportal_logo": "",
            "gemportal_favicon": "",
            "gemportal_title": "",
            "gemportal_button": "",
            "gemportal_desc": "",
            "gemportal_features1": "",
            "gemportal_features2": "",
            "gemportal_features3": "",
            "gemportal_features1_title": "BIENVENU SUR MON SITE 1",
            "gemportal_features2_title": "BIENVENU SUR MON SITE 2",
            "gemportal_features3_title": "BIENVENU SUR MON SITE 3",
            "gemportal_features1_desc": "<h3>Texte 1 – Votre destination de magasinage en ligne</h3><p>Bienvenue sur notre boutique en ligne, votre destination de confiance pour découvrir une sélection de produits soigneusement choisis. Nous mettons tout en œuvre pour vous offrir une expérience d'achat simple, rapide et sécurisée. Que vous recherchiez les dernières nouveautés ou des articles essentiels du quotidien, notre catalogue est conçu pour répondre à vos besoins avec un excellent rapport qualité-prix.</p>",
            "gemportal_features2_desc": "<h3>Texte 2 – Qualité, service et satisfaction</h3><p>Notre priorité est votre satisfaction. C'est pourquoi nous sélectionnons nos produits selon des critères rigoureux de qualité, de fiabilité et de performance. Grâce à notre plateforme conviviale, vous pouvez parcourir nos collections, comparer les produits et effectuer vos achats en toute confiance. Notre équipe demeure disponible pour répondre à vos questions et vous accompagner avant, pendant et après votre commande.</p>",
            "gemportal_features3_desc": "<h3>Texte 3 – Une expérience d'achat moderne</h3><p>Nous croyons que le commerce en ligne doit être pratique, transparent et accessible à tous. Notre boutique est conçue pour vous permettre de trouver rapidement les produits qui vous intéressent et de profiter d'un processus de commande efficace. Avec des descriptions détaillées, des options de paiement sécurisées et une livraison fiable, nous nous engageons à vous offrir une expérience d'achat agréable à chaque visite.</p>",
            "gemportal_about": "<h3>À propos de nous</h3><p>Bienvenue sur notre boutique en ligne. Depuis notre création, nous avons pour mission d'offrir à nos clients une expérience d'achat simple, agréable et sécurisée. Nous sélectionnons avec soin chacun de nos produits afin de proposer des articles de qualité répondant aux attentes et aux besoins de notre clientèle.</p><p>Nous croyons que le commerce en ligne doit allier confiance, transparence et excellence du service. C'est pourquoi nous nous engageons à fournir des descriptions précises, des prix compétitifs et un accompagnement attentif tout au long du processus d'achat.</p><p>Notre équipe travaille chaque jour pour enrichir notre catalogue, améliorer votre expérience de navigation et assurer un service à la clientèle réactif. Que vous effectuiez votre première commande ou que vous soyez un client fidèle, votre satisfaction demeure au cœur de nos priorités.</p><p>Merci de votre confiance et de faire partie de notre communauté. Nous sommes heureux de vous accompagner dans chacun de vos achats et espérons vous offrir une expérience à la hauteur de vos attentes.</p>",
            "gemportal_legal": "<h3>Mentions légales</h3><p><strong>Dernière mise à jour :</strong> Juin 2026</p><p>Le présent site web est exploité par <strong>[Nom de l'entreprise]</strong>. En accédant à ce site et en l'utilisant, vous acceptez les présentes mentions légales ainsi que les conditions d'utilisation applicables.</p><h4>Informations sur l'entreprise</h4><ul><li><strong>Nom de l'entreprise :</strong> [Nom de l'entreprise]</li><li><strong>Adresse :</strong> [Adresse complète]</li><li><strong>Téléphone :</strong> [Numéro de téléphone]</li><li><strong>Courriel :</strong> [Adresse courriel]</li><li><strong>Numéro d'entreprise :</strong> [NEQ / Numéro d'enregistrement]</li></ul><h4>Propriété intellectuelle</h4><p>L'ensemble du contenu présent sur ce site, incluant notamment les textes, images, logos, graphiques, icônes, vidéos et éléments visuels, est protégé par les lois applicables en matière de propriété intellectuelle. Toute reproduction, distribution, modification ou utilisation sans autorisation écrite préalable est interdite.</p><h4>Produits et informations</h4><p>Nous nous efforçons de fournir des informations exactes et à jour concernant les produits présentés sur notre boutique en ligne. Toutefois, des erreurs ou omissions peuvent survenir. Nous nous réservons le droit de modifier les descriptions, les prix, les promotions ou la disponibilité des produits sans préavis.</p><h4>Limitation de responsabilité</h4><p>Dans la mesure permise par la loi, nous ne pourrons être tenus responsables des dommages directs ou indirects résultant de l'utilisation ou de l'impossibilité d'utiliser ce site, incluant notamment les pertes de données, interruptions de service ou préjudices financiers.</p><h4>Protection des renseignements personnels</h4><p>Nous accordons une grande importance à la protection de votre vie privée. Les renseignements personnels recueillis par l'intermédiaire de ce site sont traités conformément à notre politique de confidentialité et aux lois applicables en matière de protection des renseignements personnels.</p><h4>Liens externes</h4><p>Le site peut contenir des liens vers des sites web tiers. Nous n'exerçons aucun contrôle sur le contenu ou les pratiques de ces sites et déclinons toute responsabilité à leur égard.</p><h4>Droit applicable</h4><p>Les présentes mentions légales sont régies par les lois applicables de la province de Québec et les lois fédérales du Canada applicables. Tout litige relatif à l'utilisation du site sera soumis à la compétence des tribunaux du Québec.</p><h4>Contact</h4><p>Pour toute question concernant ces mentions légales, veuillez communiquer avec nous à :</p><p><strong>[Nom de l'entreprise]</strong><br /><strong>Courriel :</strong> [Adresse courriel]<br /><strong>Téléphone :</strong> [Numéro de téléphone]<br /><strong>Adresse :</strong> [Adresse complète]</p>",
            "gemportal_conditions": "",
            "gemportal_politics": "",
            "pbx_instructions": 0,
            "pbx_enabled": 1,
            "pbx_hostname": "pbx.gem-car.ca",
            "pbx_port": 9999,
            "pbx_username": "scopserv-api",
            "pbx_secret": "scopserv",
            "pbx_answered_only": 0,
            "smtp_account": 0,
            "sms_email": "nomistim9000@gmail.com",
            "sms_phone": "5147941744",
            "signature": "",
            "roles": 0,
            "override_ac_cars": 0,
            "override_ac_cars_term": "Charrue",
            "vin_required": 0,
            "default_cars": 1,
            "default_product_cars": 14,
            "appointment_overlap_threshold": "0.00",
            "appointment_allow_midnight": 0,
            "restrict_bays": 0,
            "score_minimum_prospect": 60,
            "dealer_license": "",
            "supplier_for_trade_ins": 0,
            "default_account_tradeins": 114,
            "default_account_mvc": 0,
            "default_product_balance": 0,
            "default_account_purchase_fees": 3,
            "default_account_transportation_fees": 4,
            "default_account_exchange_vehicule": 2,
            "enable_bill_to_carlot": 0,
            "carlot_default_order_by": "brand",
            "carlot_default_order_direction": "DESC",
            "carlot_default_calendar_view": 0,
            "carlot_default_package": 16,
            "default_financing_rate": "0.00",
            "default_financing_term": 0,
            "default_financing_payment_frequency": "",
            "base_financing_fees": "0.00",
            "disable_website_financing_calculator": 0,
            "disable_website_vehicle_financing_banner": 0,
            "dealer_homepage_about_title": "",
            "dealer_homepage_about_text": "",
            "dealer_homepage_financing_title": "",
            "dealer_homepage_financing_text": "",
            "dealer_financing_page_title": "",
            "dealer_financing_page_text": "",
            "fni_webslug_prefix": "",
            "fni_webslug_suffix": "",
            "gem_fni_home_bg": "",
            "gem_fni_about_img": "",
            "default_no_vehicle_images_img": "",
            "inventory_data_syncs_enabled": 1,
            "kijiji_sync_enabled": 0,
            "kijiji_sync_dealer_id": "",
            "kijiji_sync_host": "",
            "kijiji_sync_user": "",
            "kijiji_sync_pw": "",
            "cargurus_sync_enabled": 0,
            "cargurus_sync_dealer_id": "",
            "autotraderca_sync_enabled": 0,
            "autotraderca_sync_host": "",
            "autotraderca_sync_user": "",
            "autotraderca_sync_pw": "",
            "autotraderca_sync_filename": "",
            "adws_sync_enabled": 0,
            "adws_dealer_id": "",
            "adws_host": "",
            "adws_user": "",
            "adws_password": "",
            "d2c_sync_enabled": 0,
            "d2c_host": "",
            "d2c_user": "",
            "d2c_password": "",
            "window_sheet_model": 209,
            "retail_vehicle_sale_contract_model": 212,
            "system_id": 99598
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 100,
        "total": 1
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Campaigns

Marketing Campaigns

## List all campaigns

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`campaigns

This endpoint allows you to get the list of your campaigns.\
The campaigns are returned, sorted by code (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | string | The number of page you wish to see. Default is 1.                        |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 19,
            "name": "Votre opinion compte pour nous",
            "active": 1,
            "date_start": "2024-12-01",
            "date_end": "0000-00-00",
            "client_type": "0",
            "client_lead": "",
            "clent_reference": "",
            "client_labels": "",
            "client_needs": "",
            "client_notes": "",
            "has_entreposages": 0,
            "type": "sms",
            "automatic": 1,
            "automatic_type": 2,
            "automatic_value": 1,
            "image": "",
            "subject": "Votre rendez-vous arrive à grand pas  ",
            "content": "<p>Bonjour {client},<br /><br />Votre rendez vous pour le véhicule {car} est prévu pour le {date}.<br />Si vous n'êtes pas dans la possibilité de vous présenter à votre rendez-vous, il serait apprécié de nous appeler afin de nous en informer.</p>",
            "history": [],
            "history_sms": [],
            "system_id": 99598
        },
        {
            "id": 18,
            "name": "",
            "active": 1,
            "date_start": "0000-00-00",
            "date_end": "0000-00-00",
            "client_type": "0",
            "client_lead": "",
            "clent_reference": "",
            "client_labels": "",
            "client_needs": "",
            "client_notes": "",
            "has_entreposages": 0,
            "type": "social_medias",
            "automatic": 1,
            "automatic_type": 1,
            "automatic_value": 0,
            "image": "",
            "subject": "Votre opinion compte pour nous",
            "content": "<p>Bonjour {client},<br /><br />Suite à votre rendez-vous récent, nous aimerions avoir votre opinion sur notre service.<br />S'il est possible pour vous de prendre quelques minutes pour nous écrire sur notre page Google, cela serait grandement apprécié.</p>",
            "history": [
                {
                    "id": 341,
                    "date": "2024-11-08 11:01:13",
                    "subject": "",
                    "from": "noreply@gem-books.com",
                    "to": "nomistim9000@gmail.com",
                    "cc": "",
                    "html": "",
                    "attachement": "0",
                    "clientID": 1,
                    "idmessage": null,
                    "date_read": null,
                    "system_id": 99598
                },
                {
                    "id": 340,
                    "date": "2024-11-08 11:00:58",
                    "subject": "",
                    "from": "noreply@gem-books.com",
                    "to": "koko@gmail.com",
                    "cc": "",
                    "html": "",
                    "attachement": "0",
                    "clientID": 4,
                    "idmessage": null,
                    "date_read": null,
                    "system_id": 99598
                }
            ],
            "history_sms": [],
            "system_id": 99598
        },
```

{% endtab %}
{% endtabs %}

## Retrieve a campaign

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`campaigns`/:id`

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

#### Path Parameters

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| id   | string | The ID of the campaign to retrieve |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 5,
        "name": "Promotion d'été",
        "active": 1,
        "date_start": "0000-00-00",
        "date_end": "0000-00-00",
        "client_type": "0",
        "client_lead": "",
        "clent_reference": "",
        "client_labels": "",
        "client_needs": "",
        "client_notes": "",
        "has_entreposages": 0,
        "type": "emails",
        "automatic": 1,
        "automatic_type": 1,
        "automatic_value": 0,
        "image": "/3e6cd3f05ff70b01e90dba20caefbb1e/3c265d2c37ffab0e768c4a32b834f202/aquisauto_footer_2.avif",
        "subject": "Votre opinion compte pour nous",
        "content": "<p>Bonjour {client},<br /><br />Suite à votre rendez-vous récent, nous aimerions avoir votre opinion sur notre service.<br />S'il est possible pour vous de prendre quelques minutes pour nous écrire sur notre page Google, cela serait grandement apprécié.</p>",
        "history": [],
        "history_sms": [],
        "system_id": 99598
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a campaign&#x20;

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/`campaigns

This endpoint allows you to create a campaign.\
Returns the created campaign.

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |
| Content-type   | string | Should be `application/json`. |

#### Request Body

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| code | string | Code of campaign |
| name | string | Name of campaign |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "name": "Promotion d'hiver",
        "active": 1,
        "date_start": "0000-00-00",
        "date_end": "0000-00-00",
        "client_type": "0",
        "client_lead": "",
        "clent_reference": "",
        "client_labels": "",
        "client_needs": "",
        "client_notes": "",
        "has_entreposages": 0,
        "type": "emails",
        "automatic": 1,
        "automatic_type": 1,
        "automatic_value": 0,
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Update a campaign

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/`campaigns`/:id`

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

#### Path Parameters

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| id   | string | ID of campaign to update |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |
| Content-type   | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 404,
        "name": "Promotion d'automne",
        "active": 1,
        "date_start": "0000-00-00",
        "date_end": "0000-00-00",
        "client_type": "0",
        "client_lead": "",
        "clent_reference": "",
        "client_labels": "",
        "client_needs": "",
        "client_notes": "",
        "has_entreposages": 0,
        "type": "emails",
        "automatic": 1,
        "automatic_type": 1,
        "automatic_value": 0,
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Branches

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

## List all branches

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/branches`

This endpoint allows you to get the list of your branches.\
The branches are returned, sorted by name (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | string | The number of page you wish to see. Default is 1.                        |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 2,
            "name": "Branch 2",
            "status": 1
        },
        {
            "id": 1,
            "name": "Logiciel Actif Inc",
            "status": 1
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a branch

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/branches/:id`

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

#### Path Parameters

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| id   | string | The ID of the resource to retrieve |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 1,
        "name": "Logiciel Actif Inc",
        "status": 1
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Clients

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

## List all clients

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/clients`

This endpoint allows you to get the list of your clients. \
The clients are returned sorted by code (A-Z).

#### 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 is 100. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 2088,
            "code": "TEST1",
            "name": "TEST1",
            "inactive": 0,
            "creation_date": "2020-08-17",
            "address": "",
            "adresse2": "",
            "city": "",
            "state": "QC",
            "zipcode": "",
            "phone": "",
            "phone2": "",
            "fax": "",
            "email": "",
            "website": "",
            "phone_work": "",
            "credit": "0.00",
            "term": 37,
            "contacts": [
                {
                    "id": 1,
                    "nom": "Contact test",
                    "fonction": "",
                    "departement": "",
                    "email": "",
                    "telephone": "",
                    "cell": "",
                    "fax": ""
                }
            ]
        },
        {
            "id": 2,
            "code": "13559",
            "name": "1TEST2",
            "inactive": 1,
            "creation_date": "2020-07-06",
            "address": "",
            "adresse2": "",
            "city": "",
            "state": "QC",
            "zipcode": "",
            "phone": "",
            "phone2": "",
            "fax": "",
            "email": "",
            "website": "",
            "phone_work": "",
            "credit": "0.00",
            "term": 37,
            "contacts": [
                {
                    "id": 1,
                    "nom": "Contact test",
                    "fonction": "",
                    "departement": "",
                    "email": "",
                    "telephone": "",
                    "cell": "",
                    "fax": ""
                }
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a client

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/clients/:id`

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

#### Path Parameters

| Name | Type    | Description                       |
| ---- | ------- | --------------------------------- |
| id   | integer | The ID of the client to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 2091,
        "code": "TEST11",
        "name": "Test Client",
        "inactive": 0,
        "creation_date": "2020-08-19",
        "address": null,
        "adresse2": null,
        "city": null,
        "state": "QC",
        "zipcode": null,
        "phone": null,
        "phone2": null,
        "fax": null,
        "email": null,
        "website": null,
        "phone_work": null,
        "credit": "0.00",
        "term": 0,
        "contacts": [
                {
                    "id": 1,
                    "nom": "Contact test",
                    "fonction": "",
                    "departement": "",
                    "email": "",
                    "telephone": "",
                    "cell": "",
                    "fax": ""
                }
            ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a client

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/clients`

This endpoint allows you to create a client.\
Returns the created client.

#### 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 | Client code. |
| name | string | Client name. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 2091,
        "code": "TEST11",
        "name": "Test Client",
        "inactive": 0,
        "creation_date": "2020-08-19",
        "address": null,
        "adresse2": null,
        "city": null,
        "state": "QC",
        "zipcode": null,
        "phone": null,
        "phone2": null,
        "fax": null,
        "email": null,
        "website": null,
        "phone_work": null,
        "credit": "0.00",
        "term": 0,
        "contacts": []
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "code": "TEST11",
    "name": "Test Client",
    "creation_date" : "2020-08-19"
}
```

## Update a client

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/clients/:id`

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

#### Path Parameters

| Name | Type    | Description          |
| ---- | ------- | -------------------- |
| id   | integer | Client id to update. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "data": {
        "id": 2091,
        ...
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "name": "Default client"
}
```


# Contacts

This page includes all endpoints available for the client's contacts module of Logiciel Actif.

## List all client's contacts

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/clients_contacts`

#### Query Parameters

| Name      | Type   | Description                                                               |
| --------- | ------ | ------------------------------------------------------------------------- |
| page      | string | The number of the page you wish to see. Default is 1.                     |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100. |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 1,
            "clientID": 1,
            "nom": "TEST 1",
            "fonction": "",
            "departement": "",
            "email": "test1@test.com",
            "telephone": "",
            "cell": "",
            "fax": ""
        },
        {
            "id": 2,
            "clientID": 2,
            "nom": "TEST 2",
            "fonction": "",
            "departement": "",
            "email": "test2@test.com",
            "telephone": "",
            "cell": "",
            "fax": ""
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a client's contact

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/clients_contacts/:id`

#### Path Parameters

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| id   | string | The id of the contact to retrieve. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 1,
            "clientID": 1,
            "nom": "TEST 1",
            "fonction": "",
            "departement": "",
            "email": "test1@test.com",
            "telephone": "",
            "cell": "",
            "fax": ""
        }
    ]
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Add a new client's contact

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/clients_contacts`

```
{
    "client_id": 158,
    "name" : "test"
}
```


# Providers

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

## List all providers

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/providers`

This endpoint allows you to get the list of your providers. \
The providers are returned, sorted by code (A-Z).

#### 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`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 1,
            "code": "1",
            "name": "Provider 1",
            "inactive": 0,
            "creation_date": "2020-07-06",
            "address": "",
            "address2": "",
            "city": "",
            "state": "QC",
            "zipcode": "",
            "phone": "",
            "fax": "",
            "email": "",
            "website": "",
            "term": 0,
            "credit": 0
        },
        {
            "id": 2,
            "code": "2",
            "name": "Provider 2",
            "inactive": 0,
            "creation_date": "2020-07-06",
            "address": "",
            "address2": "",
            "city": "",
            "state": "QC",
            "zipcode": "",
            "phone": "",
            "fax": null,
            "email": null,
            "website": null,
            "term": null,
            "credit": null
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a provider

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/providers/:id`

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

#### Path Parameters

| Name | Type    | Description                         |
| ---- | ------- | ----------------------------------- |
| id   | integer | The ID of the provider to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 1,
        "code": "1",
        "name": "Provider 1",
        "inactive": 0,
        "creation_date": "2020-07-06",
        "address": "",
        "address2": "",
        "city": "",
        "state": "QC",
        "zipcode": "",
        "phone": "",
        "fax": "",
        "email": "",
        "website": "",
        "term": 0,
        "credit": 0
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a provider

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/providers`

This endpoint allows you to create a provider. \
Returns the created provider.

#### 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 | Provider code. |
| name | string | Provider name. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 1,
        "code": "TEST",
        "name": "Test Provider",
        "inactive": 0,
        "creation_date": "2020-07-06",
        "address": "",
        "address2": "",
        "city": "",
        "state": "QC",
        "zipcode": "",
        "phone": "",
        "fax": "",
        "email": "",
        "website": "",
        "term": 0,
        "credit": 0
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "code": "TEST",
    "name": "Test Provider"
}
```

## Update a provider

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/providers/:id`

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

#### Path Parameters

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
| id   | integer | Provider id to update. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 1,
        "code": "TEST",
        "name": "Test Provider",
        "inactive": 0,
        "creation_date": "2020-07-06",
        "address": "",
        "address2": "",
        "city": "",
        "state": "QC",
        "zipcode": "",
        "phone": "",
        "fax": "",
        "email": "",
        "website": "",
        "term": 0,
        "credit": 0
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "name": "Test Provider"
}
```


# Resources

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

## List all resources

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/resources`

This endpoint allows you to get the list of your resources.\
The resources are returned, sorted by code (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | string | The number of page you wish to see. Default is 1.                        |
| per\_page | string | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 615,
            "user": null,
            "name": "m. st-onge",
            "inactive": 0,
            "language": null,
            "creation": "2020-05-28",
            "birth": null,
            "work_email": null,
            "email": null,
            "phone1": null,
            "phone2": null,
            "cell": null,
            "address": null,
            "city": null,
            "prov": "QC",
            "zip": null
        },
        {
            "id": 614,
            "user": null,
            "name": "m. provencher",
            "inactive": 0,
            "language": null,
            "creation": "2020-05-28",
            "birth": null,
            "work_email": null,
            "email": null,
            "phone1": null,
            "phone2": null,
            "cell": null,
            "address": null,
            "city": null,
            "prov": "QC",
            "zip": null
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a resource

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/resources/:id`

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

#### Path Parameters

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| id   | string | The ID of the resource to retrieve |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 615,
        "user": null,
        "name": "m. st-onge",
        "inactive": 0,
        "language": null,
        "creation": "2020-05-28",
        "birth": null,
        "work_email": null,
        "email": null,
        "phone1": null,
        "phone2": null,
        "cell": null,
        "address": null,
        "city": null,
        "prov": "QC",
        "zip": null
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a resource

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/resources`

This endpoint allows you to create a resource.\
Returns the created resource.

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |
| Content-type   | string | Should be `application/json`. |

#### Request Body

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| code | string | Code of resource |
| name | string | Name of resource |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 615,
        "user": null,
        "name": "m. st-onge",
        "inactive": 0,
        "language": null,
        "creation": "2020-05-28",
        "birth": null,
        "work_email": null,
        "email": null,
        "phone1": null,
        "phone2": null,
        "cell": null,
        "address": null,
        "city": null,
        "prov": "QC",
        "zip": null
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Update a resource

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/resources/:id`

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

#### Path Parameters

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| id   | string | ID of resource to update |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |
| Content-type   | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 615,
        "user": null,
        "name": "m. st-onge",
        "inactive": 0,
        "language": null,
        "creation": "2020-05-28",
        "birth": null,
        "work_email": null,
        "email": null,
        "phone1": null,
        "phone2": null,
        "cell": null,
        "address": null,
        "city": null,
        "prov": "QC",
        "zip": null
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Products

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

## List all products

<mark style="color:blue;">`GET`</mark> `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` |

{% tabs %}
{% tab title="200 " %}

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

{% endtab %}
{% endtabs %}

## Retrieve a product

<mark style="color:blue;">`GET`</mark> `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`. |

{% tabs %}
{% tab title="200 " %}

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

{% endtab %}
{% endtabs %}

## Create a product

<mark style="color:green;">`POST`</mark> `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. |

{% tabs %}
{% tab title="200 " %}

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

{% endtab %}
{% endtabs %}

#### Body example

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

## Update a product

<mark style="color:orange;">`PUT`</mark> `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`. |

{% tabs %}
{% tab title="200 " %}

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

{% endtab %}
{% endtabs %}

#### Body example

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


# Rentals

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

## List all rentals

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/rentals`

This endpoint allows you to get the list of your rentals. \
The rentals returned are future or in progress rentals.

#### 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. Maximum values is 100. |

#### Headers

| Name           | Type   | Description                  |
| -------------- | ------ | ---------------------------- |
| Authentication | string | Bearer token                 |
| Accept         | string | Should be `application/json` |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "data": [
    {
      "vehicle": "MITSUBISHI Lancer (2012)",
      "vehicle_id": 5955,
      "appointments": [
        {
          "start": "2026-01-30 12:34:00",
          "end": "2026-02-07 03:00:00"
        },
        {
          "start": "2026-01-19 14:21:00",
          "end": "2026-01-23 12:00:00"
        },
        {
          "start": "2026-01-12 13:05:00",
          "end": "2026-01-16 12:00:00"
        }
      ],
      "system_id": 999999
    },
    {
      ...
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 100,
    "total": 2
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a rentals

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/rentals/:id`

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

#### Path Parameters

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| id   | integer | The ID of the vehicle to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "data": [
    {
      "vehicle": "MITSUBISHI Lancer (2012)",
      "vehicle_id": 5955,
      "appointments": [
        {
          "start": "2026-01-30 12:34:00",
          "end": "2026-02-07 03:00:00"
        },
        {
          "start": "2026-01-19 14:21:00",
          "end": "2026-01-23 12:00:00"
        },
        {
          "start": "2026-01-12 13:05:00",
          "end": "2026-01-16 12:00:00"
        }
      ],
      "system_id": 999999
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}


# Projects

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

## List all projects

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/projects`

This endpoint allows you to get the list of your projects. \
The projects are returned sorted by creation date.

#### 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`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 73,
            "code": null,
            "client_id": 0,
            "active": 1,
            "nom": "Test Project",
            "description": null,
            "tasks": []
        },
        {
            "id": 72,
            "code": null,
            "client_id": 0,
            "active": 1,
            "nom": "Test Project 2",
            "description": null,
            "tasks": []
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a project

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/projects/:id`

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

#### Path Parameters

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| id   | integer | The ID of the project to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 73,
        "code": null,
        "client_id": 0,
        "active": 1,
        "nom": "Test Project",
        "description": null,
        "tasks": []
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a project

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/projects`

This endpoint allows you to create a project. \
Returns the created project.

#### 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   |
| ---- | ------ | ------------- |
| name | string | Project name. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 73,
        "code": null,
        "client_id": 0,
        "active": 1,
        "nom": "Test Project",
        "description": null,
        "tasks": []
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "name": "Test Project"
}
```

## Update a project

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/projects/:id`

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

#### Path Parameters

| Name | Type    | Description          |
| ---- | ------- | -------------------- |
| id   | integer | Project id to update |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 73,
        "code": null,
        "client_id": 0,
        "active": 1,
        "nom": "Test Project",
        "description": null,
        "tasks": []
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "name": "Test Project"
}
```


# Tasks

This page includes all endpoints available for the tasks(projects) module of Logiciel Actif.

## List all tasks

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/tasks`

This endpoint allows you to get the list of your tasks. \
The tasks are returned sorted by creation date.

#### 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`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 381,
            "projet_id": 70,
            "active": 1,
            "creation_date": "2020-06-01",
            "title": "Simoan Provencher",
            "start_date": "0000-00-00",
            "end_date": "0000-00-00",
            "status": 2,
            "time_estimated": "0.00",
            "time_spent": "1.00",
            "description": null,
            "comments": []
        },
        {
            "id": 380,
            "projet_id": 0,
            "active": 1,
            "creation_date": "2020-06-01",
            "title": "BOOKING - ",
            "start_date": "0000-00-00",
            "end_date": "0000-00-00",
            "status": 2,
            "time_estimated": "1.00",
            "time_spent": "0.00",
            "description": "",
            "comments": []
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a task

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/tasks/:id`

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

#### Path Parameters

| Name | Type    | Description                     |
| ---- | ------- | ------------------------------- |
| id   | integer | The ID of the task to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 70,
        "projet_id": 18,
        "active": 1,
        "creation_date": "0000-00-00",
        "title": "a1 - ",
        "start_date": "2019-10-02",
        "end_date": "2019-10-02",
        "status": 2,
        "time_estimated": "1.00",
        "time_spent": "9.00",
        "description": "",
        "comments": [
            {
                "id": 1,
                "tache_id": 70,
                "user_id": 205,
                "date": "2020-08-19",
                "comment": ""
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a task

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/tasks`

This endpoint allows you to create a task. \
Returns the created task.

#### 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    |
| ----------- | ------- | -------------- |
| project\_id | integer | ID of project. |
| name        | string  | Task name.     |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 70,
        "projet_id": 18,
        "active": 1,
        "creation_date": "0000-00-00",
        "title": "a1 - ",
        "start_date": "2019-10-02",
        "end_date": "2019-10-02",
        "status": 2,
        "time_estimated": "1.00",
        "time_spent": "9.00",
        "description": "",
        "comments": [
            {
                "id": 1,
                "tache_id": 70,
                "user_id": 205,
                "date": "2020-08-19",
                "comment": ""
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "project_id" : 18,
    "name": "Test Project"
}
```

## Update a task

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/tasks/:id`

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

#### Path Parameters

| Name | Type    | Description       |
| ---- | ------- | ----------------- |
| id   | integer | Task id to update |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 70,
        "projet_id": 18,
        "active": 1,
        "creation_date": "0000-00-00",
        "title": "a1 - ",
        "start_date": "2019-10-02",
        "end_date": "2019-10-02",
        "status": 2,
        "time_estimated": "1.00",
        "time_spent": "9.00",
        "description": "",
        "comments": [
            {
                "id": 1,
                "tache_id": 70,
                "user_id": 205,
                "date": "2020-08-19",
                "comment": ""
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
    "name": "Test Project"
}
```


# Reminders

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

## List all reminders

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/reminders`

This endpoint allows you to get the list of your reminders.\
The resources are returned, sorted by code (A-Z).

#### Query Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| page      | String | The number of page you wish to see. Default is 1.                        |
| per\_page | String | The number of the desired result per page. Default is 20. Maximum is 100 |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | String | Should be `application/json`. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "data": [
        {
            "id": 43,
            "titre": "teste",
            "module": "clients",
            "moduleID": 2197,
            "userID": "205",
            "date": "2021-08-31 07:46:00",
            "closed": 0,
            "labels": null,
            "notes": ""
        },
        {
            "id": 42,
            "titre": "tes es sdf",
            "module": "clients",
            "moduleID": 2178,
            "userID": "205",
            "date": "2021-06-10 13:51:00",
            "closed": 0,
            "labels": "test 1",
            "notes": ""
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a reminder

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/reminders`

This endpoint allows you to get the details of a reminder.

#### Path Parameters

| Name                                 | Type   | Description                        |
| ------------------------------------ | ------ | ---------------------------------- |
| id<mark style="color:red;">\*</mark> | String | The ID of the reminder to retrieve |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | String | Should be `application/json`. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Create a reminder

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/reminders`

This endpoint allows you to create a reminder.\
Returns the created reminder.

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | String | Should be `application/json`. |
| Content-type                                     | String | Should be `application/json`  |

#### Request Body

| Name                                       | Type   | Description                                                                                                                |
| ------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| title<mark style="color:red;">\*</mark>    | String | Title of reminder                                                                                                          |
| module<mark style="color:red;">\*</mark>   | enum   | module to insert the reminder into, here are the options available : clients,providers,sales,attributes,bookings,purchases |
| moduleID<mark style="color:red;">\*</mark> | String | ID of previous module (EX : client)                                                                                        |
| userID<mark style="color:red;">\*</mark>   | String | ID of user the reminder is set to                                                                                          |
| date<mark style="color:red;">\*</mark>     | String | Date of the reminder                                                                                                       |
| closed                                     | bool   | 1 if reminder is closed                                                                                                    |
| labels                                     | String | Labels on the reminder, comma separated                                                                                    |
| notes                                      | String | Notes of the reminder                                                                                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Update a reminder

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/reminders`

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

#### Path Parameters

| Name                                 | Type   | Description              |
| ------------------------------------ | ------ | ------------------------ |
| id<mark style="color:red;">\*</mark> | String | ID of resource to update |

#### Headers

| Name                                             | Type   | Description                   |
| ------------------------------------------------ | ------ | ----------------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer token.                 |
| Accept<mark style="color:red;">\*</mark>         | String | Should be `application/json`. |
| Content-type                                     | String | Should be `application/json`  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


# Bookings

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

## List all bookings

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/bookings`

This endpoint allows you to get the list of your bookings. \
The bookings are returned sorted by pickup dates, with the most recent appearing first.

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Retrieve a booking

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/bookings/:id`

This endpoint allows you to retrieve a specific booking.

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | Booking ID. |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 8,
        "code": "35",
        "inactive": 0,
        "pickup_date": "2020-08-12",
        "delivery_date": "2020-08-13",
        "client_id": 6,
        "contact": "",
        "contact_phone": "",
        "contact_fax": "",
        "distance": "6.05",
        "po_num": "1",
        "comm_num": "2",
        "bol_num": "3",
        "fact_number": "19047",
        "price": "50.00",
        "creation_date": "2020-08-06",
        "items": [
            {
                "id": 117931,
                "booking_id": 8,
                "description": "test",
                "value": "0.00",
                "length": "10000.00",
                "width": "0.00",
                "height": "0.00",
                "number": "1.00",
                "weight": "0.00",
                "total": "0.00",
                "details": ""
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Stops

This page includes all endpoints available for the stops(bookings) module of Logiciel Actif.

## List all stops

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/stops`

This endpoint allows you to get the list of your stops. \
The stops are returned sorted by date and time, with the most recent appearing first.

#### Query Parameters

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| geotabUserId | string | Filter by the GeoTab user linked to the stop. |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 21,
            "name": "",
            "reference": "",
            "address": "275 Rue Paradis",
            "adresse2": "",
            "city": "Repentigny",
            "state": "QC",
            "zip": "J6A 8H2",
            "contact_name": "",
            "contact_tel": "",
            "contact_fax": "",
            "contact_email": "",
            "stop_type": "Destination",
            "date": "2020-08-13",
            "time": "",
            "hours": "",
            "broker": "",
            "note_imp": "",
            "note": "",
            "note_booking": "",
            "geotabUserId": "a2"
        },
        {
            "id": 20,
            "name": "",
            "reference": "",
            "address": "197 Rue Sainte Thérèse",
            "adresse2": "",
            "city": "Charlemagne",
            "state": "QC",
            "zip": "J5Z 1B7",
            "contact_name": "",
            "contact_tel": "",
            "contact_fax": "",
            "contact_email": "",
            "stop_type": "Origin",
            "date": "2020-08-12",
            "time": "",
            "hours": "",
            "broker": "",
            "note_imp": "",
            "note": "",
            "note_booking": "",
            "geotabUserId": "a2"
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a stop

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/stops/:id`

This endpoint allows you to retrieve a specific stop.

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | Stop ID.    |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 21,
        "name": "",
        "reference": "",
        "address": "275 Rue Paradis",
        "adresse2": "",
        "city": "Repentigny",
        "state": "QC",
        "zip": "J6A 8H2",
        "contact_name": "",
        "contact_tel": "",
        "contact_fax": "",
        "contact_email": "",
        "stop_type": "Destination",
        "date": "2020-08-13",
        "time": "",
        "hours": "",
        "broker": "",
        "note_imp": "",
        "note": "",
        "note_booking": "",
        "geotabUserId": "a2"
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Actions

This page includes all endpoints available for the actions(bookings) module of Logiciel Actif.

## List all actions

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/actions`

This endpoint allows you to get the list of your actions. \
The actions are returned sorted by date and time, with the most recent appearing first.

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 21,
            "name": "",
            "reference": "",
            "address": "275 Rue Paradis",
            "adresse2": "",
            "city": "Repentigny",
            "state": "QC",
            "zip": "J6A 8H2",
            "contact_name": "",
            "contact_tel": "",
            "contact_fax": "",
            "contact_email": "",
            "stop_type": "Destination",
            "date": "2020-08-13",
            "time": "",
            "hours": "",
            "broker": "",
            "note_imp": "",
            "note": "",
            "note_booking": "",
            "geotabUserId": "a2"
        },
        {
            "id": 20,
            "name": "",
            "reference": "",
            "address": "197 Rue Sainte Thérèse",
            "adresse2": "",
            "city": "Charlemagne",
            "state": "QC",
            "zip": "J5Z 1B7",
            "contact_name": "",
            "contact_tel": "",
            "contact_fax": "",
            "contact_email": "",
            "stop_type": "Origin",
            "date": "2020-08-12",
            "time": "",
            "hours": "",
            "broker": "",
            "note_imp": "",
            "note": "",
            "note_booking": "",
            "geotabUserId": "a2"
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve an action

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/actions/:id`

This endpoint allows you to retrieve a specific action.

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | Action ID.  |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 100,
        "bookingID": 135,
        "date": "2019-11-14 10:09:52",
        "user_id": 633,
        "action_id": 1,
        "value": "950.00",
        "cost": "570.00",
        "time": "00:00:00"
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an action

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/actions`

This endpoint allows you to create an action. \
Returns the created action.

#### 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                      |
| ---------- | ------- | -------------------------------- |
| value      | string  | Amount charged to the client.    |
| cost       | string  | Amount paid to the driver.       |
| user\_id   | integer | User ID linked to the action.    |
| action\_id | integer | Action ID.                       |
| date       | string  | Date of the action.              |
| bookingID  | integer | Booking ID linked to the action. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

```
{
    "value" : "1.00",
    "cost" : "1.00",
    "user_id" : "633",
    "action_id" : "1",
    "date" : "2020-08-20 11:11:11",
    "bookingID" : "135"
}
```


# Documents

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

## Add a document

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/documents`

This endpoint allows you to add a document.

#### Query Parameters

| Name            | Type   | Description                                     |
| --------------- | ------ | ----------------------------------------------- |
| booking\_id     | string | Booking ID that this document is linked to.     |
| path            | array  | Binary document, base64 encoded image or URI.   |
| title           | string | Title of the document.                          |
| transaction\_id | string | Transaction ID that this document is linked to. |
| client\_id      | string | Client ID that this document is linked to.      |
| fournisseur\_id | string | Provider ID that this document is linked to.    |

#### Headers

| Name             | Type   | Description                      |
| ---------------- | ------ | -------------------------------- |
| Authentification | string | Bearer token.                    |
| Accept           | string | Should be `multipart/form-data`. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


# Transactions

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

## List all transactions

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/transactions`

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

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": 13033,
            "number": "13017",
            "reference": "test",
            "date": "2020-08-17",
            "user": "AAA",
            "creation_date": "2020-08-18",
            "creation_time": "11:18:31",
            "description": "This is a test!",
            "name": "test",
            "period": "Current",
            "code": null,
            "details": [
                {
                    "account": "1200",
                    "reference": "test",
                    "amount": "10.00",
                    "currency": "CAD",
                    "credit": "C"
                },
                {
                    "account": "4020",
                    "reference": "test",
                    "amount": "10.00",
                    "currency": "CAD",
                    "credit": "D"
                }
            ]
        },
        {
            "id": 13032,
            "number": "13016",
            "reference": "test",
            "date": "2020-08-17",
            "user": "AAA",
            "creation_date": "2020-08-18",
            "creation_time": "11:17:54",
            "description": "This is a test!",
            "name": "Test",
            "period": "Current",
            "code": null,
            "details": [
                {
                    "account": "1200",
                    "reference": "test",
                    "amount": "10.00",
                    "currency": "CAD",
                    "credit": "C"
                },
                {
                    "account": "4020",
                    "reference": "test",
                    "amount": "10.00",
                    "currency": "CAD",
                    "credit": "D"
                }
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 521,
        "per_page": 25,
        "total": 13021
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a transaction

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/transactions/:id`

This endpoint allows you to access a specific transaction by its ID.

#### Path Parameters

| Name | Type   | Description        |
| ---- | ------ | ------------------ |
| id   | string | ID of transaction. |

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 13033,
        "number": "13017",
        "reference": "test",
        "date": "2020-08-17",
        "user": "AAA",
        "creation_date": "2020-08-18",
        "creation_time": "11:18:31",
        "description": "This is a test!",
        "name": "test",
        "period": "99999",
        "code": null,
        "details": [
            {
                "account": "1200",
                "reference": "test",
                "amount": "10.00",
                "currency": "CAD",
                "credit": "C"
            },
            {
                "account": "4020",
                "reference": "test",
                "amount": "10.00",
                "currency": "CAD",
                "credit": "D"
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a transaction

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/transactions`

This endpoint allows you to create a new transaction. \
The new transaction will be returned.

#### Headers

| Name             | Type   | Description                   |
| ---------------- | ------ | ----------------------------- |
| Authentification | string | Bearer token.                 |
| Accept           | string | Should be `application/json`. |
| Content-Type     | string | Should be `application/json`. |

#### Request Body

| Name        | Type   | Description                                                                                                                                                        |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| code        | string | Provider or client code, this will be applied to all details using the provider or client's account. Only one provider or one client can be sent in a single call. |
| reference   | string | Transaction reference.                                                                                                                                             |
| date        | string | Transaction date.                                                                                                                                                  |
| details     | array  | All transaction legs (account,amount,currency,credit,reference,projet\_id).                                                                                        |
| description | string | Transaction description.                                                                                                                                           |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": 13033,
        "number": "13017",
        "reference": "test",
        "date": "2020-08-17",
        "user": "AAA",
        "creation_date": "2020-08-18",
        "creation_time": "11:18:31",
        "description": "This is a test!",
        "name": "test",
        "period": "99999",
        "code": null,
        "details": [
            {
                "account": "1200",
                "reference": "test",
                "amount": "10.00",
                "currency": "CAD",
                "credit": "C"
            },
            {
                "account": "4020",
                "reference": "test",
                "amount": "10.00",
                "currency": "CAD",
                "credit": "D"
            }
        ]
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body example

```
{
    "reference": "test",
    "date": "2020-08-17",
    "description": "This is a test!",
    "code": "TEST",
    "labels": "1,2,3"
    "details": [
        {
            "account" : "1200",
            "reference" : "test",
            "amount" : "10.00",
            "credit" : "C",
            "currency" : "CAD",
            "projet_id" : "0"
        },
        {
            "account" : "4020",
            "reference" : "test",
            "amount" : "10.00",
            "credit" : "D",
            "currency" : "CAD",
            "projet_id" : "0"
        }
    ]
}
```


# Categories

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

## List all categories

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/categories`

This endpoint allows you to get the list of your categories.

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 3,
      "code": "500",
      "name_fr": "Job",
      "name_en": "Job"
    },
    {
      "id": 2,
      "code": "200",
      "name_fr": "Pieces",
      "name_en": "Parts"
    },
    {
      "id": 1,
      "code": "DEFAULT",
      "name_fr": "DEFAULT",
      "name_en": "Default"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 500,
    "total": 3
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a specific sale product

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/categories/:id`

This endpoint allows you to get one specific category.&#x20;

#### Path Parameters

| Name | Type    | Description                         |
| ---- | ------- | ----------------------------------- |
| id   | integer | The ID of the category to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2,
      "code": "200",
      "name_fr": "Pieces",
      "name_en": "Parts"
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a category

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/categories`

#### 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 | Code                     |
| name\_fr | string | Category name in French  |
| name\_en | string | Category name in English |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 5,
      "code": "005",
      "name_fr": "La Franchise",
      "name_en": "Franchise"
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "code": "005",
    "name_fr": "La Franchise",
    "name_en": "Franchise"
}
```

## Update a category

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/categories/:id`

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

#### Path Parameters

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
| id   | integer | Category ID to update. |

#### Headers

| Name           | Type   | Description                  |
| -------------- | ------ | ---------------------------- |
| Authentication | string | Bearer Token                 |
| Content-Type   | string | Should be `application/json` |
| Accept         | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 4,
      "code": "100",
      "name_fr": "Entreposage de pneus",
      "name_en": "Tire storage"
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "code": "100",
    "name_fr": "Entreposage de pneus",
    "name_en": "Tire storage"
}
```


# Punch

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

## List all punch

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/punch`

This endpoint allows you to get the list of your categories.

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2504,
      "appointment_id": 909,
      "user_id": 205,
      "date": "2026-08-18",
      "start_time": "08:43:20",
      "end_time": null,
      "ptotal": "0.00",
      "note": null,
      "system_id": 99125
    },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a specific sale product

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/categories/:id`

This endpoint allows you to get one specific category.&#x20;

#### Path Parameters

| Name | Type    | Description                         |
| ---- | ------- | ----------------------------------- |
| id   | integer | The ID of the category to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2504,
      "appointment_id": 909,
      "user_id": 205,
      "date": "2026-08-18",
      "start_time": "08:43:20",
      "end_time": null,
      "ptotal": "0.00",
      "note": null,
      "system_id": 99125
    },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a punch

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/punch`

#### 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            |
| ----------- | ---- | ---------------------- |
| user\_id    | int  | User id                |
| date        | date | Date of the punch      |
| start\_time | time | Start of punch (HH:MM) |
| end\_time   | time | End of punch (HH:MM)   |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2504,
      "appointment_id": 909,
      "user_id": 205,
      "date": "2026-08-18",
      "start_time": "08:43:20",
      "end_time": null,
      "ptotal": "0.00",
      "note": null,
      "system_id": 99125
    },
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "code": "005",
    "name_fr": "La Franchise",
    "name_en": "Franchise"
}
```

## Update a punch

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/punch/:id`

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

#### Path Parameters

| Name | Type    | Description         |
| ---- | ------- | ------------------- |
| id   | integer | Punch ID to update. |

#### Headers

| Name           | Type   | Description                  |
| -------------- | ------ | ---------------------------- |
| Authentication | string | Bearer Token                 |
| Content-Type   | string | Should be `application/json` |
| Accept         | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2504,
      "appointment_id": 909,
      "user_id": 205,
      "date": "2026-08-18",
      "start_time": "08:43:20",
      "end_time": null,
      "ptotal": "0.00",
      "note": null,
      "system_id": 99125
    },
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
"id": 2504,
"appointment_id": 909,
"user_id": 205,
"date": "2026-08-18",
"start_time": "08:43:20",
"end_time": null,
"ptotal": "0.00",
"note": null,
"system_id": 99125
}
```


# Sales

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

## List all sales

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales`

This endpoint allows you to get the list of your sales. \
The transactions are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## List a specific sale

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales/:id`

This endpoint allows you to get one specific sale.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Create a sale

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/sales`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "client_id": "1",
    "date": "2022-05-25"
}
```

## Update a sale

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/sales/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "action": "invoice", //This will create an invoice from the sale
    "action": "quote" //This will create a quote from the sale
}
```


# Payments

This page includes all endpoints available for the sales pay of Logiciel Actif.

## List all sales payments

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales_payments`

This endpoint allows you to get the list of your clients.

#### 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 500. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 5,
            "invoice_id": 8,
            "method_id": 104,
            "amount": 56.40,
            "date_payment": "2024-09-23"
        },
        {
            "id": 4,
            "invoice_id": 7,
            "method_id": 104,
            "amount": 500.00,
            "date_payment": "2024-08-26"
        },
        {
            "id": 3,
            "invoice_id": 23,
            "method_id": 102,
            "amount": 47.49,
            "date_payment": "2024-08-26"
        },
        {
            "id": 2,
            "invoice_id": 104,
            "method_id": 101,
            "amount": 214.98,
            "date_payment": "2024-08-22"
        },
        {
            "id": 1,
            "invoice_id": 16,
            "method_id": 69,
            "amount": "29.50",
            "date_payment": "2024-08-21"
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 500,
        "total": 5
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a sales payment

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales_payments/:id`

This endpoint allows you to get the details of the sales payment.

#### Path Parameters

| Name | Type    | Description                              |
| ---- | ------- | ---------------------------------------- |
| id   | integer | The ID of the sales payment to retrieve. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```json
{
    "data": [
        {
            "id": 4,
            "invoice_id": 7,
            "method_id": 104,
            "amount": 500.00,
            "date_payment": "2024-08-26"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a sales payment

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/sales_payments`

This endpoint allows you to create a sales payment.\
Returns the created sales payment.

#### 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       |
| ------------- | ------ | ----------------- |
| invoice\_id   | string | Invoice ID        |
| method\_id    | string | Payment method ID |
| amount        | string | Payment amount    |
| date\_payment | string | Payment date      |

{% tabs %}
{% tab title="200 " %}

```json
{
    "data": [
        {
            "id": 6,
            "invoice_id": 10,
            "method_id": 101,
            "amount": "250.00",
            "date_payment": "2024-10-30"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

```json
{
    "invoice_id": 10,
    "method_id": 101,
    "amount": 250.00,
    "date_payment": "2024-10-30"
}
```

## Update a sales payment

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/sales_payments/:id`

This endpoint allows you to update a specific sales payment. \
Returns the updated sales payment.

#### Path Parameters

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| id   | integer | Sales payment id to update. |

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

{% tabs %}
{% tab title="200 " %}

```json
{
    "data": [
        {
            "id": 6,
            "invoice_id": 10,
            "method_id": 101,
            "amount": "100.00",
            "date_payment": "2024-10-31"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

```
{
"invoice_id": 15,
"method_id": 101,
"amount": 100.00,
"date_payment": "2024-10-31"
}
```


# Products

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

## List all sales products

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales_products`

This endpoint allows you to get the list of your sales. \
The transactions are returned sorted by most recent number.

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2,
      "sale_id": 5,
      "product_id": 2,
      "product_name": "Default service",
      "product_description": "",
      "product_quantity": "1.00",
      "produit_quantite3": "0.00",
      "produit_poids": "0.000",
      "product_price": "100.0000",
      "product_cost": "0.00",
      "product_discount": "0.0000",
      "product_serialnumber": "",
      "produit_total": "100.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 9
    },
    {
      "id": 1,
      "sale_id": 5,
      "product_id": 3,
      "product_name": "PARTS",
      "product_description": "",
      "product_quantity": "1.00",
      "produit_quantite3": "0.00",
      "produit_poids": "0.000",
      "product_price": "200.0000",
      "product_cost": "0.00",
      "product_discount": "0.0000",
      "product_serialnumber": "",
      "produit_total": "200.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 9
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 500,
    "total": 2
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a specific sale product

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales_products/:id`

This endpoint allows you to get one specific sale product.&#x20;

#### Path Parameters

| Name | Type    | Description                              |
| ---- | ------- | ---------------------------------------- |
| id   | integer | The ID of the sales product to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 1,
      "sale_id": 5,
      "product_id": 3,
      "product_name": "PARTS",
      "product_description": "",
      "product_quantity": "1.00",
      "produit_quantite3": "0.00",
      "produit_poids": "0.000",
      "product_price": "200.0000",
      "product_cost": "0.00",
      "product_discount": "0.0000",
      "product_serialnumber": "",
      "produit_total": "200.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 9
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a sale product

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/sales_products`

#### 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       |
| ----------- | ------ | ----------------- |
| sale\_id    | string | Invoice ID        |
| product\_id | string | Payment method ID |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 12,
      "sale_id": 5,
      "product_id": 1461,
      "product_name": "Produit par défaut",
      "product_description": "",
      "product_quantity": "0.00",
      "produit_quantite3": "0.00",
      "produit_poids": "0.000",
      "product_price": "0.0000",
      "product_cost": "0.00",
      "product_discount": "0.0000",
      "product_serialnumber": "",
      "produit_total": "0.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 9
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "sale_id": 5,
    "product_id": 1461
}
```

## Update a sale product

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/sales_products/:id`

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

#### Path Parameters

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| id   | integer | Sales 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` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 12,
      "sale_id": 5,
      "product_id": 1461,
      "product_name": "alignment",
      "product_description": "",
      "product_quantity": "1.00",
      "produit_quantite3": "0.00",
      "produit_poids": "0.000",
      "product_price": "60.0000",
      "product_cost": "0.00",
      "product_discount": "0.0000",
      "product_serialnumber": "",
      "produit_total": "60.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 9
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "product_name": "alignment",
    "product_price": 60
}
```


# Departments

This page includes all endpoints available for departments of Logiciel Actif.

## List all departments

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/departments`

This endpoint allows you to get the list of your departments. .

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong><strong>    "data": [
</strong>        {
            "id": 3,
            "branch_id": 1,
            "name": "Pneus",
            "categories": "15",
            "use_default": 0,
            "system_id": 999999
        },
        {
            "id": 2,
            "branch_id": 1,
            "name": "Mécanique",
            "categories": null,
            "use_default": 0,
            "system_id": 999999
        },
        {
            "id": 1,
            "branch_id": 1,
            "name": "Comptoir",
            "categories": null,
            "use_default": 1,
            "system_id": 999999
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 500,
        "total": 3
    },
    "success": true
}
</code></pre>

{% endtab %}
{% endtabs %}

## Retrieve a specific department

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/departments/:id`

This endpoint allows you to get one specific department.&#x20;

#### Path Parameters

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| id   | integer | The ID of the department to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 2,
            "branch_id": 1,
            "name": "Mécanique",
            "categories": null,
            "use_default": 0,
            "system_id": 999999
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Documents

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

## Add a document

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/documents`

This endpoint allows you to add a document.

#### Query Parameters

| Name            | Type   | Description                                     |
| --------------- | ------ | ----------------------------------------------- |
| booking\_id     | string | Booking ID that this document is linked to.     |
| path            | array  | Binary document.                                |
| title           | string | Title of the document.                          |
| transaction\_id | string | Transaction ID that this document is linked to. |
| client\_id      | string | Client ID that this document is linked to.      |
| fournisseur\_id | string | Provider ID that this document is linked to.    |

#### Headers

| Name             | Type   | Description                      |
| ---------------- | ------ | -------------------------------- |
| Authentification | string | Bearer token.                    |
| Accept           | string | Should be `multipart/form-data`. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


# Purchases

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

## List all purchases

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/purchases`

This endpoint allows you to get the list of your purchases. \
The transactions are returned sorted by most recent number.

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 27,
      "purchase_number": 37,
      "invoice_number": null,
      "internal_number": "",
      "external_number": "",
      "quote_number": null,
      "provider_id": 1,
      "active": 1,
      "date": "2024-12-27",
      "contact_name": "",
      "contact_email": null,
      "contact_phone": null,
      "contact_address": "",
      "contact_city": "",
      "contact_state": "QC",
      "contact_zip": "",
      "arrondissement": "",
      "contact_facturation": null,
      "contact_facturation_email": null,
      "contact_facturation_phone": null,
      "facturation1": "",
      "facturation2": null,
      "facturation_ville": null,
      "facturation_pays": 1,
      "facturation_prov": "QC",
      "facturation_cp": null,
      "livraison_id": 0,
      "delivery_name": null,
      "livraison_client_id": 0,
      "delivery_email": null,
      "delivery_phone": null,
      "delivery_address": "",
      "delivery_city": null,
      "delivery_state": "QC",
      "delivery_zip": null,
      "date_rec": null,
      "date_liv": null,
      "responsible": null,
      "seller_id": 230,
      "expediteur": null,
      "expediteur_ref": null,
      "tags": 0,
      "invoice_receive": 0,
      "subtotal": "0.00",
      "total": "0.00",
      "currency": 1,
      "options": null,
      "branch_id": 1,
      "has_cc": 0,
      "sale_id": 0,
      "products_lines": [],
      "documents": [],
      "system_id": 99217
    },
    {
      "id": 26,
      "purchase_number": 36,
      "invoice_number": null,
      "internal_number": "",
      "external_number": "",
      "quote_number": null,
      "provider_id": 1,
      "active": 1,
      "date": "2024-12-27",
      "contact_name": "",
      "contact_email": null,
      "contact_phone": null,
      "contact_address": "",
      "contact_city": "",
      "contact_state": "QC",
      "contact_zip": "",
      "arrondissement": "",
      "contact_facturation": null,
      "contact_facturation_email": null,
      "contact_facturation_phone": null,
      "facturation1": "",
      "facturation2": null,
      "facturation_ville": null,
      "facturation_pays": 1,
      "facturation_prov": "QC",
      "facturation_cp": null,
      "livraison_id": 0,
      "delivery_name": null,
      "livraison_client_id": 0,
      "delivery_email": null,
      "delivery_phone": null,
      "delivery_address": "",
      "delivery_city": null,
      "delivery_state": "QC",
      "delivery_zip": null,
      "date_rec": null,
      "date_liv": null,
      "responsible": null,
      "seller_id": 230,
      "expediteur": null,
      "expediteur_ref": null,
      "tags": 0,
      "invoice_receive": 0,
      "subtotal": "0.00",
      "total": "0.00",
      "currency": 1,
      "options": null,
      "branch_id": 1,
      "has_cc": 0,
      "sale_id": 0,
      "products_lines": [],
      "documents": [],
      "system_id": 99217
    },
      "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 500,
    "total": 2
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific purchase

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/purchases/:id`

This endpoint allows you to get one specific purchase.&#x20;

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": {
    "id": 26,
    "purchase_number": 36,
    "invoice_number": null,
    "internal_number": "",
    "external_number": "",
    "quote_number": null,
    "provider_id": 1,
    "active": 1,
    "date": "2024-12-27",
    "contact_name": "",
    "contact_email": null,
    "contact_phone": null,
    "contact_address": "",
    "contact_city": "",
    "contact_state": "QC",
    "contact_zip": "",
    "arrondissement": "",
    "contact_facturation": null,
    "contact_facturation_email": null,
    "contact_facturation_phone": null,
    "facturation1": "",
    "facturation2": null,
    "facturation_ville": null,
    "facturation_pays": 1,
    "facturation_prov": "QC",
    "facturation_cp": null,
    "livraison_id": 0,
    "delivery_name": null,
    "livraison_client_id": 0,
    "delivery_email": null,
    "delivery_phone": null,
    "delivery_address": "",
    "delivery_city": null,
    "delivery_state": "QC",
    "delivery_zip": null,
    "date_rec": null,
    "date_liv": null,
    "responsible": null,
    "seller_id": 230,
    "expediteur": null,
    "expediteur_ref": null,
    "tags": 0,
    "invoice_receive": 0,
    "subtotal": "0.00",
    "total": "0.00",
    "currency": 1,
    "options": null,
    "branch_id": 1,
    "has_cc": 0,
    "sale_id": 0,
    "products_lines": [],
    "documents": [],
    "system_id": 99217
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a purchase

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/purchases`

#### Headers

| Name           | Type    | Description                                                                                             |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| Authentication | string  | Bearer Token                                                                                            |
| Accept         | string  | Should be `application/json`                                                                            |
| branch\_id     | integer | Value  by default is 1 corresponding to the head office. Otherwise the branch must exist and be active. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": {
    "id": 27,
    "purchase_number": 37,
    "invoice_number": null,
    "internal_number": "",
    "external_number": "",
    "quote_number": null,
    "provider_id": 1,
    "active": 1,
    "date": "2024-12-27",
    "contact_name": "",
    "contact_email": null,
    "contact_phone": null,
    "contact_address": "",
    "contact_city": "",
    "contact_state": "QC",
    "contact_zip": "",
    "arrondissement": "",
    "contact_facturation": null,
    "contact_facturation_email": null,
    "contact_facturation_phone": null,
    "facturation1": "",
    "facturation2": null,
    "facturation_ville": null,
    "facturation_pays": 1,
    "facturation_prov": "QC",
    "facturation_cp": null,
    "livraison_id": 0,
    "delivery_name": null,
    "livraison_client_id": 0,
    "delivery_email": null,
    "delivery_phone": null,
    "delivery_address": "",
    "delivery_city": null,
    "delivery_state": "QC",
    "delivery_zip": null,
    "date_rec": null,
    "date_liv": null,
    "responsible": null,
    "seller_id": 230,
    "expediteur": null,
    "expediteur_ref": null,
    "tags": 0,
    "invoice_receive": 0,
    "subtotal": "0.00",
    "total": "0.00",
    "currency": 1,
    "options": null,
    "branch_id": 1,//Branch must exist
    "has_cc": 0,
    "sale_id": 0,
    "products_lines": [],
    "documents": [],
    "system_id": 99217
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "invoice_number": "1001234",
    "date": "2024-12-27",
    "contact_name": "John Smith",
    "contact_email": "jsmith@company.com"
}
```

## Update a purchase

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/purchase/:id`

#### Headers

| Name           | Type    | Description                                                                                             |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| Authentication | string  | Bearer Token                                                                                            |
| Accept         | string  | Should be `application/json`                                                                            |
| branch\_id     | integer | Value  by default is 1 corresponding to the head office. Otherwise the branch must exist and be active. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": {
    "id": 27,
    "purchase_number": 37,
    "invoice_number": null,
    "internal_number": "",
    "external_number": "",
    "quote_number": null,
    "provider_id": 1,
    "active": 1,
    "date": "2024-12-28",
    "contact_name": "John Smith",
    "contact_email": null,
    "contact_phone": null,
    "contact_address": "",
    "contact_city": "",
    "contact_state": "QC",
    "contact_zip": "",
    "arrondissement": "",
    "contact_facturation": null,
    "contact_facturation_email": null,
    "contact_facturation_phone": null,
    "facturation1": "",
    "facturation2": null,
    "facturation_ville": null,
    "facturation_pays": 1,
    "facturation_prov": "QC",
    "facturation_cp": null,
    "livraison_id": 0,
    "delivery_name": null,
    "livraison_client_id": 0,
    "delivery_email": null,
    "delivery_phone": null,
    "delivery_address": "",
    "delivery_city": null,
    "delivery_state": "QC",
    "delivery_zip": null,
    "date_rec": null,
    "date_liv": null,
    "responsible": null,
    "seller_id": 230,
    "expediteur": null,
    "expediteur_ref": null,
    "tags": 0,
    "invoice_receive": 0,
    "subtotal": "0.00",
    "total": "0.00",
    "currency": 1,
    "options": null,
    "branch_id": 1,
    "has_cc": 0,
    "sale_id": 0,
    "products_lines": [],
    "documents": [],
    "system_id": 99217
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "date": "2024-12-28",
    "contact_name": "John Smith"
}
```


# Products

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

## List all purchase products

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/purchases_products`

This endpoint allows you to get the list of your purchase products.&#x20;

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 1,
      "purchase_id": 2,
      "product_id": "5",
      "produit_compte": "67",
      "product_name": "Breaks",
      "product_description": "",
      "produit_projet": null,
      "product_quantity": "8.00",
      "produit_quantite_receive": "0.00",
      "produit_quantite_onhold": "8.00",
      "produit_poids": "0.000",
      "produit_poids_receive": "0.000",
      "produit_poids_onhold": "0.000",
      "product_price": "30.0000",
      "product_discount": "0.00",
      "product_serialnumber": "",
      "produit_total": "240.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 0,
      "system_id": 99217
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 500,
    "total": 1
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Retrieve a specific sale product

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/sales_products/:id`

This endpoint allows you to get one specific sale product.&#x20;

#### Path Parameters

| Name | Type    | Description                              |
| ---- | ------- | ---------------------------------------- |
| id   | integer | The ID of the sales product to retrieve. |

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 1,
      "purchase_id": 2,
      "product_id": "5",
      "produit_compte": "67",
      "product_name": "Breaks",
      "product_description": "",
      "produit_projet": null,
      "product_quantity": "8.00",
      "produit_quantite_receive": "0.00",
      "produit_quantite_onhold": "8.00",
      "produit_poids": "0.000",
      "produit_poids_receive": "0.000",
      "produit_poids_onhold": "0.000",
      "product_price": "30.0000",
      "product_discount": "0.00",
      "product_serialnumber": "",
      "produit_total": "240.00",
      "taxes_rules_id": 2,
      "gestion_taxes": "[]",
      "province_id": 0,
      "system_id": 99217
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Create a purchase product

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/purchases_products`

#### 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 |
| ------------ | ------ | ----------- |
| purchase\_id | string | Invoice ID  |
| product\_id  | string | Product ID  |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2,
      "purchase_id": 5,
      "product_id": "3",
      "product_name": "timing belt",
      "product_description": "",
      "product_quantity": "0.00",
      "product_price": "0.0000",
      "product_discount": "0.00",
      "product_serialnumber": "",
      "produit_cost": "0.00",
      "taxes_rules_id": 2,
      "province_id": 0,
      "system_id": 99217
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    "purchase_id": 5,
    "product_id": 3,
    "product_name": "timing belt"
}
```

## Update a purchase product

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/purchases_products/:id`

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

#### Path Parameters

| Name | Type    | Description                    |
| ---- | ------- | ------------------------------ |
| id   | integer | Purchase 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` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 2,
      "purchase_id": 5,
      "product_id": "3",
      "product_name": "timing belt",
      "product_description": "",
      "product_quantity": "0.00",
      "product_price": "0.0000",
      "product_discount": "0.00",
      "product_serialnumber": "",
      "produit_cost": "0.00",
      "taxes_rules_id": 2,
      "province_id": 0,
      "system_id": 99217
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "product_name": "Timing Belt",
    "product_quantity": 10,
    "product_price": 30
}
```


# Documents

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

## Add a document

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/documents`

This endpoint allows you to add a document.

#### Query Parameters

| Name            | Type   | Description                                     |
| --------------- | ------ | ----------------------------------------------- |
| booking\_id     | string | Booking ID that this document is linked to.     |
| path            | array  | Binary document.                                |
| title           | string | Title of the document.                          |
| transaction\_id | string | Transaction ID that this document is linked to. |
| client\_id      | string | Client ID that this document is linked to.      |
| fournisseur\_id | string | Provider ID that this document is linked to.    |

#### Headers

| Name             | Type   | Description                      |
| ---------------- | ------ | -------------------------------- |
| Authentification | string | Bearer token.                    |
| Accept           | string | Should be `multipart/form-data`. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


# Vehicles

This page includes all endpoints available for the vehicles' module.

## List all vehicles

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/vehicles`

This endpoint allows you to get the list of your vehicles.&#x20;

#### Heade

{% tabs %}
{% tab title="200: OK " %}

```javascript
 {
            "id": 73,
            "client": 3396,
            "serial_number": "sslapqkqpewkapakspqkapakspaksp",
            "type": 1,
            "year": 2020,
            "brand": 3,
            "model": 87,
            "doors": 0,
            "color": "",
            "transmission": 1,
            "transmission_type": 1,
            "gas_type": 1,
            "cam": 0,
            "year_production": null,
            "date_buy": null,
            "inactive": 0,
            "date_service": null,
            "car_number": "123aasqw",
            "plaque": "",
            "serial_number_province": 9,
            "last_visit": "2024-04-25",
            "odometer": 11,
            "odometer_type": 1,
            "hours": 0,
            "motor": "",
            "motor_card": "",
            "cylinder": "",
            "pnbv": "",
            "truck_divers": "",
            "truck_legs": "",
            "truck_weight": "",
            "truck_front": "",
            "truck_rear": "",
            "truck_ratio": "",
            "truck_serial_number": "",
            "truck_brand": "",
            "truck_trans_serial": "",
            "truck_trans_brand": "",
            "truck_motor_serial": "",
            "truck_motor_brand": "",
            "truck_hydrom_serial": "",
            "truck_hydrom_brand": "",
            "truck_hydrop_serial": "",
            "truck_hydrop_brand": "",
            "tire_size": "",
            "tire_size_back": "",
            "tire_azote": 0,
            "tire_sensor": 0,
            "anti_theft": 0,
            "tire_size_winter": "",
            "tire_size_back_winter": "",
            "tire_winter": 0,
            "wheel_lock_nut": 0,
            "locnut": "",
            "passcode": "",
            "valet": "",
            "separator3": 0,
            "truck_usages": "0",
            "brakes_usages": "0",
            "state": 0,
            "finish": "",
            "seats": 0,
            "steering": "",
            "power": 0,
            "carosserie": "",
            "seat_type": "",
            "interior_color": "",
            "trunk": "",
            "tank_capacity": "",
            "wheel_count": "",
            "photo": "",
            "notes": "",
            "date_creation": "2024-04-18",
            "product_id": 0,
            "vin_validated": 0,
            "options": [],
            "inspections": [],
            "ac_vehicule_maintenance_history": [],
            "ac_vehicule_maintenance_schedules": [],
            "documents": []
        },
        {
            "id": 72,
            "client": 3494,
            "serial_number": "",
            "type": 1,
            "year": 2024,
            "brand": 10,
            "model": 85,
            "doors": 4,
            "color": "",
            "transmission": 1,
            "transmission_type": 1,
            "gas_type": 1,
            "cam": 0,
            "year_production": "0000-00-00",
            "date_buy": "0000-00-00",
            "inactive": 0,
            "date_service": "0000-00-00",
            "car_number": "aaaa",
            "plaque": "",
            "serial_number_province": 9,
            "last_visit": "0000-00-00",
            "odometer": 0,
            "odometer_type": 1,
            "hours": 0,
            "motor": "",
            "motor_card": "",
            "cylinder": "",
            "pnbv": "",
            "truck_divers": "",
            "truck_legs": "",
            "truck_weight": "",
            "truck_front": "",
            "truck_rear": "",
            "truck_ratio": "",
            "truck_serial_number": "",
            "truck_brand": "",
            "truck_trans_serial": "",
            "truck_trans_brand": "",
            "truck_motor_serial": "",
            "truck_motor_brand": "",
            "truck_hydrom_serial": "",
            "truck_hydrom_brand": "",
            "truck_hydrop_serial": "",
            "truck_hydrop_brand": "",
            "tire_size": "",
            "tire_size_back": "",
            "tire_azote": 0,
            "tire_sensor": 0,
            "anti_theft": 0,
            "tire_size_winter": "",
            "tire_size_back_winter": "",
            "tire_winter": 0,
            "wheel_lock_nut": 0,
            "locnut": "",
            "passcode": "",
            "valet": "",
            "separator3": 0,
            "truck_usages": "0",
            "brakes_usages": "0",
            "state": 0,
            "finish": "",
            "seats": 0,
            "steering": "",
            "power": 0,
            "carosserie": "",
            "seat_type": "",
            "interior_color": "",
            "trunk": "",
            "tank_capacity": "",
            "wheel_count": "",
            "photo": "",
            "notes": "",
            "date_creation": "2024-02-22",
            "product_id": 0,
            "vin_validated": 0,
            "options": [],
            "inspections": [],
            "ac_vehicule_maintenance_history": [
                {
                    "id": 102,
                    "vehicule_id": 72,
                    "service_id": 7,
                    "km": 1788,
                    "hours": "0.00",
                    "date_time": "0000-00-00 00:00:00",
                    "notes": ""
                }
            ],
            "ac_vehicule_maintenance_schedules": [
                {
                    "id": 61,
                    "vehicule_id": 72,
                    "service_id": 0,
                    "km": 2,
                    "date_time": "2024-03-26 13:40:00",
                    "declined": 0,
                    "force_date": 0,
                    "next_occurence": null,
                    "next_km": 0,
                    "description": null
                }
            ],
            "documents": []
        }
```

{% endtab %}
{% endtabs %}

## List a specific vehicle

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/vehicles/:id`

This endpoint allows you to get one specific vehicle.

{% tabs %}
{% tab title="200: OK " %}

```javascript
            "id": 73,
            "client": 3396,
            "serial_number": "sslapqkqpewkapakspqkapakspaksp",
            "type": 1,
            "year": 2020,
            "brand": 3,
            "model": 87,
            "doors": 0,
            "color": "",
            "transmission": 1,
            "transmission_type": 1,
            "gas_type": 1,
            "cam": 0,
            "year_production": null,
            "date_buy": null,
            "inactive": 0,
            "date_service": null,
            "car_number": "123aasqw",
            "plaque": "",
            "serial_number_province": 9,
            "last_visit": "2024-04-25",
            "odometer": 11,
            "odometer_type": 1,
            "hours": 0,
            "motor": "",
            "motor_card": "",
            "cylinder": "",
            "pnbv": "",
            "truck_divers": "",
            "truck_legs": "",
            "truck_weight": "",
            "truck_front": "",
            "truck_rear": "",
            "truck_ratio": "",
            "truck_serial_number": "",
            "truck_brand": "",
            "truck_trans_serial": "",
            "truck_trans_brand": "",
            "truck_motor_serial": "",
            "truck_motor_brand": "",
            "truck_hydrom_serial": "",
            "truck_hydrom_brand": "",
            "truck_hydrop_serial": "",
            "truck_hydrop_brand": "",
            "tire_size": "",
            "tire_size_back": "",
            "tire_azote": 0,
            "tire_sensor": 0,
            "anti_theft": 0,
            "tire_size_winter": "",
            "tire_size_back_winter": "",
            "tire_winter": 0,
            "wheel_lock_nut": 0,
            "locnut": "",
            "passcode": "",
            "valet": "",
            "separator3": 0,
            "truck_usages": "0",
            "brakes_usages": "0",
            "state": 0,
            "finish": "",
            "seats": 0,
            "steering": "",
            "power": 0,
            "carosserie": "",
            "seat_type": "",
            "interior_color": "",
            "trunk": "",
            "tank_capacity": "",
            "wheel_count": "",
            "photo": "",
            "notes": "",
            "date_creation": "2024-04-18",
            "product_id": 0,
            "vin_validated": 0,
            "options": [],
            "inspections": [],
            "ac_vehicule_maintenance_history": [],
            "ac_vehicule_maintenance_schedules": [],
            "documents": []
        } 
```

{% endtab %}
{% endtabs %}

## Create a vehicle

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/vehicles`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
   
}
```

## Update a sale

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/vehicles/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example


# Brands

This page includes all endpoints available for the vehicle brands.

## List all vehicle brands

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`vehicles\_brands

This endpoint allows you to get the list of your vehicle brands.&#x20;

#### Headers

| Name                                            | Type   | Description                  |
| ----------------------------------------------- | ------ | ---------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                          | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## List a specific vehicle brand

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`vehicles\_brands`/:brand`

This endpoint allows you to get one specific brand.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Create a vehicle brand

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/`vehicles\_brands

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
```

## Update a vehicle brand

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/`vehicles\_brands`/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    
}
```


# Models

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

## List all sales products

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`vehicles\_models

This endpoint allows you to get the list of your vehicle models.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## List a specific vehicle brand

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/`vehicles\_brands`/:model?brand=brand`

This endpoint allows you to get one specific sale.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Create a vehicle brand

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/`vehicles\_models

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
```

## Update a vehicle brand

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/`vehicles\_models`/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```
{
    
}
```


# Inspections

This page includes all endpoints available for the vehicle inspections of Logiciel Actif.

## List all vehicle inspections

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/inpsections`

This endpoint allows you to get the list of your vehicle models.&#x20;

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "data": [
    {
      "id": 163,
      "work_order": "251480",
      "date": "2025-08-28",
      "client": "John Q",
      "vehicle": "DODGE JOURNEY SE SE (2014)",
      "system_id": 99999
    },
    {
      "id": 162,
      "work_order": "251467",
      "date": "2025-08-27",
      "client": "John Smith",
      "vehicle": "HONDA CR-V (2018)",
      "system_id": 99999
    },
    {
      "id": 161,
      "work_order": "251467",
      "date": "2025-08-27",
      "client": "Jane Smith",
      "vehicle": "TOYOTA RAV4 (2015)",
      "system_id": 99999
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 2,
    "per_page": 100,
    "total": 163
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific vehicle brand

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/inspections/:id`

This endpoint allows you to get one specific inspection.&#x20;

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
  "data": [
    {
      "id": 163,
      "work_order": "251480",
      "date": "2025-08-28",
      "client": "John Q",
      "vehicle": "DODGE JOURNEY SE SE (2014)",
      "system_id": 99999
    }
  ],
  "success": true
}
```

{% endtab %}
{% endtabs %}


# Agenda


# Appointments

This page includes all endpoints available for the agenda appointments of Logiciel Actif (GEM-CAR required).

## List all agenda appointments

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_appointments`

This endpoint allows you to get the list of your appointments. \
The appointments are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 2,
            "sale_id": 1,
            "sale_product_id": 1,
            "date_at": "2023-01-19",
            "time_at": "00:00:00",
            "workflow_id": 0,
            "duration": "1.00",
            "client_id": 1,
            "vehicle_id": 1,
            "description": null,
            "title": null,
            "date_end": "2023-01-19",
            "time_end": "10:00:00",
            "notes": null,
            "color": null,
            "bay_id": 1
        },
        {
            "id": 1,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-01-18",
            "time_at": "10:00:00",
            "workflow_id": 0,
            "duration": "100.00",
            "client_id": 0,
            "vehicle_id": 0,
            "description": "",
            "title": "TEST",
            "date_end": "2023-02-07",
            "time_end": "11:00:00",
            "notes": null,
            "color": "#519103",
            "bay_id": 2
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda appointment

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

This endpoint allows you to get one specific appointment.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-01-18",
            "time_at": "10:00:00",
            "workflow_id": 0,
            "duration": "100.00",
            "client_id": 0,
            "vehicle_id": 0,
            "description": "",
            "title": "TEST",
            "date_end": "2023-02-07",
            "time_end": "11:00:00",
            "notes": null,
            "color": "#519103",
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda appointment

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/agenda_appointments`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-03-23",
            "time_at": "13:00:00",
            "workflow_id": 0,
            "duration": "2.00",
            "client_id": 0,
            "car_id": 0,
            "description": null,
            "title": null,
            "date_end": "2023-03-23",
            "time_end": "15:00:00",
            "notes": null,
            "color": null,
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "sale_id": 0,
    "sale_product_id": 0,
    "date_at": "2023-03-23",
    "time_at": "13:00:00",
    "workflow_id": 0,
    "duration": "2.00",
    "client_id": 0,
    "vehicle_id": 0,
    "description": null,
    "title": null,
    "date_end": "2023-03-23",
    "time_end": "15:00:00",
    "notes": null,
    "color": null,
    "bay_id": null
}
```

## Update an appointment

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "sale_id": 0,
            "sale_product_id": 0,
            "date_at": "2023-03-23",
            "time_at": "13:00:00",
            "workflow_id": 0,
            "duration": "2.00",
            "client_id": 0,
            "car_id": 0,
            "description": null,
            "title": null,
            "date_end": "2023-03-23",
            "time_end": "15:00:00",
            "notes": null,
            "color": null,
            "bay_id": null
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "sale_id": 0,
    "sale_product_id": 0,
    "date_at": "2023-03-23",
    "time_at": "13:00:00",
    "workflow_id": 0,
    "duration": "2.00",
    "client_id": 0,
    "vehicle_id": 0,
    "description": null,
    "title": null,
    "date_end": "2023-03-23",
    "time_end": "15:00:00",
    "notes": null,
    "color": null,
    "bay_id": null
}
```

## Delete an appointment

<mark style="color:red;">`DELETE`</mark> `https://app.gem-books.com/api/agenda_appointments/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "result": "success",
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Displays

This page includes all endpoints available for the agenda displays of Logiciel Actif (GEM-CAR required).

## List all agenda displays

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_displays`

This endpoint allows you to get the list of your displays. \
The displays are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "branch_id": 1,
            "name": "Mécanique",
            "bay_ids": "5,2,3,4,1,74",
            "default": 1
        },
        {
            "id": 2,
            "branch_id": 1,
            "name": "Comptoir",
            "bay_ids": "5",
            "default": 0
        },
        {
            "id": 1,
            "branch_id": 1,
            "name": "Courtoisie",
            "bay_ids": "2",
            "default": 0
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 3
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda display

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_displays/:id`

This endpoint allows you to get one specific appointment.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "branch_id": 1,
            "name": "Mécanique",
            "bay_ids": "5,2,3,4,1,74",
            "default": 1
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda display

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/agenda_displays`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "branch_id": 1,
            "name": "Mécanique",
            "bay_ids": "5,2,3,4,1,74",
            "default": 1
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "name": "Mécanique",
    "bay_ids": "5,2,3,4,1,74",
    "default": 1
}
```

## Update a display

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/agenda_displays/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 3,
            "branch_id": 1,
            "name": "Mécanique",
            "bay_ids": "5,2,3,4,1,74",
            "default": 1
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "name": "Mécanique",
    "bay_ids": "5,2,3,4,1,74",
    "default": 1
}
```


# Bays

This page includes all endpoints available for the agenda bays of Logiciel Actif (GEM-CAR required).

## List all agenda bays

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_bays`

This endpoint allows you to get the list of your bays. \
The bays are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 2,
            "branch_id": 1,
            "order": 2,
            "default": 1,
            "name": "TECH 2",
            "tech_id": 0,
            "initials": "SM",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "150.00",
            "diner_name": "",
            "lunch_start": "13:00:00",
            "lunch_end": "14:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        },
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 1",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda bay

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_bays/:id`

This endpoint allows you to get one specific bay.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda bay

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/agenda_bays`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "order": 1,
    "default": 0,
    "name": "TECH 4",
    "tech_id": 0,
    "initials": "",
    "bay_type": 1,
    "vehicle_types": "",
    "cost": "0.00",
    "diner_name": "",
    "lunch_start": "12:00:00",
    "lunch_end": "13:00:00",
    "has_dinner": 1,
    "client_can_schedule": 0,
    "out_of_business_hours": 0,
    "disabled": 0
}
```

## Update a bay

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/agenda_bays/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "branch_id": 1,
            "order": 1,
            "default": 0,
            "name": "TECH 4",
            "tech_id": 0,
            "initials": "",
            "bay_type": 1,
            "vehicle_types": "",
            "cost": "0.00",
            "diner_name": "",
            "lunch_start": "12:00:00",
            "lunch_end": "13:00:00",
            "has_dinner": 1,
            "client_can_schedule": 0,
            "out_of_business_hours": 0,
            "disabled": 0
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "branch_id": 1,
    "order": 1,
    "default": 0,
    "name": "TECH 4",
    "tech_id": 0,
    "initials": "",
    "bay_type": 1,
    "vehicle_types": "",
    "cost": "0.00",
    "diner_name": "",
    "lunch_start": "12:00:00",
    "lunch_end": "13:00:00",
    "has_dinner": 1,
    "client_can_schedule": 0,
    "out_of_business_hours": 0,
    "disabled": 0
}
```


# Workflows

This page includes all endpoints available for the agenda workflows of Logiciel Actif (GEM-CAR required).

## List all agenda workflows

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_workflows`

This endpoint allows you to get the list of your workflows. \
The workflows are returned sorted by most recent number.

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 2,
            "name": "Conflict",
            "order": 1,
            "color": "#000000",
            "background_color": "#ff0000"
        },
        {
            "id": 1,
            "name": "Not available",
            "order": 0,
            "color": "#000000",
            "background_color": "#cccccc"
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 25,
        "total": 2
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## List a specific agenda workflow

<mark style="color:blue;">`GET`</mark> `https://app.gem-books.com/api/agenda_workflows/:id`

This endpoint allows you to get one specific workflow.&#x20;

#### Headers

| Name                                               | Type   | Description                  |
| -------------------------------------------------- | ------ | ---------------------------- |
| Authentification<mark style="color:red;">\*</mark> | string | Bearer Token                 |
| Accept                                             | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "name": "Not available",
            "order": 0,
            "color": "#000000",
            "background_color": "#cccccc"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

## Create an agenda workflow

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/agenda_workflows`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "name": "Not available",
            "order": 0,
            "color": "#000000",
            "background_color": "#cccccc"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "name": "Not available",
    "order": 0,
    "color": "#000000",
    "background_color": "#cccccc"
}
```

## Update a workflow

<mark style="color:orange;">`PUT`</mark> `https://app.gem-books.com/api/agenda_workflows/:id`

#### Headers

| Name             | Type   | Description                  |
| ---------------- | ------ | ---------------------------- |
| Authentification | string | Bearer Token                 |
| Accept           | string | Should be `application/json` |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": 1,
            "name": "Not available",
            "order": 0,
            "color": "#000000",
            "background_color": "#cccccc"
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body Example

```json
{
    "name": "Not available",
    "order": 0,
    "color": "#000000",
    "background_color": "#cccccc"
}
```


# Objects

Every piece of data in Logiciel Actif is represented as an object (also called `entity`).

### Blank fields

Blank fields will always be included with the value `null` (they are never omitted).


# Branch

The representation of a branch is called a Branch object. Branches are identified by a unique incremental ID.

| Attribute | Type    | Description              |
| --------- | ------- | ------------------------ |
| id        | integer | ID of the sale's product |
| name      | text    | Name of the branch       |
| status    | integer | Status of the branch     |
|           |         |                          |


# Client

The representation of a client is called a Client object. Clients are identified by a unique incremental ID.

| Attribute      | Type    | Description                                                                                     |
| -------------- | ------- | ----------------------------------------------------------------------------------------------- |
| id             | integer | Unique identifier for the client.                                                               |
| code           | string  | Visual identifier code of the client.                                                           |
| name           | string  | Client name.                                                                                    |
| inactive       | integer | <p>Possible values are :</p><ul><li>0: Client is active</li><li>1: Client is inactive</li></ul> |
| creation\_date | date    | Created date.                                                                                   |
| address        | string  | Address of the client.                                                                          |
| address2       | string  | Address (other) of the client                                                                   |
| city           | string  | City of the client.                                                                             |
| state          | string  | State of the client.                                                                            |
| zipcode        | string  | Zipcode of the client.                                                                          |
| phone          | string  | Phone of the client.                                                                            |
| phone2         | string  | Phone (other) of the client.                                                                    |
| fax            | string  | Fax of the client.                                                                              |
| email          | string  | Email of the client.                                                                            |
| website        | string  | Website of the client.                                                                          |
| phone\_work    | string  | Phone (work) of the client.                                                                     |
| credit         | numeric | Credit limit of the client.                                                                     |
| term           | integer | Payment terms (days) of the client.                                                             |


# Provider

The representation of a provider is called a Provider object. Providers are identified by a unique incremental ID.

| Attribute      | Type    | Description                                                                                         |
| -------------- | ------- | --------------------------------------------------------------------------------------------------- |
| id             | integer | Unique identifier for the provider.                                                                 |
| code           | string  | Visual identifier code of the provider.                                                             |
| name           | string  | Provider name.                                                                                      |
| inactive       | integer | <p>Possible values are :</p><ul><li>0: Provider is active</li><li>1: Provider is inactive</li></ul> |
| creation\_date | date    | Created date.                                                                                       |
| address        | string  | Address of the provider.                                                                            |
| address2       | string  | Address (other) of the provider.                                                                    |
| city           | string  | City of the provider.                                                                               |
| state          | string  | State of the provider.                                                                              |
| zipcode        | string  | Zipcode of the provider.                                                                            |
| phone          | string  | Phone of the provider.                                                                              |
| fax            | string  | Fax of the provider.                                                                                |
| email          | string  | Email of the provider.                                                                              |
| website        | string  | Website of the provider.                                                                            |
| credit         | numeric | Credit limit of the provider.                                                                       |
| term           | integer | Payment terms (days) of the provider.                                                               |


# Product

The representation of a product or service is called a Product object. Products are identified by a unique incremental ID.

| Attribute              | Type     | Description                                                                                                                                                                                                             |
| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                     | integer  | Unique identifier for the product.                                                                                                                                                                                      |
| code                   | string   | Visual identifier code of the product.                                                                                                                                                                                  |
| code\_cup              | string   | Code UPC of the product.                                                                                                                                                                                                |
| origin\_product\_id    | integer  | ID of the parent product.                                                                                                                                                                                               |
| updated\_at            | datetime | Last updated date.                                                                                                                                                                                                      |
| created\_at            | datetime | Created date.                                                                                                                                                                                                           |
| category\_id           | integer  | ID of the product categories.                                                                                                                                                                                           |
| type                   | integer  | <p>The product type.<br>Possible values are :</p><ul><li>1: Product</li><li>4: Service</li><li>7: Product used for assembly</li><li>8: Service used for assembly</li><li>11: Assembling</li><li>12: Gift card</li></ul> |
| status                 | integer  | Statut of the product. 1 for active, 0 for inactive.                                                                                                                                                                    |
| name\_fr               | string   | Product french name.                                                                                                                                                                                                    |
| additional\_fr         | string   | Short french description.                                                                                                                                                                                               |
| guaranty\_fr           | string   | Description of the french product guaranty.                                                                                                                                                                             |
| name\_en               | string   | Product english name.                                                                                                                                                                                                   |
| additional\_en         | string   | Short english description.                                                                                                                                                                                              |
| guaranty\_en           | string   | Description of the english product guaranty.                                                                                                                                                                            |
| tags                   | string   | Comma separated list of id tag.                                                                                                                                                                                         |
| price                  | numeric  | Product price.                                                                                                                                                                                                          |
| price\_return          | numeric  | Product price for the return invoice.                                                                                                                                                                                   |
| special\_price         | numeric  | Special price for the product.                                                                                                                                                                                          |
| special\_price\_return | numeric  | Special price for the product in return invoice.                                                                                                                                                                        |
| special\_price\_from   | date     | Start date for the special price.                                                                                                                                                                                       |
| special\_price\_to     | date     | End date for the special price.                                                                                                                                                                                         |
| change\_from           | date     | Date for the new price effective.                                                                                                                                                                                       |
| change\_price          | numeric  | New price.                                                                                                                                                                                                              |
| change\_return         | numeric  | New price for return invoice.                                                                                                                                                                                           |
| dimensions\_length     | numeric  | Length dimension of the product.                                                                                                                                                                                        |
| dimensions\_width      | numeric  | Width dimension of the product.                                                                                                                                                                                         |
| dimensions\_height     | numeric  | Height dimension of the product.                                                                                                                                                                                        |
| weight                 | numeric  | Weight of the product.                                                                                                                                                                                                  |
| weight\_unit           | integer  | Id of the unit for the weight.                                                                                                                                                                                          |
| unit                   | integer  | Id of the unit for the product.                                                                                                                                                                                         |
| provider\_id           | integer  | Id of the provider.                                                                                                                                                                                                     |
| provider\_reference    | string   | Reference of the provider.                                                                                                                                                                                              |
| price\_cost            | numeric  | Cost price at the provider.                                                                                                                                                                                             |
| order\_unit            | integer  | Id of the unit for the order.                                                                                                                                                                                           |
| other\_fee             | numeric  | Other price fee.                                                                                                                                                                                                        |
| quantity\_case         | numeric  | Quantity per case.                                                                                                                                                                                                      |
| quantity\_min          | numeric  | Quantity minimum.                                                                                                                                                                                                       |
| quantity\_order        | numeric  | Quantity for order.                                                                                                                                                                                                     |
| location               | string   | Location of the product.                                                                                                                                                                                                |
| is\_bank\_hour         | boolean  | Product is use for bank hour.                                                                                                                                                                                           |
| is\_subscription       | boolean  | Product is use for subscription.                                                                                                                                                                                        |
| invoice\_display       | boolean  | Product is display on invoice.                                                                                                                                                                                          |
| invoice\_order         | integer  | Position of the product on invoice.                                                                                                                                                                                     |
| submission\_display    | boolean  | Product is display on submission.                                                                                                                                                                                       |
| submission\_order      | integer  | Position of the product on submission.                                                                                                                                                                                  |
| is\_reccuring          | boolean  | Product is recurring.                                                                                                                                                                                                   |
| recurring\_renewal     | boolean  | Recurring product is auto renewal.                                                                                                                                                                                      |
| recurring\_type        | integer  | <p>Id of the type of recurring.</p><p>Possible values are :</p><ul><li>1: annual</li><li>2: quarterly</li><li>3: monthly</li><li>4: fortnightly</li><li>5: weekly</li></ul>                                             |
| recurring\_limit       | integer  | Limit of renewal. 0 for unlimited.                                                                                                                                                                                      |
| short\_description\_fr | string   | Short french description of the product.                                                                                                                                                                                |
| description\_fr        | string   | French description of the product.                                                                                                                                                                                      |
| short\_description\_en | string   | Short english description of the product.                                                                                                                                                                               |
| description\_en        | string   | English description of the product.                                                                                                                                                                                     |
| notes\_fr              | string   | French notes for the product.                                                                                                                                                                                           |
| notes\_en              | string   | English notes for the product.                                                                                                                                                                                          |
| note\_invoice          | boolean  | Add the note to the invoice automatically                                                                                                                                                                               |


# Project

The representation of a project is called a Project object. Projects are identified by a unique incremental ID.

| Attribute   | Type    | Description                                                                                       |
| ----------- | ------- | ------------------------------------------------------------------------------------------------- |
| id          | integer | Unique identifier for the project.                                                                |
| code        | string  | Visual identifier code of the project.                                                            |
| client\_id  | integer | Client ID linked to the project.                                                                  |
| active      | integer | <p>Possible values are :</p><ul><li>0: Project is inactive</li><li>1: Project is active</li></ul> |
| name        | string  | Name of project.                                                                                  |
| description | string  | Description of project.                                                                           |
| tasks       | array   | Tasks linked to the project (see Task object)                                                     |


# Task

The representation of a task is called a Task object. Tasks are identified by a unique incremental ID.

| Attribute       | Type    | Description                                                                                                                         |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| id              | integer | Unique identifier for the task.                                                                                                     |
| projet\_id      | integer | Project ID linked to the task.                                                                                                      |
| active          | integer | <p>Possible values are :</p><ul><li>0: Task is inactive</li><li>1: Task is active</li></ul>                                         |
| creation\_date  | date    | Creation date.                                                                                                                      |
| title           | string  | Title of task.                                                                                                                      |
| start\_date     | date    | Starting date of task.                                                                                                              |
| end\_date       | date    | Ending date of task                                                                                                                 |
| status          | integer | <p>Possible values are :</p><ul><li>1: To plan</li><li>2: To do</li><li>3: In progress</li><li>4: To test</li><li>5: Done</li></ul> |
| time\_estimated | number  | Time estimated to complete the task.                                                                                                |
| time\_spent     | number  | Time spent on the task.                                                                                                             |
| description     | string  | description of the task.                                                                                                            |
| comments        | array   | Comments linked to the task (user\_id,date,comment)                                                                                 |


# Booking

The representation of a booking is called a Booking object. Bookings are identified by a unique incremental ID.

| Attribute      | Type    | Description                                                                                                  |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| id             | integer | Unique identifier for the booking.                                                                           |
| code           | string  | Visual identifier code of the booking.                                                                       |
| inactive       | integer | <p>Possible values are :</p><ul><li>0: Booking is active</li><li>1: Booking is inactive</li></ul>            |
| pickup\_date   | date    | Pickup date of the booking.                                                                                  |
| delivery\_date | date    | Delivery date of the booking.                                                                                |
| client\_id     | integer | Client ID of the booking.                                                                                    |
| contact        | string  | Contact name of the booking.                                                                                 |
| contact\_phone | string  | Contact phone of the booking.                                                                                |
| contact\_fax   | string  | Contact fax of the booking.                                                                                  |
| distance       | numeric | Total distance of the booking (mile vs km depends on the system settings).                                   |
| po\_num        | string  | PO number of the booking.                                                                                    |
| comm\_num      | string  | Order number of the booking.                                                                                 |
| bol\_num       | string  | BOL number of the booking.                                                                                   |
| invoice        | numeric | Invoice number of the booking.                                                                               |
| price          | numeric | Total price of the booking.                                                                                  |
| creation\_date | date    | Created date.                                                                                                |
| items          | array   | List of the items (load) in the booking (description,value,length,width,height,number,weight,total,details). |


# Stop

The representation of a stop is called a Stop object. Stops are identified by a unique incremental ID.

| Attribute      | Type    | Description                                                                           |
| -------------- | ------- | ------------------------------------------------------------------------------------- |
| id             | integer | Unique identifier for the stop.                                                       |
| name           | string  | Name of the stop.                                                                     |
| reference      | string  | Reference of the stop.                                                                |
| address        | string  | Address of the stop.                                                                  |
| address2       | string  | Address (other) of the stop                                                           |
| city           | string  | City of the stop.                                                                     |
| state          | string  | State of the stop.                                                                    |
| zip            | string  | Zip of the stop.                                                                      |
| contact\_name  | string  | Contact name of the stop.                                                             |
| contact\_tel   | string  | Contact phone of the stop.                                                            |
| contact\_fax   | string  | Contact fax of the stop.                                                              |
| contact\_email | string  | Contact email of the stop.                                                            |
| stop\_type     | string  | <p>Possible values are :</p><ul><li>Origin</li><li>Stop</li><li>Destination</li></ul> |
| date           | date    | Date of the stop.                                                                     |
| time           | time    | Time of the stop.                                                                     |
| hours\_opened  | string  | Hours opened of the stop.                                                             |
| broker         | string  | Broker of the stop.                                                                   |
| geotabUserId   | string  | GeoTab UserId of the stop.                                                            |


# Action

The representation of an action is called an Action object. Actions are identified by a unique incremental ID.

| Attribute  | Type    | Description                                       |
| ---------- | ------- | ------------------------------------------------- |
| id         | integer | Unique identifier for the action.                 |
| bookingID  | integer | Booking ID linked to the action.                  |
| date       | date    | Date of the action.                               |
| user\_id   | integer | User ID linked to the action.                     |
| action\_id | integer | Action ID.                                        |
| value      | numeric | Amount charged to the client.                     |
| cost       | numeric | Amount paid to the driver.                        |
| time       | time    | Time of the action (if action is time sensitive). |


# Transaction

The representation of a transaction is called a Transaction object. Transactions are identified by a unique incremental ID.

| Attribute      | Type    | Description                                                            |
| -------------- | ------- | ---------------------------------------------------------------------- |
| id             | integer | Unique identifier for the transaction.                                 |
| number         | string  | Number of the transaction.                                             |
| reference      | string  | Reference of the transaction.                                          |
| date           | date    | Date of the transaction.                                               |
| user           | string  | User that created the transaction.                                     |
| creation\_date | date    | Created date.                                                          |
| creation\_time | time    | Created time.                                                          |
| description    | string  | Description of transaction.                                            |
| name           | string  | Name of transaction.                                                   |
| period         | string  | Period of transaction.                                                 |
| code           | integer | Code of transaction.                                                   |
| details        | array   | Details of the transaction (account,reference,amount,currency,credit). |
| labels         | string  | Comma separated lists of all labels linked to this transaction.        |


# Sale

The representation of a sale is called a Sale object. Sales are identified by a unique incremental ID.

| Attribute       | Type    | Description                                                    |
| --------------- | ------- | -------------------------------------------------------------- |
| id              | integer | ID of the sale                                                 |
| sale\_number    | integer | Sale number                                                    |
| invoice\_number | integer | Invoice number (automatically generated when sale is invoiced) |
| quote\_number   | integer | Quote number (automatically generated when sale is quoted)     |
| client\_id      | integer | ID of the client                                               |
| date            | date    | Date of the sale                                               |
|                 |         |                                                                |


# Product

The representation of a sale's product is called a Product object. Products are identified by a unique incremental ID.

| Attribute         | Type    | Description              |
| ----------------- | ------- | ------------------------ |
| id                | integer | ID of the sale's product |
| sale\_id          | integer | Sale ID                  |
| product\_id       | integer | Product ID               |
| product\_name     | string  | Name of the product      |
| product\_quantity | float   | Quantity in sale         |
| product\_price    | float   | Price of the product     |
|                   |         |                          |


# Agenda

The agenda allows you to manage appointments and tasks per bay (GEM-CAR required)


# Appointment

The representation of an agenda appointment is called an Appointment object. Appointments are identified by a unique incremental ID.

| Attribute         | Type    | Description                                                                       |
| ----------------- | ------- | --------------------------------------------------------------------------------- |
| id                | integer | ID of the sale                                                                    |
| sale\_id          | integer | Sale unique identifier                                                            |
| sale\_product\_id | integer | Sale product unique identifier                                                    |
| client\_id        | integer | Client unique identifier                                                          |
| vehicle\_id       | integer | Vehicle unique identifier                                                         |
| bay\_id           | integer | Bay unique identifier                                                             |
| workflow\_id      | integer | Workflow step unique identifier                                                   |
| date\_at          | date    | Date of the start of the appointment                                              |
| time\_at          | time    | Time of the start of the appointment                                              |
| date\_end         | date    | Date of the end of the appointment                                                |
| time\_end         | time    | Time of the end of the appointment                                                |
| duration          | float   | Duration of the appointment excluding diner and optionally out of business hours. |
| description       | text    | Optional description for the appointment                                          |
| title             | text    | Optional title for the appointment                                                |
| notes             | text    | Optional notes for the appointment                                                |
| color             | text    | Color displayed in the agenda                                                     |


# Display

The representation of an agenda display step is called a Display object. Workflows are identified by a unique incremental ID.

| Attribute  | Type    | Description                                                    |
| ---------- | ------- | -------------------------------------------------------------- |
| id         | integer | ID of the sale                                                 |
| branch\_id | integer | Branch unique identifier                                       |
| name       | text    | Name of the workflow                                           |
| bay\_ids   | text    | Comma separated bay unique identifiers                         |
| default    | integer | Is the default display when opening the agenda for this branch |


# Bay

The representation of an agenda bay is called a Bay object. Bays are identified by a unique incremental ID.

| Attribute                | Type    | Description                                                                                   |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------- |
| id                       | integer | ID of the sale                                                                                |
| branch\_id               | integer | Branch unique identifier                                                                      |
| resource\_id             | integer | Resource unique identifier                                                                    |
| order                    | integer | Order used for displaying in list                                                             |
| name                     | text    | Name of the bay                                                                               |
| initials                 | text    | Initials of the technician                                                                    |
| bay\_type                | integer | Type of bay (1 = Allow billing, 2 = Warn billing, 3 = Prevent billing)                        |
| vehicle\_types           | text    | Vehicle types separated by a comma (1 = Car, 2 = Bus, 3 = Truck, 4 = Motorcycle, 5 = Trailer) |
| cost                     | float   | Cost used for billing                                                                         |
| lunch\_name              | text    | Name displayed in the lunch cell                                                              |
| lunch\_start             | time    | Lunch starting time                                                                           |
| lunch\_end               | time    | Lunch ending time                                                                             |
| has\_lunch               | integer | Is lunch enabled                                                                              |
| client\_can\_schedule    | integer | Can client schedule this bay using the external website                                       |
| out\_of\_business\_hours | integer | Allow appointments out of business hours                                                      |
| disabled                 | integer | Disable this bay                                                                              |


# Workflow

The representation of an agenda workflow step is called a Workflow object. Workflows are identified by a unique incremental ID.

| Attribute         | Type    | Description                                    |
| ----------------- | ------- | ---------------------------------------------- |
| id                | integer | ID of the sale                                 |
| name              | text    | Name of the workflow                           |
| order             | integer | Order of the workflow when displayed in a list |
| color             | text    | Text color of the workflow in the agenda       |
| background\_color | text    | Background color of the workflow in the agenda |


# Batch Calls

This page explains the process required to make a batch call to any endpoint.

## Insert multiple products

<mark style="color:green;">`POST`</mark> `https://app.gem-books.com/api/RESOURCE_ENDPOINT`

This endpoint allows you to create a batch call for an endpoint.

\*\* Refer to endpoint for body details

#### Notes

* ***Batch calls are supported for all endpoints that accept POST requests.***
* ***The input must be a JSON array of objects.***
* ***Each object in the array is processed independently.***
* ***The order of the results matches the order of the input objects.***
* ***If you send a single object (not an array), the API behaves as usual.***

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

#### Request Body

Example of request body for an endpoint

| Name     | Type   | Description           |
| -------- | ------ | --------------------- |
| code     | string | Product code.         |
| name\_fr | string | Product French name.  |
| name\_en | string | Product English name. |

{% tabs %}
{% tab title="200 " %}

```json
{
    "results": [
        {
            "result": "success",
            "table_id": 22
        },
        {
            "result": "success",
            "table_id": 23
        },
        {
            "result": "success",
            "table_id": 24
        }
    ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body example

```javascript
[
    {
      "code": "demo",
      "name_fr": "Produit demo",
      "name_en": "Demo Prodcut"
    },
    {
      "code": "005",
      "name_fr": "La Franchise",
      "name_en": "Franchise"
    },
    {
      "code": "006",
      "name_fr": "Autre",
      "name_en": "Other"
    }
]
```

## Update multiple products

<mark style="color:green;">`PUT`</mark> `https://app.gem-books.com/api/RESOURCE_ENDPOINT`

This endpoint allows you to create a batch call for an endpoint.

\*\* Refer to endpoint for body details

#### Notes

* ***Batch calls are supported for all endpoints that accept POST requests.***
* ***The input must be a JSON array of objects and the body must contain the ID for each record.***
* ***Each object in the array is processed independently.***
* ***The order of the results matches the order of the input objects.***
* ***If you send a single object (not an array), the endpoint requires the :id: the API behaves as usual.***

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

#### Request Body

Example of request body for an endpoint

| Name     | Type   | Description           |
| -------- | ------ | --------------------- |
| id       | int    | ID of the record      |
| code     | string | Product code.         |
| name\_fr | string | Product French name.  |
| name\_en | string | Product English name. |

{% tabs %}
{% tab title="200 " %}

```json
{
    "results": {
        "success": [
            {
                "result": "success",
                "table_id": 1
            },
            {
                "result": "success",
                "table_id": 2
            },
            {
                "result": "success",
                "table_id": 3
            }
        ],
        "error": [
            {
                "result":"error",
                "error":"Update failed: Missing ID",
                "data":{
                    "code": "006",
                    "name_fr": "Autre",
                    "name_en": "Other"
                }
            }
        ],
    "success": true
}
```

{% endtab %}
{% endtabs %}

#### Body example

```javascript
[
    {
      "id": "1",    
      "code": "demo",
      "name_fr": "Produit demo",
      "name_en": "Demo Prodcut"
    },
    {
      "id": "2",
      "code": "005",
      "name_fr": "La Franchise",
      "name_en": "Franchise"
    },
    {
      
      "code": "006",
      "name_fr": "Autre",
      "name_en": "Other"
    }
]
```


# Search

This page explains the process required to make a search call to any endpoint.

## Make a search

<mark style="color:green;">`GET`</mark>`https://app.gem-books.com/api/RESOURCE_ENDPOINT?search=SEARCH_WORD`

This endpoint allows you to create a search call for an endpoint.

#### Notes

* ***Search results are limited to 100***

#### Headers

| Name           | Type   | Description                   |
| -------------- | ------ | ----------------------------- |
| Authentication | string | Bearer token.                 |
| Content-Type   | string | Should be `application/json`. |
| Accept         | string | Should be `application/json`. |

#### Request Body

Example of request body for an endpoint

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| search | string | search word |

{% tabs %}
{% tab title="200 " %}

```json
{
     "data": [
        {
            "id": "24",
            "code": "700",
            "status": "1",
            "name_fr": "NEW TIRES",
            "category_type": "3",
            "name_en": null,
            "category_name": "Tires",
            "previous_ID": "0",
            "next_ID": "0",
            "img_paths": "",
            "system_id": 99832
        },
        {
            "id": "77",
            "code": "513",
            "status": "1",
            "name_fr": "TIRES AND WHEELS",
            "category_type": "1",
            "name_en": null,
            "category_name": "default_parts",
            "previous_ID": "0",
            "next_ID": "0",
            "img_paths": "",
            "system_id": 99832
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 0,
        "per_page": 100,
        "total": 0
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Webhooks

This page explains the process required to set your webhook URL.

These will send a call each time one of the API endpoints has been modified with the URL below, followed by the following nomenclature: /{endpoint}/{id}

Example: <https://myappwebhook.com/sales\\_products/3>

Webhook URL can be set in **Configurations -> Configurations -> API tab**

<figure><img src="https://2094353170-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2n_RkxIGKB7qiTFuWE%2Fuploads%2FrV4zUZM0m3te9ofzhv9P%2Fimage.png?alt=media&amp;token=6e18a5e6-16ac-40e8-bb2a-36315df86312" alt=""><figcaption></figcaption></figure>


