| Name | Type | Required | Data |
|---|---|---|---|
| username | Text varchar(50) | YES | Username |
| password | Text varchar(100) | YES | Password |
| user_token | Text | YES | Token provided |
| category_id | Numeric (int 11) | YES | Category id assigned to part (level 3 category required) |
| car_id | Numeric (int 11) | YES | Car id assigned to part |
| quality | Numeric (int 11) | YES | Quality id assigned to part |
| status | Numeric (int 11) | YES | Status id assigned to part |
| position | Numeric (int 11) | NO | Position id assigned to part |
| notes | Text | NO | Additional notes |
| place | Numeric int(11) | NO | ID of the place where part is stored |
| manufacturer_code | Text varchar(255) | NO | Manufacturer code (incorrect code will be truncated) |
| visible_code | Text varchar(255) | NO | Visible code (incorrect code will be truncated) |
| other_code | Text varchar(255) | NO | Other code (incorrect code will be truncated) |
| optional_codes[] | Text | NO | Optional part codes * (incorrect codes will be truncated) |
| id_bridge | Numeric (int 11) | NO | Deprecated. Use external_id instead |
| external_id | Text varchar(255) | NO | Local id * |
| sell_price | Numeric (float) | NO | Price for which the part was sold (including VAT) |
| sell_vat_null | Numeric (int 11) | NO | Sell vat null |
| sell_date | Date | NO | Date when the part was sold at |
| internal_notes | Text | NO | Notes accessible only by internal users |
| tires | Numeric (tinyint1) | NO | Is part a tire {0, 1} |
| rims | Numeric (tinyint1) | NO | Is part a rim {0, 1} |
| rims_spacing | Numeric (tinyint3) | NO | Rims spacing, requires value based on enum {0, ... 37} |
| rims_fixing_points | Numeric (tinyint3) | NO | Rims fixing points, requires value based on enum {0, ... 11} |
| tires_width | Numeric (tinyint3) | NO | Tires width, requires value based on enum {0, ... 41} |
| rims_central_diameter | Numeric (tinyint3) | NO | Rims central diameter, requires value based on enum {0, ... 64} |
| rims_quantity | Numeric (tinyint3) | NO | Rims quantity, requires value based on enum {1, ... 5} |
| tires_height | Numeric (tinyint3) | NO | Tires height, requires value based on enum {1, ... 25} |
| tires_tread_depth | Numeric (tinyint3) | NO | Tires tread depth, requires value based on enum {1, ... 20} |
| tires_quantity | Numeric (tinyint3) | NO | Tires quantity {1, ... 5} |
| price | Numeric (float) | NO (warning) | Price (must be filled in order to be shown in shop, including VAT) |
| original_currency | Text | NO | Currency {EUR, PLN}. Default: EUR |
| photo | Text | NO | Photo url. Raw images are not supported. |
| photos[] | Text | NO | Photo url * e.g. photos[0] => 'photos.url1.jpg', photos[1] => 'photos.url2.jpg'. Raw images are not supported. |
| sticker_note | Text (varchar 32) | NO |
Note on sticker
|
| english | Numeric (integer) | NO | If part is RHD add 1 {0, 1} |
$post = [
'username' => '',
'password' => '',
'user_token' => '',
'category_id' => '55',
'car_id' => '291',
'quality' => '1',
'status' => '0',
'optional_codes[0]' => 'ABC123',
'optional_codes[1]' => 'ABCD1234',
'photo' => 'photos.url.jpg',
'photos[0]' => 'photos.url1.jpg',
'photos[1]' => 'photos.url2.jpg',
'photos[2]' => 'photos.url3.jpg',
'price' => '15',
'storage_id' => '1'
];
$ch = curl_init('https://api.rrr.lt/crm/importPart');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = json_decode(curl_exec($ch));
curl_close($ch);
{"part_id":288651,"msg":"OK","status_code":"R200"}
Raw images are not supported.
Values of 'photos[]' fields must be filled in order to be shown in shop.
Value of the 'photo' field must be first value of 'photos[]' field too, for correct main photo upload and thumbnail generation.
If part with 'id_bridge' value exist, import action will be aborted and returned part ID.
Certain values need to be provided in a form of enum that translates to actual value