NAV -image
javascript

Introduction

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

Base URL

http://api-truckpartscross.local

Authenticating requests

To authenticate requests, include a X-Authorization header with the value "{YOUR_AUTH_KEY}".

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

Categories

Category is represented by the first 3 digits of VMRS code. The same as VMRS System.

List

requires authentication

Get a list of categories (VMRS systems).

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/category"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1,
            "code": "000",
            "name": "Uncategorized",
            "sub_category_count": 1
        },
        {
            "id": 2,
            "code": "001",
            "name": "HVAC",
            "sub_category_count": 7
        },
        {
            "id": 3,
            "code": "002",
            "name": "Cab & Hood",
            "sub_category_count": 59
        }
    ]
}

Request   

GET api/v2/category

Search a Category in VMRS system

requires authentication

Search through VMRS systems.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/category/search"
);

let params = {
    "search": "consequatur",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "vmrs": "011",
            "name": "Steer Axle Group-Non Driven"
        },
        {
            "vmrs": "021",
            "name": "Steer Axle Group-Driven"
        },
        {
            "vmrs": "022",
            "name": "Drive Axle Assembly-Driven"
        },
        {
            "vmrs": "012-000",
            "name": "Auxiliary Axles \/ Axles - Non-Driven, Rear"
        },
        {
            "vmrs": "021-000",
            "name": "Steer Axle Group-Driven \/ Axles - Driven, Front Steering"
        },
        {
            "vmrs": "022-000",
            "name": "Drive Axle Assembly-Driven \/ Axles - Driven, Rear"
        },
        {
            "vmrs": "011-001",
            "name": "Steer Axle Group-Non Driven \/ Axle Components - Non-Driven, Front"
        },
        {
            "vmrs": "012-001",
            "name": "Auxiliary Axles \/ Axle Components - Non-Driven, Rear"
        },
        {
            "vmrs": "021-001",
            "name": "Steer Axle Group-Driven \/ Axle Components - Driven Front Steer Axle"
        },
        {
            "vmrs": "022-001",
            "name": "Drive Axle Assembly-Driven \/ Axle Housing Components - Driven, Rear"
        }
    ],
    "meta": {
        "found": 312
    }
}

Comments

List comments

requires authentication

Get a list of comments.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/comment"
);

let params = {
    "part_id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1,
            "created_at": {
                "date": "2018-07-30 03:56:03.000000",
                "timezone_type": 3,
                "timezone": "America\/New_York"
            },
            "part_id": 1004203,
            "part_name": "Lube Filter",
            "part_number": "LF3000",
            "user_name": "John Doe",
            "like": true,
            "comment": "Great tool",
            "date": "July 30, 2018",
            "approved": true
        }
    ],
    "meta": {
        "total": 18,
        "found": 6,
        "other_query_info": null
    }
}

Request   

GET api/v2/comment

Query Parameters

part_id  integer  
Filter by ID of the part.

Retrieve a Comment

requires authentication

Fetch an existing comment.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/comment/20"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 1,
        "created_at": {
            "date": "2018-07-30 03:56:03.000000",
            "timezone_type": 3,
            "timezone": "America\/New_York"
        },
        "part_id": 1004203,
        "part_name": "Lube Filter",
        "part_number": "LF3000",
        "user_name": "John Doe",
        "like": true,
        "comment": "Great tool",
        "date": "July 30, 2018",
        "approved": true
    }
}

Request   

GET api/v2/comment/{id}

URL Parameters

id  integer  
ID of the comment to fetch.

Add a Comment

requires authentication

Create a new comment for a part.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/comment"
);

let params = {
    "part_id": "19",
    "user_source": "1",
    "user_id": "15",
    "user_name": "et",
    "like": "",
    "comment": "occaecati",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 53,
        "created_at": {
            "date": "2019-02-14 11:22:58.000000",
            "timezone_type": 3,
            "timezone": "America\/New_York"
        },
        "part_id": 1,
        "part_name": "Air Compressor",
        "part_number": "N5060",
        "user_name": "John Doe",
        "like": true,
        "comment": "Great tool",
        "date": "February 14, 2019",
        "approved": false
    }
}

Request   

POST api/v2/comment

Query Parameters

part_id  integer  
ID of the part to attach the comment to.

user_source  integer  
Source of the comment. Possible values: 1 (truckinfo.com).

user_id  integer  
ID of the author of the comment.

user_name  string  
Name of the author.

like  boolean  
One of 1 (like) or 0 (dislike).

comment  string  
The text of the comment.

Check if user can add Comment

requires authentication

Check if user can add new Comment for specified part.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/comment/can-add"
);

let params = {
    "part_id": "7",
    "user_source": "1",
    "user_id": "13",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "result": true
}

Request   

GET api/v2/comment/can-add

Query Parameters

part_id  integer  
ID of the part to attach the comment to.

user_source  integer  
Source of the comment. Possible values: 1 (truckinfo.com).

user_id  integer  
ID of the author of the comment.

Component Parameters

Create

requires authentication

Create the component parameter.

Example request:

const url = new URL(
    "/api/component_param"
);

let params = {
    "component_id": "1",
    "name": "autem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 23,
        "component_id": 10,
        "name": "Spline Diameter",
        "slug": "spline_diameter",
        "order": 3
    }
}

Request   

POST api/component_param

Query Parameters

component_id  integer  
ID of the component.

name  string  
Name of the component parameter.

Update

requires authentication

Update the component parameter.

Example request:

const url = new URL(
    "/api/component_param/18"
);

let params = {
    "component_id": "2",
    "name": "accusamus",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 23,
        "component_id": 10,
        "name": "Spline Diameter",
        "slug": "spline_diameter",
        "order": 3
    }
}

Request   

PUT api/component_param/{id}

URL Parameters

id  integer  
ID of the component parameter.

Query Parameters

component_id  integer  
ID of the component.

name  string  
Name of the component parameter.

Delete

requires authentication

Delete the component parameter

Example request:

const url = new URL(
    "/api/component_param/2"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


[]

Request   

DELETE api/component_param/{id}

URL Parameters

id  integer  
ID of the component parameter.

Components

List

requires authentication

Get the list of components.

Example request:

const url = new URL(
    "/api/component"
);

let params = {
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "15",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 20,
            "name": "Air System - Air Dryers",
            "notes": null,
            "image": "https:\/\/api-truckpartscross.com\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
            "images": [
                {
                    "id": 5,
                    "url": "https:\/\/api-truckpartscross.com\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                    "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
                }
            ],
            "params": [
                {
                    "id": 130,
                    "component_id": 20,
                    "name": "Manufacturer",
                    "slug": "manufacturer",
                    "order": 1
                }
            ],
            "manufacturers": [
                {
                    "id": 3,
                    "name": "Bendix",
                    "default": 0
                }
            ]
        }
    ]
}

Request   

GET api/component

Query Parameters

sort_by  string optional  
What column to sort the results on. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 10, maximum 100.

Retrieve

requires authentication

Retrieve a specified component. In the retrieved component will be shown only parts from the default manufacturer. If no default manufacturer is specified the first one is considered as the default.

Example request:

const url = new URL(
    "/api/component/1"
);

let params = {
    "manufacturer_id": "7",
    "all_manufacturers": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

GET api/component/{id}

URL Parameters

id  integer  
ID of the component.

Query Parameters

manufacturer_id  integer optional  
Show only parts made by specified manufacturer, if not specified, parts of the default manufacturer will be shown.

all_manufacturers  boolean optional  
Show parts from all manufacturers.

Create

requires authentication

Create the component

Example request:

const url = new URL(
    "/api/component"
);

let params = {
    "name": "sit",
    "notes": "molestiae",
    "image": "voluptatem",
    "default_manufacturer_id": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

POST api/component

Query Parameters

name  string  
Name of the component.

notes  string optional  
Notes to the component.

image  string optional  
file Picture with explanations of component parameters.

default_manufacturer_id  integer optional  
`ID` of the default manufacturer.

Update

requires authentication

Example request:

const url = new URL(
    "/api/component/6"
);

let params = {
    "name": "omnis",
    "notes": "vero",
    "image": "possimus",
    "default_manufacturer_id": "7",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

PUT api/component/{id}

URL Parameters

id  integer  
ID of the component.

Query Parameters

name  string optional  
Name of the component.

notes  string optional  
Notes to the component.

image  string optional  
file Picture with explanations of component parameters.

default_manufacturer_id  integer optional  
`ID` of the default manufacturer.

Delete

requires authentication

Delete the component

Example request:

const url = new URL(
    "/api/component/4"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


[]

Request   

DELETE api/component/{id}

URL Parameters

id  integer  
ID of the component.

Attach image

requires authentication

Attach an image to the component

Example request:

const url = new URL(
    "/api/component/18/attach"
);

let params = {
    "attachment": "enim",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

POST api/component/{id}/attach

URL Parameters

id  integer  
ID of the component.

Query Parameters

attachment  string  
file Picture with explanations of component parameters.

Detach image

requires authentication

Detach an image from the component. If image ID is not specified the last image is deleted.

Example request:

const url = new URL(
    "/api/component/10/detach"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

POST api/component/{id}/detach

URL Parameters

id  integer  
ID of the component.

image_id  integer  
ID of the image, if not specified the last image is deleted.

Detach image

requires authentication

Detach an image from the component. If image ID is not specified the last image is deleted.

Example request:

const url = new URL(
    "/api/component/20/detach/8"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

POST api/component/{id}/detach/{image_id}

URL Parameters

id  integer  
ID of the component.

image_id  integer  
ID of the image, if not specified the last image is deleted.

Import

requires authentication

Import component from CSV file.

Example request:

const url = new URL(
    "/api/component/import"
);

let params = {
    "import-data": "distinctio",
    "manufacturer_id": "19",
    "component_id": "16",
    "notify": "qui",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": "The import has been scheduled. A notification will be sent to john.doe@example.com when it is completed."
}

Request   

POST api/component/import

Query Parameters

import-data  string  
file Data file in CSV format.

manufacturer_id  integer optional  
ID of the manufacturer.

component_id  integer optional  
ID of the component, if it's not specified the new component will be created.

notify  string optional  
Email to send the notification.

Add part

requires authentication

Add part to a component

Example request:

const url = new URL(
    "/api/component/9/part"
);

let params = {
    "manufacturer_part_id": "16",
    "params": "est",
    "accessory_id": "3",
    "notes": "quod",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

POST api/component/{id}/part

URL Parameters

id  integer  
ID of the component.

Query Parameters

manufacturer_part_id  integer  
ID of the part.

params  string  
array Array with values of the component parameters.

accessory_id  integer optional  
ID of accessory part.

notes  string optional  
Notes to the part.

Update part

requires authentication

Update a part linked to the component

Example request:

const url = new URL(
    "/api/component/et/part/8"
);

let params = {
    "manufacturer_part_id": "14",
    "params": "consequatur",
    "accessory_id": "4",
    "notes": "id",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

PUT api/component/{id}/part/{partId}

URL Parameters

id  string  
ID of the component.

partId  integer optional  
ID of the part linked to the component.

Query Parameters

manufacturer_part_id  integer  
ID of the part.

params  string  
array Array with values of the component parameters.

accessory_id  integer optional  
ID of accessory part.

notes  string optional  
Notes to the part.

Delete part

requires authentication

Delete a part linked to the component

Example request:

const url = new URL(
    "/api/component/non/part/7"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

DELETE api/component/{id}/part/{partId}

URL Parameters

id  string  
ID of the component.

partId  integer optional  
ID of the part linked to the component.

Detach Manufacturer

requires authentication

Detach all parts of the specified manufacturer from the component

Example request:

const url = new URL(
    "/api/component/17/manufacturer/qui"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 20,
        "name": "Air System - Air Dryers",
        "notes": null,
        "image": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
        "images": [
            {
                "id": 5,
                "url": "http:\/\/api-truckpartscross.local\/storage\/public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png",
                "path": "public\/component_images\/WrJcNEo6Tv9bIw6lyPNrQIZOfOS8kYWJurFMIMgM.png"
            }
        ],
        "params": [
            {
                "id": 130,
                "component_id": 20,
                "name": "Manufacturer",
                "slug": "manufacturer",
                "order": 1
            }
        ],
        "manufacturers": [
            {
                "id": 3,
                "name": "Bendix",
                "default": 0
            }
        ],
        "parts": [
            {
                "id": 186128,
                "number": "800959",
                "name": "DRYER_AIR",
                "manufacturer_id": 3,
                "manufacturer_name": "Bendix",
                "notes": "Has 1\/4\" NPT auxiliary inlet port",
                "params": {
                    "manufacturer": "Bendix",
                    "style": "AD-IS",
                    "voltage": "12V",
                    "wattage": "90W",
                    "port_size": "1\/2\"",
                    "purge_valve": "n\/a",
                    "purge_volume": "Standard",
                    "new_or_reman": "New",
                    "with_sc-pr_valve": "No",
                    "includes_mounting_bracket": "n\/a",
                    "application": "Chevrolet GMC Kodiak & Topkick C-Models"
                },
                "accessory": null
            }
        ]
    }
}

Request   

DELETE api/component/{id}/manufacturer/{manufacturerId}

URL Parameters

id  integer  
ID of the component.

manufacturerId  string  

manufacturer_id  integer  
ID of the manufacturer.

Favorite Parts

List

requires authentication

Retrieve all favorite parts

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/favorite-parts"
);

let params = {
    "user_id": "1",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "13",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "part_id": 710650,
            "part": {
                "id": 710650,
                "name": "Full-Flow Lube Spin-on",
                "number": "LF300",
                "manufacturer_id": 1166,
                "manufacturer_name": "Hastings"
            }
        }
    ],
    "meta": {
        "total": 1,
        "found": 1,
        "other_query_info": null
    }
}

Request   

GET api/v2/favorite-parts

Query Parameters

user_id  integer  
Show only parts that belong to the specified user.

sort_by  string optional  
What column to sort the results on. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 10, maximum 100.

Create

requires authentication

Create the favorite part

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/favorite-parts"
);

let params = {
    "user_id": "17",
    "part_id": "7",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": {
        "id": 1,
        "user_id": 1,
        "part_id": 710650,
        "part": {
            "id": 710650,
            "name": "Full-Flow Lube Spin-on",
            "number": "LF300",
            "manufacturer_id": 1166,
            "manufacturer_name": "Hastings"
        }
    }
}

Request   

POST api/v2/favorite-parts

Query Parameters

user_id  integer  
ID of the user.

part_id  integer  
ID of the part.

Delete

requires authentication

Delete the favorite part

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/favorite-parts/7"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


[]

Request   

DELETE api/v2/favorite-parts/{id}

URL Parameters

id  integer  
ID of the part.

Parts

Endpoints for parts. If a part is obsolete it's ignored in the match endpoint.

List

requires authentication

Get the list of parts.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/part/search"
);

let params = {
    "search": "sit",
    "category_id": "16",
    "sub_category_id": "1",
    "manufacturer_id": "4",
    "manufacturer_name": "et",
    "number": "ea",
    "vmrs": "ratione",
    "no_name": "",
    "no_xrefs": "",
    "no_vmrs": "",
    "no_category": "1",
    "no_ecommerce": "1",
    "opticat_not_matched": "1",
    "new_from": "2021-08-01",
    "new_to": "2021-08-31",
    "sort_by": "manufacturer_name",
    "sort_dir": "desc",
    "page": "2",
    "per_page": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 719206,
            "sub_category_id": 139,
            "category_name": "Filters",
            "sub_category_name": "_Default_",
            "number": "LF3",
            "standardized_number": "LF3",
            "name": "By-Pass Lube Spin-on",
            "retail": "0.00",
            "cost": "0.00",
            "image": "",
            "image_url": "",
            "vmrs": "",
            "notes": "",
            "manufacturer_name": "Lee",
            "manufacturer_website": null,
            "manufacturer_phone": null,
            "manufacturer_message": null,
            "manufacturer_pdf": "",
            "obsolete": false
        }
    ],
    "meta": {
        "total": 1220353,
        "found": 2,
        "other_query_info": null
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Retrieve a Part

requires authentication

Get a Part and its equivalences.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/part/9"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "id": 1004203,
    "sub_category_id": 114,
    "category_name": "Filters",
    "sub_category_name": "Lube",
    "number": "LF3000",
    "standardized_number": "LF3000",
    "name": "Lube Filter",
    "retail": "0.00",
    "cost": "0.00",
    "image": "1004203.jpeg",
    "image_url": "https:\/\/api-truckpartscross.com\/storage\/parts\/1004203.jpeg",
    "vmrs": "",
    "notes": "<p>Test note on LF3000<\/p>",
    "manufacturer_name": "Cummins Filtration (Fleetguard)",
    "manufacturer_website": null,
    "manufacturer_phone": null,
    "manufacturer_message": null,
    "manufacturer_pdf": "",
    "manufacturer_id": 4077,
    "retail_change_count": 0,
    "average_retail": "0.00",
    "last_retail_changes": [],
    "amazon_url": "https:\/\/www.amazon.com\/gp\/search?ie=UTF8&tag=diesellaptops-20&linkCode=ur2&linkId=25b0a443a8e34cd8f0a34f6885e2a793&camp=1789&creative=9325&index=automotive&keywords=LF3000",
    "google_url": "https:\/\/www.google.com\/search?q=LF3000",
    "ebay_url": "http:\/\/rover.ebay.com\/rover\/1\/711-53200-19255-0\/1?ff3=4&pub=5575564369&toolid=10001&campid=5338645045&customid=TruckInfo&mpre=https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html?_nkw=LF3000",
    "obsolete": false
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v2/part/{id}

URL Parameters

id  integer  
ID of part to be fetched.

Part Cross-References

requires authentication

Retrieve the list of cross-references for the specified part.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/part/7/equivalences"
);

let params = {
    "search": "eveniet",
    "manufacturer_id": "ea",
    "page": "3",
    "per_page": "16",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1272397,
            "number": "SG319",
            "name": "Oxygen Sensor",
            "manufacturer_id": 952,
            "manufacturer_name": "Standard Motor Products",
            "manufacturer_phone": null,
            "manufacturer_website": null,
            "manufacturer_message": null,
            "automatic": true,
            "vmrs": "045-021-000",
            "retail": null,
            "equivalences_count": 32
        }
    ],
    "meta": {
        "total": 43,
        "found": 43,
        "page": 1,
        "per_page": 10,
        "updates": {
            "manufacturer": {
                "id": 953,
                "name": "Standard Motor Products"
            }
        }
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v2/part/{id}/equivalences

URL Parameters

id  integer  
ID of the part.

Query Parameters

search  string optional  
Full or partial part number to look for.

manufacturer_id  string optional  
ID of manufacturer to filter result.

page  integer optional  
Which page of results to return. Defaults to page 1.

per_page  integer optional  
How many rows to return, per page. Defaults to 10.

Sub Categories

Sub category is represented by 4-6 digits of VMRS code. The same as VMRS Assembly.

List

requires authentication

Get a list of sub categories.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/sub-category"
);

let params = {
    "category_id": "maxime",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1,
            "code": "000",
            "category_id": 1,
            "category_name": "HVAC",
            "name": "Cab, Climate Control, Instrumentation, & Aerodynamic Devices Group"
        }
    ]
}

Request   

GET api/v2/sub-category

Query Parameters

category_id  string optional  
ID of the category.

Tokens

User search statistics

requires authentication

Retrieve the user search statistics.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/user/repudiandae/history"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "search": "LF3000",
            "date": "2021-08-01"
        }
    ],
    "meta": {
        "total": 1987654,
        "found": 50
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v2/user/{uid}/history

URL Parameters

uid  string  
ID of the user.

Add part

requires authentication

Add a part to user.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/user/occaecati/favorites"
);

let params = {
    "part_id": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "id": 1004203,
    "sub_category_id": 114,
    "category_name": "Filters",
    "sub_category_name": "Lube",
    "number": "LF3000",
    "standardized_number": "LF3000",
    "name": "Lube Filter",
    "retail": "0.00",
    "cost": "0.00",
    "image": "1004203.jpeg",
    "image_url": "https:\/\/api-truckpartscross.com\/storage\/parts\/1004203.jpeg",
    "vmrs": "",
    "notes": "<p>Test note on LF3000<\/p>",
    "manufacturer_name": "Cummins Filtration (Fleetguard)",
    "manufacturer_website": null,
    "manufacturer_phone": null,
    "manufacturer_message": null,
    "manufacturer_pdf": "",
    "manufacturer_id": 4077,
    "retail_change_count": 0,
    "average_retail": "0.00",
    "last_retail_changes": [],
    "amazon_url": "https:\/\/www.amazon.com\/gp\/search?ie=UTF8&tag=diesellaptops-20&linkCode=ur2&linkId=25b0a443a8e34cd8f0a34f6885e2a793&camp=1789&creative=9325&index=automotive&keywords=LF3000",
    "google_url": "https:\/\/www.google.com\/search?q=LF3000",
    "ebay_url": "http:\/\/rover.ebay.com\/rover\/1\/711-53200-19255-0\/1?ff3=4&pub=5575564369&toolid=10001&campid=5338645045&customid=TruckInfo&mpre=https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html?_nkw=LF3000",
    "obsolete": false
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/v2/user/{uid}/favorites

URL Parameters

uid  string  
ID of the user.

Query Parameters

part_id  integer  
ID of the part.

List parts

requires authentication

Retrieve a list of user parts.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/user/occaecati/favorites"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 719206,
            "sub_category_id": 139,
            "category_name": "Filters",
            "sub_category_name": "_Default_",
            "number": "LF3",
            "standardized_number": "LF3",
            "name": "By-Pass Lube Spin-on",
            "retail": "0.00",
            "cost": "0.00",
            "image": "",
            "image_url": "",
            "vmrs": "",
            "notes": "",
            "manufacturer_name": "Lee",
            "manufacturer_website": null,
            "manufacturer_phone": null,
            "manufacturer_message": null,
            "manufacturer_pdf": "",
            "obsolete": false
        }
    ],
    "meta": {
        "total": 1220353,
        "found": 2,
        "other_query_info": null
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v2/user/{uid}/favorites

URL Parameters

uid  string  
ID of the user.

Retrieve part

requires authentication

Retrieve the user part.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/user/reiciendis/favorites/11"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "id": 1004203,
    "sub_category_id": 114,
    "category_name": "Filters",
    "sub_category_name": "Lube",
    "number": "LF3000",
    "standardized_number": "LF3000",
    "name": "Lube Filter",
    "retail": "0.00",
    "cost": "0.00",
    "image": "1004203.jpeg",
    "image_url": "https:\/\/api-truckpartscross.com\/storage\/parts\/1004203.jpeg",
    "vmrs": "",
    "notes": "<p>Test note on LF3000<\/p>",
    "manufacturer_name": "Cummins Filtration (Fleetguard)",
    "manufacturer_website": null,
    "manufacturer_phone": null,
    "manufacturer_message": null,
    "manufacturer_pdf": "",
    "manufacturer_id": 4077,
    "retail_change_count": 0,
    "average_retail": "0.00",
    "last_retail_changes": [],
    "amazon_url": "https:\/\/www.amazon.com\/gp\/search?ie=UTF8&tag=diesellaptops-20&linkCode=ur2&linkId=25b0a443a8e34cd8f0a34f6885e2a793&camp=1789&creative=9325&index=automotive&keywords=LF3000",
    "google_url": "https:\/\/www.google.com\/search?q=LF3000",
    "ebay_url": "http:\/\/rover.ebay.com\/rover\/1\/711-53200-19255-0\/1?ff3=4&pub=5575564369&toolid=10001&campid=5338645045&customid=TruckInfo&mpre=https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html?_nkw=LF3000",
    "obsolete": false
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v2/user/{uid}/favorites/{part_id}

URL Parameters

uid  string  
ID of the user.

part_id  integer  
ID of the part.

Delete part

requires authentication

delete the part from the user.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/user/eveniet/favorites/1"
);

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


[]

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

DELETE api/v2/user/{uid}/favorites/{part_id}

URL Parameters

uid  string  
ID of the user.

part_id  integer  
ID of the part.

VMRS Component

VMRS component is represented by the last 3 digits of VMRS code.

List of VMRS Components

requires authentication

Get a list of VMRS components.

Example request:

const url = new URL(
    "http://api-truckpartscross.local/api/v2/vmrs-component"
);

let params = {
    "vmrs_assembly_id": "5",
    "sub_category_id": "7",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "{api-key}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):

{
    "data": [
        {
            "id": 1,
            "code": "000",
            "sub_category_id": 1,
            "sub_category_name": "Cab, Climate Control, Instrumentation, & Aerodynamic Devices Group",
            "name": "Cab, Climate Control, Instrumentation, & Aerodynamic Devices Group"
        }
    ]
}

Request   

GET api/v2/vmrs-component

Query Parameters

vmrs_assembly_id  integer optional  
ID of the VMRS assembly (sub category). At least one 'vmrs_assembly_id' or ''sub_category_id' is required.

sub_category_id  integer optional  
The same as 'vmrs_assembly_id'.