Introduction

OpenAPI 3.0 (Swagger)

Usage

RRR API has OpenAPI (Swagger) configuration file. That means, you can use such tools as openapi-generator or swagger-codegen, in order to generate fully functioning RRR API Client in many supported programming languages.

For example, in order to generate RRR API php client (and it's documentation), you should do as following:

  1. Install Openapi Generator by following instructions
  2. Run: openapi-generator generate -i https://api.rrr.lt/openapi/swagger.yaml -g php -o /path/for/client --enable-post-process-file --global-property skipFormModel=false
  3. Go to /path/for/client/docs and you'll find documentation, how to use newly generated RRR API Client.

Notice: it is mandatory to override skipFormModel flag, in order generated client will work properly: --global-property skipFormModel=false

Links

General information

Requests category:

  • CRM IMPORT requests for saving cars/parts data into user's CRM.
  • CRM EXPORT requests for return cars/parts data from user's CRM.
  • CRM INFO requests for return information required for cars/parts import/export into & from CRM.
  • SHOP EXPORT requests for return cars/parts data from RRR.lt e-shop.

All of the requests have 3 required params:

  1. username
  2. password
  3. user_token

Part is available into e-shop only if these optional fields are filled:

  1. price - part price greater than 0.00
  2. photo - part photo URL

Cars Import

Before car import You must collect possible values of required fields:

  1. Car models
  2. Car body types
  3. Car classes
  4. Car status
  5. Car steering wheel type
  6. Car wheel drive
  7. Car gearbox types
  8. Fuel

After getting all this data You can follow to the Car Import.

POST & URI parameter table:

Name Type Required Data
POST field Variable (max value) Is field required or not Information


After successful request API return JSON object:
{"car_id":292,"msg":"OK","status_code":"R200"}

Response fields meaning:
"car_id" : 292 - car #ID in CRM;
"msg" : "OK" - response message;
"status_code" : "R200" - response status code (all codes).

After Car Import can be used these requests:

  1. Import car's part to CRM
  2. Update car's data in CRM
  3. Delete car from CRM
  4. Delete all car's photos

Parts Import

Before part import You must collect possible values of required fields:

  1. Parts categories
  2. Parts quality statuses
  3. Parts statuses (for selling)

After getting all this data You can follow to the Part Import.
Note: for the part import one of required values is - car #ID. This car must exist in CRM.

After successful request API return JSON object:
{"part_id":288651,"msg":"OK","status_code":"R200"}

Response fields meaning:
"part_id" : 288651 - part #ID in CRM;
"msg" : "OK" - response message;
"status_code" : "R200" - response status code (all codes).

After Part Import can be used these requests:

  1. Update Part's data in CRM
  2. Delete Part from CRM
  3. Change Part status
  4. Delete all Part photos