MENU navbar-image

Introduction

Start (and never finish) side projects with this API.

This documentation will provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by using the Authentication > Login API Endpoint.

Authentication

* Our APIs uses the bearer tokens to authorize and authenticate calls. It provides secure access to protect resources thereby reducing the hassle of asking for a username and password everytime a user logs in.

Register a new user

Once the user is registered, a welcome email is sent to the user. They can now login to the system using login API.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Ahsan Zaman\",
    \"email\": \"jerde.abdullah@example.net\",
    \"password\": \"Test1234\",
    \"password_confirmation\": \"Test1234\",
    \"training_activate\": false,
    \"country\": \"SA\",
    \"phone\": \"+966571708606\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ahsan Zaman",
    "email": "jerde.abdullah@example.net",
    "password": "Test1234",
    "password_confirmation": "Test1234",
    "training_activate": false,
    "country": "SA",
    "phone": "+966571708606"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the user. Must not be greater than 255 characters. Example: Ahsan Zaman

email   string   

The email of the user. Must be a valid email address. Must not be greater than 255 characters. Example: jerde.abdullah@example.net

password   string   

The password of the user. It must be at least 8 characters long and confirmed. Example: Test1234

password_confirmation   string   

The password confirmation of the user. It must match the password. The value and password must match. Example: Test1234

training_activate   boolean  optional  

Activate the training for the user. Example: false

seller   string  optional  

Seller ID of the user if applicable. Must be 8 characters.

country   string  optional  

The country code of the user. Must be 2 characters. Example: SA

phone   string  optional  

The phone number of the user. It should be a valid phone number for the specified country. Example: +966571708606

Login a user

This API is used to login a user. It returns a token that can be used to access protected resources.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"ahsan.web.ml@gmail.com\",
    \"password\": \"Test1234\",
    \"device_name\": \"My Laptop\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "ahsan.web.ml@gmail.com",
    "password": "Test1234",
    "device_name": "My Laptop"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The Email of the user. Example: ahsan.web.ml@gmail.com

password   string  optional  

The password of the user. Example: Test1234

device_name   string   

The name of the device from which the user is logging in. Example: My Laptop

Logout a user

requires authentication

This API is used to logout the current user. And revoke the access token.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/logout" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/logout"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/logout

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Branch

Permissions

Display a list of available permssions.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/permissions?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/permissions"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "name": "view.invoice",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "create.invoice",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "share.invoice",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "view.credit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "create.credit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "share.credit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "view.debit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "create.debit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "share.debit-note",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        },
        {
            "name": "view.dashboard",
            "updated_at": "2025-07-13",
            "created_at": "2025-07-13"
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": "http://127.0.0.1:8000/api/permissions?cursor=eyJwZXJtaXNzaW9ucy5pZCI6MTAsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/permissions",
        "per_page": 10,
        "next_cursor": "eyJwZXJtaXNzaW9ucy5pZCI6MTAsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
        "prev_cursor": null
    }
}
 

Request      

GET api/permissions

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Temp Files

Save a temporary file.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/temp-files/upload" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "image=@C:\Users\Ahsan\AppData\Local\Temp\php30C7.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/temp-files/upload"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/temp-files/upload

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

image   file  optional  

Must be an image. Must not be greater than 6000 kilobytes. Example: C:\Users\Ahsan\AppData\Local\Temp\php30C7.tmp

Delete a temporary file.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/temp-files/delete" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/temp-files/delete"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/temp-files/delete

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Delete a media file.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/temp-files/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/temp-files/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/temp-files/{media_id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

media_id   integer   

The ID of the media. Example: 1

Reports

Branch Dashboard

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/dashboard" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/dashboard"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Dashboard Data",
    "chart1": {
        "label": [],
        "data": [],
        "limit": "Unlimited",
        "used": 0,
        "remaining": "Unlimited"
    },
    "chart2": {
        "label": [],
        "data": [],
        "limit": 0,
        "used": 0,
        "remaining": 0
    },
    "chart3": {
        "label": [],
        "data": [],
        "limit": "Unlimited",
        "used": 0,
        "remaining": "Unlimited"
    },
    "totalSales": 0,
    "totalVat": 0,
    "totalCredit": 0,
    "totalCreditVat": 0,
    "chartSales": {
        "label": [],
        "data": [],
        "limit": 1000,
        "used": 0
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/dashboard

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Settings

Display invoice settings for specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/invoice-settings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/invoice-settings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "This action is unauthorized."
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/invoice-settings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Update invoice settings for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/invoice-settings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"invoice\": true,
    \"credit_note\": false,
    \"debit_note\": false,
    \"auto_sms\": false,
    \"auto_email\": true,
    \"currency\": \"rqglgntfd\",
    \"frac_unit\": \"wfriqawp\",
    \"qty_label\": \"bdbmtqcyuopfhougegxfvalb\",
    \"qty_label_ar\": \"ubrpnp\",
    \"qty2_label\": \"oruielmoii\",
    \"qty2_label_ar\": \"wwmswfk\",
    \"quotation_title_en\": \"turithp\",
    \"quotation_title_ar\": \"fwznfuyaobhbjkwyz\",
    \"show_qty2\": true,
    \"show_product_id\": false,
    \"total_qty\": false,
    \"show_word_amount\": true,
    \"show_word_amount_ar\": true,
    \"show_word_payable\": false,
    \"show_word_payable_ar\": true,
    \"show_name_en\": true,
    \"show_payment_method\": false,
    \"show_credit_days\": false,
    \"disable_credit_sales\": false,
    \"show_created_by\": false,
    \"customer_email\": false,
    \"customer_phone\": true,
    \"customer_additional_id\": true,
    \"customer_credit_limit\": false,
    \"add_to_inventory\": true,
    \"strict_inventory\": true,
    \"adjust_inventory\": false,
    \"pos_payment_required\": false,
    \"auto_print\": false,
    \"size\": 41,
    \"show_email\": true,
    \"show_phone\": true,
    \"use_min_max\": false,
    \"latest_price\": false,
    \"new_entry\": true,
    \"customer_in_simplified\": false,
    \"product_id_required\": false,
    \"total_qty_form\": false,
    \"reverse_invoice_items\": true,
    \"show_all_fields\": true,
    \"show_calc\": true,
    \"bank_must\": true,
    \"branch_bank_id\": 14,
    \"round_line_items\": true,
    \"negative_price\": true,
    \"format_amount\": false,
    \"rounding\": \"Downward Rounding\",
    \"tax_template_id\": 20,
    \"simplified_template_id\": 20,
    \"stamp\": \"fccamoxyktrabqdwnp\",
    \"auto_starting_balance\": false,
    \"attach_supplier_to_customer\": true,
    \"supplier_on_rv\": true,
    \"daily_sales_no\": false,
    \"tax_filing\": \"Monthly\",
    \"bank_on_rv\": true,
    \"optional_supplier_on_purchases\": false,
    \"purchase_sequence\": false,
    \"extras\": [
        {
            \"label\": \"kj\",
            \"value\": \"jmxsfzzqqtztksdvqaa\"
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/invoice-settings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "invoice": true,
    "credit_note": false,
    "debit_note": false,
    "auto_sms": false,
    "auto_email": true,
    "currency": "rqglgntfd",
    "frac_unit": "wfriqawp",
    "qty_label": "bdbmtqcyuopfhougegxfvalb",
    "qty_label_ar": "ubrpnp",
    "qty2_label": "oruielmoii",
    "qty2_label_ar": "wwmswfk",
    "quotation_title_en": "turithp",
    "quotation_title_ar": "fwznfuyaobhbjkwyz",
    "show_qty2": true,
    "show_product_id": false,
    "total_qty": false,
    "show_word_amount": true,
    "show_word_amount_ar": true,
    "show_word_payable": false,
    "show_word_payable_ar": true,
    "show_name_en": true,
    "show_payment_method": false,
    "show_credit_days": false,
    "disable_credit_sales": false,
    "show_created_by": false,
    "customer_email": false,
    "customer_phone": true,
    "customer_additional_id": true,
    "customer_credit_limit": false,
    "add_to_inventory": true,
    "strict_inventory": true,
    "adjust_inventory": false,
    "pos_payment_required": false,
    "auto_print": false,
    "size": 41,
    "show_email": true,
    "show_phone": true,
    "use_min_max": false,
    "latest_price": false,
    "new_entry": true,
    "customer_in_simplified": false,
    "product_id_required": false,
    "total_qty_form": false,
    "reverse_invoice_items": true,
    "show_all_fields": true,
    "show_calc": true,
    "bank_must": true,
    "branch_bank_id": 14,
    "round_line_items": true,
    "negative_price": true,
    "format_amount": false,
    "rounding": "Downward Rounding",
    "tax_template_id": 20,
    "simplified_template_id": 20,
    "stamp": "fccamoxyktrabqdwnp",
    "auto_starting_balance": false,
    "attach_supplier_to_customer": true,
    "supplier_on_rv": true,
    "daily_sales_no": false,
    "tax_filing": "Monthly",
    "bank_on_rv": true,
    "optional_supplier_on_purchases": false,
    "purchase_sequence": false,
    "extras": [
        {
            "label": "kj",
            "value": "jmxsfzzqqtztksdvqaa"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/invoice-settings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

invoice   boolean  optional  

Example: true

credit_note   boolean  optional  

Example: false

debit_note   boolean  optional  

Example: false

auto_sms   boolean  optional  

Example: false

auto_email   boolean  optional  

Example: true

currency   string  optional  

Must not be greater than 255 characters. Example: rqglgntfd

frac_unit   string  optional  

Must not be greater than 255 characters. Example: wfriqawp

qty_label   string  optional  

Must not be greater than 255 characters. Example: bdbmtqcyuopfhougegxfvalb

qty_label_ar   string  optional  

Must not be greater than 255 characters. Example: ubrpnp

qty2_label   string  optional  

Must not be greater than 32 characters. Example: oruielmoii

qty2_label_ar   string  optional  

Must not be greater than 32 characters. Example: wwmswfk

quotation_title_en   string  optional  

Must not be greater than 32 characters. Example: turithp

quotation_title_ar   string  optional  

Must not be greater than 32 characters. Example: fwznfuyaobhbjkwyz

show_qty2   boolean  optional  

Example: true

show_product_id   boolean  optional  

Example: false

total_qty   boolean  optional  

Example: false

show_word_amount   boolean  optional  

Example: true

show_word_amount_ar   boolean  optional  

Example: true

show_word_payable   boolean  optional  

Example: false

show_word_payable_ar   boolean  optional  

Example: true

show_name_en   boolean  optional  

Example: true

show_payment_method   boolean  optional  

Example: false

show_credit_days   boolean  optional  

Example: false

disable_credit_sales   boolean  optional  

Example: false

show_created_by   boolean  optional  

Example: false

customer_email   boolean  optional  

Example: false

customer_phone   boolean  optional  

Example: true

customer_additional_id   boolean  optional  

Example: true

customer_credit_limit   boolean  optional  

Example: false

add_to_inventory   boolean  optional  

Example: true

strict_inventory   boolean  optional  

Example: true

adjust_inventory   boolean  optional  

Example: false

pos_payment_required   boolean  optional  

Example: false

auto_print   boolean  optional  

Example: false

size   integer  optional  

Must be between 40 and 220. Example: 41

show_email   boolean  optional  

Example: true

show_phone   boolean  optional  

Example: true

use_min_max   boolean  optional  

Example: false

latest_price   boolean  optional  

Example: false

new_entry   boolean  optional  

Example: true

customer_in_simplified   boolean  optional  

Example: false

product_id_required   boolean  optional  

Example: false

total_qty_form   boolean  optional  

Example: false

reverse_invoice_items   boolean  optional  

Example: true

show_all_fields   boolean  optional  

Example: true

show_calc   boolean  optional  

Example: true

bank_must   boolean  optional  

Example: true

branch_bank_id   integer  optional  

The id of an existing record in the branch_banks table. Example: 14

round_line_items   boolean  optional  

Example: true

negative_price   boolean  optional  

Example: true

format_amount   boolean  optional  

Example: false

rounding   string   

Example: Downward Rounding

Must be one of:
  • Disabled
  • Upward Rounding
  • Downward Rounding
  • Normal Rounding
tax_template_id   integer  optional  

The id of an existing record in the invoice_templates table. Example: 20

simplified_template_id   integer  optional  

The id of an existing record in the invoice_templates table. Example: 20

extras   object[]  optional  

Must not have more than 10 items.

label   string  optional  

Must not be greater than 256 characters. Example: kj

value   string  optional  

Must not be greater than 256 characters. Example: jmxsfzzqqtztksdvqaa

stamp   string  optional  

Must not be greater than 1024 characters. Example: fccamoxyktrabqdwnp

auto_starting_balance   boolean  optional  

Example: false

attach_supplier_to_customer   boolean  optional  

Example: true

supplier_on_rv   boolean  optional  

Example: true

daily_sales_no   boolean  optional  

Example: false

tax_filing   string  optional  

Example: Monthly

Must be one of:
  • Quarterly
  • Monthly
custom_fields   object  optional  
bank_on_rv   boolean  optional  

Example: true

optional_supplier_on_purchases   boolean  optional  

Example: false

purchase_sequence   boolean  optional  

Example: false

Login with Google. Use Gmail account.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Redirect user to the following URL to initiate the login process",
    "data": "https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=449339483187-o1qidqhqu3kulg47ta8psgru5dkcmaum.apps.googleusercontent.com&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2Fapi%2Fcompanies%2F10000%2Fbranches%2F1000%2Fbranch-emails%2Flogin-with-google%2Fcallback&state=1000&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.send&approval_prompt=auto"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/branch-emails/login-with-google

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Login with Google. Callback URL.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google/callback" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"est\",
    \"state\": \"enim\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google/callback"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "code": "est",
    "state": "enim"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Access Denied"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/branch-emails/login-with-google/callback

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

code   string   

Example: est

state   string   

Example: enim

Login with Google. Disconnect Gmail account.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google/disconnect" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/login-with-google/disconnect"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Your company does not have any email configs."
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/branch-emails/login-with-google/disconnect

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Custom email settings for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "This action is unauthorized."
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/branch-emails

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"server\": \"gdixbn\",
    \"port\": 9,
    \"from\": \"lcyetohqzozp\",
    \"username\": \"bwiwefopnimalmmerpdrzfnjl\",
    \"password\": \"`2#Nd4zE%:@wuT-c!\",
    \"encryption\": \"ssl\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "server": "gdixbn",
    "port": 9,
    "from": "lcyetohqzozp",
    "username": "bwiwefopnimalmmerpdrzfnjl",
    "password": "`2#Nd4zE%:@wuT-c!",
    "encryption": "ssl"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/branch-emails

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

server   string  optional  

Must not be greater than 255 characters. Example: gdixbn

port   integer  optional  

Example: 9

from   string  optional  

Must not be greater than 255 characters. Example: lcyetohqzozp

username   string  optional  

Must not be greater than 255 characters. Example: bwiwefopnimalmmerpdrzfnjl

password   string  optional  

Must not be greater than 255 characters. Example: `2#Nd4zE%:@wuT-c!

encryption   string  optional  

Example: ssl

Must be one of:
  • ssl
  • tls

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/4" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-emails/4"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/branch-emails/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the branch email. Example: 4

Printer Client Download

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers/download" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers/download"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company}/branches/{branch}/printers/download

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company   integer   

The company. Example: 10000

branch   integer   

The branch. Example: 1000

Display the current printer for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 2,
            "created_at": "2025-07-19 02:26:26",
            "updated_at": "2025-07-19 02:26:26",
            "name": "Dell",
            "api_token": "Wy1EAfK4gzyUsXEBnF25GHRVD4GkrWkhlCXKTgLV"
        }
    ]
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/printers

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Add a new printer for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"lfg\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "lfg"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/printers

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: lfg

Remove the specified printer from the specified branch.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers/2" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/printers/2"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/printers/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the printer. Example: 2

List of custom fields for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"myilsqudsqhy\",
    \"name_ar\": \"qlhp\",
    \"type\": \"select\",
    \"options\": [
        \"hkcoueabpxkvcefhx\"
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "myilsqudsqhy",
    "name_ar": "qlhp",
    "type": "select",
    "options": [
        "hkcoueabpxkvcefhx"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: myilsqudsqhy

name_ar   string  optional  

Must not be greater than 255 characters. Example: qlhp

type   string   

Example: select

Must be one of:
  • text
  • date
  • number
  • select
options   string[]  optional  

Must not be greater than 255 characters.

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields/7" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"name_ar\": \"mjygivaaeay\",
    \"type\": \"text\",
    \"options\": [
        \"tyex\"
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields/7"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "b",
    "name_ar": "mjygivaaeay",
    "type": "text",
    "options": [
        "tyex"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/custom-fields/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the custom field. Example: 7

Body Parameters

name   string   

Must not be greater than 255 characters. Example: b

name_ar   string  optional  

Must not be greater than 255 characters. Example: mjygivaaeay

type   string   

Example: text

Must be one of:
  • text
  • date
  • number
  • select
options   string[]  optional  

Must not be greater than 255 characters.

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/custom-fields/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the custom field. Example: 1

List of product custom fields for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/product-custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new product custom field for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"mjkniboenxrjleayiftxmlvnd\",
    \"name_ar\": \"mopuijsqolgav\",
    \"type\": \"select\",
    \"options\": [
        \"aiupmshmlxqtbrvxwu\"
    ],
    \"calculative\": true
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "mjkniboenxrjleayiftxmlvnd",
    "name_ar": "mopuijsqolgav",
    "type": "select",
    "options": [
        "aiupmshmlxqtbrvxwu"
    ],
    "calculative": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/product-custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: mjkniboenxrjleayiftxmlvnd

name_ar   string  optional  

Must not be greater than 255 characters. Example: mopuijsqolgav

type   string   

Example: select

Must be one of:
  • text
  • date
  • number
  • select
options   string[]  optional  

Must not be greater than 255 characters.

calculative   boolean  optional  

Example: true

Update the product custom field for the specified branch.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields/18" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"whzzshga\",
    \"name_ar\": \"xhnlbgqlexopuavrlgcognj\",
    \"type\": \"number\",
    \"options\": [
        \"ljqqdvkczlugwbdvcjfeoh\"
    ],
    \"calculative\": true
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields/18"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "whzzshga",
    "name_ar": "xhnlbgqlexopuavrlgcognj",
    "type": "number",
    "options": [
        "ljqqdvkczlugwbdvcjfeoh"
    ],
    "calculative": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/product-custom-fields/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/product-custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product custom field. Example: 18

Body Parameters

name   string   

Must not be greater than 255 characters. Example: whzzshga

name_ar   string  optional  

Must not be greater than 255 characters. Example: xhnlbgqlexopuavrlgcognj

type   string   

Example: number

Must be one of:
  • text
  • date
  • number
  • select
options   string[]  optional  

Must not be greater than 255 characters.

calculative   boolean  optional  

Example: true

Delete the product custom field.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields/6" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-custom-fields/6"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/product-custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product custom field. Example: 6

List of customer custom fields for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/customer-custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new customer custom field for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"icizgfkuleuomrgascmrkwjjs\",
    \"name_ar\": \"tzjtkenqmajntiiktosg\",
    \"type\": \"number\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "icizgfkuleuomrgascmrkwjjs",
    "name_ar": "tzjtkenqmajntiiktosg",
    "type": "number"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/customer-custom-fields

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: icizgfkuleuomrgascmrkwjjs

name_ar   string  optional  

Must not be greater than 255 characters. Example: tzjtkenqmajntiiktosg

type   string   

Example: number

Must be one of:
  • text
  • date
  • number

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields/13" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"juslpyszuxjtjuubeormyhpm\",
    \"name_ar\": \"eijt\",
    \"type\": \"date\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields/13"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "juslpyszuxjtjuubeormyhpm",
    "name_ar": "eijt",
    "type": "date"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/customer-custom-fields/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/customer-custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer custom field. Example: 13

Body Parameters

name   string   

Must not be greater than 255 characters. Example: juslpyszuxjtjuubeormyhpm

name_ar   string  optional  

Must not be greater than 255 characters. Example: eijt

type   string   

Example: date

Must be one of:
  • text
  • date
  • number

Delete the customer custom field from the specified branch.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields/3" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-custom-fields/3"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/customer-custom-fields/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer custom field. Example: 3

Setting Sales Groups

List of customers for the specified sales group.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/sales-groups/{salesGroup_id}/customers

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

salesGroup_id   integer   

The ID of the salesGroup. Example: 1

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Generate PDF of customers for the specified sales group.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers/export/pdf?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers/export/pdf"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/sales-groups/{salesGroup_id}/customers/export/pdf

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

salesGroup_id   integer   

The ID of the salesGroup. Example: 1

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Transfer customers from one sales person to another.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers/transfer" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customers\": [
        15
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1/customers/transfer"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customers": [
        15
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Customers transferred successfully."
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/sales-groups/{salesGroup_id}/customers/transfer

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

salesGroup_id   integer   

The ID of the salesGroup. Example: 1

Body Parameters

customers   integer[]  optional  

List of sales groups for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "created_at": "2025-07-19 23:32:45",
            "updated_at": "2025-07-19 23:32:45",
            "deleted_at": null,
            "code": "SG001",
            "name": "Sales Group TEST 1",
            "name_en": null,
            "phone": null,
            "email": null,
            "country": null,
            "address": null,
            "branch_id": 1000,
            "user_id": null,
            "invoice_template_id": null,
            "customer_type_id": null,
            "type": "B2B Sales",
            "route_planning": 0,
            "name_locale": "Sales Group TEST 1"
        },
        {
            "id": 2,
            "created_at": "2025-07-19 23:32:56",
            "updated_at": "2025-07-19 23:48:33",
            "deleted_at": null,
            "code": "SG002",
            "name": "No-example",
            "name_en": null,
            "phone": null,
            "email": null,
            "country": null,
            "address": null,
            "branch_id": 1000,
            "user_id": null,
            "invoice_template_id": null,
            "customer_type_id": null,
            "type": "B2B Sales",
            "route_planning": 0,
            "name_locale": "No-example"
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/sales-groups

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new sales group for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"SG001\",
    \"name\": \"No-example\",
    \"type\": \"B2B Sales\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "code": "SG001",
    "name": "No-example",
    "type": "B2B Sales"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/sales-groups

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

code   string   

Unique code for the sales group. Must not be greater than 255 characters. Example: SG001

name   string   

Name of the sales group. Must not be greater than 255 characters. Example: No-example

name_en   string  optional  

Name of the sales group in English. Must not be greater than 255 characters.

email   string  optional  

Email of the sales group. Must not be greater than 255 characters.

phone   string  optional  

Point of contact for the sales group. Must not be greater than 255 characters.

country   string  optional  

Country code of the phone number. ISO 3166-1 alpha-2 format. This field is required when phone is present. Must be 2 characters.

address   string  optional  

Addess of the sales group. Must not be greater than 255 characters.

user_id   integer  optional  

Assign user to the sales group.

invoice_template_id   integer  optional  

Custom invoice template for the sales group.

customer_type_id   integer  optional  

Set default customer type for the sales group.

route_planning   boolean  optional  

Default route planning for the sales group.

type   string   

Type of the sales group. Possible values: Direct Sales, B2B Sales. Example: B2B Sales

Must be one of:
  • Direct Sales
  • B2B Sales

Update the sales group for the specified branch.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"SG001\",
    \"name\": \"No-example\",
    \"type\": \"B2B Sales\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "code": "SG001",
    "name": "No-example",
    "type": "B2B Sales"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/sales-groups/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/sales-groups/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the sales group. Example: 1

Body Parameters

code   string   

Unique code for the sales group. Must not be greater than 255 characters. Example: SG001

name   string   

Name of the sales group. Must not be greater than 255 characters. Example: No-example

name_en   string  optional  

Name of the sales group in English. Must not be greater than 255 characters.

email   string  optional  

Email of the sales group. Must not be greater than 255 characters.

phone   string  optional  

Point of contact for the sales group. Must not be greater than 255 characters.

country   string  optional  

Country code of the phone number. ISO 3166-1 alpha-2 format. This field is required when phone is present. Must be 2 characters.

address   string  optional  

Addess of the sales group. Must not be greater than 255 characters.

user_id   integer  optional  

Assign user to the sales group.

invoice_template_id   integer  optional  

Custom invoice template for the sales group.

customer_type_id   integer  optional  

Set default customer type for the sales group.

route_planning   boolean  optional  

Default route planning for the sales group.

type   string   

Type of the sales group. Possible values: Direct Sales, B2B Sales. Example: B2B Sales

Must be one of:
  • Direct Sales
  • B2B Sales

Delete the sales group

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/sales-groups/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/sales-groups/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the sales group. Example: 1

Roles

List of the roles available for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles?per_page=10&with_disabled=&with_permissions=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"with_permissions\": true
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
    "with_permissions": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "with_permissions": true
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/roles

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

with_permissions   boolean  optional  

Load with or without permssions. Example: false

Body Parameters

with_permissions   boolean  optional  

Example: true

Create a new role for the specified branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"New Role\",
    \"permissions\": [
        \"uftdqkceyrm\"
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "New Role",
    "permissions": [
        "uftdqkceyrm"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/roles

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

The name of the role. Must not be greater than 255 characters. Example: New Role

permissions   string[]  optional  

The name of an existing record in the permissions table. Must not be greater than 255 characters.

Update A Role.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"New Role\",
    \"permissions\": [
        \"fjnebiszmxuhyjhbidrldxf\"
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "New Role",
    "permissions": [
        "fjnebiszmxuhyjhbidrldxf"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/roles/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/roles/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the role. Example: 1

Body Parameters

name   string   

The name of the role. Must not be greater than 255 characters. Example: New Role

permissions   string[]  optional  

The name of an existing record in the permissions table. Must not be greater than 255 characters.

Delete a Role.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/roles/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/roles/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the role. Example: 1

Branch Users

Recalculate the user cash in hand balance.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1/recalculate-balance" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1/recalculate-balance"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/branch-users/{branchUser_id}/recalculate-balance

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

branchUser_id   integer   

The ID of the branchUser. Example: 1

Enable or disable OTP authentication for a user.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1/toggle-otp" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1/toggle-otp"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/branch-users/{branchUser_id}/toggle-otp

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

branchUser_id   integer   

The ID of the branchUser. Example: 1

Display a listing of the users in the current branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "name": "Ahsan Zaman",
            "email": "ahsan.web.ml@gmail.com",
            "email_verified": true,
            "phone": "+966571708606",
            "user_type": null,
            "default_payment_status": null,
            "default_payment_method": "cash",
            "profile_photo": null,
            "created_at": "2025-07-13 18:12:08",
            "updated_at": "2025-07-13 18:12:08",
            "role": "Admin",
            "inventory_location_id": "",
            "cash_in_hand": 0,
            "cash_in_hand_limit": ""
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/branch-users

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Add a new user to the branch.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"zzeewjerxfxbuxoodtbhmmp\",
    \"email\": \"pfeffer.levi@example.net\",
    \"password\": \"3|dlq,al4JHO$\",
    \"country\": \"pe\",
    \"phone\": \"est\",
    \"role_id\": 13,
    \"role\": \"Custom User\",
    \"cash_in_hand_limit\": 32115.9504536,
    \"permissions\": [
        \"pdybrakjvxlqtrrifvpcv\"
    ],
    \"location_id\": 7,
    \"sales_person_id\": 20,
    \"locale\": \"ar\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "zzeewjerxfxbuxoodtbhmmp",
    "email": "pfeffer.levi@example.net",
    "password": "3|dlq,al4JHO$",
    "country": "pe",
    "phone": "est",
    "role_id": 13,
    "role": "Custom User",
    "cash_in_hand_limit": 32115.9504536,
    "permissions": [
        "pdybrakjvxlqtrrifvpcv"
    ],
    "location_id": 7,
    "sales_person_id": 20,
    "locale": "ar"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/branch-users

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: zzeewjerxfxbuxoodtbhmmp

email   string   

Must be a valid email address. Example: pfeffer.levi@example.net

password   string  optional  

Must be at least 6 characters. Example: 3|dlq,al4JHO$

country   string   

Must be 2 characters. Example: pe

phone   string   

Example: est

role_id   integer  optional  

Example: 13

role   string   

Example: Custom User

Must be one of:
  • Operator
  • Sales
  • Custom User
cash_in_hand_limit   number  optional  

Example: 32115.9504536

permissions   string[]  optional  

The name of an existing record in the permissions table. Must not be greater than 255 characters.

location_id   integer  optional  

Example: 7

sales_person_id   integer  optional  

Example: 20

locale   string  optional  

Example: ar

Must be one of:
  • en
  • ar

Update settings for a user in the branch.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"dokfe\",
    \"email\": \"bhegmann@example.com\",
    \"password\": \"L:9}FoQF]oNl=#eD#x\",
    \"country\": \"vk\",
    \"phone\": \"enim\",
    \"role_id\": 6,
    \"role\": \"Sales\",
    \"cash_in_hand_limit\": 311.7,
    \"permissions\": [
        \"gusblldrkhlzhkhvnmglpkhk\"
    ],
    \"location_id\": 14,
    \"sales_person_id\": 15,
    \"locale\": \"ar\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "dokfe",
    "email": "bhegmann@example.com",
    "password": "L:9}FoQF]oNl=#eD#x",
    "country": "vk",
    "phone": "enim",
    "role_id": 6,
    "role": "Sales",
    "cash_in_hand_limit": 311.7,
    "permissions": [
        "gusblldrkhlzhkhvnmglpkhk"
    ],
    "location_id": 14,
    "sales_person_id": 15,
    "locale": "ar"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/branch-users/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/branch-users/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the branch user. Example: 1

Body Parameters

name   string   

Must not be greater than 255 characters. Example: dokfe

email   string   

Must be a valid email address. Example: bhegmann@example.com

password   string  optional  

Must be at least 6 characters. Example: L:9}FoQF]oNl=#eD#x

country   string   

Must be 2 characters. Example: vk

phone   string   

Example: enim

role_id   integer  optional  

Example: 6

role   string   

Example: Sales

Must be one of:
  • Operator
  • Sales
  • Custom User
cash_in_hand_limit   number  optional  

Example: 311.7

permissions   string[]  optional  

The name of an existing record in the permissions table. Must not be greater than 255 characters.

location_id   integer  optional  

Example: 14

sales_person_id   integer  optional  

Example: 15

locale   string  optional  

Example: ar

Must be one of:
  • en
  • ar

Remove a user from the branch.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/branch-users/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/branch-users/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the branch user. Example: 1

API Tokens

Display a listing of the user tokens.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1004,
            "branch_id": null,
            "name": "My Laptop",
            "last_used_ago": "1 week ago"
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/api-tokens

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new token.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"tjsyioqfssszorp\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "tjsyioqfssszorp"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/api-tokens

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: tjsyioqfssszorp

Delete a specific token.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens/1004" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/api-tokens/1004"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/api-tokens/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the api token. Example: 1004

Customer Types

Display a listing of the customer Types for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "created_at": "2025-07-23 20:14:50",
            "updated_at": "2025-07-23 20:14:50",
            "is_active": true,
            "no": "RT",
            "name": "Retail",
            "starting_no": "RT-00001",
            "auto_no": 1,
            "rounding": 1,
            "customers_count": 0
        },
        {
            "id": 2,
            "created_at": "2025-07-23 20:15:09",
            "updated_at": "2025-07-23 20:15:09",
            "is_active": true,
            "no": "B2B",
            "name": "Back Office",
            "starting_no": null,
            "auto_no": 0,
            "rounding": 1,
            "customers_count": 0
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/customer-types

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a new Customer Type.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"no\": \"RT\",
    \"name\": \"Retail\",
    \"auto_no\": false,
    \"starting_no\": \"RT-00001\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "no": "RT",
    "name": "Retail",
    "auto_no": false,
    "starting_no": "RT-00001"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/customer-types

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

no   string   

The unique number for the customer type. Must not be greater than 255 characters. Example: RT

name   string   

The name of the customer type. Must not be greater than 255 characters. Example: Retail

auto_no   boolean  optional  

Indicates if the customers created using this customer type will get auto-generated customer numbers or not. Example: false

starting_no   string  optional  

The starting number for auto-generated customer numbers. Must not be greater than 255 characters. Example: RT-00001

Update the specified Customer Type.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"no\": \"RT\",
    \"name\": \"Retail\",
    \"auto_no\": false,
    \"starting_no\": \"RT-00001\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "no": "RT",
    "name": "Retail",
    "auto_no": false,
    "starting_no": "RT-00001"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/customer-types/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/customer-types/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer type. Example: 1

Body Parameters

no   string   

The unique number for the customer type. Must not be greater than 255 characters. Example: RT

name   string   

The name of the customer type. Must not be greater than 255 characters. Example: Retail

auto_no   boolean  optional  

Indicates if the customers created using this customer type will get auto-generated customer numbers or not. Example: false

starting_no   string  optional  

The starting number for auto-generated customer numbers. Must not be greater than 255 characters. Example: RT-00001

Remove the specified Customer Type.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customer-types/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/customer-types/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer type. Example: 1

Customer Regions

Display a listing of the regions for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "name": "North Region",
            "updated_at": "2025-07-23 20:28:38",
            "created_at": "2025-07-23 20:28:38",
            "is_active": true
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/regions

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a new region.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"North Region\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "North Region"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/regions

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

The name of the customer type. Must not be greater than 255 characters. Example: North Region

Update the specified region.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"North Region\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "North Region"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/regions/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/regions/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the region. Example: 1

Body Parameters

name   string   

The name of the customer type. Must not be greater than 255 characters. Example: North Region

Remove the specified region.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/regions/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/regions/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the region. Example: 1

Customers

POST api/companies/{company_id}/branches/{branch_id}/customers/{customer_id}/calculate-balance

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/7/calculate-balance" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/7/calculate-balance"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/customers/{customer_id}/calculate-balance

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

customer_id   integer   

The ID of the customer. Example: 7

Export customers to Excel.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/8/export/excel" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sortBy\": \"customer_no\",
    \"customer\": \"owoypmjwwaoagx\",
    \"customer_no\": \"dhzgxlix\",
    \"customer_phone\": \"akvoqzpbaghxfo\",
    \"cr_no\": \"sr\",
    \"vat_no\": \"sg\",
    \"additional_id\": \"uanulunmwe\",
    \"customer_id\": 12,
    \"customer_type_id\": 12,
    \"sp\": 7,
    \"sg\": 9,
    \"approved_by\": 9
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/8/export/excel"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sortBy": "customer_no",
    "customer": "owoypmjwwaoagx",
    "customer_no": "dhzgxlix",
    "customer_phone": "akvoqzpbaghxfo",
    "cr_no": "sr",
    "vat_no": "sg",
    "additional_id": "uanulunmwe",
    "customer_id": 12,
    "customer_type_id": 12,
    "sp": 7,
    "sg": 9,
    "approved_by": 9
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: public
content-disposition: attachment; filename="2025-07-30 23:30:22-customers.xlsx"
content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
accept-ranges: bytes
vary: Origin
 


 

Request      

GET api/companies/{company_id}/branches/{branch_id}/customers/{customer}/export/excel

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

customer   integer   

The customer. Example: 8

Body Parameters

sortBy   string  optional  

Example: customer_no

Must be one of:
  • customer_no
customer   string  optional  

Must not be greater than 255 characters. Example: owoypmjwwaoagx

customer_no   string  optional  

Must not be greater than 255 characters. Example: dhzgxlix

customer_phone   string  optional  

Must not be greater than 15 characters. Example: akvoqzpbaghxfo

cr_no   string  optional  

Must not be greater than 10 characters. Example: sr

vat_no   string  optional  

Must not be greater than 15 characters. Example: sg

additional_id   string  optional  

Must not be greater than 255 characters. Example: uanulunmwe

customer_id   integer  optional  

Example: 12

customer_type_id   integer  optional  

Example: 12

sp   integer  optional  

Example: 7

sg   integer  optional  

Example: 9

approved_by   integer  optional  

Example: 9

Generate PDF for customers.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/7/export/pdf" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sortBy\": \"customer_no\",
    \"customer\": \"xiqavndwdhla\",
    \"customer_no\": \"yfjuaxohbiqzppmmyh\",
    \"customer_phone\": \"arktztrocaoztm\",
    \"cr_no\": \"py\",
    \"vat_no\": \"cbtxx\",
    \"additional_id\": \"xhggzfengajm\",
    \"customer_id\": 20,
    \"customer_type_id\": 12,
    \"sp\": 5,
    \"sg\": 1,
    \"approved_by\": 6
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/7/export/pdf"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sortBy": "customer_no",
    "customer": "xiqavndwdhla",
    "customer_no": "yfjuaxohbiqzppmmyh",
    "customer_phone": "arktztrocaoztm",
    "cr_no": "py",
    "vat_no": "cbtxx",
    "additional_id": "xhggzfengajm",
    "customer_id": 20,
    "customer_type_id": 12,
    "sp": 5,
    "sg": 1,
    "approved_by": 6
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/customers/{customer}/export/pdf

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

customer   integer   

The customer. Example: 7

Body Parameters

sortBy   string  optional  

Example: customer_no

Must be one of:
  • customer_no
customer   string  optional  

Must not be greater than 255 characters. Example: xiqavndwdhla

customer_no   string  optional  

Must not be greater than 255 characters. Example: yfjuaxohbiqzppmmyh

customer_phone   string  optional  

Must not be greater than 15 characters. Example: arktztrocaoztm

cr_no   string  optional  

Must not be greater than 10 characters. Example: py

vat_no   string  optional  

Must not be greater than 15 characters. Example: cbtxx

additional_id   string  optional  

Must not be greater than 255 characters. Example: xhggzfengajm

customer_id   integer  optional  

Example: 20

customer_type_id   integer  optional  

Example: 12

sp   integer  optional  

Example: 5

sg   integer  optional  

Example: 1

approved_by   integer  optional  

Example: 6

Display a listing of the customers for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sortBy\": \"customer_no\",
    \"customer\": \"picmg\",
    \"customer_no\": \"gmits\",
    \"customer_phone\": \"xr\",
    \"cr_no\": \"ugfakz\",
    \"vat_no\": \"diunlzenblqflhq\",
    \"additional_id\": \"hakrnzwsjjctn\",
    \"customer_id\": 20,
    \"customer_type_id\": 15,
    \"region_id\": 6,
    \"sp\": 17,
    \"sg\": 5,
    \"approved_by\": 12
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sortBy": "customer_no",
    "customer": "picmg",
    "customer_no": "gmits",
    "customer_phone": "xr",
    "cr_no": "ugfakz",
    "vat_no": "diunlzenblqflhq",
    "additional_id": "hakrnzwsjjctn",
    "customer_id": 20,
    "customer_type_id": 15,
    "region_id": 6,
    "sp": 17,
    "sg": 5,
    "approved_by": 12
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/customers

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Body Parameters

sortBy   string  optional  

Example: customer_no

Must be one of:
  • customer_no
customer   string  optional  

Must not be greater than 255 characters. Example: picmg

customer_no   string  optional  

Must not be greater than 255 characters. Example: gmits

customer_phone   string  optional  

Must not be greater than 15 characters. Example: xr

cr_no   string  optional  

Must not be greater than 10 characters. Example: ugfakz

vat_no   string  optional  

Must not be greater than 15 characters. Example: diunlzenblqflhq

additional_id   string  optional  

Must not be greater than 255 characters. Example: hakrnzwsjjctn

customer_id   integer  optional  

Example: 20

customer_type_id   integer  optional  

Example: 15

region_id   integer  optional  

Example: 6

sp   integer  optional  

Example: 17

sg   integer  optional  

Example: 5

approved_by   integer  optional  

Example: 12

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_no\": \"CUST-001\",
    \"customer_type\": \"c\",
    \"customer_type_id\": 1,
    \"customer_name\": \"جون دو\",
    \"customer_name_en\": \"John Doe\",
    \"address\": \"123 Main St, Riyadh\",
    \"country\": \"SA\",
    \"phone\": \"+966500000000\",
    \"sales_person_id\": 1,
    \"customer_visit_plan_id\": 1,
    \"balance\": 1000,
    \"region\": \"Riyadh\",
    \"region_id\": 1,
    \"google_maps\": \"https:\\/\\/maps.google.com\\/?q=24.7136,46.6753\",
    \"credit_limit\": 5000,
    \"max_credit_days\": 30,
    \"short_address\": \"RAHA3443\",
    \"building_no\": \"٢٩٢٩\",
    \"street_address\": \"ريحانة بنت زيد\",
    \"secondary_no\": \"٨١١٨\",
    \"district_name\": \"حي العارض\",
    \"city\": \"الرياض\",
    \"zip_code\": \"١٣٣٣٧\",
    \"short_address_en\": \"RAHA3443\",
    \"building_no_en\": \"2929\",
    \"street_address_en\": \"Raihan Bint Zaid\",
    \"secondary_no_en\": \"8118\",
    \"district_name_en\": \"Al Arid\",
    \"city_en\": \"Riyadh\",
    \"zip_code_en\": \"13337\",
    \"contacts\": [
        {
            \"name\": \"Jane Doe\",
            \"phone\": \"+966500000001\"
        }
    ],
    \"cfs\": [
        {
            \"id\": 17,
            \"value\": \"ungryoqp\"
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_no": "CUST-001",
    "customer_type": "c",
    "customer_type_id": 1,
    "customer_name": "جون دو",
    "customer_name_en": "John Doe",
    "address": "123 Main St, Riyadh",
    "country": "SA",
    "phone": "+966500000000",
    "sales_person_id": 1,
    "customer_visit_plan_id": 1,
    "balance": 1000,
    "region": "Riyadh",
    "region_id": 1,
    "google_maps": "https:\/\/maps.google.com\/?q=24.7136,46.6753",
    "credit_limit": 5000,
    "max_credit_days": 30,
    "short_address": "RAHA3443",
    "building_no": "٢٩٢٩",
    "street_address": "ريحانة بنت زيد",
    "secondary_no": "٨١١٨",
    "district_name": "حي العارض",
    "city": "الرياض",
    "zip_code": "١٣٣٣٧",
    "short_address_en": "RAHA3443",
    "building_no_en": "2929",
    "street_address_en": "Raihan Bint Zaid",
    "secondary_no_en": "8118",
    "district_name_en": "Al Arid",
    "city_en": "Riyadh",
    "zip_code_en": "13337",
    "contacts": [
        {
            "name": "Jane Doe",
            "phone": "+966500000001"
        }
    ],
    "cfs": [
        {
            "id": 17,
            "value": "ungryoqp"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/customers

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

customer_no   string  optional  

Unique customer number for the customer. If not provided, it will be auto-generated. Must not be greater than 255 characters. Example: CUST-001

customer_type   string  optional  

Type of customer, either "c" for consumer or "b" for business. Example: c

Must be one of:
  • c
  • b
customer_type_id   integer  optional  

ID of the customer type. Must exist in the customer types for the branch. The id of an existing record in the customer_types table. Example: 1

customer_name   string   

Arabic name of the customer. Must not be greater than 255 characters. Example: جون دو

customer_name_en   string  optional  

Name of the customer. Must not be greater than 255 characters. Example: John Doe

address   string   

Line Address of the customer. Must not be greater than 255 characters. Example: 123 Main St, Riyadh

email   string  optional  

Email address of the customer. Required if the branch settings require customer email. Must be a valid email address.

country   string  optional  

Country code of the customer's location, must be a 2-letter ISO code. This field is required when phone is present. Must be 2 characters. Example: SA

phone   string  optional  

Phone number of the customer. Required if the branch settings require customer phone. Example: +966500000000

customer_vat_no   string  optional  

VAT number of the customer, must be 15 digits. Must be 15 digits.

cr_no   string  optional  

Commercial Registration number of the customer, must be 10 digits. Must be 10 characters.

un   string  optional  

Unified Number of the customer, must be 10 digits. Must be 10 characters.

sales_person_id   integer  optional  

ID of the sales person associated with the customer. Must exist in the sales people for the branch. The id of an existing record in the sales_people table. Example: 1

customer_visit_plan_id   integer  optional  

ID of the customer visit plan associated with the customer. Must exist in the visit plans for the branch. The id of an existing record in the customer_visit_plans table. Example: 1

balance   number  optional  

Current balance of the customer. Example: 1000

region   string  optional  

Region of the customer's location. Must not be greater than 255 characters. Example: Riyadh

region_id   integer  optional  

ID of the region associated with the customer. Must exist in the regions for the branch. The id of an existing record in the regions table. Example: 1

google_maps   string  optional  

Google Maps link for the customer's location. Must not be greater than 255 characters. Example: https://maps.google.com/?q=24.7136,46.6753

credit_limit   number  optional  

Credit limit for the customer. Example: 5000

max_credit_days   integer  optional  

Maximum credit days allowed for the customer. Example: 30

contacts   object[]  optional  

Array of contacts associated with the customer.

name   string   

Name of the contact person. Example: Jane Doe

phone   string   

Phone number of the contact person. Example: +966500000001

supplier_id   integer  optional  

ID of the supplier associated with the customer.

short_address   string  optional  

The short address for the customer. (Arabic). Must not be greater than 255 characters. Example: RAHA3443

building_no   string  optional  

Building number of the customer. (Arabic). Must not be greater than 255 characters. Example: ٢٩٢٩

street_address   string  optional  

Street name of the customer. (Arabic). Must not be greater than 255 characters. Example: ريحانة بنت زيد

secondary_no   string  optional  

Secondary number of the customer. (Arabic). Must not be greater than 255 characters. Example: ٨١١٨

district_name   string  optional  

District of the customer. (Arabic). Must not be greater than 255 characters. Example: حي العارض

city   string  optional  

City of the customer. (Arabic). Must not be greater than 255 characters. Example: الرياض

zip_code   string  optional  

Postal code of the customer. (Arabic). Must not be greater than 255 characters. Example: ١٣٣٣٧

short_address_en   string  optional  

The short address for the customer. (English). Must not be greater than 255 characters. Example: RAHA3443

building_no_en   string  optional  

Building number of the customer. (English). Must not be greater than 255 characters. Example: 2929

street_address_en   string  optional  

Street name of the customer. (English). Must not be greater than 255 characters. Example: Raihan Bint Zaid

secondary_no_en   string  optional  

Secondary number of the customer. (English). Must not be greater than 255 characters. Example: 8118

district_name_en   string  optional  

District of the customer. (English). Must not be greater than 255 characters. Example: Al Arid

city_en   string  optional  

City of the customer. (English). Must not be greater than 255 characters. Example: Riyadh

zip_code_en   string  optional  

Postal code of the customer. (English). Must not be greater than 255 characters. Example: 13337

cfs   object[]  optional  
id   integer   

The id of an existing record in the customer_custom_fields table. Example: 17

value   string  optional  

Must not be greater than 255 characters. Example: ungryoqp

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/4" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_no\": \"CUST-001\",
    \"customer_type\": \"c\",
    \"customer_type_id\": 1,
    \"customer_name\": \"جون دو\",
    \"customer_name_en\": \"John Doe\",
    \"address\": \"123 Main St, Riyadh\",
    \"country\": \"SA\",
    \"phone\": \"+966500000000\",
    \"sales_person_id\": 1,
    \"customer_visit_plan_id\": 1,
    \"balance\": 1000,
    \"region\": \"Riyadh\",
    \"region_id\": 1,
    \"google_maps\": \"https:\\/\\/maps.google.com\\/?q=24.7136,46.6753\",
    \"credit_limit\": 5000,
    \"max_credit_days\": 30,
    \"short_address\": \"RAHA3443\",
    \"building_no\": \"٢٩٢٩\",
    \"street_address\": \"ريحانة بنت زيد\",
    \"secondary_no\": \"٨١١٨\",
    \"district_name\": \"حي العارض\",
    \"city\": \"الرياض\",
    \"zip_code\": \"١٣٣٣٧\",
    \"short_address_en\": \"RAHA3443\",
    \"building_no_en\": \"2929\",
    \"street_address_en\": \"Raihan Bint Zaid\",
    \"secondary_no_en\": \"8118\",
    \"district_name_en\": \"Al Arid\",
    \"city_en\": \"Riyadh\",
    \"zip_code_en\": \"13337\",
    \"contacts\": [
        {
            \"name\": \"Jane Doe\",
            \"phone\": \"+966500000001\"
        }
    ],
    \"cfs\": [
        {
            \"id\": 8,
            \"value\": \"yyooukvlezujwvmiamjafqo\"
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/4"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_no": "CUST-001",
    "customer_type": "c",
    "customer_type_id": 1,
    "customer_name": "جون دو",
    "customer_name_en": "John Doe",
    "address": "123 Main St, Riyadh",
    "country": "SA",
    "phone": "+966500000000",
    "sales_person_id": 1,
    "customer_visit_plan_id": 1,
    "balance": 1000,
    "region": "Riyadh",
    "region_id": 1,
    "google_maps": "https:\/\/maps.google.com\/?q=24.7136,46.6753",
    "credit_limit": 5000,
    "max_credit_days": 30,
    "short_address": "RAHA3443",
    "building_no": "٢٩٢٩",
    "street_address": "ريحانة بنت زيد",
    "secondary_no": "٨١١٨",
    "district_name": "حي العارض",
    "city": "الرياض",
    "zip_code": "١٣٣٣٧",
    "short_address_en": "RAHA3443",
    "building_no_en": "2929",
    "street_address_en": "Raihan Bint Zaid",
    "secondary_no_en": "8118",
    "district_name_en": "Al Arid",
    "city_en": "Riyadh",
    "zip_code_en": "13337",
    "contacts": [
        {
            "name": "Jane Doe",
            "phone": "+966500000001"
        }
    ],
    "cfs": [
        {
            "id": 8,
            "value": "yyooukvlezujwvmiamjafqo"
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/customers/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/customers/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer. Example: 4

Body Parameters

customer_no   string  optional  

Unique customer number for the customer. If not provided, it will be auto-generated. Must not be greater than 255 characters. Example: CUST-001

customer_type   string  optional  

Type of customer, either "c" for consumer or "b" for business. Example: c

Must be one of:
  • c
  • b
customer_type_id   integer  optional  

ID of the customer type. Must exist in the customer types for the branch. The id of an existing record in the customer_types table. Example: 1

customer_name   string   

Arabic name of the customer. Must not be greater than 255 characters. Example: جون دو

customer_name_en   string  optional  

Name of the customer. Must not be greater than 255 characters. Example: John Doe

address   string   

Line Address of the customer. Must not be greater than 255 characters. Example: 123 Main St, Riyadh

email   string  optional  

Email address of the customer. Required if the branch settings require customer email. Must be a valid email address.

country   string  optional  

Country code of the customer's location, must be a 2-letter ISO code. This field is required when phone is present. Must be 2 characters. Example: SA

phone   string  optional  

Phone number of the customer. Required if the branch settings require customer phone. Example: +966500000000

customer_vat_no   string  optional  

VAT number of the customer, must be 15 digits. Must be 15 digits.

cr_no   string  optional  

Commercial Registration number of the customer, must be 10 digits. Must be 10 characters.

un   string  optional  

Unified Number of the customer, must be 10 digits. Must be 10 characters.

sales_person_id   integer  optional  

ID of the sales person associated with the customer. Must exist in the sales people for the branch. The id of an existing record in the sales_people table. Example: 1

customer_visit_plan_id   integer  optional  

ID of the customer visit plan associated with the customer. Must exist in the visit plans for the branch. The id of an existing record in the customer_visit_plans table. Example: 1

balance   number  optional  

Current balance of the customer. Example: 1000

region   string  optional  

Region of the customer's location. Must not be greater than 255 characters. Example: Riyadh

region_id   integer  optional  

ID of the region associated with the customer. Must exist in the regions for the branch. The id of an existing record in the regions table. Example: 1

google_maps   string  optional  

Google Maps link for the customer's location. Must not be greater than 255 characters. Example: https://maps.google.com/?q=24.7136,46.6753

credit_limit   number  optional  

Credit limit for the customer. Example: 5000

max_credit_days   integer  optional  

Maximum credit days allowed for the customer. Example: 30

contacts   object[]  optional  

Array of contacts associated with the customer.

name   string   

Name of the contact person. Example: Jane Doe

phone   string   

Phone number of the contact person. Example: +966500000001

supplier_id   integer  optional  

ID of the supplier associated with the customer.

short_address   string  optional  

The short address for the customer. (Arabic). Must not be greater than 255 characters. Example: RAHA3443

building_no   string  optional  

Building number of the customer. (Arabic). Must not be greater than 255 characters. Example: ٢٩٢٩

street_address   string  optional  

Street name of the customer. (Arabic). Must not be greater than 255 characters. Example: ريحانة بنت زيد

secondary_no   string  optional  

Secondary number of the customer. (Arabic). Must not be greater than 255 characters. Example: ٨١١٨

district_name   string  optional  

District of the customer. (Arabic). Must not be greater than 255 characters. Example: حي العارض

city   string  optional  

City of the customer. (Arabic). Must not be greater than 255 characters. Example: الرياض

zip_code   string  optional  

Postal code of the customer. (Arabic). Must not be greater than 255 characters. Example: ١٣٣٣٧

short_address_en   string  optional  

The short address for the customer. (English). Must not be greater than 255 characters. Example: RAHA3443

building_no_en   string  optional  

Building number of the customer. (English). Must not be greater than 255 characters. Example: 2929

street_address_en   string  optional  

Street name of the customer. (English). Must not be greater than 255 characters. Example: Raihan Bint Zaid

secondary_no_en   string  optional  

Secondary number of the customer. (English). Must not be greater than 255 characters. Example: 8118

district_name_en   string  optional  

District of the customer. (English). Must not be greater than 255 characters. Example: Al Arid

city_en   string  optional  

City of the customer. (English). Must not be greater than 255 characters. Example: Riyadh

zip_code_en   string  optional  

Postal code of the customer. (English). Must not be greater than 255 characters. Example: 13337

cfs   object[]  optional  
id   integer   

The id of an existing record in the customer_custom_fields table. Example: 8

value   string  optional  

Must not be greater than 255 characters. Example: yyooukvlezujwvmiamjafqo

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/3" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/customers/3"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/customers/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the customer. Example: 3

Product Category

Display a listing of the product categories.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/categories

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"fnrbuxrkskgtnupjnb\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "fnrbuxrkskgtnupjnb"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/categories

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: fnrbuxrkskgtnupjnb

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories/17" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"rjqgndseftcah\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories/17"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "rjqgndseftcah"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/categories/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/categories/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the category. Example: 17

Body Parameters

name   string   

Must not be greater than 255 characters. Example: rjqgndseftcah

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories/8" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/categories/8"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/categories/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the category. Example: 8

Product Tags

Display a listing of the branch product tags.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/tags

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"zfwbrsoqh\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "zfwbrsoqh"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/tags

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string   

Must not be greater than 255 characters. Example: zfwbrsoqh

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"aagkygecvjbtmiervdcid\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "aagkygecvjbtmiervdcid"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/tags/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/tags/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the tag. Example: 1

Body Parameters

name   string   

Must not be greater than 255 characters. Example: aagkygecvjbtmiervdcid

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags/14" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/tags/14"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/tags/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the tag. Example: 14

Product SKUs

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/product-skus

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sku\": \"zzbcjadgnbrowddxkafwdtunp\",
    \"base_unit\": 58931.904251949,
    \"label_ar\": \"fugiat\",
    \"label_en\": \"consequatur\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sku": "zzbcjadgnbrowddxkafwdtunp",
    "base_unit": 58931.904251949,
    "label_ar": "fugiat",
    "label_en": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/product-skus

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

sku   string   

Must not be greater than 255 characters. Example: zzbcjadgnbrowddxkafwdtunp

base_unit   number   

Example: 58931.904251949

label_ar   string   

Example: fugiat

label_en   string   

Example: consequatur

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus/7" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sku\": \"dexx\",
    \"base_unit\": 391,
    \"label_ar\": \"porro\",
    \"label_en\": \"repellat\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus/7"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sku": "dexx",
    "base_unit": 391,
    "label_ar": "porro",
    "label_en": "repellat"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/product-skus/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/product-skus/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product sku. Example: 7

Body Parameters

sku   string   

Must not be greater than 255 characters. Example: dexx

base_unit   number   

Example: 391

label_ar   string   

Example: porro

label_en   string   

Example: repellat

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus/9" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/product-skus/9"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/product-skus/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product sku. Example: 9

Products

Remove the specified resource from storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/20/enable" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/20/enable"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/products/{product_id}/enable

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

product_id   integer   

The ID of the product. Example: 20

Delete a media file.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/export/excel" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"lrzbrxmmruaaaiwq\",
    \"product_id\": \"ywekrslnjphemnyswnwceea\",
    \"product\": 18,
    \"category_id\": 18,
    \"product_sku_id\": 8,
    \"exclude_zero_stock\": false
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/export/excel"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "lrzbrxmmruaaaiwq",
    "product_id": "ywekrslnjphemnyswnwceea",
    "product": 18,
    "category_id": 18,
    "product_sku_id": 8,
    "exclude_zero_stock": false
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: public
content-disposition: attachment; filename="2025-07-30 23:30:22products.xlsx"
content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
accept-ranges: bytes
vary: Origin
 


 

Request      

GET api/companies/{company_id}/branches/{branch_id}/products/export/excel

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: lrzbrxmmruaaaiwq

product_id   string  optional  

Must not be greater than 255 characters. Example: ywekrslnjphemnyswnwceea

product   integer  optional  

Example: 18

category_id   integer  optional  

Must not be greater than 999999999. Example: 18

product_sku_id   integer  optional  

Example: 8

exclude_zero_stock   boolean  optional  

Example: false

Display a listing of the products in the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/products?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"z\",
    \"product_id\": \"iloyzahsrmrxcygzjyk\",
    \"product\": 6,
    \"category_id\": 8,
    \"product_sku_id\": 9,
    \"exclude_zero_stock\": true
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "z",
    "product_id": "iloyzahsrmrxcygzjyk",
    "product": 6,
    "category_id": 8,
    "product_sku_id": 9,
    "exclude_zero_stock": true
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/products",
        "per_page": 15,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/products

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: z

product_id   string  optional  

Must not be greater than 255 characters. Example: iloyzahsrmrxcygzjyk

product   integer  optional  

Example: 6

category_id   integer  optional  

Example: 8

product_sku_id   integer  optional  

Example: 9

exclude_zero_stock   boolean  optional  

Example: true

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "product_name=uwpkffhajutaa"\
    --form "narration=nwzvuzgpl"\
    --form "product_id=jtnsizphmqwalhlcpnpuyvy"\
    --form "vat_rate=5"\
    --form "tax_code=e"\
    --form "min_price=55077.47369"\
    --form "max_price=68.521315972"\
    --form "price=2008.586"\
    --form "cost_price=20417.65000155"\
    --form "supplier_price=77309.1514867"\
    --form "model_no=ig"\
    --form "category_id=17"\
    --form "product_sku_id=6"\
    --form "type=service"\
    --form "barcode=hmmtohxujhrql"\
    --form "cash_sales_only="\
    --form "cfs[][id]=16"\
    --form "cfs[][value]=edxyhebnzpa"\
    --form "image=@C:\Users\Ahsan\AppData\Local\Temp\php3994.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('product_name', 'uwpkffhajutaa');
body.append('narration', 'nwzvuzgpl');
body.append('product_id', 'jtnsizphmqwalhlcpnpuyvy');
body.append('vat_rate', '5');
body.append('tax_code', 'e');
body.append('min_price', '55077.47369');
body.append('max_price', '68.521315972');
body.append('price', '2008.586');
body.append('cost_price', '20417.65000155');
body.append('supplier_price', '77309.1514867');
body.append('model_no', 'ig');
body.append('category_id', '17');
body.append('product_sku_id', '6');
body.append('type', 'service');
body.append('barcode', 'hmmtohxujhrql');
body.append('cash_sales_only', '');
body.append('cfs[][id]', '16');
body.append('cfs[][value]', 'edxyhebnzpa');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/products

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

product_name   string   

Must not be greater than 255 characters. Example: uwpkffhajutaa

narration   string  optional  

Must not be greater than 5000 characters. Example: nwzvuzgpl

product_id   string  optional  

Must not be greater than 255 characters. Example: jtnsizphmqwalhlcpnpuyvy

vat_rate   number   

Must not be greater than 100. Example: 5

tax_code   string  optional  

Example: e

Must be one of:
  • p
  • e
  • x
  • z
min_price   number  optional  

Example: 55077.47369

max_price   number  optional  

Example: 68.521315972

price   number   

Example: 2008.586

cost_price   number  optional  

Example: 20417.65000155

supplier_price   number  optional  

Example: 77309.1514867

model_no   string  optional  

Must not be greater than 255 characters. Example: ig

category_id   integer  optional  

The id of an existing record in the categories table. Example: 17

product_sku_id   integer  optional  

The id of an existing record in the product_s_k_u_s table. Example: 6

type   string  optional  

Example: service

Must be one of:
  • service
  • product
barcode   string  optional  

Must not be greater than 255 characters. Example: hmmtohxujhrql

image   file  optional  

Must be a file. Must not be greater than 1024 kilobytes. Example: C:\Users\Ahsan\AppData\Local\Temp\php3994.tmp

cash_sales_only   boolean  optional  

Example: false

cfs   object[]  optional  
id   integer   

The id of an existing record in the product_custom_fields table. Example: 16

value   string  optional  

Must not be greater than 255 characters. Example: edxyhebnzpa

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/19" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "product_name=qcsoyirudmfd"\
    --form "narration=efqxwwlxtpvchdl"\
    --form "product_id=aorbwjfhhzambnogady"\
    --form "vat_rate=5"\
    --form "tax_code=z"\
    --form "min_price=120.1816223"\
    --form "max_price=1.846916411"\
    --form "price=32.770459585"\
    --form "cost_price=24"\
    --form "supplier_price=495"\
    --form "model_no=chhjnnbfaqgxkexcmxnpvzoa"\
    --form "category_id=7"\
    --form "product_sku_id=2"\
    --form "type=service"\
    --form "barcode=xpkknhitcflxpwmrlqkeiit"\
    --form "cash_sales_only=1"\
    --form "cfs[][id]=15"\
    --form "cfs[][value]=nocirmtzt"\
    --form "image=@C:\Users\Ahsan\AppData\Local\Temp\php39A4.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/19"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('product_name', 'qcsoyirudmfd');
body.append('narration', 'efqxwwlxtpvchdl');
body.append('product_id', 'aorbwjfhhzambnogady');
body.append('vat_rate', '5');
body.append('tax_code', 'z');
body.append('min_price', '120.1816223');
body.append('max_price', '1.846916411');
body.append('price', '32.770459585');
body.append('cost_price', '24');
body.append('supplier_price', '495');
body.append('model_no', 'chhjnnbfaqgxkexcmxnpvzoa');
body.append('category_id', '7');
body.append('product_sku_id', '2');
body.append('type', 'service');
body.append('barcode', 'xpkknhitcflxpwmrlqkeiit');
body.append('cash_sales_only', '1');
body.append('cfs[][id]', '15');
body.append('cfs[][value]', 'nocirmtzt');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/products/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/products/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product. Example: 19

Body Parameters

product_name   string   

Must not be greater than 255 characters. Example: qcsoyirudmfd

narration   string  optional  

Must not be greater than 5000 characters. Example: efqxwwlxtpvchdl

product_id   string  optional  

Must not be greater than 255 characters. Example: aorbwjfhhzambnogady

vat_rate   number   

Must not be greater than 100. Example: 5

tax_code   string  optional  

Example: z

Must be one of:
  • p
  • e
  • x
  • z
min_price   number  optional  

Example: 120.1816223

max_price   number  optional  

Example: 1.846916411

price   number   

Example: 32.770459585

cost_price   number  optional  

Example: 24

supplier_price   number  optional  

Example: 495

model_no   string  optional  

Must not be greater than 255 characters. Example: chhjnnbfaqgxkexcmxnpvzoa

category_id   integer  optional  

The id of an existing record in the categories table. Example: 7

product_sku_id   integer  optional  

The id of an existing record in the product_s_k_u_s table. Example: 2

type   string  optional  

Example: service

Must be one of:
  • service
  • product
barcode   string  optional  

Must not be greater than 255 characters. Example: xpkknhitcflxpwmrlqkeiit

image   file  optional  

Must be a file. Must not be greater than 1024 kilobytes. Example: C:\Users\Ahsan\AppData\Local\Temp\php39A4.tmp

cash_sales_only   boolean  optional  

Example: true

cfs   object[]  optional  
id   integer   

The id of an existing record in the product_custom_fields table. Example: 15

value   string  optional  

Must not be greater than 255 characters. Example: nocirmtzt

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/12" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/products/12"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/products/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the product. Example: 12

Inventory Location

Export Inventory Location products to Excel.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/export/excel" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"exzhopoponspkudcp\",
    \"product_id\": \"vecakyvnwlcbhzqeojbezeeq\",
    \"product\": 2,
    \"category_id\": 14
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/export/excel"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "exzhopoponspkudcp",
    "product_id": "vecakyvnwlcbhzqeojbezeeq",
    "product": 2,
    "category_id": 14
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company}/branches/{branch}/inventory-locations/export/excel

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company   integer   

The company. Example: 10000

branch   integer   

The branch. Example: 1000

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: exzhopoponspkudcp

product_id   string  optional  

Must not be greater than 255 characters. Example: vecakyvnwlcbhzqeojbezeeq

product   integer  optional  

Example: 2

category_id   integer  optional  

Example: 14

Add Product to Inventory Location

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/5/add-products" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"inventory_location_id\": 8,
    \"product_id\": 15,
    \"quantity\": 17
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/5/add-products"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "inventory_location_id": 8,
    "product_id": 15,
    "quantity": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/inventory-locations/{inventory-location}/add-products

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

inventory-location   integer   

Example: 5

Body Parameters

inventory_location_id   integer   

The ID of the inventory location. Example: 8

product_id   integer   

The ID of the product to be added. Example: 15

quantity   integer   

The quantity of the product to be added. Example: 17

Remove Product to Inventory Location

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/14/remove-products" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": 16,
    \"quantity\": 2
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/14/remove-products"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": 16,
    "quantity": 2
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/inventory-locations/{inventory-location}/remove-products

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

inventory-location   integer   

Example: 14

Body Parameters

product_id   integer   

The ID of the product to be added. Example: 16

quantity   integer   

The quantity of the product to be added. Example: 2

List of the Inventory Locations for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations",
        "per_page": 15,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/inventory-locations

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new Inventory Location.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"location_id\": \"praesentium\",
    \"name\": \"bbescydfabktwqnnhdokjj\",
    \"customer_id\": 17
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "location_id": "praesentium",
    "name": "bbescydfabktwqnnhdokjj",
    "customer_id": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/inventory-locations

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

location_id   string   

Example: praesentium

name   string   

Must not be greater than 255 characters. Example: bbescydfabktwqnnhdokjj

customer_id   integer  optional  

The id of an existing record in the customers table. Example: 17

Update an Inventory Location.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/20" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"location_id\": \"temporibus\",
    \"name\": \"uwtopwfydozwx\",
    \"customer_id\": 6
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/20"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "location_id": "temporibus",
    "name": "uwtopwfydozwx",
    "customer_id": 6
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/inventory-locations/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/inventory-locations/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the inventory location. Example: 20

Body Parameters

location_id   string   

Example: temporibus

name   string   

Must not be greater than 255 characters. Example: uwtopwfydozwx

customer_id   integer  optional  

The id of an existing record in the customers table. Example: 6

Disable an Inventory Location.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/17" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-locations/17"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/inventory-locations/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the inventory location. Example: 17

Stock Transfer Notes

Export to PDF

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/10/export/pdf" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/10/export/pdf"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (302):

Show headers
cache-control: no-cache, private
location: http://127.0.0.1:8000/docs
content-type: text/html; charset=utf-8
vary: Origin
set-cookie: XSRF-TOKEN=eyJpdiI6IkkvaTJROGlWM2s0QjUxSVBsT2NrRHc9PSIsInZhbHVlIjoiSExRajg3RUtKR0pzV0NmaFV6RUQvZHVnMVg3alNvc2pleGdkZ3BYd1hsRUFjbDNra3ZTdlZsOTdnT29HaXQ4TmRhOHpPQ1ZPN0luREhSOWdaRzFjejJXQlduTkt4MWxWR1Z6Y29keEliSUpVM1NCamQ4anpPTC8vek5TYnR4Y0QiLCJtYWMiOiJhOGNjMjAyNjZhYTIyMDc4ZWQ5ZjhhMjRlYmQ2MTVhZDA3MzM1ODg3MjUyYTU1ODc1MmM5ZDkyYzAwNGJhOTQwIiwidGFnIjoiIn0%3D; expires=Wed, 30 Jul 2025 22:30:23 GMT; Max-Age=7200; path=/; domain=127.0.0.1; samesite=lax; einvoiceme_session=eyJpdiI6ImVwak1FNkNJZ0FIU1JzZWU0dWVQb0E9PSIsInZhbHVlIjoidzJvcXNUbjRTRVRJRFlqbUpKY1hzTnV3L0toT1ZtYk9IY1BTNXFodm1pZFdLNTRWRDE0ZGEwM05CbHE5cE84eG04R1AvQkNoWnM2M3g5SC9XRUg4NjA0YXVwd2c4MGQ2SXVmdFNVWnduOXhaQnVYcnFtOUV1ZUlBWHRTTTFSSVQiLCJtYWMiOiJmNmY2NDNhZjQ5MjBkODkzNzM3NzQ2NzFiMGM1YjFhN2FjMGJjNWNkYzgxNTBjNjg2NDFhOWQ4MzYwMjQ0NTFkIiwidGFnIjoiIn0%3D; expires=Wed, 30 Jul 2025 22:30:23 GMT; Max-Age=7200; path=/; domain=127.0.0.1; httponly; samesite=lax
 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='http://127.0.0.1:8000/docs'" />

        <title>Redirecting to http://127.0.0.1:8000/docs</title>
    </head>
    <body>
        Redirecting to <a href="http://127.0.0.1:8000/docs">http://127.0.0.1:8000/docs</a>.
    </body>
</html>
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes/{stock-transfer-note}/export/pdf

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

stock-transfer-note   integer   

Example: 10

Display a list of stock transfer notes for the specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"from_location\": 1,
    \"to_location\": 6,
    \"from\": \"2025-07-30\",
    \"to\": \"2025-07-30\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "from_location": 1,
    "to_location": 6,
    "from": "2025-07-30",
    "to": "2025-07-30"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Body Parameters

from_location   integer  optional  

Example: 1

to_location   integer  optional  

Example: 6

from   string  optional  

Must be a valid date in the format Y-m-d. Example: 2025-07-30

to   string  optional  

Must be a valid date in the format Y-m-d. Example: 2025-07-30

Create a new stock transfer note or convert from stock transfer request.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"stock_transfer_request_id\": 9,
    \"date\": \"2025-07-30\",
    \"all_products\": false,
    \"items\": [
        {
            \"id\": 2,
            \"quantity\": 2260255.2
        }
    ],
    \"remarks\": \"wbvintvjjq\",
    \"from_location_id\": 9,
    \"to_location_id\": 15
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "stock_transfer_request_id": 9,
    "date": "2025-07-30",
    "all_products": false,
    "items": [
        {
            "id": 2,
            "quantity": 2260255.2
        }
    ],
    "remarks": "wbvintvjjq",
    "from_location_id": 9,
    "to_location_id": 15
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

stock_transfer_request_id   integer  optional  

Example: 9

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

all_products   boolean  optional  

Example: false

items   object[]   

Must have at least 1 items.

id   integer   

Example: 2

quantity   number   

Example: 2260255.2

remarks   string  optional  

Must not be greater than 255 characters. Example: wbvintvjjq

from_location_id   integer   

Example: 9

to_location_id   integer   

Example: 15

Update a stock transfer note.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/16" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"stock_transfer_request_id\": 12,
    \"date\": \"2025-07-30\",
    \"all_products\": true,
    \"items\": [
        {
            \"id\": 6,
            \"quantity\": 3.4
        }
    ],
    \"remarks\": \"tnawflglpharldlctpobe\",
    \"from_location_id\": 12,
    \"to_location_id\": 5
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/16"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "stock_transfer_request_id": 12,
    "date": "2025-07-30",
    "all_products": true,
    "items": [
        {
            "id": 6,
            "quantity": 3.4
        }
    ],
    "remarks": "tnawflglpharldlctpobe",
    "from_location_id": 12,
    "to_location_id": 5
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the stock transfer note. Example: 16

Body Parameters

stock_transfer_request_id   integer  optional  

Example: 12

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

all_products   boolean  optional  

Example: true

items   object[]   

Must have at least 1 items.

id   integer   

Example: 6

quantity   number   

Example: 3.4

remarks   string  optional  

Must not be greater than 255 characters. Example: tnawflglpharldlctpobe

from_location_id   integer   

Example: 12

to_location_id   integer   

Example: 5

Delete a stock transfer note.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/17" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-notes/17"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/stock-transfer-notes/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the stock transfer note. Example: 17

Stock Transfer Requests

Display a list of the STRs for specified branch.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/stock-transfer-requests

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new STR.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2025-07-30\",
    \"from_location_id\": 20,
    \"to_location_id\": 18,
    \"items\": [
        {
            \"id\": 9,
            \"quantity\": 7.7,
            \"cac\": 12348791.9
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2025-07-30",
    "from_location_id": 20,
    "to_location_id": 18,
    "items": [
        {
            "id": 9,
            "quantity": 7.7,
            "cac": 12348791.9
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/stock-transfer-requests

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

from_location_id   integer  optional  

Example: 20

to_location_id   integer  optional  

Example: 18

items   object[]   

Must have at least 1 items.

id   integer   

Example: 9

quantity   number   

Example: 7.7

cac   number  optional  

Example: 12348791.9

Update/Approve a STR.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests/20" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2025-07-30\",
    \"from_location_id\": 14,
    \"to_location_id\": 14,
    \"items\": [
        {
            \"id\": 11,
            \"quantity\": 8390161.413778106,
            \"cac\": 567
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests/20"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2025-07-30",
    "from_location_id": 14,
    "to_location_id": 14,
    "items": [
        {
            "id": 11,
            "quantity": 8390161.413778106,
            "cac": 567
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/stock-transfer-requests/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/stock-transfer-requests/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the stock transfer request. Example: 20

Body Parameters

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

from_location_id   integer  optional  

Example: 14

to_location_id   integer  optional  

Example: 14

items   object[]   

Must have at least 1 items.

id   integer   

Example: 11

quantity   number   

Example: 8390161.4137781

cac   number  optional  

Example: 567

Cancel a STR.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests/14" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/stock-transfer-requests/14"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/stock-transfer-requests/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the stock transfer request. Example: 14

Inventory Adjustments

Export inventory adjustments to aa excel file.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/export/excel" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quarter\": \"voluptatem\",
    \"from\": \"molestias\",
    \"to\": \"2025-07-30\",
    \"product\": \"ux\",
    \"product_id\": \"rynisqhhutk\",
    \"location_id\": 17,
    \"type\": \"returned\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/export/excel"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quarter": "voluptatem",
    "from": "molestias",
    "to": "2025-07-30",
    "product": "ux",
    "product_id": "rynisqhhutk",
    "location_id": 17,
    "type": "returned"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: public
content-disposition: attachment; filename=inventory-adjustment-export.xlsx
content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
accept-ranges: bytes
vary: Origin
 


 

Request      

GET api/companies/{company_id}/branches/{branch_id}/inventory-adjustments/export/excel

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

quarter   string  optional  

Example: voluptatem

from   string   

Example: molestias

to   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

product   string  optional  

Must not be greater than 255 characters. Example: ux

product_id   string  optional  

Must not be greater than 255 characters. Example: rynisqhhutk

location_id   integer  optional  

Example: 17

type   string  optional  

Example: returned

Must be one of:
  • received
  • sold
  • returned
  • damaged
  • transfer
  • conversion
  • other

Display a list of the adjustments log.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quarter\": \"fugiat\",
    \"to\": \"2025-07-30\",
    \"product\": \"sripkvjaackcssm\",
    \"product_id\": \"cjyavu\",
    \"location_id\": 9,
    \"type\": \"transfer\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quarter": "fugiat",
    "to": "2025-07-30",
    "product": "sripkvjaackcssm",
    "product_id": "cjyavu",
    "location_id": 9,
    "type": "transfer"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (422):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "The to field must be a date after .",
    "errors": {
        "to": [
            "The to field must be a date after ."
        ]
    }
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/inventory-adjustments

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Body Parameters

quarter   string  optional  

Example: fugiat

from   string  optional  
to   string  optional  

Must be a valid date in the format Y-m-d. Example: 2025-07-30

product   string  optional  

Must not be greater than 255 characters. Example: sripkvjaackcssm

product_id   string  optional  

Must not be greater than 255 characters. Example: cjyavu

location_id   integer  optional  

Example: 9

type   string  optional  

Example: transfer

Must be one of:
  • received
  • sold
  • returned
  • damaged
  • transfer
  • conversion
  • other

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": 10,
    \"location_id\": 1,
    \"product2_id\": 18,
    \"location2_id\": 4,
    \"quantity\": -9999999999,
    \"type\": \"received\",
    \"reason\": \"mmavwoejdkic\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": 10,
    "location_id": 1,
    "product2_id": 18,
    "location2_id": 4,
    "quantity": -9999999999,
    "type": "received",
    "reason": "mmavwoejdkic"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/inventory-adjustments

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

product_id   integer   

Example: 10

location_id   integer  optional  

Example: 1

product2_id   integer  optional  

This field is required when type is conversion. Example: 18

location2_id   integer  optional  

Example: 4

quantity   number   

Must not be one of 0 Must be between -9999999999.9999 and 9999999999.9999. Example: -9999999999

type   string   

Example: received

Must be one of:
  • received
  • damaged
  • sold
  • returned
  • other
  • conversion
reason   string  optional  

Must not be greater than 255 characters. Example: mmavwoejdkic

Update an adjustment.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": 7,
    \"location_id\": 3,
    \"product2_id\": 6,
    \"location2_id\": 2,
    \"quantity\": -9999999999,
    \"type\": \"returned\",
    \"reason\": \"tkvj\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": 7,
    "location_id": 3,
    "product2_id": 6,
    "location2_id": 2,
    "quantity": -9999999999,
    "type": "returned",
    "reason": "tkvj"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/inventory-adjustments/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/inventory-adjustments/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the inventory adjustment. Example: 1

Body Parameters

product_id   integer   

Example: 7

location_id   integer  optional  

Example: 3

product2_id   integer  optional  

This field is required when type is conversion. Example: 6

location2_id   integer  optional  

Example: 2

quantity   number   

Must not be one of 0 Must be between -9999999999.9999 and 9999999999.9999. Example: -9999999999

type   string   

Example: returned

Must be one of:
  • received
  • damaged
  • sold
  • returned
  • other
  • conversion
reason   string  optional  

Must not be greater than 255 characters. Example: tkvj

Delete an adjustment.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/10" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/inventory-adjustments/10"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/inventory-adjustments/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the inventory adjustment. Example: 10

Landed Costs

Post Landed Cost.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/18/post" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/18/post"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/landed-costs/{landedCost_id}/post

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

landedCost_id   integer   

The ID of the landedCost. Example: 18

Display a list of the landed costs.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/branches/{branch_id}/landed-costs

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new landed cost.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"no\": \"pcodqswcdvxkzgkf\",
    \"date\": \"2025-07-30\",
    \"purchase_order_id\": 20,
    \"purchase_id\": 17,
    \"xr\": 43024024.912977,
    \"currency\": \"moq\",
    \"items\": [
        {
            \"type\": \"Warehouse Expenses\",
            \"method\": \"Equal\",
            \"amount\": 545.909
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "no": "pcodqswcdvxkzgkf",
    "date": "2025-07-30",
    "purchase_order_id": 20,
    "purchase_id": 17,
    "xr": 43024024.912977,
    "currency": "moq",
    "items": [
        {
            "type": "Warehouse Expenses",
            "method": "Equal",
            "amount": 545.909
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches/{branch_id}/landed-costs

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

Body Parameters

no   string   

Must not be greater than 255 characters. Example: pcodqswcdvxkzgkf

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

purchase_order_id   integer   

Example: 20

purchase_id   integer  optional  

Example: 17

xr   number  optional  

Example: 43024024.912977

currency   string  optional  

Must be 3 characters. Example: moq

items   object[]   

Must have at least 1 items.

type   string   

Example: Warehouse Expenses

Must be one of:
  • Clearance
  • Custom Duty
  • Demurrage
  • Freight
  • Insurence
  • Port Expenses
  • Warehouse Expenses
method   string   

Example: Equal

Must be one of:
  • Equal
  • By Quantity
  • By Current Cost
amount   number   

Example: 545.909

Update an existing landed cost.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"no\": \"flcwpaqqiim\",
    \"date\": \"2025-07-30\",
    \"purchase_order_id\": 13,
    \"purchase_id\": 11,
    \"xr\": 26,
    \"currency\": \"nzk\",
    \"items\": [
        {
            \"type\": \"Clearance\",
            \"method\": \"By Quantity\",
            \"amount\": 332097591.5298673
        }
    ]
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "no": "flcwpaqqiim",
    "date": "2025-07-30",
    "purchase_order_id": 13,
    "purchase_id": 11,
    "xr": 26,
    "currency": "nzk",
    "items": [
        {
            "type": "Clearance",
            "method": "By Quantity",
            "amount": 332097591.5298673
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{branch_id}/landed-costs/{id}

PATCH api/companies/{company_id}/branches/{branch_id}/landed-costs/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the landed cost. Example: 1

Body Parameters

no   string   

Must not be greater than 255 characters. Example: flcwpaqqiim

date   string   

Must be a valid date in the format Y-m-d. Example: 2025-07-30

purchase_order_id   integer   

Example: 13

purchase_id   integer  optional  

Example: 11

xr   number  optional  

Example: 26

currency   string  optional  

Must be 3 characters. Example: nzk

items   object[]   

Must have at least 1 items.

type   string   

Example: Clearance

Must be one of:
  • Clearance
  • Custom Duty
  • Demurrage
  • Freight
  • Insurence
  • Port Expenses
  • Warehouse Expenses
method   string   

Example: By Quantity

Must be one of:
  • Equal
  • By Quantity
  • By Current Cost
amount   number   

Example: 332097591.52987

Delete a landed cost.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/12" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000/landed-costs/12"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{branch_id}/landed-costs/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

branch_id   integer   

The ID of the branch. Example: 1000

id   integer   

The ID of the landed cost. Example: 12

Manage Companies

* Create & Manage Companies for the user.

List of Companies

requires authentication

This endpoint retrieves a list of companies associated with the authenticated user.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 10000,
            "created_at": "2025-07-13 18:12:08",
            "updated_at": "2025-07-17 01:30:38",
            "name": "شركة محدودة",
            "name_ar": "My Company Ltd",
            "vat_no": "312378945600003",
            "id_type": "cr",
            "cr": "4030101010",
            "enable_issue": false,
            "branch_limit": 0,
            "status": "Disabled",
            "type": "Main",
            "un": "7007000077",
            "status_color": "red-700",
            "name_locale": "My Company Ltd",
            "branches": [
                {
                    "id": 1000,
                    "created_at": "2025-07-13 18:12:08",
                    "updated_at": "2025-07-13 18:12:08",
                    "branch_name": "Jeddah Branch",
                    "logo": "/branch_logo/16310998641000.png",
                    "country": null,
                    "phone": null,
                    "email": "ahsan@ahsan-web.ml",
                    "website": null,
                    "short_address": null,
                    "building_no": null,
                    "street_name": "Al Ahd Al Jadid",
                    "secondary_no": null,
                    "district": "Ar Ruwais",
                    "city": "Jeddah",
                    "postal_code": null,
                    "allow_webhook": false,
                    "allow_api": true,
                    "short_address_en": null,
                    "building_no_en": null,
                    "street_name_en": null,
                    "secondary_no_en": null,
                    "district_en": null,
                    "city_en": null,
                    "postal_code_en": null,
                    "role": "Admin",
                    "logo_url": "/storage//branch_logo/16310998641000.png",
                    "full_address_ar": "- Al Ahd Al Jadid- Ar Ruwais-Jeddah ",
                    "full_address_en": ""
                }
            ]
        },
        {
            "id": 10003,
            "created_at": "2025-07-16 00:24:56",
            "updated_at": "2025-07-16 00:24:56",
            "name": "شركة محدودة",
            "name_ar": "My Company Ltd",
            "vat_no": "312345678900003",
            "id_type": "cr",
            "cr": "4030123456",
            "enable_issue": true,
            "branch_limit": 1,
            "status": "Active",
            "type": "Main",
            "un": "7001234567",
            "status_color": "green-700",
            "name_locale": "My Company Ltd",
            "branches": [
                {
                    "id": 1010,
                    "created_at": "2025-07-16 19:54:01",
                    "updated_at": "2025-07-16 20:18:04",
                    "branch_name": "Main Branch",
                    "logo": null,
                    "country": "SA",
                    "phone": "+966500000000",
                    "email": "test@test.com",
                    "website": null,
                    "short_address": "RAHA3443",
                    "building_no": "٢٩٢٩",
                    "street_name": "ريحانة بنت زيد",
                    "secondary_no": "٨١١٨",
                    "district": "حي العارض",
                    "city": "nlfwerknss",
                    "postal_code": "١٣٣٣٧",
                    "allow_webhook": false,
                    "allow_api": true,
                    "short_address_en": "RAHA3443",
                    "building_no_en": "2929",
                    "street_name_en": "Raihan Bint Zaid",
                    "secondary_no_en": "8118",
                    "district_en": "Al Arid",
                    "city_en": "Riyadh",
                    "postal_code_en": "13337",
                    "role": "Admin",
                    "logo_url": "https://cdn-einvme.fra1.cdn.digitaloceanspaces.com/eInvoiceMe/7/conversions/Picture1-logo.jpg",
                    "full_address_ar": "RAHA3443-٢٩٢٩ ريحانة بنت زيد-٨١١٨ حي العارض-nlfwerknss ١٣٣٣٧",
                    "full_address_en": "RAHA3443-2929 Raihan Bint Zaid-8118 Al Arid-Riyadh 13337"
                }
            ]
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create a new Company

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"شركة محدودة\",
    \"name_en\": \"My Company Ltd\",
    \"cr\": \"4030123456\",
    \"un\": \"700*******\",
    \"vat_no\": \"3*********00003\",
    \"id_type\": \"cr\",
    \"sequence_start\": 100001
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "شركة محدودة",
    "name_en": "My Company Ltd",
    "cr": "4030123456",
    "un": "700*******",
    "vat_no": "3*********00003",
    "id_type": "cr",
    "sequence_start": 100001
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the company in Arabic. Must not be greater than 255 characters. Example: شركة محدودة

name_en   string  optional  

The English name of the company. Must not be greater than 255 characters. Example: My Company Ltd

cr   string   

Company registration number (CR). Must be 10 digits. Example: 4030123456

un   string  optional  

Unified Number of the company. Must be 10 digits. Example: 700*******

vat_no   string  optional  

VAT number of the company. Must be 15 digits. Example: 3*********00003

id_type   string  optional  

Type of ID used for the company. Example: cr

Must be one of:
  • cr
  • ni
  • un
sequence_start   string  optional  

Starting sequence number for invoices. Must not be greater than 20 characters. Example: 100001

Update the specified Company.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"شركة محدودة\",
    \"name_en\": \"My Company Ltd\",
    \"cr\": \"4030123456\",
    \"un\": \"700*******\",
    \"vat_no\": \"3*********00003\",
    \"id_type\": \"cr\",
    \"sequence_start\": 100001
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "شركة محدودة",
    "name_en": "My Company Ltd",
    "cr": "4030123456",
    "un": "700*******",
    "vat_no": "3*********00003",
    "id_type": "cr",
    "sequence_start": 100001
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{id}

PATCH api/companies/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the company. Example: 10000

Body Parameters

name   string   

The name of the company in Arabic. Must not be greater than 255 characters. Example: شركة محدودة

name_en   string  optional  

The English name of the company. Must not be greater than 255 characters. Example: My Company Ltd

cr   string   

Company registration number (CR). Must be 10 digits. Example: 4030123456

un   string  optional  

Unified Number of the company. Must be 10 digits. Example: 700*******

vat_no   string  optional  

VAT number of the company. Must be 15 digits. Example: 3*********00003

id_type   string  optional  

Type of ID used for the company. Example: cr

Must be one of:
  • cr
  • ni
  • un
sequence_start   string  optional  

Starting sequence number for invoices. Must not be greater than 20 characters. Example: 100001

Settings

View Company Settings

requires authentication

This endpoint retrieves the settings of a specific company associated with the authenticated user.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/settings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/settings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Company settings retrieved successfully.",
    "data": {
        "created_at": "2025-07-18 01:12:14",
        "updated_at": "2025-07-18 01:12:14",
        "unified_inventory": false,
        "unified_customers": false,
        "unified_suppliers": false,
        "enable_zatca": false,
        "integration_phase_acknowledged": false,
        "unified_templates": false,
        "internal_search": false
    }
}
 

Request      

GET api/companies/{company_id}/settings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Update Company Settings

requires authentication

This endpoint updates the settings of a specific company associated with the authenticated user.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/settings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"unified_inventory\": false,
    \"unified_customers\": false,
    \"unified_suppliers\": false,
    \"unified_templates\": false,
    \"internal_search\": false
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/settings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "unified_inventory": false,
    "unified_customers": false,
    "unified_suppliers": false,
    "unified_templates": false,
    "internal_search": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/settings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Body Parameters

unified_inventory   boolean  optional  

Enable or disable unified inventory across branches. Example: false

unified_customers   boolean  optional  

Enable or disable unified customer management across branches. Example: false

unified_suppliers   boolean  optional  

Enable or disable unified supplier management across branches. Example: false

unified_templates   boolean  optional  

Enable or disable unified templates across branches. Example: false

internal_search   boolean  optional  

Enable or disable internal search functionality across branches. Example: false

List Sequences

requires authentication

This endpoint retrieves all sequences for a specific company associated with the authenticated user.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/sequences" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/sequences"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "created_at": "2025-07-16 02:22:48",
            "updated_at": "2025-07-16 02:22:48",
            "ref": "2023",
            "prefix": "INV-",
            "first": "INV-2023",
            "last": null
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/sequences",
        "per_page": 2,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/sequences

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Create Sequence

requires authentication

This endpoint allows the authenticated user to create a new sequence for a specific company.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/sequences" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"prefix\": \"INV-\",
    \"ref\": \"2023\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/sequences"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "prefix": "INV-",
    "ref": "2023"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/sequences

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Body Parameters

prefix   string  optional  

The prefix for the sequence (optional). Must not be greater than 10 characters. Example: INV-

ref   string   

The reference for the sequence (required). Must not be greater than 20 characters. Example: 2023

Update Sequence

requires authentication

This endpoint allows the authenticated user to update an existing sequence for a specific company.

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/sequences/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"prefix\": \"INV-\",
    \"ref\": \"2023\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/sequences/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "prefix": "INV-",
    "ref": "2023"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/sequences/{id}

PATCH api/companies/{company_id}/sequences/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

id   integer   

The ID of the sequence. Example: 1

Body Parameters

prefix   string  optional  

The prefix for the sequence (optional). Must not be greater than 10 characters. Example: INV-

ref   string   

The reference for the sequence (required). Must not be greater than 20 characters. Example: 2023

Delete Sequence

requires authentication

This endpoint allows the authenticated user to delete an existing sequence for a specific company.

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/sequences/1" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/sequences/1"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/sequences/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

id   integer   

The ID of the sequence. Example: 1

Branches

List Branches

requires authentication

This endpoint retrieves all branches for a specific company associated with the authenticated user.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/branches?per_page=10&with_disabled=" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches"
);

const params = {
    "per_page": "10",
    "with_disabled": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [
        {
            "id": 1000,
            "created_at": "2025-07-13 18:12:08",
            "updated_at": "2025-07-13 18:12:08",
            "branch_name": "Jeddah Branch",
            "logo": "/branch_logo/16310998641000.png",
            "country": null,
            "phone": null,
            "email": "ahsan@ahsan-web.ml",
            "website": null,
            "short_address": null,
            "building_no": null,
            "street_name": "Al Ahd Al Jadid",
            "secondary_no": null,
            "district": "Ar Ruwais",
            "city": "Jeddah",
            "postal_code": null,
            "allow_webhook": false,
            "allow_api": true,
            "short_address_en": null,
            "building_no_en": null,
            "street_name_en": null,
            "secondary_no_en": null,
            "district_en": null,
            "city_en": null,
            "postal_code_en": null,
            "role": null,
            "logo_url": "/storage//branch_logo/16310998641000.png",
            "full_address_ar": "- Al Ahd Al Jadid- Ar Ruwais-Jeddah ",
            "full_address_en": ""
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/branches",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/branches

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Query Parameters

search   string  optional  

Optional search term to filter the results. Must not be greater than 255 characters.

per_page   integer  optional  

Number of items to return per page. Defaults to 10 if not provided. Must be at least 1. Must not be greater than 300. Example: 10

with_disabled   boolean  optional  

Include disabled items in the results. Example: false

Create Branch

requires authentication

This endpoint allows the authenticated user to create a new branch for a specific company.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/branches" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "branch_name=Main Branch"\
    --form "short_address=RAHA3443"\
    --form "building_no=٢٩٢٩"\
    --form "street_name=ريحانة بنت زيد"\
    --form "secondary_no=٨١١٨"\
    --form "district=حي العارض"\
    --form "postal_code=١٣٣٣٧"\
    --form "city=uvchuw"\
    --form "short_address_en=RAHA3443"\
    --form "building_no_en=2929"\
    --form "street_name_en=Raihan Bint Zaid"\
    --form "secondary_no_en=8118"\
    --form "district_en=Al Arid"\
    --form "postal_code_en=13337"\
    --form "city_en=Riyadh"\
    --form "email=test@test.com"\
    --form "phone=+966500000000"\
    --form "country=SA"\
    --form "logo=@C:\Users\Ahsan\AppData\Local\Temp\php3220.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('branch_name', 'Main Branch');
body.append('short_address', 'RAHA3443');
body.append('building_no', '٢٩٢٩');
body.append('street_name', 'ريحانة بنت زيد');
body.append('secondary_no', '٨١١٨');
body.append('district', 'حي العارض');
body.append('postal_code', '١٣٣٣٧');
body.append('city', 'uvchuw');
body.append('short_address_en', 'RAHA3443');
body.append('building_no_en', '2929');
body.append('street_name_en', 'Raihan Bint Zaid');
body.append('secondary_no_en', '8118');
body.append('district_en', 'Al Arid');
body.append('postal_code_en', '13337');
body.append('city_en', 'Riyadh');
body.append('email', 'test@test.com');
body.append('phone', '+966500000000');
body.append('country', 'SA');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/branches

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Body Parameters

branch_name   string   

The name of the branch. Must not be greater than 255 characters. Example: Main Branch

logo   file  optional  

Example: C:\Users\Ahsan\AppData\Local\Temp\php3220.tmp

short_address   string  optional  

The short address for the branch/company. (Arabic). Must be 8 characters. Example: RAHA3443

building_no   string  optional  

Building number of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{4})$/u. Example: ٢٩٢٩

street_name   string  optional  

Street name of the branch/company. (Arabic). Must not be greater than 64 characters. Example: ريحانة بنت زيد

secondary_no   string  optional  

Secondary number of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{4})$/u. Example: ٨١١٨

district   string  optional  

District of the branch/company. (Arabic). Must not be greater than 32 characters. Example: حي العارض

postal_code   string  optional  

Postal code of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{5})$/u. Example: ١٣٣٣٧

city   string  optional  

Must not be greater than 32 characters. Example: uvchuw

short_address_en   string  optional  

The short address for the branch/company. (English). Must be 8 characters. Example: RAHA3443

building_no_en   string  optional  

Building number of the branch/company. (English). Must match the regex /^([0-9٠-٩]{4})$/u. Example: 2929

street_name_en   string  optional  

Street name of the branch/company. (English). Must not be greater than 64 characters. Example: Raihan Bint Zaid

secondary_no_en   string  optional  

Secondary number of the branch/company. (English). Must match the regex /^([0-9٠-٩]{4})$/u. Example: 8118

district_en   string  optional  

District of the branch/company. (English). Must not be greater than 32 characters. Example: Al Arid

postal_code_en   string  optional  

Postal code of the branch/company. (English). Must match the regex /^([0-9٠-٩]{5})$/u. Example: 13337

city_en   string  optional  

City of the branch/company. (English). Must not be greater than 32 characters. Example: Riyadh

email   string   

Email address of the branch (optional). Must be a valid email address. Must not be greater than 255 characters. Example: test@test.com

phone   string  optional  

Phone number of the branch (optional). Example: +966500000000

country   string  optional  

Country code of the branch (optional). ISO 3166-1 alpha-2 format. This field is required when phone is present. Must not be greater than 2 characters. Example: SA

Update Branch

requires authentication

This endpoint allows the authenticated user to update an existing branch for a specific company.

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "branch_name=Main Branch"\
    --form "short_address=RAHA3443"\
    --form "building_no=٢٩٢٩"\
    --form "street_name=ريحانة بنت زيد"\
    --form "secondary_no=٨١١٨"\
    --form "district=حي العارض"\
    --form "postal_code=١٣٣٣٧"\
    --form "city=gtqnhyo"\
    --form "short_address_en=RAHA3443"\
    --form "building_no_en=2929"\
    --form "street_name_en=Raihan Bint Zaid"\
    --form "secondary_no_en=8118"\
    --form "district_en=Al Arid"\
    --form "postal_code_en=13337"\
    --form "city_en=Riyadh"\
    --form "email=test@test.com"\
    --form "phone=+966500000000"\
    --form "country=SA"\
    --form "logo=@C:\Users\Ahsan\AppData\Local\Temp\php3230.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('branch_name', 'Main Branch');
body.append('short_address', 'RAHA3443');
body.append('building_no', '٢٩٢٩');
body.append('street_name', 'ريحانة بنت زيد');
body.append('secondary_no', '٨١١٨');
body.append('district', 'حي العارض');
body.append('postal_code', '١٣٣٣٧');
body.append('city', 'gtqnhyo');
body.append('short_address_en', 'RAHA3443');
body.append('building_no_en', '2929');
body.append('street_name_en', 'Raihan Bint Zaid');
body.append('secondary_no_en', '8118');
body.append('district_en', 'Al Arid');
body.append('postal_code_en', '13337');
body.append('city_en', 'Riyadh');
body.append('email', 'test@test.com');
body.append('phone', '+966500000000');
body.append('country', 'SA');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());

Request      

PUT api/companies/{company_id}/branches/{id}

PATCH api/companies/{company_id}/branches/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

id   integer   

The ID of the branch. Example: 1000

Body Parameters

branch_name   string   

The name of the branch. Must not be greater than 255 characters. Example: Main Branch

logo   file  optional  

Example: C:\Users\Ahsan\AppData\Local\Temp\php3230.tmp

short_address   string  optional  

The short address for the branch/company. (Arabic). Must be 8 characters. Example: RAHA3443

building_no   string  optional  

Building number of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{4})$/u. Example: ٢٩٢٩

street_name   string  optional  

Street name of the branch/company. (Arabic). Must not be greater than 64 characters. Example: ريحانة بنت زيد

secondary_no   string  optional  

Secondary number of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{4})$/u. Example: ٨١١٨

district   string  optional  

District of the branch/company. (Arabic). Must not be greater than 32 characters. Example: حي العارض

postal_code   string  optional  

Postal code of the branch/company. (Arabic). Must match the regex /^([0-9٠-٩]{5})$/u. Example: ١٣٣٣٧

city   string  optional  

Must not be greater than 32 characters. Example: gtqnhyo

short_address_en   string  optional  

The short address for the branch/company. (English). Must be 8 characters. Example: RAHA3443

building_no_en   string  optional  

Building number of the branch/company. (English). Must match the regex /^([0-9٠-٩]{4})$/u. Example: 2929

street_name_en   string  optional  

Street name of the branch/company. (English). Must not be greater than 64 characters. Example: Raihan Bint Zaid

secondary_no_en   string  optional  

Secondary number of the branch/company. (English). Must match the regex /^([0-9٠-٩]{4})$/u. Example: 8118

district_en   string  optional  

District of the branch/company. (English). Must not be greater than 32 characters. Example: Al Arid

postal_code_en   string  optional  

Postal code of the branch/company. (English). Must match the regex /^([0-9٠-٩]{5})$/u. Example: 13337

city_en   string  optional  

City of the branch/company. (English). Must not be greater than 32 characters. Example: Riyadh

email   string   

Email address of the branch (optional). Must be a valid email address. Must not be greater than 255 characters. Example: test@test.com

phone   string  optional  

Phone number of the branch (optional). Example: +966500000000

country   string  optional  

Country code of the branch (optional). ISO 3166-1 alpha-2 format. This field is required when phone is present. Must not be greater than 2 characters. Example: SA

Delete Branch

requires authentication

This endpoint allows the authenticated user to delete an existing branch for a specific company.

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/companies/10000/branches/1000" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/branches/1000"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/companies/{company_id}/branches/{id}

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

id   integer   

The ID of the branch. Example: 1000

ZATCA

Display the ZATCA settings for a company.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/zatcaSettings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/zatcaSettings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/companies/{company_id}/zatcaSettings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Store or update the ZATCA settings for a company.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/zatcaSettings" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"common_name\": \"Company Name\",
    \"egs_serial_number\": \"1-eInvoiceMe|2-v1.0.0|3-10001\",
    \"organization_unit_name\": \"Finance Department\",
    \"organization_name\": \"My Company Name\",
    \"country_name\": \"SA\",
    \"invoice_type\": \"1100\",
    \"location\": \"Riyadh, Saudi Arabia\",
    \"industry\": \"Information Technology\",
    \"is_live\": false,
    \"otp\": \"123456\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/zatcaSettings"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "common_name": "Company Name",
    "egs_serial_number": "1-eInvoiceMe|2-v1.0.0|3-10001",
    "organization_unit_name": "Finance Department",
    "organization_name": "My Company Name",
    "country_name": "SA",
    "invoice_type": "1100",
    "location": "Riyadh, Saudi Arabia",
    "industry": "Information Technology",
    "is_live": false,
    "otp": "123456"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/zatcaSettings

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Body Parameters

common_name   string   

Provided by the Taxpayer for each Solution unit: Unique Name or Asset Tracking Number of the Solution Unit. Must match the regex /^[a-zA-Z0-9\s]*$/. Must be between 3 and 255 characters. Example: Company Name

egs_serial_number   string   

Automatically filled and not by the taxpayer: Unique identification code for the EGS. Manufacturer serial number for each solution unit including
1. Manufacturer or Solution Provider Name | 2-Model or Version | 3-SerialNumber. Must match the regex /(1-[a-zA-Z\d]{3,})([|]2-[a-zA-Z\d]{3,})([|]3-[a-zA-Z\d]{3,})/. Must be between 3 and 255 characters. Example: 1-eInvoiceMe|2-v1.0.0|3-10001

organization_unit_name   string   

The branch name for taxpayers. In case of VAT Groups this field should contain the 10-digit TIN number of the individual group member whose EGS Unit is being onboarded. Must be between 3 and 255 characters. Example: Finance Department

organization_name   string   

Organization/Taxpayer Name. Must match the regex /^[a-zA-Z0-9\s]*$/. Must be between 3 and 255 characters. Example: My Company Name

country_name   string   

Name of the country
2 letter code. ISO 3166-1 alpha-2 code. Must be 2 characters. Example: SA

invoice_type   string   

The type of invoices issued by the organization.
Allowed values: 1100, 0100, 1000. Example: 1100

Must be one of:
  • 1100
  • 0100
  • 1000
location   string   

The address of the Branch or location where the device or solution unit is primarily situated (could be website address for e-commerce). Must not be greater than 255 characters. Example: Riyadh, Saudi Arabia

industry   string   

Industry or sector for which the device or solution will generate invoices. Must not be greater than 255 characters. Example: Information Technology

is_live   boolean  optional  

Indicates if the ZATCA setting is for the LIVE environment or the Simulation environment. Example: false

otp   string   

Log onto the fatoora portal (https://fatoora.zatca.gov.sa) with tax portal credentials. select Onboard new solution unit/device and you will be presented with an option to generate an OTP. The OTP is then required to be entered in this step. Must be 6 digits. Example: 123456

Enable/Disable ZATCA Auto Post

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/zatca/auto-post" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"auto\": true
}"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/zatca/auto-post"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "auto": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/companies/{company_id}/zatca/auto-post

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Body Parameters

auto   boolean   

Example: true

Display the ZATCA dashboard for a company.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/zatca/dashboard?irn=1234567890" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/zatca/dashboard"
);

const params = {
    "irn": "1234567890",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/zatca/dashboard",
        "per_page": 15,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/zatca/dashboard

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Query Parameters

irn   integer  optional  

The Invoice Reference Number (IRN) of the invoice. Example: 1234567890

inv   string  optional  

The Invoice Number.

vat_no   string  optional  

The VAT Number of the company. Must not be greater than 15 characters.

cr_no   string  optional  

The Commercial Registration Number of the company. Must not be greater than 10 characters.

customer_name   string  optional  

The name of the customer. Must not be greater than 50 characters.

customer_phone   string  optional  

The phone number of the customer. Must not be greater than 15 characters.

invoice_type   string  optional  

The type of invoice.

Must be one of:
  • simplified-tax-invoice
  • tax-invoice
transaction_type   string  optional  

The type of transaction.

Must be one of:
  • i
  • c
  • d
status   string  optional  

The status of the invoice.

Must be one of:
  • accepted
  • rejected
  • not-sent

Report document to ZATCA for a specific invoice sequence.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/companies/10000/invoice-sequences/7/report" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/invoice-sequences/7/report"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/companies/{company_id}/invoice-sequences/{invoiceSequence_id}/report

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

invoiceSequence_id   integer   

The ID of the invoiceSequence. Example: 7

Company Reports

Compnay Transactions Report

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/transactions?from=2025-07-01&to=2025-07-31" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/transactions"
);

const params = {
    "from": "2025-07-01",
    "to": "2025-07-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "http://127.0.0.1:8000/api/companies/10000/transactions",
        "per_page": 10,
        "next_cursor": null,
        "prev_cursor": null
    }
}
 

Request      

GET api/companies/{company_id}/transactions

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Query Parameters

irn   string  optional  

The IRN of the transaction.

inv   string  optional  

The internal invoice number of the transaction.

vat_no   integer  optional  

Filter all transactions by the seller VAT number.

branch_id   integer  optional  

Get all the transactions for a specific branch.

transaction_type   string  optional  

Filter transactions by document type. i (Invoice), c (Credit Note), d (Debit Note).

Must be one of:
  • i
  • c
  • d
from   string   

Filter transactions from a specific date. Must be a valid date in the format Y-m-d. Example: 2025-07-01

to   string   

Filter transactions to a specific date. Must be a valid date in the format Y-m-d. Example: 2025-07-31

Company VAT Sales Report

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/vat-sales?from=2025-07-01&to=2025-07-31" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/vat-sales"
);

const params = {
    "from": "2025-07-01",
    "to": "2025-07-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "VAT Sales Report",
    "data": {
        "transactions": [],
        "sales_vat": 0,
        "open_vat": 0,
        "debit_vat": 0,
        "adjusted_vat": 0
    }
}
 

Request      

GET api/companies/{company_id}/vat-sales

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Query Parameters

vat_no   string  optional  

VAT number of the company. Optional, but if provided, must be a 15-digit number. Must be 15 digits.

from   string   

Start date for the report in YYYY-MM-DD format. Must be a valid date in the format Y-m-d. Example: 2025-07-01

to   string   

End date for the report in YYYY-MM-DD format. Must be a valid date in the format Y-m-d. Must be a date after or equal to from. Example: 2025-07-31

Company VAT Purchases Report

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/companies/10000/vat-purchases?from=2025-07-01&to=2025-07-31" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/companies/10000/vat-purchases"
);

const params = {
    "from": "2025-07-01",
    "to": "2025-07-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Company VAT Purchases Report",
    "transactions": [],
    "total_sales": 0,
    "total_sales_vat": 0,
    "total_debit_notes": 0,
    "total_debit_notes_vat": 0,
    "total_credit_notes": 0,
    "total_credit_notes_vat": 0
}
 

Request      

GET api/companies/{company_id}/vat-purchases

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10000

Query Parameters

from   string   

Start date for the report in YYYY-MM-DD format. Must be a valid date in the format Y-m-d. Example: 2025-07-01

to   string   

End date for the report in YYYY-MM-DD format. Must be a valid date in the format Y-m-d. Must be a date after or equal to from. Example: 2025-07-31

Manage Profile

This controller handles the management of user profiles, including viewing and updating profile information.

Current User profile.

requires authentication

This method retrieves the authenticated user's profile information

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/my-profile" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/my-profile"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "User profile retrieved successfully",
    "data": {
        "id": 1,
        "name": "Ahsan Zaman",
        "email": "ahsan.web.ml@gmail.com",
        "email_verified": true,
        "phone": "+966571708606",
        "user_type": "User",
        "default_payment_status": "open",
        "default_payment_method": "cash",
        "profile_photo": {
            "id": 1,
            "model_type": "App\\Models\\User",
            "model_id": 1,
            "uuid": "b7eb9ee0-a30c-4285-af35-267b0752cb0d",
            "collection_name": "profile_photo",
            "name": "logo",
            "file_name": "logo.jpeg",
            "mime_type": "image/jpeg",
            "disk": "public",
            "conversions_disk": "public",
            "size": 6488,
            "manipulations": [],
            "custom_properties": {
                "custom_headers": {
                    "visibility": "public"
                }
            },
            "generated_conversions": [],
            "responsive_images": [],
            "order_column": 1,
            "created_at": "2025-07-13T19:53:22.000000Z",
            "updated_at": "2025-07-13T19:53:22.000000Z",
            "original_url": "http://127.0.0.1:8000/storage/eInvoiceMe/1/logo.jpeg",
            "preview_url": ""
        }
    }
}
 

Request      

GET api/my-profile

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Update Current User profile.

requires authentication

This method updates the authenticated user's profile information

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/update-my-profile" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name=Ahsan Zaman"\
    --form "email=jerde.quincy@example.net"\
    --form "country=SA"\
    --form "phone=+966571708606"\
    --form "invoice_type=1"\
    --form "customer_type=1"\
    --form "payment_status=1"\
    --form "payment_method=cash"\
    --form "photo=@C:\Users\Ahsan\AppData\Local\Temp\php2FCC.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/update-my-profile"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', 'Ahsan Zaman');
body.append('email', 'jerde.quincy@example.net');
body.append('country', 'SA');
body.append('phone', '+966571708606');
body.append('invoice_type', '1');
body.append('customer_type', '1');
body.append('payment_status', '1');
body.append('payment_method', 'cash');
body.append('photo', document.querySelector('input[name="photo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/update-my-profile

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string   

The name of the user. Must not be greater than 255 characters. Example: Ahsan Zaman

email   string   

The email of the user. Must be a valid email address. Must not be greater than 255 characters. Example: jerde.quincy@example.net

country   string  optional  

The country code of the user. ISO 3166-1 alpha-2 format is expected. Must be 2 characters. Example: SA

phone   string   

The phone number of the user. It should be a valid phone number for the specified country. Example: +966571708606

invoice_type   string   

Indicates whether the user TAX Invoices (true) or Simplified TAX Invoices (false). Example: true

Must be one of:
  • true
  • false
  • 1
  • 0
  • 1
  • 0
  • 1
customer_type   string   

Indicates whether the user is a Business (true) or Individual (false). Example: true

Must be one of:
  • true
  • false
  • 1
  • 0
  • 1
  • 0
  • 1
payment_status   integer   

Default payment status for documents. 0 for Close with RV, 1 for Open, 2 for Close without RV. Example: 1

payment_method   string  optional  

The default payment method used by the user. Example: cash

Must be one of:
  • cash
  • debit
  • credit
  • bank
  • cheque
  • acc
  • gold
  • Hunger Station
  • Jahez
  • Lugmty
  • The chefz
  • deposit
  • withdrawal
photo   file  optional  

Example: C:\Users\Ahsan\AppData\Local\Temp\php2FCC.tmp

Get Current User Bills.

requires authentication

This method retrieves the authenticated user's bills & Subscription payments

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/billing" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/billing"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Server Error"
}
 

Request      

GET api/billing

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Verify Phone Number

requires authentication

This method verifies the user's phone number by sending an OTP. If the phone number is already verified, it returns a message indicating that.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/verify-phone" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/verify-phone"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/verify-phone

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Verify Phone Number OTP

requires authentication

This method verifies the user's phone number by checking the provided OTP.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/verify-phone-otp" \
    --header "Authorization: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"otp\": \"123456\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/verify-phone-otp"
);

const headers = {
    "Authorization": "Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "otp": "123456"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/verify-phone-otp

Headers

Authorization      

Example: Bearer ApYZSQUg570EUAiPjWM3tsRzoENrulCLt0heXJuJ

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

otp   string   

User must provide a 6-digit OTP received via SMS. Must be 6 characters. Example: 123456