MRPeasy API

MRPeasy has a REST API, it is accessible in Unlimited pricing plan for paying clients. It allows to create new objects or view, update and delete them using standard methods.

Disclaimer! Our API is an Application Programming Interface. This is not a function of the MRPeasy software. Our Support Department cannot help you using the API. To use it, you must have your own highly qualified software development partner.

Method: GET
Description:

Get an object if its ID is provided. For example, https://api.mrpeasy.com/rest/v1/items/1.

If no ID is provided, return a list of objects. For example, https://api.mrpeasy.com/rest/v1/items.

The maximum length of list is 100 objects at a time. If there are more than 100 objects in the database, response code will be 206 and response will include HTTP header content-range with indexes of the first and the last objects and total number of objects. Please note that the index of the last object is equal to the total number of objects minus 1.

In order to receive next objects from the list, your request should include HTTP header range with index of the first object that should be returned.
To receive less than 100 objects, include HTTP header range with indexes of the first and the last objects.

For example:

content-range: items 0-99/250 - response contains first 100 objects of 250.

content-range: items 200-249/250 - response contains last 50 objects of 250.

range: items=200 - request 100 objects starting from 201.
range: items=10-14 - request 5 objects starting from 11.

Response codes:

200 - object is found

200 - all elements of list are returned

206 - list is returned partially

400 - provided data did not pass the validation

404 - object is not found

Method: POST
Description:

Create a new object.

For example, request to https://api.mrpeasy.com/rest/v1/items creates a new stock item.

Data should be posted as HTTP POST data (application/x-www-form-urlencoded) or JSON.

If object is created successfully, the response includes the ID of created object.

If provided data was not valid, the response includes array of validation errors.

Response codes:

201 - object is created successfully

400 - provided data did not pass the validation

Method: PUT
Description:

Updates existing object.

For example, request to https://api.mrpeasy.com/rest/v1/items/1 updates stock item.

Data should be posted as HTTP POST data (application/x-www-form-urlencoded) or JSON.

If object is updated successfully, response has no content.

If provided data was not valid, the response includes array of validation errors.

Response codes:

202 - object is updated successfully

400 - provided data did not pass the validation

404 - object is not found

Method: DELETE
Description:

Deletes existing object.

For example, request to https://api.mrpeasy.com/rest/v1/items/1 updates stock item.

This method has no content in response.

Response codes:

204 - object is deleted successfully

400 - object cannot be deleted

404 - object is not found

Requests must be in UTF-8.

Response data is JSON encoded in UTF-8.

Also, API can return the following codes:

  • 401 - Unauthorized. Please see section Authentication for details.
  • 429 - Too Many Requests. MRPeasy allows one request per client at a time. In this case please retry the same request after previous request is completed. Also, MRPeasy allows 100 requests per 10 seconds only.
  • 503 - MRPeasy is under maintenance. In this case please retry the same request later.

Authentication

MRPeasy REST API uses Basic access authentication. Each request must contain the HTTP header Authorization:

Authorization: Basic base64([api-key]:[api-secret])

  • api-key - your MRPeasy API key, that can be found in Settings - Integration - API access;
  • api-secret - a secret key that can be defined in Settings - Integration - API access. Please note that it must be confidential. Never give it to anybody. We will never ask you for this key.
    We advise to change this key from time to time. If you do not need to do API requests all the time, we advise do delete it after each usage. Empty API access key disables API and this increases security.

For example:

api-key: z1g41b3d0a7c2
api-secret: AbC123

Authorization: Basic ejFnNDFiM2QwYTdjMjpBYkMxMjM=

Typically, we would write a cUrl request as follows:

curl -X "GET" "https://api.mrpeasy.com/rest/v1/items" \
-H 'content-type: application/json' \
-u 'z1g41b3d0a7c2:AbC123'

curl -X "PUT" "https://api.mrpeasy.com/rest/v1/items/5" \
-H 'content-type: application/json' \
-u 'z1g41b3d0a7c2:AbC123' \
-d '{"selling_price": "2.54"}'

In the examples above, you can replace the URLs with the ones you find from the documentation. In case of a PUT request, there is a payload (the last parameter -d). You can supply it with any field found in the documentation for the corresponding URL.

Objects

MRPeasy REST API provides the access to the following objects:

Bills of materials

https://api.mrpeasy.com/rest/v1/boms

Field Type Description
bom_id Integer, read-only Database ID of the BOM.
product_id Integer ID of the final product for this BOM. It can be defined only while creating a new BOM and cannot be changed later.
This field can be added as a GET parameter to URL to filter BOMs list.
code String A unique number to identify the BOM.
title String Name of the BOM.
routings Array of integers IDs of routings that are suitable for this BOM.
components Array of objects

Array of BOM components.

If you create a new BOM, then you must provide components.

If you update existing BOM, you should provide either all components (both updated and not updated with their component IDs) or no components (existing components will remain).

If you provide components, then each component that has existing component ID will be updated, components without component ID will be created and old components that were not found by ID among provided ones will be deleted.

 
Components are objects with the following structure:
Field Type Description
component_id Integer, read-only Database ID of the component.
article_id Integer ID of the material.
product_id Integer ID of the product (if Matrix BOM functionality is turned on).
relation_id Integer ID of the relation (if Matrix BOM functionality is turned on).
def_params String Default parameter values (if Matrix BOM functionality is turned on).
quantity Decimal or array Number of units that are needed to produce one unit of finished product (array if Matrix BOM functionality is turned on).
quantity_fixed Decimal Fixed number of units that are needed to execute the manufacturing order (if Fixed Quantity functionality is turned on).
description Text A free text
ord Integers A serial number of the component, starting with 1.

Sample POST data

  • product_id=1&components%5B0%5D%5Barticle_id%5D=2&components%5B0%5D%5Bquantity%5D=5&components%5B0%5D%5Bord%5D=1&components%5B1%5D%5Barticle_id%5D=3&components%5B1%5D%5Bquantity%5D=7&components%5B1%5D%5Bord%5D=2
  • { "product_id": 1, "components": [ { "article_id": 2, "quantity": 5, "ord": 1 }, { "article_id": 3, "quantity": 7, "ord": 2 } ] }

Customer orders

https://api.mrpeasy.com/rest/v1/customer-orders[?cust_ord_id=...&code=...]

Field Type Description
cust_ord_id Integer, read-only Database ID of the customer order.
This field can be added as a GET parameter to URL to filter customer orders list.
code String A unique number to identify the customer order.
This field can be added as a GET parameter to URL to filter customer orders list.
reference String Reference of the customer order.
This field can be added as a GET parameter to URL to filter customer orders list.
customer_id Integer Database ID of the customer.
This field can be added as a GET parameter to URL to filter customer orders list.
customer_code String, read-only A unique number to identify the customer.
This field can be added as a GET parameter to URL to filter customer orders list.
customer_name String, read-only A name of the customer.
This field can be added as a GET parameter to URL to filter customer orders list.
pricelist_id Integer Database ID of the pricelist.
This field can be added as a GET parameter to URL to filter customer orders list.
pricelist_code String, read-only A unique number to identify the pricelist.
This field can be added as a GET parameter to URL to filter customer orders list.
pricelist_title String, read-only A name of the pricelist.
This field can be added as a GET parameter to URL to filter customer orders list.
shipping_address_id Integer ID of customer order shipping address if it is selected in CO details.
This field can be added as a GET parameter to URL to filter customer orders list.
shipping_address String or array, read-only Shipping address as a text or an array.
This field can be added as a GET parameter to URL to filter customer orders list.
If shipping_address_id is empty, then this is the default address of a customer. It was not selected manually in CO details.
status Integer Status of customer order.
  • 10 - Quotation
  • 20 - Waiting for confirmation
  • 30 - Confirmed
  • 40 - Waiting for production
  • 50 - In production
  • 60 - Ready for shipment
  • 70 - Shipped
  • 80 - Delivered
  • 85 - Archived
  • 90 - Cancelled
This field can be added as a GET parameter to URL to filter customer orders list.
status_txt String, read-only Status of customer order as text.
part_status Integer, read-only Product status of customer order.
  • 10 - Not booked
  • 15 - Requested
  • 20 - Delayed
  • 25 - Possibly delayed
  • 30 - Expected on time
  • 40 - Ready for shipment
  • 50 - Delivered
This field can be added as a GET parameter to URL to filter customer orders list.
part_status_txt String, read-only Product status of customer order as text.
invoice_status Integer, read-only Invoice status of customer order.
  • 10 - Not invoiced
  • 20 - Part invoiced
  • 30 - Invoiced
This field can be added as a GET parameter to URL to filter customer orders list.
invoice_status_txt String, read-only Invoice status of customer order as text.
payment_status Integer, read-only Payment status of customer order.
  • 10 - Not paid
  • 20 - Part paid
  • 30 - Paid
This field can be added as a GET parameter to URL to filter customer orders list.
payment_status_txt String, read-only Payment status of customer order as text.
created Unix timestamp Date and time when this customer order was created.
GET parameters created_min and created_max can be added to URL to filter customer orders list.
delivery_date Unix timestamp Date and time when this customer order should be delivered.
GET parameters delivery_date_min and delivery_date_max can be added to URL to filter customer orders list.
actual_delivery_date Unix timestamp, read-only Date and time when products were picked in a shipment
GET parameters actual_delivery_date_min and actual_delivery_date_max can be added to URL to filter customer orders list.
currency String Currency of the customer order.
currency_rate Decimal Currency rate of the customer order.
total_price Decimal, read-only Total price of the customer order.
GET parameters total_price_min and total_price_max can be added to URL to filter customer orders list.
total_price_cur Decimal, read-only Total price of the customer order in the order's currency.
total_cost Decimal, read-only Total cost of the customer order. It is available if all products have been booked.
GET parameters total_cost_min and total_cost_max can be added to URL to filter customer orders list.
profit Decimal, read-only Difference between total_price and total_cost.
GET parameters profit_min and profit_max can be added to URL to filter customer orders list.
discount_rate Decimal Percentage of discount.
discount_sum Decimal Sum of discount.
discount_sum_cur Decimal Sum of discount in the order's currency.
notes String Internal notes, any additional information about the order.
delivery_terms String Delivery terms of the order.
products Array of objects Array of products that are sold.
 
Products are objects with the following structure:
Field Type Description
line_id Integer, read-only Database ID of the customer order line.
ord Integers A number of the product, starting with 1.
article_id Integer ID of the article.
description Text A free text.
quantity Decimal Number of items to sell.
shipped Decimal, read-only Number of shipped items.
delivery_date Unix timestamp Custom date and time when this product should be delivered. If this field is empty, use order's delivery_date.
item_price Decimal Price of one item.
item_price_cur Decimal Price of one item in the order's currency.
total_price Decimal Price of product.
total_price_cur Decimal Price of product in the order's currency.
discount_rate Decimal Percentage of discount per line.
discount_sum Decimal, read-only Sum of discount per line.
discount_sum_cur Decimal, read-only Sum of discount per line in the order's currency.
cost Decimal, read-only Total cost of the product. It is available if the products has been booked.
profit Decimal, read-only Difference between total_price and cost.
part_status Integer, read-only Status of product booking:
  • 10 - Not booked
  • 20 - Delayed
  • 25 - Possibly delayed
  • 30 - Expected on time
  • 40 - Ready for shipment
  • 50 - Delivered
part_status_txt String, read-only Product status of booking as text.
source Array, read-only Stock lots, from which products are booked.
The following fields are included:
  • lot_id
  • lot_code
  • lot_status
  • lot_status_txt
  • man_ord_id
  • manufacturing_order_code
  • manufacturing_order_status
  • manufacturing_order_status_txt
  • pur_ord_id
  • purchase_order_code
  • purchase_order_status
  • purchase_order_status_txt

To create a customer order, provide the following data:

  • customer_id;
  • products
    • article_id - whether article_id from MRPeasy database;
      sku - or SKU that must match part number in MRPeasy;
      product_id with param [parameter_id => value_id, parameter_id => value_id, ...] - or, if Matrix BOM is turned on, product_id from MRPeasy database with array of parameters.
    • quantity;
    • total_price_cur
  • status - optional. If the status is Confirmed (30) or greater, the software tries to book available products from stock immediately. If the status is Shipped (70) or Delivered (80), and products are booked, the software creates a shipment document and picks products from the stock.
  • site_id - optional, integer. If provided, products are booked from this site. Otherwise, products are booked from the customer order's site.
  • lot_id - optional, integer or array. If provided, products are booked from these stock lots. Otherwise, products are booked from any stock lots.
  • location_id - optional, integer or array. If provided, products are booked from these storage locations. Otherwise, products are booked from any storage location.
  • Other fields not marked as read-only may also be provided.

Sample POST data

  • customer_id=1&status=30&products%5B0%5D%5Barticle_id%5D=2&products%5B0%5D%5Bquantity%5D=5&products%5B0%5D%5Btotal_price_cur%5D=100&products%5B1%5D%5Barticle_id%5D=3&products%5B1%5D%5Bquantity%5D=7&products%5B1%5D%5Btotal_price_cur%5D=70
  • { "customer_id": 1, "status": 30, "products": [ { "article_id": 2, "quantity": 5, "total_price_cur": 100 }, { "article_id": 3, "quantity": 7, "total_price_cur": 70 } ] }

Customers

https://api.mrpeasy.com/rest/v1/customers[?code=...&title=...]

Customers can be added, viewed, and updated. Only GET, POST, and PUT methods are supported. Other methods are disabled.

Field Type Description
customer_id Integer, read-only Database ID of the customer.
code String A unique number to identify the customer.
This field can be added as a GET parameter to URL to filter customers list.
title String Name of the customer.
This field can be added as a GET parameter to URL to filter customers list.
reg_nr String Registration number of customer's company.
This field can be added as a GET parameter to URL to filter customers list.
tax_nr String Tax/VAT number of customer's company.
This field can be added as a GET parameter to URL to filter customers list.
created Unix timestamp Date and time when this customer was created.
GET parameters created_min and created_max can be added to URL to filter customers list.
next_contact Unix timestamp Date and time when this customer should be contacted.
GET parameters next_contact_min and next_contact_max can be added to URL to filter customers list.
status Integer Status of customer. Statuses are configured in MRPeasy -> Settings -> System settings -> Customer statuses.
This field can be added as a GET parameter to URL to filter customers list.
payment_period Integer A default payment period in days for invoices to this customer.
user_id Integer Sales person who handles that customer.
language_id Integer Language of documents that are printed for this customer.
contact_data Array of objects Array of contact details.
 
Contact details are objects with the following structure:
Field Type Description
line_id Integer, read-only Database ID of the contact information.
type String Type of contact information:
  • phone
  • fax
  • skype
  • email
  • web
  • address
  • shipping_address
  • other
value String or object Contact information.
If this is address or shipping_address, it is possible to pass a structured address as an object:
  • first_name
  • last_name
  • company
  • street_line_1
  • street_line_2
  • city
  • postal_code
  • state
  • country_code - 2 characters (ISO 3166-1 alpha-2)
  • phone

To create a customer, provide the following data:

  • title;
  • contact_data
    • type;
    • value

Sample POST data

  • title=Tester&contact_data%5B0%5D%5Btype%5D=phone&contact_data%5B0%5D%5Bvalue%5D=123456789&contact_data%5B1%5D%5Btype%5D=email&contact_data%5B1%5D%5Bvalue%5D=info%40tester.com&contact_data%5B2%5D%5Btype%5D=address&contact_data%5B2%5D%5Bvalue%5D%5Bfirst_name%5D=John&contact_data%5B2%5D%5Bvalue%5D%5Blast_name%5D=Doe&contact_data%5B2%5D%5Bvalue%5D%5Bcompany%5D=JD+Ltd&contact_data%5B2%5D%5Bvalue%5D%5Bstreet_line_1%5D=123+Maple+Street&contact_data%5B2%5D%5Bvalue%5D%5Bstreet_line_2%5D=&contact_data%5B2%5D%5Bvalue%5D%5Bcity%5D=Any-town&contact_data%5B2%5D%5Bvalue%5D%5Bpostal_code%5D=17101&contact_data%5B2%5D%5Bvalue%5D%5Bstate%5D=PA&contact_data%5B2%5D%5Bvalue%5D%5Bcountry_code%5D=US&contact_data%5B2%5D%5Bvalue%5D%5Bphone%5D=999-999-9999
  • { "title": "Tester", "contact_data": [ { "type": "phone", "value": "123456789" }, { "type": "email", "value": "info@tester.com" }, { "type": "address", "value": { "first_name": "John", "last_name": "Doe", "company": "JD Ltd", "street_line_1": "123 Maple Street", "street_line_2": "", "city": "Any-town", "postal_code": "17101", "state": "PA", "country_code": "US", "phone": "999-999-9999" } } ] }

Manufacturing orders

https://api.mrpeasy.com/rest/v1/manufacturing-orders[?man_ord_id=...&code=...]

Field Type Description
man_ord_id Integer, read-only Database ID of the manufacturing order.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
code String A unique number to identify the manufacturing order.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
article_id Integer, read-only Database ID of the stock item. If Matrix BOM is turned on, this is unique for each variation.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
product_id Integer, read-only Database product ID. If Matrix BOM is turned on, product_id is the same at all variations of the stock item.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
item_code String A unique number to identify the stock item.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
item_title String Name of the stock item.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
unit_id Integer or null ID of the unit of measurement.
unit String Unit of measurement.
group_id Integer or null ID of the product group.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
group_code String A unique number to identify the product group.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
group_title String Name of the product group.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
quantity Decimal Quantity of manufacturing order.
GET parameters quantity_min and quantity_max can be added to URL to filter manufacturing orders list.
status Integer Status of manufacturing order.
  • 10 - New
  • 15 - Not Scheduled
  • 20 - Scheduled
  • 30 - In progress
  • 35 - Paused
  • 40 - Done
  • 50 - Shipped
  • 60 - Closed
  • 70 - Cancelled
This field can be added as a GET parameter to URL to filter manufacturing orders list.
part_status Integer Status of parts that are booked.
  • 4 - Requested
  • 3 - Not booked
  • 2 - Delayed
  • 1 - Expected
  • 0 - Received
This field can be added as a GET parameter to URL to filter manufacturing orders list.
part_status_txt String, read-only Part status of manufacturing order as text.
created Unix timestamp Date and time when this manufacturing order was created.
GET parameters created_min and created_max can be added to URL to filter manufacturing orders list.
due_date Unix timestamp Date and time when this manufacturing order should be ready.
GET parameters due_date_min and due_date_max can be added to URL to filter manufacturing orders list.
start_date Unix timestamp Date and time when this manufacturing order is started.
GET parameters start_date_min and start_date_max can be added to URL to filter manufacturing orders list.
finish_date Unix timestamp Date and time when this manufacturing order is finished.
GET parameters finish_date_min and finish_date_max can be added to URL to filter manufacturing orders list.
item_cost Decimal Cost per one stock item.
GET parameters item_cost_min and item_cost_max can be added to URL to filter manufacturing orders list.
total_cost Decimal Total cost of manufacturing order.
GET parameters total_cost_min and total_cost_max can be added to URL to filter manufacturing orders list.
assigned_id Integer User that is responsible for this manufacturing order.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
assigned_username String Username of the user that is responsible for this manufacturing order.
bom_id Integer ID of BOM.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
routing_id Integer ID of routing.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
lot_id Integer deprecated
Please use the list of target lots instead.
ID of target stock lot.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
lot_code String deprecated
Please use the list of target lots instead.
A unique number to identify the target lot.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
target_lots Array of objects A list of target lots produced by this manufacturing order.
site_id Integer ID of site where this manufacturing order is performed (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter manufacturing orders list.
revision String Revision of the stock item (only if Enterprise function "Revision/Version Control System" is enabled).
parts Array of objects Array of booked or consumed parts.
This field is included in the reply only when a particular MO is requested (https://api.mrpeasy.com/rest/v1/manufacturing-orders/[MO_ID]).
operations Array of objects Array of manufacturing operations.
This field is included in the reply only when a particular MO is requested (https://api.mrpeasy.com/rest/v1/manufacturing-orders/[MO_ID]).
notes Array of objects Array of notes of the manufacturing order.
This field is included in the reply only when a particular MO is requested (https://api.mrpeasy.com/rest/v1/manufacturing-orders/[MO_ID]).

Target lots are objects with the following structure:
Field Type Description
lot_id Integer, read-only Database ID of the stock lot.
This field can be added as a GET parameter to URL to filter manufacturing orders list.
code String, read-only A unique number of the stock lot.
lot_code can be added as a GET parameter to URL to filter manufacturing orders list.

Parts are objects with the following structure:
Field Type Description
writeoff_id Integer, read-only Database ID of the booking.
booking_code String A unique number of the booking.
article_id Integer ID of the article.
product_id Integer ID of the product.
booked Decimal Number of items that are booked.
consumed Decimal Number of items that are consumed.
lots Array of objects Array of stock lots.
 
Stock lots are objects with the following structure:
Field Type Description
lot_id Integer, read-only Database ID of the stock lot. NULL if the item is not booked from a particular stock lot.
code String A unique number of the stock lot. NULL if the item is not booked from a particular stock lot.
booked Decimal Number of items that are booked.
consumed Decimal Number of items that are consumed.
item_cost Decimal Cost per one stock item.
 
Operations are objects with the following structure:
Field Type Description
operation_id Integer, read-only Database ID of the operation.
ord Integers A number of the operation, starting with 1.
type_id Integer ID of the work station type.
vendor_id Integer ID of the subcontractor.
description Text A description of the operation.
setup_time Integer Setup time from a routing in minutes.
cycle_time Integer Cycle time from a routing in minutes.
planned_start_date Unix timestamp Date and time when this operation should be started.
planned_finish_date Unix timestamp Date and time when this operation should be finished.
planned_duration Integer Planned duration of the operation.
real_start_date Unix timestamp Date and time when this operation was started. NULL if the operation is not started yet.
real_finish_date Unix timestamp Date and time when this operation was finished. NULL if the operation is not finished yet.
real_duration Integer Real duration of the operation. NULL if the operation is not finished yet.
manufacturing_cost Decimal Manufacturing overhead.
labour_cost Decimal Labour cost.
stations Array of objects Array of work stations.
 
Work stations are objects with the following structure:
Field Type Description
pws_id Integer, read-only Database ID of the work station in the operation.
station_id Integers Database ID of the work station.
code String A unique number of the work station.
title String Name of the work station.
planned_start_date Unix timestamp Date and time when this operation should be started.
planned_finish_date Unix timestamp Date and time when this operation should be finished.
planned_duration Integer Planned duration of the operation.
real_start_date Unix timestamp Date and time when this operation was started. NULL if the operation is not started yet.
real_finish_date Unix timestamp Date and time when this operation was finished. NULL if the operation is not finished yet.
real_duration Integer Real duration of the operation. NULL if the operation is not finished yet.
manufacturing_cost Decimal Manufacturing overhead.
workers Array of objects Array of worker.
 
Workers are objects with the following structure:
Field Type Description
worker_id Integer, read-only Database ID of the worker.
user_id Integers Database ID of the user.
department_id Integers Database ID of the department.
planned_start_date Unix timestamp Date and time when this operation should be started.
planned_finish_date Unix timestamp Date and time when this operation should be finished.
planned_duration Integer Planned duration of the operation.
real_start_date Unix timestamp Date and time when this operation was started. NULL if the operation is not started yet.
real_finish_date Unix timestamp Date and time when this operation was finished. NULL if the operation is not finished yet.
real_duration Integer Real duration of the operation. NULL if the operation is not finished yet.
labour_cost Decimal Labour cost.
results Array of objects Array of real results of the worker.
 
Results are objects with the following structure:
Field Type Description
result_id Integer, read-only Database ID of the result.
real_start_date Unix timestamp Date and time when this operation was started. NULL if the operation is not started yet.
real_finish_date Unix timestamp Date and time when this operation was finished. NULL if the operation is not finished yet.
real_duration Integer Real duration of the operation. NULL if the operation is not finished yet.
Quantity Decimal Number of ready items.
 
Notes are objects with the following structure:
Field Type Description
note_id Integer, read-only Database ID of the result.
created Unix timestamp Date and time when this note was created.
author_id Integer ID of the user who created that note.
author String Username of the user who created that note.
last_modified Unix timestamp Date and time when this note was modified the last time.
last_modifier_id Integer ID of the user who modified that note.
last_modifier String Username of the user who modified that note.
text Text Text of the note.

To add a manufacturing order, provide the following data:

  • article_id;
  • quantity;
  • assigned_id;
  • site_id (only if Enterprise function "Multiple Production Sites/Stocks" is enabled);
  • no_bookings - optional, if the Professional function "Unscheduled Manufacturing Orders" is enabled, and the value is 1, parts will not be booked;
  • no_scheduling - optional, if the Professional function "Unscheduled Manufacturing Orders" is enabled, and the value is 1, workstations will not be booked.

Sample POST data

  • article_id=1&quantity=10&assigned_id=3&site_id=1
  • { "article_id": 1, "quantity": 10, "assigned_id": 3, "site_id": 1 }
 

Via API, it is possible to update the following fields only. Other changed must be done in the software.

  • code;
  • quantity;
  • due_date;
  • assigned_id;
  • custom fields.

Parameters

https://api.mrpeasy.com/rest/v1/parameters[?parameter_id=...&title=...]

Field Type Description
parameter_id Integer, read-only Database ID of the parameter.
title String Name of the parameter.
This field can be added as a GET parameter to URL to filter parameters list.
changes_quantity Boolean Shows if the parameter can change the quantities of raw materials in BOM.
values Array of objects Array of possible values.
 
Values are objects with the following structure:
Field Type Description
value_id Integer Database ID of the value.
code String A unique number to identify the value.
value String A name of the value.
selling_price Decimal Selling price adjustment of the value.
ord Integer A number of the value, starting with 1.

Sample POST data

  • title=Size&changes_quantity=1&values%5B0%5D%5Bcode%5D=s&values%5B0%5D%5Bvalue%5D=S&values%5B0%5D%5Bord%5D=1&values%5B1%5D%5Bcode%5D=m&values%5B1%5D%5Bvalue%5D=M&values%5B1%5D%5Bord%5D=2&values%5B2%5D%5Bcode%5D=l&values%5B2%5D%5Bvalue%5D=L&values%5B2%5D%5Bord%5D=3&values%5B3%5D%5Bcode%5D=xl&values%5B3%5D%5Bvalue%5D=XL&values%5B3%5D%5Bord%5D=4
  • { "title": "Size", "changes_quantity": true, "values": [ { "code": "s", "value": "S", "ord": 1 }, { "code": "m", "value": "M", "ord": 2 }, { "code": "l", "value": "L", "ord": 3 }, { "code": "xl", "value": "XL", "ord": 4 } ] }

Product groups

https://api.mrpeasy.com/rest/v1/product-groups[?group_id=...&code=...]

Field Type Description
group_id Integer, read-only Database ID of the group.
code String A unique number to identify the group.
This field can be added as a GET parameter to URL to filter product groups list.
title String Name of the group.
This field can be added as a GET parameter to URL to filter product groups list.

Sample POST data

  • title=Ready+products
  • { "title": "Ready products" }

Purchase orders

https://api.mrpeasy.com/rest/v1/purchase-orders[?pur_ord_id=...&code=...]

Purchase orders are read-only. Only GET method is supported. Other methods are disabled.

Field Type Description
pur_ord_id Integer, read-only Database ID of the purchase order.
This field can be added as a GET parameter to URL to filter purchase orders list.
code String A unique number to identify the purchase order.
This field can be added as a GET parameter to URL to filter purchase orders list.
vendor_id Integer Database ID of the vendor.
This field can be added as a GET parameter to URL to filter purchase orders list.
vendor_code String, read-only A unique number to identify the vendor.
This field can be added as a GET parameter to URL to filter purchase orders list.
vendor_title String, read-only A name of the vendor.
This field can be added as a GET parameter to URL to filter purchase orders list.
status Integer Status of purchase order.
  • 10 - New
  • 5 - RFQ
  • 20 - Ordered
  • 30 - Shipped
  • 40 - Received
  • 110 - Archived
  • 120 - Cancelled
This field can be added as a GET parameter to URL to filter purchase orders list.
created Unix timestamp Date and time when this purchase order was created.
GET parameters created_min and created_max can be added to URL to filter purchase orders list.
expected_date Unix timestamp Date and time when this purchase order should be received.
GET parameters expected_date_min and expected_date_max can be added to URL to filter purchase orders list.
due_date Unix timestamp Due date of the purchase order.
GET parameters due_date_min and due_date_max can be added to URL to filter purchase orders list.
If the Software setting "Several invoices per PO" is enabled, please check the bills field.
shipped_date Unix timestamp Actual shipment date of the purchase order.
GET parameters shipped_date_min and shipped_date_max can be added to URL to filter purchase orders list.
arrival_date Unix timestamp Actual arrival date and time of the purchase order.
GET parameters arrival_date_min and arrival_date_max can be added to URL to filter purchase orders list.
order_number String Order number that is received from the vendor.
This field can be added as a GET parameter to URL to filter purchase orders list.
order_date Unix timestamp Vendor order's date.
GET parameters order_date_min and order_date_max can be added to URL to filter purchase orders list.
invoice_number String Invoice number that is received from the vendor.
This field can be added as a GET parameter to URL to filter purchase orders list.
If the Software setting "Several invoices per PO" is enabled, please check the bills field.
invoice_date Unix timestamp Vendor invoice's date.
GET parameters invoice_date_min and invoice_date_max can be added to URL to filter purchase orders list.
If the Software setting "Several invoices per PO" is enabled, please check the bills field.
total_price Decimal Total price of the purchase order in the default currency.
GET parameters total_price_min and total_price_max can be added to URL to filter purchase orders list.
total_price_cur Decimal Total price of the purchase order in vendor's currency.
fees_taxable_sum Decimal Taxable fees of the purchase order in the default currency.
fees_taxable_sum_cur Decimal Taxable fees of the purchase order in vendor's currency.
fees_sum Decimal Additional fees of the purchase order in the default currency.
fees_sum_cur Decimal Additional fees of the purchase order in vendor's currency.
tax_rate Decimal Tax percentage.
tax_sum Decimal Tax sum of the purchase order in the default currency.
tax_sum_cur Decimal Tax sum of the purchase order in vendor's currency.
discount_rate Decimal Discount percentage.
discount_sum Decimal Discount sum of the purchase order in the default currency.
discount_sum_cur Decimal Discount sum of the purchase order in vendor's currency.
currency String Vendor's currency.
currency_rate Decimal Vendor's currency rate.
free_text Text A free text.
products Array of objects Array of products that are ordered.
bills Array of objects If the Software setting "Several invoices per PO" is enabled, this field contains an array of incoming invoices with the following fields:
  • due_date
  • invoice_number
  • invoice_date
 
Products are objects with the following structure:
Field Type Description
line_id Integer, read-only Database ID of the purchase order line.
ord Integers A number of the product, starting with 1.
article_id Integer Database ID of the stock item.
product_id Integer Database product ID.
item_code String A unique number to identify the stock item.
item_title String Name of the stock item.
description String A free text.
unit_id Integer or null ID of the unit of measurement.
unit String Unit of measurement.
group_id Integer or null ID of the product group.
group_code String A unique number to identify the product group.
group_title String Name of the product group.
quantity Decimal Number of products purchased in the default unit.
vendor_quantity Decimal Number of products purchased in the vendor's custom unit of measurement.
vendor_unit String Vendor's custom unit of measurement.
item_price Decimal Price per item of the purchase order line in the default currency.
item_price_cur Decimal Price per item of the purchase order line in vendor's currency.
total_price Decimal Total price of the purchase order line in the default currency.
total_price_cur Decimal Total price of the purchase order line in vendor's currency.
fees_taxable_sum Decimal Taxable fees of the purchase order line in the default currency.
fees_taxable_sum_cur Decimal Taxable fees of the purchase order line in vendor's currency.
fees_sum Decimal Additional fees of the purchase order line in the default currency.
fees_sum_cur Decimal Additional fees of the purchase order line in vendor's currency.
tax_sum Decimal Tax sum of the purchase order line in the default currency.
tax_sum_cur Decimal Tax sum of the purchase order line in vendor's currency.
discount_sum Decimal Discount sum of the purchase order line in the default currency.
discount_sum_cur Decimal Discount sum of the purchase order line in vendor's currency.
revision String Revision of the stock item (only if Enterprise function "Revision/Version Control System" is enabled).

Relations

https://api.mrpeasy.com/rest/v1/relations[?relation_id=...&code=...]

Field Type Description
relation_id Integer, read-only Database ID of the relation.
code String A unique number to identify the relation.
This field can be added as a GET parameter to URL to filter relations list.
title String Name of the relation.
This field can be added as a GET parameter to URL to filter relations list.
lines Array of objects Array of possible parameter values and articles.
This field is included in the reply only when a particular relation is requested (https://api.mrpeasy.com/rest/v1/relations/[ID]).
 
Lines are objects with the following structure:
Field Type Description
line_id Integer Database ID of the line.
article_id Integer Database ID of the stock item.
ord Integers A number of the product, starting with 1.
values Array of objects Object that defines parameter values. Object has the following keys:
  • parameter_id
  • value_id

Sample POST data

  • title=Relation+A&lines%5B0%5D%5Barticle_id%5D=2&lines%5B0%5D%5Bord%5D=1&lines%5B0%5D%5Bvalues%5D%5B0%5D%5Bparameter_id%5D=1&lines%5B0%5D%5Bvalues%5D%5B0%5D%5Bvalue_id%5D=11&lines%5B0%5D%5Bvalues%5D%5B1%5D%5Bparameter_id%5D=2&lines%5B0%5D%5Bvalues%5D%5B1%5D%5Bvalue_id%5D=21&lines%5B1%5D%5Barticle_id%5D=3&lines%5B1%5D%5Bord%5D=2&lines%5B1%5D%5Bvalues%5D%5B0%5D%5Bparameter_id%5D=1&lines%5B1%5D%5Bvalues%5D%5B0%5D%5Bvalue_id%5D=12&lines%5B1%5D%5Bvalues%5D%5B1%5D%5Bparameter_id%5D=2&lines%5B1%5D%5Bvalues%5D%5B1%5D%5Bvalue_id%5D=22
  • { "title": "Relation A", "lines": [ { "article_id": 2, "ord": 1, "values": [ { "parameter_id": 1, "value_id": 11 }, { "parameter_id": 2, "value_id": 21 } ] }, { "article_id": 3, "ord": 2, "values": [ { "parameter_id": 1, "value_id": 12 }, { "parameter_id": 2, "value_id": 22 } ] } ] }

RMA orders

https://api.mrpeasy.com/rest/v1/rma[?rma_ord_id=...&code=...]

Field Type Description
rma_ord_id Integer, read-only Database ID of the RMA order.
This field can be added as a GET parameter to URL to filter RMA orders list.
code String A unique number to identify the RMA order.
This field can be added as a GET parameter to URL to filter RMA orders list.
reference String Reference of the RMA order.
This field can be added as a GET parameter to URL to filter RMA orders list.
customer_id Integer Database ID of the customer.
This field can be added as a GET parameter to URL to filter RMA orders list.
customer_code String, read-only A unique number to identify the customer.
This field can be added as a GET parameter to URL to filter RMA orders list.
customer_name String, read-only A name of the customer.
This field can be added as a GET parameter to URL to filter RMA orders list.
status Integer Status of RMA order.
  • 10 - Quotation
  • 20 - Waiting for inspection
  • 40 - Waiting for action
  • 50 - In production
  • 60 - Ready for shipment
  • 70 - Shipped
  • 80 - Delivered
  • 110 - Archived
  • 120 - Cancelled
This field can be added as a GET parameter to URL to filter RMA orders list.
status_txt String, read-only Status of RMA order as text.
rma_type Integer Type of RMA order.
  • 70 - Credit only
  • 10 - Repair
  • 20 - Repair and invoice
  • 30 - Replacement
  • 40 - Receipt and credit
  • 50 - Receipt and no credit
  • 60 - Reject and ship back
  •  1 - Not specified
This field can be added as a GET parameter to URL to filter RMA orders list.
rma_type_txt String, read-only Type of RMA order as text.
created Unix timestamp Date and time when this customer order was created.
GET parameters created_min and created_max can be added to URL to filter RMA orders list.
notes String Internal notes, any additional information about the order.
article_id Integer ID of the article.
This field can be added as a GET parameter to URL to filter RMA orders list.
item_code String A unique number to identify the stock item.
This field can be added as a GET parameter to URL to filter RMA orders list.
item_title String Name of the stock item.
This field can be added as a GET parameter to URL to filter RMA orders list.
quantity Decimal Number of items returned.
unit_id Integer or null ID of the unit of measurement.
unit String Unit of measurement.
group_id Integer or null ID of the product group.
This field can be added as a GET parameter to URL to filter RMA orders list.
group_code String A unique number to identify the product group.
This field can be added as a GET parameter to URL to filter RMA orders list.
group_title String Name of the product group.
This field can be added as a GET parameter to URL to filter RMA orders list.
received Boolean Is the item received or not. If the item is received, a stock lot is created.
lot_id Integer or null ID of the target stock lot.
lot_code String or null A unique number of the target stock lot.
lot_status Integer or null Status of target stock lot, if the product is received.
lot_status_txt String or null Status of target stock lot as text.
site_id Integer ID of site where this RMA order is created (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter RMA orders list.
notes String Internal notes, any additional information about the order.
service_order_id Integer or null ID of the service order.
service_order_code Integer or null A unique number to identify the service order.
service_order_status Integer or null Status of the service order.

Routings

https://api.mrpeasy.com/rest/v1/routings

Field Type Description
routing_id Integer, read-only Database ID of the routing.
product_id Integer ID of the final product for this routing. It can be defined only while creating a new routing and cannot be changed later.
code String A unique number to identify the routing.
title String Name of the routing.
boms Array of integers IDs of BOMs that are suitable for this routing.
operations Array of objects

Array of routing operations.

If you create a new routing, then you must provide operations.

If you update existing routing, you should provide either all operations (both updated and not updated with their operation IDs) or no operations (existing operations will remain).

If you provide operations, then each operation that has existing operation ID will be updated, operations without operation ID will be created and old operations that were not found by ID among provided ones will be deleted.

 
Operations are objects with the following structure (for a better explanation please see Quick help in the software):
Field Type Description
operation_id Integer, read-only Database ID of the operation.
type_id Integer ID of the work center type.
ord Integer An ordinal number of operation, starting with 1.
description Text A free text.
fixed_time Decimal A time in minutes that is needed to start the operation (this time does not depend on the quantity of finished products).
variable_time Decimal Additional time of each finished product in minutes.
fixed_cost Decimal A cost of starting the operation that does not depend on the quantity of finished products.
variable_cost Decimal Additional cost of each finished product.
variable_quantity Decimal A quantity of finished products that are produced simultaneously.
time_payment Boolean Shows if user receives a salary per working time.
piece_payment Decimal If defined, then user receives a payment per each piece of finished product.
sequence Array of integers An array of ord values of operations that must be finished before current operation can start (first operation must have sequence 0).
overlap Decimal or null
If the current operation starts before previous operation is fully finished, you can define the quantity of products that must be ready before this operation can start.

Sample POST data

  • product_id=1&title=Routing+A&operations%5B0%5D%5Btype_id%5D=1&operations%5B0%5D%5Bord%5D=1&operations%5B0%5D%5Bvariable_time%5D=30&operations%5B1%5D%5Btype_id%5D=4&operations%5B1%5D%5Bord%5D=2&operations%5B1%5D%5Bvariable_time%5D=60
  • { "product_id": 1, "title": "Routing A", "operations": [ { "type_id": 1, "ord": 1, "variable_time": 30 }, { "type_id": 4, "ord": 2, "variable_time": 60 } ] }

Sales invoices

https://api.mrpeasy.com/rest/v1/invoices[?invoice=...&code=...]

Field Type Description
invoice_id Integer, read-only Database ID of the invoice.
This field can be added as a GET parameter to URL to filter the list of invoices.
code String A unique number to identify the invoice.
This field can be added as a GET parameter to URL to filter the list of invoices.
type Integer Type of invoice.
  • 10 - Quotation
  • 20 - Pro-forma invoice
  • 25 - Prepayment invoice
  • 30 - Invoice
  • 40 - Credit-invoice
  • 50 - Order confirmation
This field can be added as a GET parameter to URL to filter the list of invoices.
type_txt String, read-only Type of invoice as text.
status Integer Status of invoice.
  • 10 - Dummy
  • 20 - Unpaid
  • 30 - Paid partially
  • 40 - Paid
  • 50 - Cancelled
This field can be added as a GET parameter to URL to filter the list of invoices.
status_txt String, read-only Status of invoice as text.
customer_id Integer Database ID of the customer.
This field can be added as a GET parameter to URL to filter the list of invoices.
customer_code String, read-only A unique number to identify the customer.
This field can be added as a GET parameter to URL to filter the list of invoices.
customer_name String, read-only A name of the customer.
This field can be added as a GET parameter to URL to filter the list of invoices.
cust_ord_id Integer Database ID of the customer order.
This field can be added as a GET parameter to URL to filter the list of invoices.
customer_order_code String A unique number to identify the customer order.
This field can be added as a GET parameter to URL to filter the list of invoices.
rma_ord_id Integer Database ID of the RMA order.
This field can be added as a GET parameter to URL to filter the list of invoices.
rma_order_code String A unique number to identify the RMA order.
This field can be added as a GET parameter to URL to filter the list of invoices.
pricelist_id Integer Database ID of the pricelist.
This field can be added as a GET parameter to URL to filter the list of invoices.
pricelist_code String, read-only A unique number to identify the pricelist.
This field can be added as a GET parameter to URL to filter the list of invoices.
pricelist_title String, read-only A name of the pricelist.
This field can be added as a GET parameter to URL to filter the list of invoices.
billing_address_id Integer ID of invoice billing address.
This field can be added as a GET parameter to URL to filter the list of invoices.
billing_address String or array, read-only Billing address as a text or an array.
This field can be added as a GET parameter to URL to filter the list of invoices.
created Unix timestamp Date and time when this invoice was created.
GET parameters created_min and created_max can be added as a GET parameters to URL to filter the list of invoices.
due_date Unix timestamp Date when this invoice should be paid.
GET parameters due_date_min and due_date_max can be added as a GET parameters to URL to filter the list of invoices.
free_text Text Free text.
This field can be added as a GET parameter to URL to filter the list of invoices.
currency String Currency of the invoice.
currency_rate Decimal Currency rate of the invoice.
total_price Decimal Total price of the invoice.
total_price_cur Decimal Total price of the invoice in customer's currency.
GET parameters total_price_cur_min and total_price_cur_max can be added as a GET parameters to URL to filter the list of invoices.
total_tax_price Decimal Total price of the invoice with tax.
total_tax_price_cur Decimal Total price of the invoice with tax in customer's currency.
GET parameters total_tax_price_cur_min and total_tax_price_cur_max can be added as a GET parameters to URL to filter the list of invoices.
discount_rate Decimal Percentage of discount.
discount_sum Decimal Sum of discount.
discount_sum_cur Decimal Sum of discount in customer's currency.
prepayment_rate Decimal Percentage of pre-payment in a pre-payment invoice.
prepayment_sum Decimal Sum of a pre-payment invoice or sum of allocated pre-payment in an invoice.
prepayment_sum_cur Decimal Sum of a pre-payment invoice or sum of allocated pre-payment in an invoice, in customer's currency.
prepayment_tax_sum Decimal Sum of a pre-payment invoice or sum of allocated pre-payment in an invoice, with tax.
prepayment_tax_sum_cur Decimal Sum of a pre-payment invoice or sum of allocated pre-payment in an invoice, with tax in customer's currency.
tax_rate Decimal Percentage of tax.
tax_sum Decimal Tax sum of the invoice in the default currency.
tax_sum_cur Decimal Tax sum of the invoice in customer's currency.
products Array of objects Array of products that are sold.
 
Products are objects with the following structure:
Field Type Description
line_id Integer, read-only Database ID of the invoice line.
ord Integers A number of the product, starting with 1.
article_id Integer ID of the article.
description Text A free text.
quantity Decimal Number of items to sell.
item_price Decimal Price of one item.
item_price_cur Decimal Price of one item in customer's currency.
total_price Decimal Price of product.
total_price_cur Decimal Price of product in customer's currency.
discount_rate Decimal Percentage of discount per line.
discount_sum Decimal, read-only Sum of discount per line.
discount_sum_cur Decimal, read-only Sum of discount per line in customer's currency.
delivery_date Unix timestamp Custom date and time when this product should be delivered.

Serial numbers

https://api.mrpeasy.com/rest/v1/serials[?serial_id=...&serial=...]

Serial numbers are read-only. Only GET method is supported. Other methods are disabled.

Field Type Description
serial_id Integer, read-only Database ID of the serial number.
This field can be added as a GET parameter to URL to filter serial numbers list.
serial String Serial number.
This field can be added as a GET parameter to URL to filter serial numbers list.
article_id Integer, read-only Database ID of the stock item. If Matrix BOM is turned on, this is unique for each variation.
This field can be added as a GET parameter to URL to filter serial numbers list.
product_id Integer, read-only Database product ID. If Matrix BOM is turned on, product_id is the same at all variations of the stock item.
This field can be added as a GET parameter to URL to filter serial numbers list.
item_code String A unique number to identify the stock item.
This field can be added as a GET parameter to URL to filter serial numbers list.
item_title String Name of the stock item.
This field can be added as a GET parameter to URL to filter serial numbers list.
group_id Integer or null ID of the product group.
This field can be added as a GET parameter to URL to filter serial numbers list.
group_code String A unique number to identify the product group.
This field can be added as a GET parameter to URL to filter serial numbers list.
group_title String Name of the product group.
This field can be added as a GET parameter to URL to filter serial numbers list.
status Integer Status of serial number.
  • 10 - Planned
  • 20 - Received
  • 30 - Consumed
  • 40 - Shipped
  • 50 - Written off
  • 60 - Returned
  • 70 - RMA
  • 80 - Rejected
This field can be added as a GET parameter to URL to filter serial numbers list.
lot_id Integer ID of serial number's stock lot.
This field can be added as a GET parameter to URL to filter serial numbers list.
lot_code String Unique code of serial number's stock lot.
This field can be added as a GET parameter to URL to filter serial numbers list.
cust_ord_id Integer If the item with this serial number has been shipped, show the database ID of the customer order.
This field can be added as a GET parameter to URL to filter serial numbers list.
customer_order_code String If the item with this serial number has been shipped, show the customer order number.
This field can be added as a GET parameter to URL to filter serial numbers list.
customer_order_created Unix timestamp Date and time when the customer order was created.
GET parameters customer_order_created_min and customer_order_created_max can be added to URL to filter serial numbers list.
rma_ord_id Integer If the item with this serial number was received in RMA order, show the database ID of the RMA order.
This field can be added as a GET parameter to URL to filter serial numbers list.
rma_order_code String If the item with this serial number was received in RMA order, show the RMA order number.
This field can be added as a GET parameter to URL to filter serial numbers list.
customer_id Integer If the item with this serial number has been shipped, show the database ID of the customer.
This field can be added as a GET parameter to URL to filter serial numbers list.
customer_code String If the item with this serial number has been shipped, show the customer number.
This field can be added as a GET parameter to URL to filter serial numbers list.
customer_name String If the item with this serial number has been shipped, show the customer name.
This field can be added as a GET parameter to URL to filter serial numbers list.
site_id Integer ID of site where this serial number is located (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter serial numbers list.

Shipments

https://api.mrpeasy.com/rest/v1/shipments[?shipment_id=...&code=...]

Shipments are read-only. Only GET method is supported. Other methods are disabled.

It is not possible to create a shipment directly. To ship the entire customer order, please update a CO and set the status 70 Shipped or 80 Delivered. This will create a shipment with all products and pick it up.

Field Type Description
shipment_id Integer, read-only Database ID of the shipment.
This field can be added as a GET parameter to URL to filter shipments list.
code String A unique number to identify the shipment.
This field can be added as a GET parameter to URL to filter shipments list.
tracking_number String Tracking number.
This field can be added as a GET parameter to URL to filter shipments list.
created Unix timestamp Date and time when this shipment was created.
GET parameters created_min and created_max can be added as a GET parameters to URL to filter the list of shipments.
delivery_date Unix timestamp Date and time when this shipment should be picked.
GET parameters created_min and created_max can be added as a GET parameters to URL to filter the list of shipments.
status Integer Status of shipment.
  • 10 - New
  • 15 - Ready for shipment
  • 20 - Shipped
  • 30 - Cancelled

This field can be added as a GET parameter to URL to filter shipments list.
status_txt String, read-only Status of shipment as text.
orders Array of objects Orders that are shipped by this shipment.
shipping_address String or array, read-only Shipping address as a text or an array.
waybill_notes String Notes for the waybill.
packing_notes String Notes for the picking list.
products Array of objects Array of products that are shipped.
Orders are objects with the following structure:
Field Type Description
customer_order_id Integer Database ID of the customer order.
This field can be added as a GET parameter to URL to filter the list of shipments.
customer_order_code String A unique number to identify the customer order.
This field can be added as a GET parameter to URL to filter the list of shipments.
rma_order_id Integer Database ID of the RMA order.
This field can be added as a GET parameter to URL to filter the list of shipments.
rma_order_code String A unique number to identify the RMA order.
This field can be added as a GET parameter to URL to filter the list of shipments.
purchase_order_id Integer Database ID of the purchase order.
This field can be added as a GET parameter to URL to filter the list of shipments.
purchase_order_code String A unique number to identify the purchase order.
This field can be added as a GET parameter to URL to filter the list of shipments.
Products are objects with the following structure:
Field Type Description
article_id Integer Database ID of the stock item.
product_id Integer Database product ID.
item_code String A unique number to identify the stock item.
item_title String Name of the stock item.
unit_id Integer or null ID of the unit of measurement.
unit String Unit of measurement.
quantity_picked Decimal Number of products that have been shipped.
quantity_booked Decimal Number of products that are waiting to be shipped.
lot_id Integer or null ID of the stock lot.
lot_code String or null A unique number of the stock lot.
lot_status Integer or null Status of the stock lot.
lot_status_txt String or null Status of the stock lot as text.
expiry_date Unix timestamp Expiry date of this stock lot (only if Professional function "Expiry Date" is enabled).
site_id Integer ID of site where this product should be shipped (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
site String Name of site where this product should be shipped (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
location_id Integer ID of storage location.
location String Name of storage location.
weight Number The total weight of this product (only if Enterprise function "Packing" is enabled).
weight_unit_id Integer
  • 1 - gram
  • 2 - ounce
  • 3 - pound
  • 4 - kilogram
weight_unit_txt String Weight UoM as a text.
serials Array If a product has serial numbers, a list of shipped serial numbers (only if Professional function "Serial numbers" is enabled).
Serials are objects with the following structure:
Field Type Description
serial_id Integer Database ID of the serial number.
serial String Serial number.

Stock items

https://api.mrpeasy.com/rest/v1/items[?article_id=...&code=...]

Field Type Description
article_id Integer, read-only

Database ID of the stock item. If Matrix BOM is turned on, this is unique for each variation.
article_id can be seen in URL of stock item's reports page (https://app.mrpeasy.com/articles/stats/[article_id]).

This field can be added as a GET parameter to URL to filter stock items list.

product_id Integer, read-only

Database product ID. If Matrix BOM is turned on, product_id is the same at all variations of the stock item.
product_id can be seen in URL of stock item's details page (https://app.mrpeasy.com/articles/view/[product_id]).

This field can be added as a GET parameter to URL to filter stock items list.

code String

A unique part number to identify the item. If Matrix BOM is turned on, it is same for all variations.

This field can be added as a GET parameter to URL to filter stock items list.

title String

Name/description of the item. If Matrix BOM is turned on, it is same for all variations.

This field can be added as a GET parameter to URL to filter stock items list.

unit_id Integer or null

ID of the unit of measurement. If Matrix BOM is turned on, it is same for all variations.

This field can be added as a GET parameter to URL to filter stock items list.

group_id Integer or null

ID of the product group. If Matrix BOM is turned on, it is same for all variations.

This field can be added as a GET parameter to URL to filter stock items list.

group_code String, read-only A unique number to identify the product group.
This field can be added as a GET parameter to URL to filter stock items list.
group_title String, read-only Name of the product group.
This field can be added as a GET parameter to URL to filter stock items list.
is_raw Boolean

Shows if this is a raw material that is bought from vendors. If Matrix BOM is turned on, it is same for all variations.

This field can be added as a GET parameter to URL to filter stock items list.

selling_price Decimal or array or null If you sell this item, enter a selling price. Array is returned if tiered prices are defined for the product. If Matrix BOM is turned on, it is same for all variations.
GET parameters selling_price_min and selling_price_max can be added to URL to filter stock items list.
avg_cost Decimal or null Approximate cost of the item. Please check the documentation about how the cost of items is calculated.
GET parameters avg_cost_min and avg_cost_max can be added to URL to filter stock items list.
in_stock
Decimal, read-only Total physical quantity in stock right now (available + booked).
GET parameters in_stock_min and in_stock_max can be added to URL to filter stock items list.
available Decimal, read-only Quantity, which is in stock and available.
GET parameters available_min and available_max can be added to URL to filter stock items list.
booked Decimal, read-only Quantity, which is in stock and booked, not freely available.
GET parameters booked_min and booked_max can be added to URL to filter stock items list.
expected_total Decimal, read-only Total quantity which is planned to be received in the future.
GET parameters expected_total_min and expected_total_max can be added to URL to filter stock items list.
expected_available Decimal, read-only Quantity, which is expected and available, not booked yet.
GET parameters expected_available_min and expected_available_max can be added to URL to filter stock items list.
expected_booked Decimal, read-only Quantity, which is expected and already booked, not freely available.
GET parameters expected_booked_min and expected_booked_max can be added to URL to filter stock items list.
min_quantity Decimal or array The minimal inventory level of the item (reorder point).
If the Enterprise function "Multiple Production Sites/Stocks" is disabled, this is a number.
Otherwise,
  • when requesting a list of items, this is a number at the site, which is selected by the optional site_id parameter (default: 1).
  • when requesting a particular item, this is an array with min. stock values for every site.
revision String Revision of the stock item (only if Enterprise function "Revision/Version Control System" is enabled).
This field can be added as a GET parameter to URL to filter stock items list.
icon String URL of the icon.
quality_control Boolean Shows whether this item must pass quality inspection when received (only if Professional function "Quality Control" is enabled).
onhold_period Integer The number of days the goods will be on hold for quality inspection (only if Professional function "Quality Control" is enabled).
serials Boolean Shows whether this item has serial numbers (only if Professional function "Serial Numbers" is enabled).
shelf_life Integer The number of days before the goods expire (only if Professional function "Expiry Date" is enabled).
deleted Boolean Shows if this item is deleted.
This field can be added as a GET parameter to URL to filter stock items list.
purchase_terms Array of objects Array of purchase terms.
parameters Array of objects If Matrix BOM is turned on, this field contains array of parameters:
  • parameter_id - database ID of the parameter
  • ord - order of the parameter in product details
  • title - name of parameter
 
Purchase terms are read-only. They are objects with the following structure:
Field Type Description
vendor_id Integer Database ID of the vendor.
vendor_code String A unique number to identify the vendor.
vendor_title String A name of the vendor.
vendor_product_code String Item number in vendor's database.
priority Decimal Priority of this vendor compared with other vendors that supply the same stock item (as a number, higher number means higher priority).
lead_time Integer How many days it takes for the purchase order to arrive from the vendor to your stock.
unit String Units, which are used to purchase the item. Can be whether item's unit or vendor's custom unit.
unit_rate Decimal If a vendor has a custom unit, this is a conversion rate.
min_quantity Decimal Minimum quantity of purchase order in item's units.
vendor_min_quantity Decimal Minimum quantity of purchase order in vendor's units.
price Decimal Price per one unit in the main currency (in vendor's unit, if it is used).
currency_price Decimal Price per one unit in vendor's currency.
currency String Vendor's currency.

Sample POST data

  • title=Wooden+table&unit_id=5&group_id=3&is_raw=0
  • { "title": "Wooden table", "unit_id": 5, "group_id": 3, "is_raw": false }

Stock lots

https://api.mrpeasy.com/rest/v1/lots[?lot_id=...&code=...]

Stock lots are read-only. Only GET method is supported. Other methods are disabled.

Field Type Description
lot_id Integer, read-only Database ID of the stock lot.
This field can be added as a GET parameter to URL to filter stock lots list.
code String A unique number to identify the stock lot.
This field can be added as a GET parameter to URL to filter stock lots list.
article_id Integer, read-only Database ID of the stock item. If Matrix BOM is turned on, this is unique for each variation.
This field can be added as a GET parameter to URL to filter stock lots list.
product_id Integer, read-only Database product ID. If Matrix BOM is turned on, product_id is the same at all variations of the stock item.
This field can be added as a GET parameter to URL to filter stock lots list.
item_code String A unique number to identify the stock item.
This field can be added as a GET parameter to URL to filter stock lots list.
item_title String Name of the stock item.
This field can be added as a GET parameter to URL to filter stock lots list.
unit_id Integer or null ID of the unit of measurement.
unit String Unit of measurement.
group_id Integer or null ID of the product group.
This field can be added as a GET parameter to URL to filter stock lots list.
group_code String A unique number to identify the product group.
This field can be added as a GET parameter to URL to filter stock lots list.
group_title String Name of the product group.
This field can be added as a GET parameter to URL to filter stock lots list.
status Integer Status of stock lot.
  • 5 - Requested
  • 10 - Planned
  • 15 - On hold
  • 20 - Received
  • 25 - Rejected
  • 30 - Cancelled
  • 100 - RMA Waiting for inspection
  • 105 - RMA Waiting for repair
  • 110 - RMA ready for shipment
  • 115 - RMA returned
This field can be added as a GET parameter to URL to filter stock lots list.
created Unix timestamp Date and time when this stock lot was created.
GET parameters created_min and created_max can be added to URL to filter stock lots list.
available_from Unix timestamp Date and time when this stock lot becomes available.
GET parameters available_from_min and available_from_max can be added to URL to filter stock lots list.
quantity Decimal Initial quantity of stock lot.
GET parameters quantity_min and quantity_max can be added to URL to filter stock lots list.
available Decimal Quantity of stock items that are available for booking.
GET parameters available_min and available_max can be added to URL to filter stock lots list.
booked Decimal Quantity of stock items that are booked.
GET parameters booked_min and booked_max can be added to URL to filter stock lots list.
item_cost Decimal Cost per one stock item.
GET parameters item_cost_min and item_cost_max can be added to URL to filter stock lots list.
total_cost Decimal Total cost of stock lot.
GET parameters total_cost_min and total_cost_max can be added to URL to filter stock lots list.
pur_ord_id Integer or null ID of purchase order if this stock lot was purchased.
This field can be added as a GET parameter to URL to filter stock lots list.
purchase_order_code String or null Number of purchase order if this stock lot was purchased.
This field can be added as a GET parameter to URL to filter stock lots list.
man_ord_id Integer or null ID of manufacturing order if this stock lot was produced.
This field can be added as a GET parameter to URL to filter stock lots list.
manufacturing_order_code String or null Number of manufacturing order if this stock lot was produced.
This field can be added as a GET parameter to URL to filter stock lots list.
transfer_id Integer or null ID of transfer order if this stock lot was transferred from one site to another (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter stock lots list.
transfer_order_code String or null Number of transfer order if this stock lot was transferred from one site to another (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter stock lots list.
site_id Integer ID of site where this stock lot is located (only if Enterprise function "Multiple Production Sites/Stocks" is enabled).
This field can be added as a GET parameter to URL to filter stock lots list.
locations Array of objects List of storage locations, where items from this lot are placed.
expiry Unix timestamp Expiry date of this stock lot (only if Professional function "Expiry Date" is enabled).
GET parameters expiry_min and expiry_max can be added to URL to filter stock lots list.
revision String Revision of the stock lot (only if Enterprise function "Revision/Version Control System" is enabled).
This field can be added as a GET parameter to URL to filter stock lots list.
 
Locations are objects with the following structure:
Field Type Description
location_id Integer Database ID of the storage location.
location String Name of the storage location.
available Decimal Quantity of stock items that are available for booking.
booked Decimal Quantity of stock items that are booked.

Units of measurement

https://api.mrpeasy.com/rest/v1/units

Field Type Description
unit_id Integer, read-only Database ID of the unit of measurement.
title String Name of the unit of measurement.

Sample POST data

  • title=pcs
  • { "title": "pcs" }

User actions

https://api.mrpeasy.com/rest/v1/users/actions[?log_id=...&created_min=...]

User actions are read-only. Only GET method is supported. Other methods are disabled.

Field Type Description
log_id Integer, read-only Database ID of the action.
This field can be added as a GET parameter to URL to filter actions list.
created Unix timestamp Date and time when this action was made.
GET parameters created_min and created_max can be added to URL to filter actions list.
user_id Integer Database ID of the user.
This field can be added as a GET parameter to URL to filter actions list.
username String Username of the user.
object_id Integer Database ID of the target object.
This field can be added as a GET parameter to URL to filter actions list.
activity Integer Unique number of the activity.
This field can be added as a GET parameter to URL to filter actions list.
description String Text description of the activity.
comment String Additional comment about the action.
This field can be added as a GET parameter to URL to filter actions list.

It is possible to get a list of all possible activities by making a GET request to https://api.mrpeasy.com/rest/v1/users/actions/list.

Vendors

https://api.mrpeasy.com/rest/v1/vendors

Purchase orders are read-only. Only GET method is supported. Other methods are disabled.

Field Type Description
vendor_id Integer, read-only Database ID of the vendor.
code String A unique number to identify the vendor.
This field can be added as a GET parameter to URL to filter vendors list.
title String Name of the vendor.
This field can be added as a GET parameter to URL to filter vendors list.
currency String Default currency of the vendor.
tax_rate Decimal Default tax percentage of the vendor.
payment_period Integer Default payment period of the vendor in days.
payment_period_type Integer
  • 0 - after the invoice date
  • 10 - after the end of the invoice month
lead_time Integer Default lead time of the vendor in days.
language String Language of documents that are printed for this vendor.
language_id Integer Language of documents that are printed for this vendor.
contact_data Array of objects Array of contact details.
on_time_rate Decimal On time delivery percentage of the vendor during the period *.
avg_delay Decimal Average delay of the vendor in days during the period *.
total_cost Decimal Total cost of purchase orders during the period *.
rejected Decimal Number of rejected items the period *.
rejected_rate Decimal Percentage of rejected items the period *.

* the default period is this year. To change the period, set the GET parameters start and end (YYYY-MM-DD).


Contact details are objects with the following structure:
Field Type Description
line_id Integer, read-only Database ID of the contact information.
type String Type of contact information:
  • phone
  • fax
  • skype
  • email
  • web
  • address
  • shipping_address
  • other
value String or object Contact information.
If this is address or shipping_address, it is possible to pass a structured address as an object:
  • first_name
  • last_name
  • company
  • street_line_1
  • street_line_2
  • city
  • postal_code
  • state
  • country_code - 2 characters (ISO 3166-1 alpha-2)
  • phone

Work station types

https://api.mrpeasy.com/rest/v1/work-center-types

Field Type Description
type_id Integer, read-only Database ID of the type.
code String A unique number to identify the work center type.
title String Name of the work center type.

Sample POST data

  • title=Bench
  • { "title": "Bench" }

Work stations

https://api.mrpeasy.com/rest/v1/work-centers

Field Type Description
center_id Integer, read-only Database ID of the type.
type_id Integer ID of the work center type.
code String A unique number to identify the work center.
title String Name of the work center.

Sample POST data

  • type_id=2&title=Bench+1
  • { "type_id": 2, "title": "Bench 1" }

Inventory

To fetch inventory, make a GET request to https://api.mrpeasy.com/rest/v1/stock/inventory. This returns a list of stock items with on hand quantities and costs.

To fetch inventory at a specific date, add a date parameter to request URL (for example, https://api.mrpeasy.com/rest/v1/stock/inventory?date=2024-01-01).

To fetch on hand quantity of a particular stock item, use request URL https://api.mrpeasy.com/rest/v1/stock/inventory/[article_id] (replace [article_id] with a number).

To get a total cost of inventory make a request to URL https://api.mrpeasy.com/rest/v1/stock/inventory/sum. A DATE parameter can be used to receive total cost at a specific date.

The following parameters can be added to a request URL to filter the result:

  • group_id
  • group_code
  • group_title
  • site_id

For example: https://api.mrpeasy.com/rest/v1/stock/inventory?group_id=1&site_id=2

Reports

MRPeasy API provides access to some reports.

To fetch a report, make a GET request to https://api.mrpeasy.com/rest/v1/report/[REPORT_TYPE].

The default period for reports is current month. You can adjust the period by setting dates like https://api.mrpeasy.com/rest/v1/report/[REPORT_TYPE]?from=2024 -01-01&to=2024-01-31. Maximum period length is one month.

The following reports are available:

Type Description
crm/shipped Get the CRM -> Statistics -> "Goods shipped" report.
GET parameters with same names as fields can be added to URL to filter the list. Numeric parameters must have suffixes _min and _max. For example:
https://api.mrpeasy.com/rest/v1/report/crm/shipped?from=2024 -01-01&to=2024-01-31&product_id=[ID]&quantity_min=10.
production/products Get a production plan by products (planned finish date is within the period).
production/coproducts Get a list of co-products that were made during the period.
production/operations Get a list of manufacturing operations that are planned for the period (planned finish date is within the period).

Sample request:

https://api.mrpeasy.com/rest/v1/report/production/products?from=2024 -01-01&to=2024-01-31.

Sample response:

Object (
[from] => 2024-01-01
[to] => 2024 -01-31
[report] => production/products
[data] => Array (...)
)

Webhooks

Webhooks can be configured in Settings - Integration - API access - Webhooks.

A webhook enables MRPeasy to send a request to a provided URL whenever the status of a Customer order, Manufacturing order, Purchase order, or Shipment changes.

To set up a webhook, please provide the following information:

  • URL - the endpoint where the webhook data will be sent.
  • Object - customer, manufacturing, purchase order, or shipment.
  • Action - depending on object, Status changed or Payment status changed events are supported.
  • HTTP auth username - optional, if your URL requires authentication, you can provide the username here.
  • HTTP auth password - optional, along with the username, you can provide the authentication password.

Up to 5 webhooks can be configured in total.

Code sample

Download a sample API client in PHP.

If cUrl is not configured to validate SSL certificates, please uncomment lines 279 and 280.

Troubleshooting

HTTP Response Code 403 returned

The 403 response code is returned when a GET request includes a body or a content-length header.

This commonly occurs when a client employs a single cURL session for multiple requests, and a GET request follows a prior POST or PUT request. By default, cURL accumulates request headers and includes all headers from preceding requests. Consequently, a POST or PUT request appends the content-length header, and the subsequent GET request is transmitted with this unintended header.

To avoid this issue, use the --next option in subsequent requests ( curl_reset in PHP ). This ensures that the headers are appropriately managed, preventing the inadvertent inclusion of headers from previous requests.

Are HTTP header names lowercase or Pascal-Case?

According to HTTP/2 standard, all headers are lowercase.

We use cookies to enhance your experience on our website. If you continue using this website, we assume that you agree with these. Agree Learn more Ok