NAV -image
bash

Introduction

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

Base URL

http://api-truckpartscross.local

Authenticating requests

This API is authenticated by sending a X-Authorization header with the value "{YOUR_AUTH_KEY}".

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

Application

Common endpoints

Auto-suggest

requires authentication

Get items matching the search query for the entity defined by context_id

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/autosuggest/part_id?query=hic" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

[
    {
        "name": "Cummins",
        "id": 232
    },
    {
        "name": "Cummins Filtration (Fleetguard)",
        "id": 4077
    }
]

Request   

GET api/autosuggest/{context_id}

URL Parameters

context_id  string  
'manufacturer_id' for manufacturers or 'part_id' for parts.

Query Parameters

query  string  
Search query.

Attachments

Download the attachment

requires authentication

Download the attachment

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/view/odit?inline=" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (404):

{
    "message": "",
    "exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
    "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php",
    "line": 1113,
    "trace": [
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/helpers.php",
            "line": 44,
            "function": "abort",
            "class": "Illuminate\\Foundation\\Application",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/app\/Http\/Controllers\/AttachmentController.php",
            "line": 43,
            "function": "abort"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Controller.php",
            "line": 54,
            "function": "view",
            "class": "App\\Http\\Controllers\\AttachmentController",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Route.php",
            "line": 261,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Route.php",
            "line": 204,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php",
            "line": 695,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Middleware\/SubstituteBindings.php",
            "line": 50,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/app\/Http\/Middleware\/JwtApiToken.php",
            "line": 41,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "App\\Http\\Middleware\\JwtApiToken",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/ConvertEmptyStringsToNull.php",
            "line": 31,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/TrimStrings.php",
            "line": 40,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php",
            "line": 697,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php",
            "line": 672,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php",
            "line": 636,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php",
            "line": 625,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Kernel.php",
            "line": 166,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/fruitcake\/laravel-cors\/src\/HandleCors.php",
            "line": 52,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Fruitcake\\Cors\\HandleCors",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/PreventRequestsDuringMaintenance.php",
            "line": 86,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Kernel.php",
            "line": 141,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Kernel.php",
            "line": 110,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Strategies\/Responses\/ResponseCalls.php",
            "line": 324,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Strategies\/Responses\/ResponseCalls.php",
            "line": 305,
            "function": "callLaravelOrLumenRoute",
            "class": "Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Strategies\/Responses\/ResponseCalls.php",
            "line": 76,
            "function": "makeApiCall",
            "class": "Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Strategies\/Responses\/ResponseCalls.php",
            "line": 51,
            "function": "makeResponseCall",
            "class": "Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Strategies\/Responses\/ResponseCalls.php",
            "line": 41,
            "function": "makeResponseCallIfEnabledAndNoSuccessResponses",
            "class": "Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Generator.php",
            "line": 236,
            "function": "__invoke",
            "class": "Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Generator.php",
            "line": 172,
            "function": "iterateThroughStrategies",
            "class": "Knuckles\\Scribe\\Extracting\\Generator",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Extracting\/Generator.php",
            "line": 127,
            "function": "fetchResponses",
            "class": "Knuckles\\Scribe\\Extracting\\Generator",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Commands\/GenerateDocumentation.php",
            "line": 119,
            "function": "processRoute",
            "class": "Knuckles\\Scribe\\Extracting\\Generator",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/knuckleswtf\/scribe\/src\/Commands\/GenerateDocumentation.php",
            "line": 73,
            "function": "processRoutes",
            "class": "Knuckles\\Scribe\\Commands\\GenerateDocumentation",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/BoundMethod.php",
            "line": 36,
            "function": "handle",
            "class": "Knuckles\\Scribe\\Commands\\GenerateDocumentation",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Util.php",
            "line": 40,
            "function": "Illuminate\\Container\\{closure}",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/BoundMethod.php",
            "line": 93,
            "function": "unwrapIfClosure",
            "class": "Illuminate\\Container\\Util",
            "type": "::"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/BoundMethod.php",
            "line": 37,
            "function": "callBoundMethod",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php",
            "line": 651,
            "function": "call",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php",
            "line": 136,
            "function": "call",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/symfony\/console\/Command\/Command.php",
            "line": 299,
            "function": "execute",
            "class": "Illuminate\\Console\\Command",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php",
            "line": 121,
            "function": "run",
            "class": "Symfony\\Component\\Console\\Command\\Command",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/symfony\/console\/Application.php",
            "line": 978,
            "function": "run",
            "class": "Illuminate\\Console\\Command",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/symfony\/console\/Application.php",
            "line": 295,
            "function": "doRunCommand",
            "class": "Symfony\\Component\\Console\\Application",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/symfony\/console\/Application.php",
            "line": 167,
            "function": "doRun",
            "class": "Symfony\\Component\\Console\\Application",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Application.php",
            "line": 92,
            "function": "run",
            "class": "Symfony\\Component\\Console\\Application",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php",
            "line": 129,
            "function": "run",
            "class": "Illuminate\\Console\\Application",
            "type": "->"
        },
        {
            "file": "\/home\/vagrant\/Code\/api-truckpartscross\/artisan",
            "line": 35,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Console\\Kernel",
            "type": "->"
        }
    ]
}

Request   

GET api/view/{token}

URL Parameters

token  string  
Token or name in format token.pdf of attachment to fetch.

Query Parameters

inline  boolean optional  
If this parameter presents in the query file will be open in browser.

Delete

requires authentication

Delete the attachment

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/attachment/7" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Request   

DELETE api/attachment/{id}

URL Parameters

id  integer  
`ID` of the attachment.

Brand

Endpoints for brands

List

requires authentication

Retrieve all brands

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/brand?search=quo&manufacturer_id=2&sort_by=name&sort_dir=asc&page=1&per_page=20" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "manufacturer_id": 792,
            "code": "BFDG",
            "name": "Baldwin"
        }
    ],
    "meta": {
        "total": 14,
        "found": 14,
        "other_query_info": null
    }
}

Request   

GET api/brand

Query Parameters

search  string optional  
Full or partial name of the brand.

manufacturer_id  integer optional  
Show only brands for specified manufacturer.

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

Get a brand

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/brand/19" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "manufacturer_id": 792,
        "code": "BFDG",
        "name": "Baldwin"
    }
}

Request   

GET api/brand/{id}

URL Parameters

id  integer  
ID of the brand to fetch.

Create

requires authentication

Create new brand

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/brand?manufacturer_id=1&name=et&code=similique" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "manufacturer_id": 792,
        "code": "BFDG",
        "name": "Baldwin"
    }
}

Request   

POST api/brand

Query Parameters

manufacturer_id  integer  
ID of the manufacturer.

name  string  
Name of the brand.

code  string  
AutoCare brand ID.

Update

requires authentication

Update brand

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/brand/2?manufacturer_id=13&name=aut&code=aliquid" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

PUT api/brand/{id}

URL Parameters

id  integer  
ID of the brand.

Query Parameters

manufacturer_id  integer  
ID of the manufacturer.

name  string  
Name of the brand.

code  string  
AutoCare brand ID.

Delete

requires authentication

Delete the brand

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/brand/6" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Request   

DELETE api/brand/{id}

URL Parameters

id  integer  
ID of the brand.

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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/category

Update

requires authentication

Update category (VMRS system).

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/category/4?name=eveniet" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

PUT api/category/{id}

URL Parameters

id  integer  
ID of the category.

Query Parameters

name  string  
Name of category (VMRS system).

Parts report

requires authentication

Get the list of parts that belong to the category

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/category/17/parts?notify=nesciunt" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "The report is generated. A notification is sent to john.doe@gmail.com."
}

Request   

POST api/category/{id}/parts

URL Parameters

id  integer  
ID of the manufacturer to fetch.

Query Parameters

notify  string  
Email to send the notification.

Export

requires authentication

Export all categories, sub categories and VMRS parts in CSV format

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/category/export" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/category/export

Search a Category through all levels

requires authentication

Search through all levels of VMRS.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/category/deep_search?search=eos" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
        }
    ]
}

List

requires authentication

Get a list of categories (VMRS systems).

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/category

Search a Category in VMRS system

requires authentication

Search through VMRS systems.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/category/search?search=numquam" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
    }
}

List

requires authentication

Get a list of categories (VMRS systems).

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/category/search?search=iure" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/comment?part_id=1" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/comment

Query Parameters

part_id  integer  
Filter by ID of the part.

Retrieve a Comment

requires authentication

Fetch an existing comment.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/comment/17" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/comment/{id}

URL Parameters

id  integer  
ID of the comment to fetch.

Update

requires authentication

Update comment for a part.

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/comment/14?part_id=16&user_source=1&user_id=5&user_name=eius&like=&comment=dolorem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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   

PUT api/comment/{id}

URL Parameters

id  integer  
ID of the comment to fetch.

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.

Delete

requires authentication

Delete the comment

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/comment/19" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Request   

DELETE api/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:

curl -X POST \
    "http://api-truckpartscross.local/api/comment?part_id=17&user_source=1&user_id=10&user_name=at&like=&comment=dolores" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/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:

curl -X POST \
    "http://api-truckpartscross.local/api/comment/can_add?part_id=11&user_source=1&user_id=2" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": true
}

Request   

POST api/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.

List comments

requires authentication

Get a list of comments.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/comment?part_id=9" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/comment

Query Parameters

part_id  integer  
Filter by ID of the part.

Retrieve a Comment

requires authentication

Fetch an existing comment.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/comment/12" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/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:

curl -X POST \
    "http://api-truckpartscross.local/api/v1/comment?part_id=7&user_source=1&user_id=12&user_name=perferendis&like=&comment=voluptatum" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/comment/can_add?part_id=9&user_source=1&user_id=19" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": true
}

Request   

GET api/v1/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.

List comments

requires authentication

Get a list of comments.

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/comment?part_id=4" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/comment/19" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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:

curl -X POST \
    "http://api-truckpartscross.local/api/v2/comment?part_id=9&user_source=1&user_id=19&user_name=delectus&like=1&comment=qui" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/comment/can-add?part_id=4&user_source=1&user_id=6" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
component_id integer required ID of the component
name string required name of the component parameter

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component_param" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/component_param

Update

requires authentication

Update the component parameter

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
component_id integer required ID of the component
name string required name of the component parameter

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/component_param/consequuntur" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Delete

requires authentication

Delete the component parameter

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/component_param/repudiandae" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

DELETE api/component_param/{id}

URL Parameters

id  string  

Components

List

requires authentication

Get the list of components.

Route Bindings

(no route bindings)

Query Parameters

ParameterTypeStatusDescription
sort_bystringoptionalwhat column to sort the results on
sort_dirstringoptional sort direction; defaults to asc
Possible values: asc or desc
pagenumberoptional which page of results to return; defaults to 1
per_pagenumberoptional how many rows to return, per page; defaults to 10, maximum 100

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/component" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

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.

Route Bindings

Binding Type Status Description
id number required ID of the component to fetch

Query Parameters

BindingTypeStatusDescription
manufacturer_idnumberoptional show only parts made by specified manufacturer, if not specified, parts of the default manufacturer will be shown
all_manufacturersbooleanoptionalshow parts from all manufacturers

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/component/iusto" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Create

requires authentication

Create the component

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of the component
notes string optional notes to the component
image image file optional picture with explanations of component parameters
default_manufacturer_id number optional ID of the default manufacturer

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

Update

requires authentication

Update the component

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string optional name of the component
notes string optional notes to the component
image image file optional picture with explanations of component parameters
default_manufacturer_id number optional ID of the default manufacturer

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/component/rem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Delete

requires authentication

Delete the component

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/component/quo" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

DELETE api/component/{id}

URL Parameters

id  string  

Attach image

requires authentication

Attach an image to the component

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
attachment image file required picture with explanations of component parameters

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component/impedit/attach" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Detach image

requires authentication

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

Route Bindings

Binding Type Status Description
id number required ID of the component
image_id integer optional ID of the image, if not specified the last image is deleted

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component/non/detach" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Detach image

requires authentication

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

Route Bindings

Binding Type Status Description
id number required ID of the component
image_id integer optional ID of the image, if not specified the last image is deleted

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component/aut/detach/ut" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

image_id  string  

Import

requires authentication

Import component from CSV file.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
notify string optional email to send the notification
import-data file required data file in CSV format
manufacturer_id number required ID of the manufacturer
component_id number optional ID of the component, if it's not specified the new component will be created

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component/import" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "The Component import has been scheduled. A notification is sent to john.doe@gmail.com."
}

Request   

POST api/component/import

Add part

requires authentication

Add part to a component

Route Bindings

Binding Type Status Description
id number required ID of the component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
manufacturer_part_id integer required ID of the part
notes string optional notes to the part
params array required array with values of the component parameters
accessory_id integer optional ID of accessory part

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/component/laboriosam/part" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Update part

requires authentication

Update a part linked to the component

Route Bindings

Binding Type Status Description
id number required ID of the component
partId number required ID of the part linked to the component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
manufacturer_part_id integer optional ID of the part
notes string optional notes to the part
params array optional array with values of the component parameters
accessory_id integer optional ID of accessory part

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/component/vitae/part/autem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  

partId  string  

Delete part

requires authentication

Delete a part linked to the component

Route Bindings

Binding Type Status Description
id number required ID of the component
partId number required ID of the part linked to the component

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/component/quidem/part/voluptates" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  

partId  string  

Detach Manufacturer

requires authentication

Detach all parts of the specified manufacturer from the component

Route Bindings

Binding Type Status Description
id number required ID of the component
manufacturer_id number required ID of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/component/eos/manufacturer/omnis" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

manufacturerId  string  

Duplicate Parts

Operations with duplicate parts.

List of duplicate parts

requires authentication

Get a list of duplicate parts. Parameter mode specifies the type of duplicates to be returned. Mode 1 matches duplicates with the same number and the same manufacturer. Mode 2 matches the same number ignoring special symbols and the same manufacturer. Mode 3 matches the same number and different manufacturers. Mode 4 matches the same number ignoring special symbols and different manufacturers.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
mode number required what type of duplicates to return
manufacturer_id number optional ID of the manufacturer
search string optional full or partial part number to look for (min: 3 characters)
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 "http://api-truckpartscross.local/api/duplicate" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
    }
}

Request   

GET api/duplicate

List of duplicate parts CSV

requires authentication

Get a list of duplicate parts in CSV format. Parameter mode specifies the type of duplicates to be returned. Mode 1 matches duplicates with the same number and the same manufacturer. Mode 2 matches the same number ignoring special symbols and the same manufacturer. Mode 3 matches the same number and different manufacturers. Mode 4 matches the same number ignoring special symbols and different manufacturers.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
mode number required what type of duplicates to return

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/duplicate/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/duplicate/csv

Merge duplicate parts

requires authentication

Merge duplicate parts. All parts but the last from ids list will be deleted.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
ids string required IDs of parts to be merged, format id1,id2,id3
ignore_number boolean optional if true, parts with different numbers must be merged, else error will be thrown, default to false

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/duplicate/merge" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": "ok"
}

Request   

GET api/duplicate/merge

Merge by manufacturers

requires authentication

Merge parts with the same number for manufacturer id1 and manufacturer id2, parts for manufacturer id1 will be deleted.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
manufacturer_id1 number required ID manufacturer to be merged
manufacturer_id2 number required ID manufacturer to be merged

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/duplicate/merge_by_manufacturer" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": "ok",
    "message": "New task to merge parts is added to the queue."
}

Request   

GET api/duplicate/merge_by_manufacturer

Endpoints

api/part/{id}

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/recusandae" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (404):

{
    "error": "Not found"
}

Request   

GET api/part/{id}

URL Parameters

id  string  

api/parts

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/parts

api/{catchall}

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/sequi" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (404):

{
    "error": "Not found"
}

Request   

GET api/{catchall}

POST api/{catchall}

PUT api/{catchall}

PATCH api/{catchall}

DELETE api/{catchall}

OPTIONS api/{catchall}

URL Parameters

catchall  string  

Favorite Parts

List

requires authentication

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 "http://api-truckpartscross.local/api/v1/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/favorite-parts

Create

requires authentication

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 \
    "http://api-truckpartscross.local/api/v1/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/favorite-parts

Delete

requires authentication

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 \
    "http://api-truckpartscross.local/api/v1/favorite-parts/voluptate" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

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

URL Parameters

id  string  

List

requires authentication

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 "http://api-truckpartscross.local/api/v2/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

Create

requires authentication

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 \
    "http://api-truckpartscross.local/api/v2/favorite-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

Delete

requires authentication

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 \
    "http://api-truckpartscross.local/api/v2/favorite-parts/nulla" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

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

URL Parameters

id  string  

Manufacturers

Endpoints for manufacturers

List

requires authentication

Retrieve all manufacturers

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
search string optional full or partial name of manufacturer (min: 3 characters)
preferred_partner boolean optional filter by preferred partner
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 "http://api-truckpartscross.local/api/manufacturer" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 859,
            "name": "Dorman",
            "priority": 30,
            "website": "www.dormanhdsolutions.com",
            "phone": "800-523-2492",
            "message": "Think its dealer only? Check Dorman first",
            "vmrs": "DRMN",
            "history": "People's lives and livelihoods depend upon cars and trucks...",
            "mission": "Our Culture of Contribution is defined as the way Dorman...",
            "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
            "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
            "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
            "video": "j0IC88GuImE",
            "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
            "year_founded": 1919,
            "logo": "https:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
            "categories": [
                {
                    "id": 3,
                    "code": "002",
                    "name": "Cab & Hood"
                },
                {
                    "id": 9,
                    "code": "013",
                    "name": "Brake and Components"
                },
                {
                    "id": 37,
                    "code": "044",
                    "name": "Fuel System"
                },
                {
                    "id": 38,
                    "code": "045",
                    "name": "Engine Components"
                }
            ],
            "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
            "pdfs": [
                {
                    "id": 5,
                    "name": "Dorman_HD_Catalog_2020.pdf",
                    "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
                }
            ],
            "amazon": false,
            "google": true,
            "ebay": false,
            "preferred_partner": true,
            "reputation": 47
        }
    ],
    "meta": {
        "total": 3764,
        "found": 3764,
        "other_query_info": null
    }
}

Request   

GET api/manufacturer

Retrieve

requires authentication

Get a Manufacturer

Route Bindings

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

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/manufacturer/ab" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

GET api/manufacturer/{id}

URL Parameters

id  string  

Create

requires authentication

Create new Manufacturer

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of the manufacturer
website string optional manufacturer's website
phone string optional phone number
message string optional manufacturer's message
vmrs string optional VMRS code
notes string optional notes for the manufacturer
history string optional company history
mission string optional company mission
warranty_policy string optional warranty policy
training_offerings string optional training offerings
why_buy string optional description 'Why you should buy'
video string optional link to video; format: 11 symbols YouTube code
year_founded integer optional year when company was founded
logo file optional logo image file; format: jpg, jpeg, png, bmp, gif, svg, webp
amazon boolean optional if Amazon link should be shown; default: false
google boolean optional if Google link should be shown; default: false
ebay boolean optional if Ebay link should be shown; default: false
preferred_partner boolean optional if the company is preferred partner; default: false
reputation integer optional reputation score; min: -50; max: 50; default: 0

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

POST api/manufacturer

Update

requires authentication

Update manufacturer

Route Bindings

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

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of the manufacturer
website string optional manufacturer's website
phone string optional phone number
message string optional manufacturer's message
vmrs string optional VMRS code
notes string optional notes for the manufacturer
history string optional company history
mission string optional company mission
warranty_policy string optional warranty policy
training_offerings string optional training offerings
why_buy string optional description 'Why you should buy'
video string optional link to video; format: 11 symbols YouTube code
year_founded integer optional year when company was founded
logo file optional logo image file; format: jpg, jpeg, png, bmp, gif, svg, webp
amazon boolean optional if Amazon link should be shown; default: false
google boolean optional if Google link should be shown; default: false
ebay boolean optional if Ebay link should be shown; default: false
preferred_partner boolean optional if the company is preferred partner; default: false
reputation integer optional reputation score; min: -50; max: 50; default: 0

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/manufacturer/velit" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

PUT api/manufacturer/{id}

URL Parameters

id  string  

Delete

requires authentication

Delete the manufacturer

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/manufacturer/ut" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Request   

DELETE api/manufacturer/{id}

URL Parameters

id  string  

Hard Delete

requires authentication

Delete the manufacturer from trash or hard delete without moving to trash.

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/manufacturer/nobis/forced" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Request   

DELETE api/manufacturer/{id}/forced

URL Parameters

id  string  

Restore

requires authentication

Restore the manufacturer from trash.

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/eius/restore" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

POST api/manufacturer/{id}/restore

URL Parameters

id  string  

Merge

requires authentication

Merge two manufacturers. Move parts from first manufacturer to the second one. Duplicates will be merged, other parts will be reassigned, the first manufacturer will be deleted

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer to be merged and deleted
to number required the id of the result manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/sunt/merge/officia" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": "ok",
    "message": "New task to merge manufacturers is added to the queue."
}

Request   

POST api/manufacturer/{id}/merge/{to}

URL Parameters

id  string  

to  string  

Report

requires authentication

Get report containing all parts of specified manufacturer in CSV format

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/ducimus/report" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

POST api/manufacturer/{id}/report

URL Parameters

id  string  

Auto suggest

requires authentication

Retrieve manufacturers which match the search criteria for autocomplete fields

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
search string required search query (part of name)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/manufacturer/autocomplete" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 859,
            "name": "Dorman",
            "priority": 30,
            "website": "www.dormanhdsolutions.com",
            "phone": "800-523-2492",
            "message": "Think its dealer only? Check Dorman first",
            "vmrs": "DRMN",
            "history": "People's lives and livelihoods depend upon cars and trucks...",
            "mission": "Our Culture of Contribution is defined as the way Dorman...",
            "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
            "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
            "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
            "video": "j0IC88GuImE",
            "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
            "year_founded": 1919,
            "logo": "https:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
            "categories": [
                {
                    "id": 3,
                    "code": "002",
                    "name": "Cab & Hood"
                },
                {
                    "id": 9,
                    "code": "013",
                    "name": "Brake and Components"
                },
                {
                    "id": 37,
                    "code": "044",
                    "name": "Fuel System"
                },
                {
                    "id": 38,
                    "code": "045",
                    "name": "Engine Components"
                }
            ],
            "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
            "pdfs": [
                {
                    "id": 5,
                    "name": "Dorman_HD_Catalog_2020.pdf",
                    "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
                }
            ],
            "amazon": false,
            "google": true,
            "ebay": false,
            "preferred_partner": true,
            "reputation": 47
        }
    ],
    "meta": {
        "total": 3764,
        "found": 3764,
        "other_query_info": null
    }
}

Request   

GET api/manufacturer/autocomplete

Equivalencies

requires authentication

Get all equivalent parts for the manufacturer

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/manufacturer/perspiciatis/equivalences" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 28269,
            "number": "298670",
            "name": "Full-Flow Lube Spin-on",
            "linked_id": 884998,
            "linked_number": "18-7874",
            "linked_name": "Spin on Oil Filter",
            "automatic": 0
        }
    ],
    "meta": {
        "total": 17811,
        "found": 17811
    }
}

Request   

GET api/manufacturer/{id}/equivalences

URL Parameters

id  string  

Equivalencies CSV

requires authentication

Get all equivalent parts for the manufacturer in CSV format

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/non/equivalences/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

POST api/manufacturer/{id}/equivalences/csv

URL Parameters

id  string  

Export

requires authentication

Export all manufacturers in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/manufacturer/export" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/manufacturer/export

Attach

requires authentication

Attach PDF file to the manufacturer

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
pdf file required file in PDF format

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/enim/attach" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

POST api/manufacturer/{id}/attach

URL Parameters

id  string  

Detach

requires authentication

Detach PDF file from the manufacturer

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/illo/detach" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1204,
        "name": "Stay Ready",
        "priority": 0,
        "website": "www.companysite.com",
        "phone": "888-983-1975",
        "message": "We sell the parts you need!",
        "vmrs": "NORMA1",
        "pdf": ""
    }
}

Request   

POST api/manufacturer/{id}/detach

URL Parameters

id  string  

Detach

requires authentication

Detach PDF file from the manufacturer

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/manufacturer/maxime/detach/sapiente" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1204,
        "name": "Stay Ready",
        "priority": 0,
        "website": "www.companysite.com",
        "phone": "888-983-1975",
        "message": "We sell the parts you need!",
        "vmrs": "NORMA1",
        "pdf": ""
    }
}

Request   

DELETE api/manufacturer/{id}/detach/{attachment_id}

URL Parameters

id  string  

attachment_id  string  

Compare

requires authentication

Compare 2 manufacturers, make 2 reports: parts that cross between these manufacturers, and parts that no cross.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
id1 integer required ID of the first manufacturer
id2 integer required ID of the second manufacturer
notify string optional email to send report

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/compare" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/manufacturer/compare

Match

requires authentication

For each manufacturer from the request array return id and name of manufacturers matching the given name. It's used for matching names with the real manufacturers from the DB.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
names array required array of manufacturer names

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/match" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "name": "Grote",
            "matches": [
                {
                    "id": 19,
                    "name": "Grote"
                }
            ]
        },
        {
            "name": "Fakename",
            "matches": []
        }
    ]
}

Request   

POST api/manufacturer/match

Affiliate Links

requires authentication

Turn on or off all Amazon, Google or eBay links

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
link_name string required name of the link
Possible values: amazon, google, ebay
value boolean required turn links on or off

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/manufacturer/affiliate_links" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

OptiCat Parts

List

requires authentication

Retrieve all OptiCat parts

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
search string optional full or partial name of manufacturer
brand_code string optional show only parts with specified brand code
matched boolean optional show only parts linked with Diesel Laptops parts
not_matched boolean optional show only parts not linked with Diesel Laptops parts
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 "http://api-truckpartscross.local/api/opticat" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 4,
            "part_id": null,
            "number": "100-21AL",
            "brand_id": "BFDG",
            "brand_name": "Baldwin",
            "descriptions": {
                "Application Summary - 2000": "DAHL Products",
                "AAIA Part Type Description": "Multi Purpose Container",
                "Product Description - Long - 80": "Aluminum Bowl",
                "Product Description - Invoice - 40": "Aluminum Bowl"
            },
            "image": true,
            "part": null,
            "searched": true
        }
    ],
    "meta": {
        "total": 53950,
        "found": 53950,
        "other_query_info": null,
        "updates": {
            "manufacturer": []
        }
    }
}

Request   

GET api/opticat

Retrieve from OptiCat

requires authentication

Retrieve all information about the part from the OptiCat API. OptiCat API WSDL is available by link: https://webservice.opticatonline.com/autocare/v1/services/Catalog.soapEndpoint?doc

Retrieve all OptiCat parts

Route Bindings

Binding Type Status Description
id number required the id of the OptiCat part

Query Parameters

(no query bindings)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/opticat/et" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "partNumber": "100",
        "brandCode": "BFDG",
        "brandName": "Baldwin",
        "brandAdditionalInfo": {
            "isKnowYourParts": true,
            "websiteURL": "https:\/\/www.baldwinfilters.com\/",
            "logoImageURL50x20": "https:\/\/digital-assets.opticatonline.com\/brand-logos\/50x20\/baldwin.gif",
            "logoImageURL100x40": "https:\/\/digital-assets.opticatonline.com\/brand-logos\/100x40\/baldwin.gif",
            "logoImageURL200x80": "https:\/\/digital-assets.opticatonline.com\/brand-logos\/200x80\/baldwin.gif",
            "logoImageURL400x160": "https:\/\/digital-assets.opticatonline.com\/brand-logos\/400x160\/baldwin.gif",
            "logoImageURL800x320": "https:\/\/digital-assets.opticatonline.com\/brand-logos\/800x320\/baldwin.gif"
        },
        "brandLabel": "Baldwin",
        "categoryId": 12,
        "categoryName": "Air and Fuel Delivery",
        "subCategoryId": 153,
        "subCategoryName": "Filters",
        "partTypeId": 6216,
        "partTypeName": "Fuel Water Separator Filter",
        "hazardousMaterialCode": false,
        "itemLevelGTIN": {
            "gtin": "00791440035126",
            "qualifierCode": "UP",
            "qualifierName": "UPC"
        },
        "quantityPerApplication": {
            "value": 1,
            "uomCode": "EA",
            "uomName": "Each"
        },
        "minimumOrderQuantity": {
            "value": 1,
            "uomCode": "EA",
            "uomName": "Each"
        },
        "descriptions": [
            {
                "value": "DAHL Products",
                "descriptionTypeCode": "ASM",
                "descriptionTypeName": "Application Summary - 2000",
                "languageCode": "EN"
            },
            {
                "value": "Fuel Water Separator Filter",
                "descriptionTypeCode": "DEF",
                "descriptionTypeName": "AAIA Part Type Description",
                "languageCode": "EN"
            },
            {
                "value": "Fuel Water Separator Filter",
                "descriptionTypeCode": "DEF",
                "descriptionTypeName": "AAIA Part Type Description",
                "languageCode": "EN"
            },
            {
                "value": "Diesel Fuel Filter\/Water Separator",
                "descriptionTypeCode": "DES",
                "descriptionTypeName": "Product Description - Long - 80",
                "languageCode": "EN"
            },
            {
                "value": "Fuel\/Water Separator",
                "descriptionTypeCode": "INV",
                "descriptionTypeName": "Product Description - Invoice - 40",
                "languageCode": "EN"
            }
        ],
        "extendedInformation": [
            {
                "value": "N",
                "formattedValue": "No",
                "expiCode": "MSR",
                "expiName": "SDR Required Flag"
            },
            {
                "value": "US",
                "formattedValue": "United States",
                "expiCode": "CTO",
                "expiName": "Country of Origin (Primary)"
            },
            {
                "value": "8421230000",
                "formattedValue": "8421230000",
                "expiCode": "HSB",
                "expiName": "Harmonized Tariff Code (Schedule B)"
            }
        ],
        "productAttributes": [],
        "packages": [
            {
                "packageUOMCode": "CA",
                "packageUOMName": "Case",
                "quantityOfEaches": 1,
                "dimensions": {
                    "height": 6,
                    "width": 6.6,
                    "length": 11.9,
                    "uomCode": "IN",
                    "uomName": "Inch"
                },
                "weights": {
                    "weight": 4.85,
                    "uomCode": "PG",
                    "uomName": "Pounds Gross"
                },
                "hazardousMaterials": []
            },
            {
                "packageUOMCode": "EA",
                "packageUOMName": "Smallest Pack (Consumer Level)",
                "quantityOfEaches": 1,
                "dimensions": {
                    "height": 6,
                    "width": 6.6,
                    "length": 11.9,
                    "uomCode": "IN",
                    "uomName": "Inch"
                },
                "weights": {
                    "weight": 4.85,
                    "uomCode": "PG",
                    "uomName": "Pounds Gross"
                },
                "hazardousMaterials": []
            },
            {
                "packageUOMCode": "PL",
                "packageUOMName": "Pallet",
                "quantityOfEaches": 175,
                "dimensions": {
                    "height": 42,
                    "width": 48,
                    "length": 42,
                    "uomCode": "IN",
                    "uomName": "Inch"
                },
                "weights": {
                    "weight": 848.75,
                    "uomCode": "PG",
                    "uomName": "Pounds Gross"
                },
                "hazardousMaterials": []
            }
        ],
        "kits": [],
        "partInterchanges": [],
        "digitalAssets": [
            {
                "assetTypeCode": "P04",
                "assetTypeName": "Photo - Primary",
                "representationTypeCode": "A",
                "representationTypeName": "Actual",
                "orientationViewTypeCode": "FRO",
                "orientationViewTypeName": "Front",
                "languageCode": "EN",
                "imageURL50": "https:\/\/digital-assets.opticatonline.com\/images\/50\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "imageURL100": "https:\/\/digital-assets.opticatonline.com\/images\/100\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "imageURL200": "https:\/\/digital-assets.opticatonline.com\/images\/200\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "imageURL400": "https:\/\/digital-assets.opticatonline.com\/images\/400\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "imageURL800": "https:\/\/digital-assets.opticatonline.com\/images\/800\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "imageURL1600": "https:\/\/digital-assets.opticatonline.com\/images\/1600\/59eee8b980c5359dd64e135f97543017a05ea502.jpg",
                "descriptions": [],
                "fileName": "100.jpg"
            }
        ]
    }
}

Request   

GET api/opticat/{id}

URL Parameters

id  string  

Update

requires authentication

Update new OptiCat part

Route Bindings

Binding Type Status Description
id number required the id of the OptiCat part

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
part_id integer required ID of the Diesel Laptop part

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/opticat/voluptates" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 4,
        "part_id": null,
        "number": "100-21AL",
        "brand_id": "BFDG",
        "brand_name": "Baldwin",
        "descriptions": {
            "Application Summary - 2000": "DAHL Products",
            "AAIA Part Type Description": "Multi Purpose Container",
            "Product Description - Long - 80": "Aluminum Bowl",
            "Product Description - Invoice - 40": "Aluminum Bowl"
        },
        "image": true,
        "part": null,
        "searched": true
    }
}

Request   

PUT api/opticat/{id}

URL Parameters

id  string  

Scan

requires authentication

Scan brand on OptiCat and copy all parts

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
brand_code string required brand code
notify string optional email to send report

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/brand-scan" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/opticat/brand-scan

api/opticat/brand-special-scan

requires authentication

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/brand-special-scan" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

POST api/opticat/brand-special-scan

Suggestions

requires authentication

Suggest Diesel Laptops parts to link

Route Bindings

Binding Type Status Description
id number required the id of the OptiCat part

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/opticat/quia/suggestions" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

[
    {
        "id": 790466,
        "number": "PA10057",
        "manufacturer_id": 792,
        "manufacturer_name": "Baldwin"
    }
]

Request   

GET api/opticat/{id}/suggestions

URL Parameters

id  string  

Add

requires authentication

Copy OptiCat part to Diesel Laptop DB

Route Bindings

Binding Type Status Description
id number required the id of the OptiCat part

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/qui" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
}

Request   

POST api/opticat/{id}

URL Parameters

id  string  

Mass Add

requires authentication

Copy all OptiCat parts for specified brand to Diesel Laptop DB

Route Bindings

Binding Type Status Description
brand_code string required the 4 symbol code of the brand
notify string required Email to send the notification

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/add" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/opticat/add

Add manufacturer

requires authentication

Add OptiCat manufacturer to Diesel Laptops

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
brand_code number required the brand code

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/add-manufacturer" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

POST api/opticat/add-manufacturer

Match

requires authentication

Run job calculating suggestions for all OptiCat parts.

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/match" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "OptiCat parts matching is scheduled."
}

Request   

POST api/opticat/match

Number of unmatched OptiCat parts

requires authentication

Get number of unmatched OptiCat parts.

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/opticat/unmatched-count" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": 100
}

Request   

GET api/opticat/unmatched-count

Not matched Diesel Laptops parts

requires authentication

Export not matched Diesel Laptops parts

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
brand_code number required the brand code

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/opticat/export-not-matched-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{}

Request   

GET api/opticat/export-not-matched-parts

Not matched OptiCat parts

requires authentication

Export not matched OptiCat parts

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
brand_code number required the brand code

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/opticat/export-not-matched-opticat-parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{}

Request   

GET api/opticat/export-not-matched-opticat-parts

Import Images

requires authentication

Import images from OptiCat for parts which haven't ones

Route Bindings

Binding Type Status Description
notify string required Email to send the notification

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/import-images" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/opticat/import-images

Xrefs Report

requires authentication

Make a report about cross refs parts from Optiat

Route Bindings

Binding Type Status Description
notify string required Email to send the notification

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/opticat/interchange-report" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/opticat/interchange-report

Parts cross references

Deep Xrefs

requires authentication

Get deep cross parts references

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
manufacturer_id number required ID of the manufacturer
search string optional full or partial part number to look for (min: 3 characters)
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 "http://api-truckpartscross.local/api/xref" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 238564,
            "number": "9Y4506",
            "manufacturer_name": "Caterpillar",
            "name": "Lube, Full-Flow Spin-On",
            "xref_qty": 22082
        }
    ],
    "meta": {
        "total": 235900,
        "found": 235900
    }
}

Request   

GET api/xref

Retrieve a Part

requires authentication

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 "http://api-truckpartscross.local/api/xref/facere" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "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,
        "xref_qty": 0,
        "xref_qty_same_name": null,
        "obsolete": false
    }
}

Request   

GET api/xref/{id}

URL Parameters

id  string  

Approve XREF

requires authentication

Approve deep cross reference between the part id1 and the part id2. Deep cross reference is recognized as actual cross reference with indirect mark.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
id1 number required the ID of the first part
id2 number required the ID of the second part

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/xref/approve" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

POST api/xref/approve

Decline XREF

requires authentication

Decline deep cross reference between the part id1 and the part id2. Deep cross reference is removed from deep cross references list.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
id1 number required the ID of the first part
id2 number required the ID of the second part

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/xref/decline" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

POST api/xref/decline

Deep Xrefs for a part

requires authentication

Get deep cross parts references for a specified part

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
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 "http://api-truckpartscross.local/api/xref/part/dolorem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1372304,
            "sub_category_id": null,
            "category_name": "",
            "sub_category_name": "",
            "number": "W267",
            "standardized_number": "W267",
            "name": "WhlStud Shoulder LH for RH",
            "manufacturer_name": "Leland",
            "price": null,
            "image": "",
            "image_url": "",
            "notes": "",
            "manufacturer_pdf": "",
            "manufacturer_id": 2285,
            "equivalences": [
                {
                    "id": 454024,
                    "number": "20X243",
                    "name": "Serrated Double",
                    "manufacturer_id": 4290,
                    "manufacturer_name": "Rockwell\/Meritor",
                    "equivalences_count": 2,
                    "automatic": false,
                    "price": null
                }
            ]
        }
    ],
    "meta": {
        "total": 1,
        "found": 1
    }
}

Request   

GET api/xref/part/{id}

URL Parameters

id  string  

Deep Xrefs for a part, CSV

requires authentication

Get deep cross parts references for a specified part in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/xref/part/et/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (404):

{
    "error": "Not found"
}

Request   

GET api/xref/part/{id}/csv

URL Parameters

id  string  

Deep Xrefs for a manufacturer, CSV

requires authentication

Get deep cross parts references for a specified manufacturer in CSV format

Route Bindings

Binding Type Status Description
id number required the id of the manufacturer

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/xref/manufacturer/praesentium/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (404):

{
    "error": "Not found"
}

Request   

GET api/xref/manufacturer/{id}/csv

URL Parameters

id  string  

Parts Look Statistics

Part retrieve

requires authentication

Get statistics of part retrieve.

Route Bindings

Parameter Type Status Description
date_from string required report beginning date, format: YYYY-mm-dd
date_to string required report end date, format: YYYY-mm-dd
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

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/stat/part-retrieve" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 430784,
            "number": "AS1142",
            "manufacturer": "Gunite",
            "name": "Air Brake Automatic Slack Adjuster",
            "qty": 826
        }
    ],
    "meta": {
        "found": 48985,
        "current_page": 1,
        "from": 1,
        "last_page": 4899,
        "path": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve",
        "per_page": 10,
        "to": 10,
        "total": 48985
    },
    "links": {
        "first": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=1",
        "last": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=4899",
        "prev": null,
        "next": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=2"
    }
}

Request   

GET api/stat/part-retrieve

Report in CSV

requires authentication

Route Bindings

Parameter Type Status Description
date_from string required report beginning date, format: YYYY-mm-dd
date_to string required report end date, format: YYYY-mm-dd
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

Query Parameters

(no query parameters)

Get parts look statistics report in csv format

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/stat/part-retrieve/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/stat/part-retrieve/csv

Part retrieve

requires authentication

Get statistics of part retrieve.

Route Bindings

Parameter Type Status Description
date_from string required report beginning date, format: YYYY-mm-dd
date_to string required report end date, format: YYYY-mm-dd
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

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/parts_look" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 430784,
            "number": "AS1142",
            "manufacturer": "Gunite",
            "name": "Air Brake Automatic Slack Adjuster",
            "qty": 826
        }
    ],
    "meta": {
        "found": 48985,
        "current_page": 1,
        "from": 1,
        "last_page": 4899,
        "path": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve",
        "per_page": 10,
        "to": 10,
        "total": 48985
    },
    "links": {
        "first": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=1",
        "last": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=4899",
        "prev": null,
        "next": "https:\/\/api-truckpartscross.com\/api\/stat\/part-retrieve?page=2"
    }
}

Request   

GET api/parts_look

Report in CSV

requires authentication

Route Bindings

Parameter Type Status Description
date_from string required report beginning date, format: YYYY-mm-dd
date_to string required report end date, format: YYYY-mm-dd
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

Query Parameters

(no query parameters)

Get parts look statistics report in csv format

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/parts_look/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/parts_look/csv

Parts

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

Search For Part

requires authentication

Search through 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 "http://api-truckpartscross.local/api/part" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/part

Export

requires authentication

Export all parts in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

ParameterTypeStatusDescription
notifystringrequiredEmail to send the notification
namestringoptionalname of the report
fieldsarrayoptional fields to show in the report
default: [name, manufacturerName, name]

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/csv

Create

requires authentication

Create a part

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
manufacturer_id string required ID of the manufacturer
name string required name of the part
number string required number of the part
retail string optional retail price of the part
cost string optional cost of the part
notes string optional notes for the part
vmrs1 string optional system VMRS, 4 symbols
vmrs2 string optional assembly VMRS, 4 symbols
vmrs3 string optional component VMRS, 4 symbols
ecommerce_link string optional e-commerce link
obsolete boolean optional true if the part is obsolete, default false

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Example response (422):

{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}

Request   

POST api/part

Update

requires authentication

Update the part

Route Bindings

Binding Type Status Description
id number required the id of the part

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
manufacturer_id string required ID of the manufacturer
name string required name of the part
number string required number of the part
retail string optional retail price of the part
cost string optional cost of the part
notes string optional notes for the part
vmrs1 string optional system VMRS, 4 symbols
vmrs2 string optional assembly VMRS, 4 symbols
vmrs3 string optional component VMRS, 4 symbols
ecommerce_link string optional e-commerce link
obsolete boolean optional true if the part is obsolete, default false

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/part/id" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Example response (422):

{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}

Request   

PUT api/part/{id}

URL Parameters

id  string  

Delete

requires authentication

Delete the part

Route Bindings

Binding Type Status Description
id number required the id of the part

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/part/est" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

DELETE api/part/{id}

URL Parameters

id  string  

Import Parts

requires authentication

Import parts from the data array.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

ParameterTypeStatusDescription
notifystringoptionalEmail to send the notification
tokenstringoptional Token of the multipage import. Token is provided in the response and is used to identify the next page of the same import procedure.
completebooleanoptionalStart the import procedure. If this parameter is set to true, the request is recognized as a last page of the multipage import.
dataarrayrequired Array with parts data,
format: ['id', 'number', 'manufacturer_id', 'manufacturer', 'xref_id', 'xref_number', 'xref_manufacturer_id', 'xref_manufacturer', 'name']
id - part ID
number - part number
manufacturer_id - ID of the manufacturer
manufacturer - name of the manufacturer
xref_id - ID of the part to be linked
xref_number - number of part to be linked
xref_manufacturer_id - ID of the part to be linked
xref_manufacturer - name of the manufacturer of the part to be linked
name - part description

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "",
    "token": "ZKlBfXqfIJKaEebJxnMoZObNpXkGKhjn"
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/import

Import prices

requires authentication

Import prices for the parts in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
import-data file required file with data to import in CSV format

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import-price" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (422):

{
    "message": "The given data was invalid.",
    "errors": {
        "import-data": [
            "The import-data field is required."
        ]
    }
}

Request   

POST api/part/import-price

Import cost

requires authentication

Import costs for the parts in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
import-data file required file with data to import in CSV format

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import-cost" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (422):

{
    "message": "The given data was invalid.",
    "errors": {
        "import-data": [
            "The import-data field is required."
        ]
    }
}

Request   

POST api/part/import-cost

Import prices

requires authentication

Import parts without cross references in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
import-data file required file with data to import in CSV format

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import-no-xrefs" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (422):

{
    "message": "The given data was invalid.",
    "errors": {
        "import-data": [
            "The import-data field is required."
        ]
    }
}

Request   

POST api/part/import-no-xrefs

Upload image

requires authentication

Upload image for a part

Route Bindings

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

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
image file required image file, jpg and png are allowed

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/repellendus/image" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Example response (500):

{
    "error": "Cannot upload image"
}

Request   

POST api/part/{id}/image

URL Parameters

id  string  

Delete image

requires authentication

Delete image from a part

Route Bindings

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

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/part/et/image" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Example response (500):

{
    "error": "Cannot upload image"
}

Request   

DELETE api/part/{id}/image

URL Parameters

id  string  

Upload image

requires authentication

Upload image for a part by number and manufacturer

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
file file required image file, jpg and png are allowed
number string required part number
manufacturer_id number required ID of the manufacturer

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/manufacturer/image" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": "ok"
}

Example response (401):

{
    "message": "Unauthenticated."
}

Example response (500):

{
    "error": "Cannot upload image"
}

Request   

POST api/part/manufacturer/image

Total number of parts

requires authentication

Get total number of parts

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/total" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "total": 1226241
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/total

Link parts

requires authentication

Link parts id with part link_to

Route Bindings

Parameter Type Status Description
id number required ID of part to be linked
link_to number required ID of part to be linked

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/laudantium/link/praesentium" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Unlink parts

requires authentication

Unlink parts id and link_to

Route Bindings

Parameter Type Status Description
id number required ID of part to be unlinked
link_to number required ID of part to be unlinked

Query Parameters

(no query parameters)

Post Parameters

Parameter Type Status Description
relink_to number optional if it's specified part id is linked to relinked_to

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/et/unlink/voluptatem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Mass Unlink

requires authentication

Remove specified cross-references from a part.

Route Bindings

Parameter Type Status Description
id number required ID of part to be unlinked

Query Parameters

(no query parameters)

Post Parameters

Parameter Type Status Description
ids array required IDs of parts to be unlinked

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/aut/unlink" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Add Recommended

requires authentication

Add recommended part

Route Bindings

Binding Type Status Description
id number required ID of the part to which we add the recommended part

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
id integer required ID of recommended part
notes string optional notes to the recommended parts

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/iste/recommended" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Update Recommended

requires authentication

Update recommended part

Route Bindings

Binding Type Status Description
id integer required ID of the part in which we update the recommended part
recommended_id integer required ID of the recommended part

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
notes string optional notes to the recommended parts

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/part/placeat/recommended/modi" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Delete Recommended

requires authentication

Delete recommended part

Route Bindings

Binding Type Status Description
id integer required ID of the part from which we delete the recommended part
recommended_id integer required ID of the recommended part

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/part/quam/recommended/non" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Copy recommended parts

requires authentication

Copy all recommended parts to the another part

Route Bindings

Binding Type Status Description
id integer required ID of the part from which we copy the recommended parts

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
id integer required ID of part to which we copy the recommended parts

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/omnis/copy_recommended" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


[]

Example response (401):

{
    "message": "Unauthenticated."
}

Count of modified parts

requires authentication

Count of parts modified between date_from and date_to

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
date_from date optional date of period beginning, default a week ago
date_to date optional date of period end, default today

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/modified/count" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "count": 0,
        "date_from": "2019-04-02 12:48:20",
        "date_to": "2019-04-09 12:48:20"
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/modified/count

Modified parts

requires authentication

Parts modified between date_from and date_to

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
date_from date optional date of period beginning, default a week ago
date_to date optional date of period end, default today

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/modified" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1466919,
            "sub_category_id": null,
            "category_name": "",
            "sub_category_name": "",
            "number": "MBFME414358",
            "standardized_number": "MBFME414358",
            "name": "Clutch Cooling Fan",
            "manufacturer_name": "Freightliner",
            "retail": null,
            "cost": null,
            "image": "",
            "image_url": "",
            "notes": "",
            "manufacturer_pdf": "",
            "manufacturer_id": 28,
            "equivalences": [],
            "obsolete": false
        }
    ],
    "meta": {
        "found": 8796,
        "date_from": "2019-04-02 12:50:21",
        "date_to": "2019-04-09 12:50:21",
        "current_page": 1,
        "from": 1,
        "last_page": 880,
        "path": "https:\/\/api-truckpartscross.com\/api\/part\/modified",
        "per_page": 10,
        "to": 10,
        "total": 8796
    },
    "links": {
        "first": "https:\/\/api-truckpartscross.com\/api\/part\/modified?page=1",
        "last": "https:\/\/api-truckpartscross.com\/api\/part\/modified?page=880",
        "prev": null,
        "next": "https:\/\/api-truckpartscross.com\/api\/part\/modified?page=2"
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/modified

Match parts

requires authentication

Find parts matching the searched. Fields that are specified in the parameter schema will be returned for matched parts in the report. The field hash in the response is used as a record unique ID. Obsolete parts are ignored.

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

ParameterTypeStatusDescription
schemaarrayoptional The data schema.
Default: [number,name,manufacturer_id].
You can use any properties of a part in schema, e.g. manufacturer_name, cost. Fields number and name are obligatory.
import-dataarrayrequired Input data
Array must have fields from a schema
min_reputationintegeroptional exclude manufactures with reputation below specified

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/match" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "hash": "97dd2f08c96d7e9e3e8bcdced5d29ce1",
            "number": "LF3",
            "name": "By-Pass Lube Spin-on",
            "manufacturer_name": "Lee",
            "matches": [
                {
                    "id": 719206,
                    "number": "LF3",
                    "name": "By-Pass Lube Spin-on",
                    "manufacturer_name": "Lee"
                },
                {
                    "id": 719207,
                    "number": "LF30",
                    "name": "Full-Flow Lube Spin-on",
                    "manufacturer_name": "Lee"
                },
                {
                    "id": 719208,
                    "number": "LF33",
                    "name": "Full-Flow Lube Spin-on",
                    "manufacturer_name": "Lee"
                },
                {
                    "id": 719209,
                    "number": "LF39",
                    "name": "Full-Flow Lube Element",
                    "manufacturer_name": "Lee"
                }
            ]
        }
    ]
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/match

Cleanup

requires authentication

Make Cleanup report

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

ParameterTypeStatusDescription
notifystringoptionalEmail to send the notification
dataarrayrequired Array with parts data,
format: ['id', 'number', 'name']
id - part ID
number - part number
name - part description

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/cleanup" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/cleanup

Xrefs report

requires authentication

Generate cross references report. Report can be made with several requests. Requests in one report are identified by token returned in the 1st request. The last request must have param "complete" = TRUE. Email with a link to the report is sent after report is generated.

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

ParameterTypeStatusDescription
notifystringoptionalEmail to send the notification
partsarrayrequired Array of parts for the report,
format
['id', 'number', 'name']
tokenstringoptional Token is returned in the response. Use it if the data is uploaded in several requests for identification of the same report.
completebooleanoptionalSet true if request has the last part of data

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/xrefs" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "",
    "token": "ZKlBfXqfIJKaEebJxnMoZObNpXkGKhjn"
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/xrefs

Inventory analysis

requires authentication

Send the inventory analysis report

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

Parameter Type Status Description
data array required Data for report in the format [id, number, name]
notify string required Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/inventory-analysis" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/inventory-analysis

Mass changing VMRS

requires authentication

Send the inventory analysis report

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

Parameter Type Status Description
vmrs_from string required The VMRS template to change from, e.g. '042-005-'
vmrs_to string required The VMRS template to change to, e.g. '042-006-'

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/vmrs-mass-change" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "changed_parts": 7
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/vmrs-mass-change

Report VMRS codes

requires authentication

Send the report about VMRS codes in csv format

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

Parameter Type Status Description
vmrs string optional Include in the report all pars where VMRS starts with specified, e.g. '042-005-'
no_vmrs boolean optional Include in the report all parts without VMRS code
notify string optional Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/vmrs-report" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "changed_parts": 7
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/vmrs-report

Mass import VMRS

requires authentication

Mass import VMRS codes from the CSV file

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

Parameter Type Status Description
import-data file required File in CSV format: (Number,Name,Manufacturer,VMRS System,VMRS Assy,VMRS Comp).
notify string optional Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import-vmrs" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/import-vmrs

Mass VMRS

requires authentication

Make Mass VMRS report. Report can be made with several requests. Requests in one report are identified by token returned in the 1st request. The last request must have param "complete" = TRUE. Email with a link to the report is sent after report is generated.

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

ParameterTypeStatusDescription
notifystringoptionalEmail to send the notification
dataarrayrequired Array with parts data,
format: ['index', 'id', 'number', 'name', 'manufacturer'].
index - row number in CSV file
id - part ID
number - part number
name - part description
manufacturer - part manufacturer name
tokenstringoptional Token is returned in the response. Use it if the data is uploaded in several requests for identification of the same report.
completebooleanoptionalSet true if request has the last part of data

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/mass-vmrs" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "",
    "token": "ZKlBfXqfIJKaEebJxnMoZObNpXkGKhjn"
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/mass-vmrs

New parts

requires authentication

Generate report of parts added in the system during the specified date range

Route Bindings

(no route bindings)

Query Parameters

(no query bindings)

POST Parameters

Parameter Type Status Description
from string required Date of period beginning
to string required Date of period end
notify string optional Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/new-report" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/new-report

Auto-suggest

requires authentication

Get parts matching the search query

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
query string required search query

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/autocomplete" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1013733,
            "number": "LF380",
            "name": "2-Section Dual-Flow Lube Element with Bail Handle",
            "manufacturer_name": "Shell"
        }
    ]
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/autocomplete

Import eCommerce

requires authentication

Import eCommerce links in CSV format

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

ParameterTypeStatusDescription
notifystringoptionalEmail to send the notification
import-datafilerequired data file in CSV format
format: ID,URL
ID - part ID
URL - eCommerce link (URL format with http/https)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/import-ecommerce" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/import-ecommerce

Mass update

requires authentication

Mass update of parts

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
import-data file required file with data to import in CSV format: ID,Manufacturer,Number,Name,Notes,Image,VMRS

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/mass-update" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

POST api/part/mass-update

Set OptiCat image

requires authentication

Set specified image from OptiCat as the default image of the part.

Route Bindings

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

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
image array required an array describing an image from OptiCat API

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/part/amet/set-opticat-image" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/part/{id}/set-opticat-image

URL Parameters

id  string  

List

requires authentication

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 "http://api-truckpartscross.local/api/part/search" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

List

requires authentication

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 POST \
    "http://api-truckpartscross.local/api/part/search" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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."
}

Part Cross-References

requires authentication

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

Route Bindings

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

Query Parameters

Binding Type Status Description
search string required full or partial part number to look for
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

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/part/quisquam/equivalences" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/part/{id}/equivalences

URL Parameters

id  string  

List

requires authentication

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 "http://api-truckpartscross.local/api/v1/part/search" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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.

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 "http://api-truckpartscross.local/api/v1/part/quaerat" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/part/{id}

URL Parameters

id  string  

List

requires authentication

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 "http://api-truckpartscross.local/api/v2/part/search" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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.

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 "http://api-truckpartscross.local/api/v2/part/a" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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  string  

Part Cross-References

requires authentication

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

Route Bindings

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

Query Parameters

Binding Type Status Description
search string required full or partial part number to look for
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

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/part/omnis/equivalences" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

id  string  

Quote Parts

List

requires authentication

Get the list of quoted parts.

Route Bindings

(no route bindings)

Query Parameters

ParameterTypeStatusDescription
quote_idintegeroptionalfiltering by ID of quote
manufacturer_part_idintegeroptional filtering by ID of manufacturer
archivedbooloptional look for archived or not archived quotes;
possible values: true, false, 1, 0, '1', '0'
sort_bystringoptional what column to sort the results on;
Possible values: vendor, archived, price
sort_dirstringoptional sort direction; defaults to asc
Possible values: asc or desc
pagenumberoptional which page of results to return; defaults to 1
per_pagenumberoptional how many rows to return, per page; defaults to 10, maximum 100

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/quote_part" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "quote_id": 1,
            "manufacturer_part_id": 430784,
            "price": "105.00",
            "archived": false,
            "vendor": "Vendor Name",
            "part_number": "AS1142",
            "created_at": "2020-07-06 12:13:14"
        }
    ],
    "meta": {
        "total": 1,
        "found": 1,
        "other_query_info": null
    }
}

Request   

GET api/quote_part

Update

requires authentication

Update the quoted part

Route Bindings

Binding Type Status Description
id number required ID of the quote part

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
price string required quoted price of part

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote_part/qui" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "quote_id": 1,
        "manufacturer_part_id": 430784,
        "price": "105.00",
        "archived": false,
        "vendor": "Vendor Name",
        "part_number": "AS1142",
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote_part/{id}

URL Parameters

id  string  

Archive

requires authentication

Archive the quoted part

Route Bindings

Binding Type Status Description
id number required ID of the quote part

Query Parameters

(no query parameters)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote_part/ducimus/archive" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "quote_id": 1,
        "manufacturer_part_id": 430784,
        "price": "105.00",
        "archived": true,
        "vendor": "Vendor Name",
        "part_number": "AS1142",
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote_part/{id}/archive

URL Parameters

id  string  

Activate

requires authentication

Restore the quoted part from archive

Route Bindings

Binding Type Status Description
id number required ID of the quote part

Query Parameters

(no query parameters)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote_part/ullam/activate" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "quote_id": 1,
        "manufacturer_part_id": 430784,
        "price": "105.00",
        "archived": false,
        "vendor": "Vendor Name",
        "part_number": "AS1142",
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote_part/{id}/activate

URL Parameters

id  string  

Quotes

List

requires authentication

Get the list of quotes.

Route Bindings

(no route bindings)

Query Parameters

ParameterTypeStatusDescription
archivedbooloptional look for archived or not archived quotes;
possible values: true, false, 1, 0, '1', '0'
sort_bystringoptional what column to sort the results on;
Possible values: vendor, archived
sort_dirstringoptional sort direction; defaults to asc
Possible values: asc or desc
pagenumberoptional which page of results to return; defaults to 1
per_pagenumberoptional how many rows to return, per page; defaults to 10, maximum 100

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/quote" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "vendor": "Vendor Name",
            "archived": false,
            "created_at": "2020-07-06 12:13:14"
        }
    ],
    "meta": {
        "total": 100,
        "found": 100,
        "other_query_info": null
    }
}

Request   

GET api/quote

Retrieve

requires authentication

Retrieve a specified Quote

Route Bindings

Binding Type Status Description
id number required ID of the quote to fetch

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/quote/ea" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "vendor": "Vendor Name",
        "archived": false,
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

GET api/quote/{id}

URL Parameters

id  string  

Import

requires authentication

Import quotes from an array generated by match function. Array must have id of part and a price.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
notify string optional email to send the notification
vendor string required vendor name
parts array required array of quoted parts;
format: [id, price]

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/quote/import" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "The Import Quote has been scheduled. A notification is sent to john.doe@gmail.com."
}

Request   

POST api/quote/import

Update

requires authentication

Update the quote

Route Bindings

Binding Type Status Description
id number required ID of the quote

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
vendor string optional vendor name

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote/omnis" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "vendor": "Vendor Name",
        "archived": false,
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote/{id}

URL Parameters

id  string  

Archive

requires authentication

Archive the quote

Route Bindings

Binding Type Status Description
id number required ID of the quote

Query Parameters

(no query parameters)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote/error/archive" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "vendor": "Vendor Name",
        "archived": true,
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote/{id}/archive

URL Parameters

id  string  

Activate

requires authentication

Restore the quote from archive

Route Bindings

Binding Type Status Description
id number required ID of the quote

Query Parameters

(no query parameters)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/quote/accusantium/activate" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "vendor": "Vendor Name",
        "archived": false,
        "created_at": "2020-07-06 12:13:14"
    }
}

Request   

PUT api/quote/{id}/activate

URL Parameters

id  string  

Reports

Download the report

requires authentication

Download the report

Route Bindings

Binding Type Status Description
token string required token or name in format token.pdf of attachment to fetch

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/report/at" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


File

Request   

GET api/report/{token}

URL Parameters

token  string  

Request Statistics

Request statistics

requires authentication

Retrieve statistics for specified dates

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
from string optional date from which statistics is shown; format: YYYY-mm-dd; default: 7 days before today
to string optional date untill which statistics is shown; format YYYY-mm-dd; default: today date

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/request-stat" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "name": "TruckInfo.com Master Key",
            "count": 140
        },
        {
            "name": "TruckInfo.com Consumer Key",
            "count": 200
        }
    ]
}

Request   

GET api/request-stat

Scheduled Jobs

List

requires authentication

Get a list of scheduled jobs.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/job_monitor" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 8,
            "name": "Inventory Analysis",
            "token": "e4244dc4dce6e0f458844f8cdd4f782f",
            "email": "mn@itdesign.ru",
            "report_id": 799,
            "status": "complete",
            "page": 8,
            "percentage": 100,
            "error": null,
            "started_at": "2020-07-27 08:09:31",
            "finished_at": "2020-07-27 08:54:15",
            "estimated_time": "2020-07-27 09:38:15",
            "downloaded": "2020-07-27 08:54:41",
            "created_at": "2020-07-27 06:48:24"
        }
    ]
}

Request   

GET api/job_monitor

Restart

requires authentication

Restart a failed scheduled job. Only a job with status failed can be restarted.

Route Bindings

Binding Type Status Description
id number required ID of the job to restart

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job_monitor/velit/restart" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job_monitor/{id}/restart

URL Parameters

id  string  

Clear

requires authentication

Delete data files from a failed scheduled job. Only a job with status failed can be cleared.

Route Bindings

Binding Type Status Description
id number required ID of the job to restart

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job_monitor/velit/clear" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job_monitor/{id}/clear

URL Parameters

id  string  

Find

requires authentication

Find a job by token, looks only for the jobs with status loading. If nothing is found [] is returned.

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
token number required job token to look for

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job_monitor/check" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job_monitor/check

Delete

requires authentication

Delete the job monitor

Route Bindings

Binding Type Status Description
id number required the id of the job monitor

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/job_monitor/ea" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

DELETE api/job_monitor/{id}

URL Parameters

id  string  

List

requires authentication

Get a list of scheduled jobs.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/job-monitor" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 8,
            "name": "Inventory Analysis",
            "token": "e4244dc4dce6e0f458844f8cdd4f782f",
            "email": "mn@itdesign.ru",
            "report_id": 799,
            "status": "complete",
            "page": 8,
            "percentage": 100,
            "error": null,
            "started_at": "2020-07-27 08:09:31",
            "finished_at": "2020-07-27 08:54:15",
            "estimated_time": "2020-07-27 09:38:15",
            "downloaded": "2020-07-27 08:54:41",
            "created_at": "2020-07-27 06:48:24"
        }
    ]
}

Request   

GET api/job-monitor

Restart

requires authentication

Restart a failed scheduled job. Only a job with status failed can be restarted.

Route Bindings

Binding Type Status Description
id number required ID of the job to restart

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job-monitor/et/restart" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job-monitor/{id}/restart

URL Parameters

id  string  

Clear

requires authentication

Delete data files from a failed scheduled job. Only a job with status failed can be cleared.

Route Bindings

Binding Type Status Description
id number required ID of the job to restart

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job-monitor/ad/clear" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job-monitor/{id}/clear

URL Parameters

id  string  

Find

requires authentication

Find a job by token, looks only for the jobs with status loading. If nothing is found [] is returned.

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
token number required job token to look for

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/job-monitor/check" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 8,
        "name": "Inventory Analysis",
        "token": "e4244dc4dce6e0f458844f8cdd4f782f",
        "email": "mn@itdesign.ru",
        "report_id": 799,
        "status": "complete",
        "page": 8,
        "percentage": 100,
        "error": null,
        "started_at": "2020-07-27 08:09:31",
        "finished_at": "2020-07-27 08:54:15",
        "estimated_time": "2020-07-27 09:38:15",
        "downloaded": "2020-07-27 08:54:41",
        "created_at": "2020-07-27 06:48:24"
    }
}

Request   

POST api/job-monitor/check

Delete

requires authentication

Delete the job monitor

Route Bindings

Binding Type Status Description
id number required the id of the job monitor

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/job-monitor/harum" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

DELETE api/job-monitor/{id}

URL Parameters

id  string  

Search Statistics

Get statistics for period

requires authentication

Get search statistics for period specified by date_from and date_to

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
date_from string required date of the period beginning, format Y-m-d
date_to string required date of the period end, format Y-m-d
zero optional if this parameter presents in the query, result has only search queries produced the zero result

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/stat" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "qty": 2,
            "search": "1680528C91",
            "found": 1,
            "source": "TruckInfo.com Master Key"
        }
    ]
}

Request   

GET api/stat

Get statistics for period CSV

requires authentication

Get search statistics in CSV format for period specified by date_from and date_to

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
date_from string required date of the period beginning, format Y-m-d
date_to string required date of the period end, format Y-m-d

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/stat/csv" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/stat/csv

Detailed CSV report

requires authentication

Get detailed statistics report in CSV format.

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
date_from string required date of the period beginning, format Y-m-d
date_to string required date of the period end, format Y-m-d

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/stat/csv/detailed" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

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

Request   

POST api/stat/csv/detailed

Exclude from zero report

requires authentication

Exclude specified search query from report returning queries having zero result

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
search string required search query to be excluded from report

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/stat/check" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "result": "ok"
}

Request   

POST api/stat/check

Statistics for parts without xrefs

requires authentication

Get search statistics for parts that have no cross references for period specified by date_from and date_to

Route Bindings

(no route bindings)

Query Parameters

Binding Type Status Description
date_from string required date of the period beginning, format Y-m-d
date_to string required date of the period end, format Y-m-d

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/stat/noxrefs" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


File

Request   

GET api/stat/noxrefs

Sub Categories

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

List of sub categories

requires authentication

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 "http://api-truckpartscross.local/api/sub_category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/sub_category

Update

requires authentication

Update category (VMRS assembly)

Route Bindings

Binding Type Status Description
id number required ID of the sub category

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of sub category (VMRS assembly)
vmrs_system_id integer optional ID of VMRS system (category)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/sub_category/autem" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

PUT api/sub_category/{id}

URL Parameters

id  string  

Parts report

requires authentication

Get the list of parts that belong to the sub category (VMRS assembly)

Route Bindings

Binding Type Status Description
id number required the id of the sub category

Query Parameters

Parameter Type Status Description
notify string required Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/sub_category/perferendis/parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "The report is generated. A notification is sent to john.doe@gmail.com."
}

Request   

POST api/sub_category/{id}/parts

URL Parameters

id  string  

List of sub categories

requires authentication

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 "http://api-truckpartscross.local/api/v1/sub_category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/sub_category

List of sub categories

requires authentication

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 "http://api-truckpartscross.local/api/v2/sub-category" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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

Tokens

List all API Keys

requires authentication

List all API keys available.

Route Bindings

(no route bindings)

Query Parameters

Parameter Type Status Description
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 "http://api-truckpartscross.local/api/token" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "name": "WordPress Key",
            "api_token": "...",
            "role": "consumer"
        }
    ],
    "meta": {
        "total": 10,
        "found": 10,
        "other_query_info": null
    }
}

Request   

GET api/token

Retrieve an API Key

requires authentication

Get an instance of an API key.

Route Bindings

Binding Type Status Description
id number required the id of the user

Query Parameters

(no query parameters)

Post Parameters

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/token/neque" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "name": "WordPress Key",
        "api_token": "...",
        "role": "consumer"
    }
}

Request   

GET api/token/{id}

URL Parameters

id  string  

Create an API Key

requires authentication

Create a new API key.

Route Bindings

(no route bindings)

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of the token
role string required master or consumer
email string optional email

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/token" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "name": "WordPress Key",
        "api_token": "...",
        "role": "consumer"
    }
}

Request   

POST api/token

Update an API Key

requires authentication

Update an existing API key.

Route Bindings

Binding Type Status Description
id number required the id of the user

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of the token
role string required master or consumer
email string optional email

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/token/quia" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "name": "WordPress Key",
        "api_token": "...",
        "role": "consumer"
    }
}

Request   

PUT api/token/{id}

URL Parameters

id  string  

Re-generate an API Key

requires authentication

To re-generate an existing API key. This will keep the same key name, just re-generate the key value. The old key value will immediately be invalidated. Note that you can not delete the key used as authorization header for the call.

Route Bindings

Binding Type Status Description
id number required the id of the user

Query Parameters

(no query parameters)

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/token/id/regenerate" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 1,
        "name": "WordPress Key",
        "api_token": "...",
        "role": "consumer"
    }
}

Request   

POST api/token/{id}/regenerate

URL Parameters

id  string  

Delete an API Key

requires authentication

To delete an existing API key. Note that you can not delete the key used as authorization header for the call.

Route Bindings

Binding Type Status Description
id number required the id of the user

Query Parameters

(no query parameters)

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/token/neque" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):


{
     []
}

Request   

DELETE api/token/{id}

URL Parameters

id  string  

api/v1/user/{uid}/history

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/user/sunt/history" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

api/v1/user/{uid}/favorites

requires authentication

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/v1/user/sed/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

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

URL Parameters

uid  string  

api/v1/user/{uid}/favorites

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/user/deserunt/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

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

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v1/user/in/favorites/quis" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

part_id  string  

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

requires authentication

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/v1/user/et/favorites/et" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

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

URL Parameters

uid  string  

part_id  string  

api/v2/user/{uid}/history

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/user/rerum/history" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

api/v2/user/{uid}/favorites

requires authentication

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/v2/user/eum/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

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

URL Parameters

uid  string  

api/v2/user/{uid}/favorites

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/user/doloremque/favorites" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

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

requires authentication

Example request:

curl -X GET \
    -G "http://api-truckpartscross.local/api/v2/user/et/favorites/cumque" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

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

URL Parameters

uid  string  

part_id  string  

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

requires authentication

Example request:

curl -X DELETE \
    "http://api-truckpartscross.local/api/v2/user/pariatur/favorites/est" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Request   

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

URL Parameters

uid  string  

part_id  string  

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.

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 "http://api-truckpartscross.local/api/vmrs_component" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/vmrs_component

Update

requires authentication

Update VMRS Component

Route Bindings

Binding Type Status Description
id number required the id of VMRS component

Query Parameters

(no query parameters)

Post Parameters

Binding Type Status Description
name string required name of VMRS Component
vmrs_assembly_id string optional ID of VMRS assembly (sub category)

Example request:

curl -X PUT \
    "http://api-truckpartscross.local/api/vmrs_component/aut" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": {
        "id": 859,
        "name": "Dorman",
        "priority": 30,
        "website": "www.dormanhdsolutions.com",
        "phone": "800-523-2492",
        "message": "Think its dealer only? Check Dorman first",
        "vmrs": "DRMN",
        "history": "People's lives and livelihoods depend upon cars and trucks...",
        "mission": "Our Culture of Contribution is defined as the way Dorman and our Contributors...",
        "warranty_policy": "12 months from the date of installation ~ Hybrid Batteries...",
        "training_offerings": "We offer a full line of training, both online and offline, at www.dormantrainingcenter.com.",
        "why_buy": "At Dorman, we use the Advanced Product Quality Planning (APQP) framework of procedures...",
        "video": "j0IC88GuImE",
        "video_url": "https:\/\/www.youtube.com\/watch?v=j0IC88GuImE",
        "year_founded": 1919,
        "logo": "http:\/\/api-truckpartscross.com\/storage\/public\/Z9LI3uCcDUWQNgna1dYvoKKhxvf2Xv1ZlRUl8Iv6.jpeg",
        "categories": [
            {
                "id": 3,
                "code": "002",
                "name": "Cab & Hood"
            },
            {
                "id": 9,
                "code": "013",
                "name": "Brake and Components"
            },
            {
                "id": 37,
                "code": "044",
                "name": "Fuel System"
            },
            {
                "id": 38,
                "code": "045",
                "name": "Engine Components"
            }
        ],
        "pdf": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf",
        "pdfs": [
            {
                "id": 5,
                "name": "Dorman_HD_Catalog_2020.pdf",
                "url": "http:\/\/api-truckpartscross.com\/api\/view\/99affb31f958f8ec9003dc8652f74516.pdf"
            }
        ],
        "amazon": false,
        "google": true,
        "ebay": false,
        "preferred_partner": true,
        "reputation": 47,
        "brands": [
            {
                "id": 9,
                "manufacturer_id": 859,
                "code": "HJQM",
                "name": "Dorman"
            }
        ]
    }
}

Request   

PUT api/vmrs_component/{id}

URL Parameters

id  string  

Parts report

requires authentication

Get the list of parts that belong to the VMRS component

Route Bindings

Binding Type Status Description
id number required the id of the component

Query Parameters

Parameter Type Status Description
notify string required Email to send the notification

Example request:

curl -X POST \
    "http://api-truckpartscross.local/api/vmrs_component/aliquid/parts" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Example response (200):

{
    "data": "The report is generated. A notification is sent to john.doe@gmail.com."
}

Request   

POST api/vmrs_component/{id}/parts

URL Parameters

id  string  

List of VMRS Components

requires authentication

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 "http://api-truckpartscross.local/api/v1/vmrs_component" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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/v1/vmrs_component

List of VMRS Components

requires authentication

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 "http://api-truckpartscross.local/api/v2/vmrs-component" \
    -H "X-Authorization: {api-key}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/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