Eminia Trading API Instructions
Introduction
Eminia Trading API access link: apib2b.eminiasystem.com.
For API access your account must be approved by your Sales Representative.
API supports JSON format only.
User request limit is 1 request per 3 seconds.
Based on REST API rules, requested controllers might be sent as GET/POST. HEAD/OPTIONS requests are also supported in order to provide possible HTTP-request types.
For API access your account must be approved by your Sales Representative.
API supports JSON format only.
User request limit is 1 request per 3 seconds.
Based on REST API rules, requested controllers might be sent as GET/POST. HEAD/OPTIONS requests are also supported in order to provide possible HTTP-request types.
Authentication
Authentication is required for API access.
It is realized using 2-step verification:
It is realized using 2-step verification:
-
Auth-Key requesting by username & password key-pair
Also known as 'refresh-token'.
We never change it so make sure to keep it in safety. - Access-Token requesting by username & password & Auth-Key parameters Access-Token is available for next 24 hours. Otherwise, all resources will throw Unauthorized exception.
- Using special header with Access-Token value on any HTTP-request will grant you access to any API resource.
Step 1
- URL
- /auth/get-auth-key
- Method
- GET
- Headers
-
Name Value Content-Type application/x-www-form-urlencoded Authorization Basic {X} {X} - 'username:password' string converted to base64 - Parameters
- --
- Response
-
Code Description 200 { "auth_key":"JnudMllTynAnip3PhMrFj_2_bJrbXJh0" }
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
Step 2
- URL
- /auth/get-access-token
- Method
- GET
- Headers
-
Name Value Content-Type application/x-www-form-urlencoded Authorization Basic {X} {X} - 'username:password' string converted to base64 Auth-Key JnudMllTynAnip3PhMrFj_2_bJrbXJh0 - Parameters
- --
- Response
-
Code Description 200 { "access_token":"Yxxe12X7LRYkLzLgW2ZbKd0QT08ny8Oi", "expires_at":1660300542 }
401 { "name":"Unauthorized", "message":"Auth-Key not provided", "code":0, "status":401 }
Items
GET /items
- Description
-
- Get list of items sorted by their name ascending
- Item list is limited by 25 rows
- If at least one provided parameter is not valid, empty resultset will be returned
- URL
- /items
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description part_number *Optional 1111111 String/array of strings. Each PN's length is limited to 50. brand_name *Optional VAG String. Maxlength = 50. in_stock *Optional 1 Bool. Ignored if 0. If sent, then show only items currently available. allow_analog *Optional 1 Bool. Default 0. If sent as 1, then also finds item analogs. - Response
-
Code Description 200 [ { "id":11710, "name":"ASTON MARTIN 1460180 Track Control Arm", "weight_kg":null, "part_number":"1460180", "brand_name":"ASTON MARTIN", "function_name":"Track Control Arm", "quantity":0, "min_qty":0, "price":0 }, { "id":11701, "name":"ASTON MARTIN 6G333A696AB Hydraulic Pump, steering system", "weight_kg":null, "part_number":"6G333A696AB", "brand_name":"ASTON MARTIN", "function_name":"Hydraulic Pump, Steering System", "quantity":0, "min_qty":0, "price":0 } ]
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed
GET /items/{id}
- Description
-
- Display item info by it's ID
- URL
- /items/{id}
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description id 11701 Unique item identifier (from our system). *Can only be sent as part of URL - Response
-
Code Description 200 { "id":11701, "name":"ASTON MARTIN 6G333A696AB Hydraulic Pump, steering system", "weight_kg":null, "part_number":"6G333A696AB", "brand_name":"ASTON MARTIN", "function_name":"Hydraulic Pump, Steering System", "quantity":0, "min_qty":0, "price":0 }
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed
Orders
GET /orders
- Description
-
- Get list of orders created by user sorting by creation date order descending
- Order list is not limited
- If at least one provided parameter is not valid, empty resultset will be returned
- URL
- /orders
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description note *Optional Documentation note String. Maxlength = 50. Find only orders with provided substring present in order note timestamp *Optional 1660231365 Integer. Find only orders updated after provided timestamp - Response
-
Code Description 200 [ { "id":2, "created_at":"2022-57-10T14:57:18", "updated_at":"2022-57-10T14:57:19", "user_note":"user_note2", "status":"Processing", "address": { "city":"city2", "country":"country2", "street":"street2", "zip":"zip2", "phone":"phone2", "fio":"fio2" } }, { "id":1, "created_at":"2022-57-10T14:55:18", "updated_at":"2022-57-10T14:55:19", "user_note":"user_note1", "status":"Processing", "address": { "city":"city1", "country":"country1", "street":"street1", "zip":"zip1", "phone":"phone1", "fio":"fio1" } } ]
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed
GET /orders/{id}
- Description
-
- Display order info by it's ID
- URL
- /orders/{id}
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description id 2 Order ID *Can only be sent as part of URL - Response
-
Code Description 200 { "id":2, "created_at":"2022-57-10T14:57:18", "updated_at":"2022-57-10T14:57:19", "user_note":"user_note2", "status":"Processing", "address": { "city":"city2", "country":"country2", "street":"street2", "zip":"zip2", "phone":"phone2", "fio":"fio2" } }
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed
POST /orders
- Description
-
- Create Order based on provided parameters
- URL
- /orders
- Method
- POST
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step Content-Type application/json - Parameters
-
Name Value Description data { "user_note": "Note to find order", "address": { "street": "street1", "city": "city1", "country": "city2", "zip": "12345", "phone": "11111111", "fio": "Ivan Ivanov" }, "orderItem": [ { "item_id": "920", "quantity": "1" }, { "item_id": "1203", "quantity": "1" } ] }
Body parameter. Validation:Order:- user_note ( Maxlength = 255 )
Address:- street* ( Maxlength = 255 )
- city* ( Maxlength = 255 )
- country* ( Maxlength = 255 )
- zip* ( Integer. Maxlength = 10 )
- fio* ( Maxlength = 255 )
- phone ( Maxlength = 10 )
OrderItem:- item_id* ( Integer. Must exist in /items )
- quantity* ( Integer )
- Response
-
Code Description 200 All items successfully added{ "status":1, "address":{ "city":"city1", "country":"country1", "street":"street1", "zip":"12345", "phone":"11111111", "fio":"Ivan Ivanov" }, "order":{ "id":21, "user_note":"Note to find order" }, "orderItems":[ { "item_id":920, "part_number":"SMC500270", "brand_name":"LAND ROVER", "function_name":"Brake Caliper", "quantity":1, "price":77.2, "status":"OK" }, { "item_id":1203, "part_number":"ERR2081", "brand_name":"LAND ROVER", "function_name":"Sender Unit, Coolant Temperature", "quantity":1, "price":60.03, "status":"OK" } ] }
At least 1 item added{ "status":1, "address":{ "city":"city1", "country":"country1", "street":"street1", "zip":"12345", "phone":"11111111", "fio":"Ivan Ivanov" }, "order":{ "id":21, "user_note":"Note to find order" }, "orderItems":[ { "item_id":1515, "part_number":"60779163", "brand_name":"FIAT GROUP", "function_name":"Mirror Glass, Outside Mirror", "quantity":1, "price":72.15, "status":"OK" }, { "item_id":4, "part_number":"6U0611053B", "brand_name":"VAG", "function_name":"Wheel Brake Cylinder", "quantity":1, "price":0, "status":"NOT_AVAILABLE" } ] }
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed 422 Unprocessable entity No data sent{ "status":0, "message":"Data validation failed" }
Address validation fail{ "address":{ "city":"", "country":"country1", "street":"", "zip":"12345", "phone":"11111111", "fio":"Ivan Ivanov" }, "status":0, "message":"Address data validation failed" }
Order validation fail{ "order":{ "id":0, "user_note":"Note with length > 255 :)" }, "status":0, "message":"Order data validation failed" }
All items data not valid (by data OR availability){ "address":{ "city":"city1", "country":"country1", "street":"street1", "zip":"12345", "phone":"11111111", "fio":"Ivan Ivanov" }, "order":{ "id":0, "user_note":"Note to find order" }, "orderItems":[ { "error_message":["Item ID must be an integer."], "item_id":"", "part_number":"", "brand_name":"", "function_name":"", "quantity":1, "price":"", "status":"NOT_FOUND" }, { "error_message":["Item ID must be an integer."], "item_id":"", "part_number":"", "brand_name":"", "function_name":"", "quantity":1, "price":"", "status":"NOT_FOUND" } ], "status":0, "message":"All items not available" }
500 Internal server error{ "address":{ "city":"city1", "country":"country1", "street":"street1", "zip":"12345", "phone":"11111111", "fio":"Ivan Ivanov" }, "order":{ "id":0, "user_note":"Note to find order" }, "orderItems":[ { "item_id":1515, "part_number":"60779163", "brand_name":"FIAT GROUP", "function_name":"Mirror Glass, Outside Mirror", "quantity":1, "price":0, "status":"NOT_FOUND" }, { "item_id":3060, "part_number":"LFA1159099F", "brand_name":"MAZDA", "function_name":"V-Belt", "quantity":1, "price":117.6, "status":"NOT_FOUND" } ], "status":0, "message":"Internal server error" }
- Useful info
-
Possible order item statuses
Value Description NOT_AVAILABLE Item does not exist in our stock QUANTITY_REDUCED If user requested quantity more than is available right now, quantity is being reduced to our available quantity MIN_QTY_PROBLEM Quantity requested is less than item minimum quantity for order NOT_FOUND Item does not exist NO_PRICE_AVAILABLE Item has no price at current moment OK No problem
Order Items
GET /order-items
- Description
-
- Display order item list by provided order ID
- URL
- /order-items
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description order_id * 2 Order ID of user related order - Response
-
Code Description 200 [ { "order_id":2, "item_id":613781, "part_number":"0041594903,A0041594903", "brand_name":"MERCEDES-BENZ", "function_name":"Spark Plug", "quantity":1, "price":1.00 }, { "order_id":2, "item_id":19142072, "part_number":"27715649", "brand_name":"BMW", "function_name":"Battery", "quantity":1, "price":2.50 } ]
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed
Order Tracking Numbers
GET /order-tracking-numbers
- Description
-
- Display order item tracking numbers by provided order ID
- URL
- /order-tracking-numbers
- Method
- GET
- Headers
-
Name Value Description Authorization Bearer {X} {X} - Access-Token received from Authentication step - Parameters
-
Name Value Description order_id * 2 Order ID of user related order - Response
-
Code Description 200 [ { "order_id":2, "tracking_number":"DHLTESTTRACKING", "carrier":"DHL" }, { "order_id":2, "tracking_number":"GLSTESTTRACKING", "carrier":"GLS" } ]
401 { "name":"Unauthorized", "message":"Your request was made with invalid credentials.", "code":0, "status":401 }
404 Page not found 405 Method not allowed