NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

Categories

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

List of categories with sub categories

Get a list of categories with sub categories.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/category" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/category",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": [
        {
            "id": 1,
            "name": "Chassis & Frame",
            "sub_categories": {
                "data": [
                    {
                        "id": 1,
                        "category_id": 1,
                        "category_name": "Chassis & Frame",
                        "name": "Bolts and Misc"
                    }
                ]
            }
        }
    ]
}

HTTP Request

GET api/v1/category

Search a Category

Search through the list of categories.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
search string required the beginning of category name to look for

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/category/search" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/category/search",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": [
        {
            "id": 1,
            "name": "Chassis & Frame",
            "sub_categories": {
                "data": [
                    {
                        "id": 1,
                        "category_id": 1,
                        "category_name": "Chassis & Frame",
                        "name": "Bolts and Misc"
                    }
                ]
            }
        }
    ]
}

HTTP Request

GET api/v1/category/search

Comments

List comments

Get a list of comments.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
part_id number optional restrict comments to only those for that part ID

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/comment" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/comment",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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
    }
}

HTTP Request

GET api/v1/comment

Retrieve a Comment

Fetch an existing comment.

Route Bindings

Binding Type Status Description
id number required the id of the comment to fetch.

Query Parameters

(no query parameters)

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/comment/{id}" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/comment/{id}",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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
    }
}

HTTP Request

GET api/v1/comment/{id}

Add a Comment

Create a new comment for a part.

Route Bindings

Binding Type Status Description
part_id number required the id of the part to attach the comment to.
user_source number required source of the comment; must always be 1 (truckinfo.com)
user_id number required Id of the comment's author
user_name string required Name of the comment's author
like boolean required One of 1 (like) or 0 (dislike)
comment text required The actual comment from the author

Query Parameters

(no query parameters)

Example request:

curl -X POST "https://api-truckpartscross.com/api/v1/comment" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/comment",
    "method": "POST",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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
    }
}

HTTP Request

POST api/v1/comment

Check if user can add Comment

Check if user can add new Comment for specified part.

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
part_id number required the id of the part to attach the comment to.
user_source number required source of the comment; must always be 1 (truckinfo.com)
user_id number required Id of the comment's author

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/comment/can_add" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/comment/can_add",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "result": true
}

HTTP Request

GET api/v1/comment/can_add

Favorite Parts

List

Retrieve all favorite parts

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
user_id integer required show only parts that belong to the specified user
sort_by string optional what column to sort the results on
sort_dir string optional sort direction; defaults to "asc"
Possible values: asc or desc
page number optional which page of results to return; defaults to page 1
per_page number optional how many rows to return, per page; defaults to 10, maximum 100

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/favorite-parts",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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
    }
}

HTTP Request

GET api/v1/favorite-parts

Create

Create the favorite part

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
user_id integer required the ID of the user
part_id integer required the ID of the part

Example request:

curl -X POST "https://api-truckpartscross.com/api/v1/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/favorite-parts",
    "method": "POST",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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"
        }
    }
}

HTTP Request

POST api/v1/favorite-parts

Delete

Delete the favorite part

Route Bindings

Binding Type Status Description
id number required ID of the part

Query Parameters

(no query parameters)

Example request:

curl -X DELETE "https://api-truckpartscross.com/api/v1/favorite-parts/{id}" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/favorite-parts/{id}",
    "method": "DELETE",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{}

HTTP Request

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

Parts

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

List

Get the list of parts.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
search string required full or partial part number to look for (min: 3 characters)
category_id integer optional filter by ID of the category
sub_category_id integer optional filter by ID of the sub category
manufacturer_id integer optional filter by ID of the manufacturer
manufacturer_name string optional filter by the name of the manufacturer, matches the beginning of the manufacturer name
number string optional filter by the number
vmrs string optional filter by the VMRS
no_name boolean optional show only parts which have no name
no_xrefs boolean optional show only parts which have no cross references
no_vmrs boolean optional show only parts which have no VMRS
no_category boolean optional show only parts which is not linked with some category
no_ecommerce boolean optional show only parts which have no ecommerce link
opticat_not_matched boolean optional show only parts which are not matched with opticat part
new_from date optional show only parts created in the period from new_from to new_to; new_to is required; format YYYY-mm-dd
new_to date optional show only parts created in the period from new_from to new_to; new_from is required; format YYYY-mm-dd
sort_by string optional what column to sort the results on; defaults to "number"
Possible values: number or manufacturer_name
sort_dir string optional sort direction; defaults to "asc"
Possible values: asc or desc
page number optional which page of results to return; defaults to page 1
per_page number optional how many rows to return, per page; defaults to 10, maximum 100

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/part/search" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/part/search",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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
    }
}

HTTP Request

GET api/v1/part/search

Retrieve a Part

Get a Part and its equivalences.

Route Bindings

Binding Type Status Description
id number required the id of the part to fetch.

Query Parameters

(no query parameters)

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/part/{id}" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/part/{id}",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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,
    "equivalences": [
        {
            "id": 27133,
            "number": "54429",
            "name": "Dual-Flow Lube Spin-on",
            "sub_category_id": 114,
            "manufacturer_id": 200,
            "manufacturer_name": "Champion",
            "manufacturer_phone": null,
            "manufacturer_website": null,
            "manufacturer_message": null,
            "equivalences_count": 127,
            "automatic": false,
            "vmrs": "",
            "retail": "0.00"
        }
    ],
    "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
}

HTTP Request

GET api/v1/part/{id}

Sub Categories

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

List of sub categories

Get a list of sub categories.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
category_id string optional ID of the category

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/sub_category" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/sub_category",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

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

HTTP Request

GET api/v1/sub_category

Tokens

api/v1/user/{uid}/history

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/user/{uid}/history" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/user/{uid}/history",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "header": "Your session has expired",
    "message": "Please refresh the page and try again.",
    "type": "TokenMismatchException"
}

HTTP Request

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

api/v1/user/{uid}/favorites

Example request:

curl -X POST "https://api-truckpartscross.com/api/v1/user/{uid}/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/user/{uid}/favorites",
    "method": "POST",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

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

api/v1/user/{uid}/favorites

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/user/{uid}/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/user/{uid}/favorites",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "header": "Your session has expired",
    "message": "Please refresh the page and try again.",
    "type": "TokenMismatchException"
}

HTTP Request

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

api/v1/user/{uid}/favorites/{part_id}

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/user/{uid}/favorites/{part_id}" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/user/{uid}/favorites/{part_id}",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "header": "Your session has expired",
    "message": "Please refresh the page and try again.",
    "type": "TokenMismatchException"
}

HTTP Request

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

api/v1/user/{uid}/favorites/{part_id}

Example request:

curl -X DELETE "https://api-truckpartscross.com/api/v1/user/{uid}/favorites/{part_id}" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/user/{uid}/favorites/{part_id}",
    "method": "DELETE",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

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

VMRS Component

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

List of VMRS Components

Get a list of VMRS components.

Route Bindings

(no route bindings)

Query Parameters

ParameterTypeStatusDescription
vmrs_assembly_idintegeroptional ID of the VMRS assembly (sub category)
at least one vmrs_assembly_id or sub_category_id is required
sub_category_idintegeroptional the same as vmrs_assembly_id

Example request:

curl -X GET -G "https://api-truckpartscross.com/api/v1/vmrs_component" \
    -H "X-Authorization: {api-key}" \
    -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api-truckpartscross.com/api/v1/vmrs_component",
    "method": "GET",
    "headers": {
        "X-Authorization": "{api-key}",
        "Accept": "application/json",
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "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"
        }
    ]
}

HTTP Request

GET api/v1/vmrs_component