ioi API

Mise à jour le 18 septembre 2026·

Request

The ioi API lets you use the following ioi classes:

  • ioi Customer,
  • ioi Supplier,
  • ioi Item,
  • ioi Sales Quote,
  • ioi Sales Order,
  • ioi Sales Delivery,
  • ioi Sales Invoice,
  • ioi Purchases Price Request,
  • ioi Purchases Order,
  • ioi Purchases Receipt,
  • ioi Purchases Invocie.

→ It works on the same principle as FRAPPE’s REST API: https://frappeframework.com/docs/user/en/api/rest

Authentication and permissions #

Same principles as the FRAPPE REST API.

→ For Authentication:

  1. Token Based Authentication,
  2. Password Based Authentication,
  3. Access Token.

→ For permissions, based on user permissions per doctype (Basic).

Body structure #

→ Type: Body raw of type json.

Example :

{
    "mandatory_field": "ID",
    "my_data":{
        ""overriding_field": "DATE"
    },
    "line_detail": [{
           "mandatory_field": "ITEM",
           "my_data": {
                "overriding_field": "PRICE"
           }
        }
    ]
}

→ One of the advantages of using classes is to benefit from object populates.

Example: When a customer’s reference is entered, all fields concerning this customer will be populated with the customer’s populate.

→ In addition, any data found in the “my_data” object will overwrite the populate data.

Example: If we have a customer populate but still want to force the Sales Condition value, we’ll need to indicate :

    "my_data":{
        "sales_condition_id": "NORMAL"
    }

The “line_detail” object is a table intended for detail lines. It only concerns Sales and Purchases documents. The principle explained above is the same for detail lines. To sum up:

  • In the “main” object: Mandatory fields and fields that will trigger a populate.
  • In the “my_data” object: all other fields.
  • In the “line_detail” table: detail lines.

Populate list #

Customer/Supplier #

  • full_name
  • mode
  • postal_code_id
  • Sales / Purchases documents

Header:

  • document_date
  • period_id
  • order_customer_id / order_supplier_id
  • order_customer_contact_id order_supplier_contact_id
  • delivery_customer_id / delivery_supplier_id
  • delivery_customer_contact_id / delivery_supplier_contact_id
  • invoice_customer_id / invoice_supplier_id
  • invoice_customer_contact_id / invoice_supplier_contact_id
  • currency_id
  • currency_rate
  • currency_rate_inv
  • cashdesk_id

Detail:

  • sales_condition_id / purchases_condition_id

  • item_id

  • manufacter_ref

  • unit_id

  • unit_price

  • fixed_price

  • Base_discount

  • extra_discount

  • value_discount

  • unit_price_tvac

  • account_id

  • vat_type

  • vat_service

  • vat_matching_id

  • vat_rate

  • vatcode_id

  • warehouse_id

CRUD Operations #

Create #

Method: POST

Request: api/method/silicon_ioi.api.resource/:doctype

ioi Customer #

Request: api/method/silicon_ioi.api.resource/ioi Customer

→ Body:

{
    "identification": "ACE",
    "ioistatus": 4,
    "full_name": "ACE SA",
    "my_data":{
        "address": "Avenue Louise 222",
        "city": "Brussel",
        "postal_code": "1010",
        "country_id": "FR",
        "phone_1": "02\/758.25.69",
        "email": "info@ace.be",
        "language": "fr",
        "currency_id": "EUR",
        "family_1_id": "INDUSTRIE",
        "payment_term_id": "30,J",
        "general_memo": "<!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\">\n<html>\n<head>\n<title><\/title>\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\">\n<\/head>\n\n<body>\n\n<div align=\"left\"><font face=\"Courier new\" size=\"2\" color=\"#000000\"><u><i><b>TEST Rtf<br><\/b><\/i><\/u>\n<\/div>\n<div align=\"center\">je test la conversio du rtf en hml via la dll<\/font><\/div>\n<\/body>\n<\/html>",
        "vat_number": "BE432-112-630",
        "dimension_type": "N",
        "website": "www.ace.be",
        "delivery_condition_id": "EXWORKS",
        "delivery_copy": 1,
        "invoice_copy": 1,
        "mode": 2,
        "id_ioi": "ACE",
        "last_sync_dt_ioi": "2023-04-26T13:25:06.210Z",
        "sync_dt_ioi": "2023-04-24T09:36:39.923Z"
    }
}

ioi Sales Order #

Request: api/method/silicon_ioi.api.resource/ioi Sales Order

→ Body:

{
    "prefix_id": "CMD",
    "document_date": "2023-10-12",
    "ioistatus": 1,
    "order_customer_id": "VOLVO",
    "delivery_customer_id": "GARDENANS",
    "invoice_customer_id": "GARDENANS",
    "currency_id": "EUR",
    "my_data":{
        "sales_condition_id": "DISTRIB",
        "delivery_condition_id": "NORMAL",
        "language": "fr",
        "external_ref": "TEST external ref",
        "shipping_datetime": "2023-10-16 23:00:11.000",
        "expected_arrival_on": "2023-10-23",
        "responsible_id": "Administrator",
        "base_discount": 0,
        "extra_discount": 0,
        "financial_discount": 0,
        "vat_type": "NAT",
        "spec_vat_rate": 21,
        "wo_vat1": 810,
        "wo_vat2": 0,
        "wo_vat3": 0,
        "wo_vat4": 0,
        "wo_vat5": 0,
        "base_vat1": 810,
        "base_vat2": 0,
        "base_vat3": 0,
        "base_vat4": 0,
        "base_vat5": 0,
        "vat_type1": "NAT",
        "rate_vat1": 21,
        "rate_vat2": 0,
        "rate_vat3": 0,
        "rate_vat4": 0,
        "rate_vat5": 0,
        "vat1": 170.1,
        "vat2": 0,
        "vat3": 0,
        "vat4": 0,
        "vat5": 0,
        "inc_vat1": 980.1,
        "inc_vat2": 0,
        "inc_vat3": 0,
        "inc_vat4": 0,
        "inc_vat5": 0,
        "sales_agent_id": "ANDRE",
        "credit_mode": 0,
        "payment_term_id": "FDM,30,J",
        "asked_arrival_date": "2015-10-13"
    },
    "line_detail": [{
           "sales_condition_id": "DISTRIB",
           "item_id": "B02-LAWNMOWER",
           "unit_id": "PCS",
           "ordered_qty": 1,
           "unit_price": 1350,
           "unit_price_tvac": 1633.5,
           "base_discount": 10,
           "extra_discount": 5,
           "value_discount":5,
           "vat_type": "NAT",
           "vat_service": "G",
           "vat_rate": 21,
           "my_data": {
                "expected_arrival_on": "2023-10-20 12:30:45",
                "warehouse_id": "BXL",
                "to_execute": 0,
                "shipping_datetime": "2023-10-15 18:57:11.000",
                "weight": 1000,
                "external_ref": 10,
                "item_cost": 572.22,
                "item_cost_std_stamp": 485.293105,
                "value_paid": 810,
                "barcode_reference": "1234567001609",
                "reserved_qty": 10,
                "free_part_qty": 0
           }
        }
    ]
}

Read #

Method: GET

Request: api/method/silicon_ioi.api.resource/:doctype/:name

ioi Customer #

Request: api/method/silicon_ioi.api.resource/silicon_ioi.api.resource/ACE

→ Body:

{
    "data": {
        "name": "ACE",
        "owner": "Administrator",
        "creation": "2023-10-25 14:29:39.937475",
        "modified": "2023-10-25 14:29:40.216554",
        "modified_by": "Administrator",
        "docstatus": 0,
        "idx": 0,
        "is_warning": 0,
        "warninfo": "",
        "identification": "ACE",
        "id_prefix": null,
        "id_number": 0,
        "lib_ioistatus": "Active",
        "full_name": "ACE SA",
        "language": "en",
        "supplier_id": null,
        "mode": "0",
        "currency_id": "EUR",
        "address": null,
        "postal_code_id": null,
        "latitude": 0.0,
        "postal_code": "1000",
        "city": "Brussel",
        "longitude": 0.0,
        "country_id": "FR",
        "contact_title": null,
        "contact_lastname": null,
        "contact_firstname": null,
        "phone_1": "02/758.25.69",
        "email": "info@ace.be",
        "phone_2": null,
        "website": "www.ace.be",
        "select_image": null,
        "vat_number": "BE432-112-630",
        "external_reference": null,
        "vat_matching_id": null,
        "duns_number": null,
        "vat_type": "NAT",
        "payment_term_id": "30,J",
        "payment_reminder_category_id": null,
        "payment_last_reminder_date": null,
        "payment_last_reminder_level": 0,
        "payment_reminder_last_level": null,
        "accounting_collective_account_id": null,
        "accounting_default_account_id": null,
        "specific_vat_code_id": null,
        "financial_discount": 0.0,
        "financial_delay": 0,
        "financial_discount_mode": "0",
        "domiciliation_sign_date": null,
        "domiciliation_active": 0,
        "domiciliation_id": null,
        "domiciliation_type": null,
        "sales_catalog_id": "STANDARD",
        "sales_condition_id": "NORMAL",
        "specific_condition_id": null,
        "delivery_condition_id": "EXWORKS",
        "delivery_delay": 0,
        "base_discount": 0.0,
        "extra_discount": 0.0,
        "sales_agent_id": null,
        "default_order_to": null,
        "delivery_flow": "0",
        "default_deliver_to": null,
        "default_invoice_to": null,
        "end_user_id": null,
        "not_for_order": 0,
        "invoice_mode": "PAPER",
        "summary_invoice": 0,
        "not_for_delivery": 0,
        "invoice_email": null,
        "delivery_copy": 1,
        "edi_identification": null,
        "not_for_invoice": 0,
        "invoice_format": "PDF",
        "invoice_copy": 1,
        "document_calc_mode": "0",
        "batch_invoice_grouping_mode": "0",
        "batch_invoice_grouping_cadency": 0,
        "batch_invoice_grouping_except_bo": 0,
        "family_1_id": "INDUSTRIE",
        "family_2_id": null,
        "marketing_action_disabled": 0,
        "activity_summary": "",
        "sector_summary": "",
        "sla_category_id": null,
        "geographic_index_id": null,
        "distance": 0,
        "visible": 0,
        "sale_name": null,
        "vweb": null,
        "id_nav": null,
        "ioistatus": "2",
        "imported_data": 1,
        "ioiuserstatus": "0",
        "lib_ioiuserstatus": null,
        "accounting_memo": null,
        "general_memo": "\n\n\n<title></title>\n<meta content=\"text/html; charset=iso-8859-1\">\n\n\n\n\n<div align=\"left\"><font color=\"#000000\" face=\"Courier new\" size=\"2\"><u><i><b>TEST Rtf<br></b></i></u>\n</font></div><font color=\"#000000\" face=\"Courier new\" size=\"2\">\n</font><div align=\"center\"><font color=\"#000000\" face=\"Courier new\" size=\"2\">je test la conversio du rtf en hml via la dll</font></div>\n\n",
        "reconciliation_number": 0,
        "doctype": "ioi Customer",
        "bank_detail": [],
        "activity_detail": [],
        "sector_detail": [],
        "preconfigured_imputations": [],
        "cust_discount_detail": []
    }
}

ioi Sales Order #

Request: api/method/silicon_ioi.api.resource/silicon_ioi.api.resource/ioi Sales Order?filters=[[“order_customer_id”,“=”,“GARDENANS”]]&fields=[“name”, “total_htva”, “currency_id”]

→ Body:

{
    "data": [
        {
            "name": "CMD • 2020000040",
            "total_htva": 36000.0,
            "currency_id": "EUR"
        },
        {
            "name": "CMD • 2020000055",
            "total_htva": 19980.0,
            "currency_id": "EUR"
        },
        {
            "name": "CMD • 2020000071",
            "total_htva": 600.0,
            "currency_id": "EUR"
        },
        {
            "name": "ORD • 2020000027",
            "total_htva": 133.88,
            "currency_id": "EUR"
        },
        {
            "name": "ORD • 2020000042",
            "total_htva": 918.0,
            "currency_id": "EUR"
        }
    ]
}

Update #

Method: PUT

Request: api/method/silicon_ioi.api.resource/:doctype/:name

ioi Customer #

Request: api/method/silicon_ioi.api.resource/ioi Customer/ACE

→ Body:

{
    "my_data":
        {
        "city": "Brussel",
        "postal_code": "1000",
        "country_id": "BE"
        }
}

ioi Sales Order #

Request: api/method/silicon_ioi.api.resource/ioi Sales Order/CMD • 2020000087

→ Body:

{
    "document_date": "2050-10-12",
    "order_customer_id": "GARDENANS",
    "line_detail":[{
        "name": "d2c19403c1",
        "unit_price": 1400,
        "my_data": {
            "weight": 1100
        }
    }
    ]
}

Delete #

Method: DELETE

Request: api/method/silicon_ioi.api.resource/:doctype/:name

ioi Customer #

Request: api/method/silicon_ioi.api.resource/ioi Customer/ACE

→ Response:

{
    "message": "ok"
}

ioi Sales Order #

Request: api/method/silicon_ioi.api.resource/ioi Sales Order/CMD • 2020000087

→ Response:

{
    "message": "ok"
}

Change status #

Method: POST

Request: api/method/silicon_ioi.api.resource/:doctype/:name?run_method=change_status

→ Body:

{
    "ioistatus": 2
}

Change user status #

Method: POST

Request: api/method/silicon_ioi.api.resource/:doctype/:name?run_method= change_user_status

→ Body:

{
    "ioiuserstatus": 2
}

Specific methods #

It is also possible to create a document from another.

Method: POST

Request: api/method/silicon_ioi.api.resource/:doctype/:name?run_method=method_name

→ Notes: normally no parameters are required in the body to use these methods, with 2 exceptions for create_delivery and add_lines_to_delivery in which the qty_rule parameter must also be specified (see example). The following are the accepted values for qty_rule:

  • 1: Fill limited to site stock,
  • 2: Fill limited to available,
  • 3: Fill limited to scheduled available (default),
  • 5: Fill with order qty.

Creation of a delivery from an order #

Request: api/method/silicon_ioi.api.resource/ioi Sales Order/CMD - 2020000087?run_method=create_delivery

→ Body:

{
    "qty_rule": 3
}

Add a detail line to a delivery from an Order #

Query: api/method/silicon_ioi.api.resource/ioi Sales Order/CMD - 2020000087?run_method=add_lines_to_delivery

→ Body:

{
    "name": "LIV • 2020000054",
    "qty_rule": 3
}

List of specific methods #

ioi Sales/Purchases Quote #

  • create_order
  • add_lines_to_order

ioi Sales Order #

  • create_delivery
  • add_lines_to_delivery
  • create_invoice
  • add_lines_to_invoice

ioi Purchases Order #

  • create_receipt
  • add_lines_to_receipt
  • create_invoice
  • add_lines_to_invoice

ioi Sales/Purchases Delivery/Receipt #

  • create_invoice
  • add_lines_to_invoice

Contract #

To create a contact, add the document_type: CONTRACT parameter to the main object of the ioi Sales Quote doctype.

Method: POST

Request: api/method/silicon_ioi.api.resource/ioi Sales Quote

→ Body :

{
    "prefix_id": "CTC",
    "document_date": "2023-10-12",
    "ioistatus": 1,
    "order_customer_id": "ASMA",
    "delivery_customer_id": "ASMA",
    "invoice_customer_id": "ASMA",
    "currency_id": "EUR",
    "document_type": "CONTRACT",
    "my_data":{
        "sales_condition_id": "NORMAL",
        "sales_catalog_id": "STANDARD",
        "delivery_condition_id": "NORMAL",
        "language": "fr",
        "external_ref": "TEST external ref",
        "shipping_datetime": "2023-10-16 23:00:11.000",
        "expected_arrival_on": "2023-10-23",
        "responsible_id": "Administrator",
        "base_discount": 0,
        "extra_discount": 0,
        "financial_discount": 0,
        "vat_type": "NAT",
        "wo_vat1": 810,
        "wo_vat2": 0,
        "wo_vat3": 0,
        "wo_vat4": 0,
        "wo_vat5": 0,
        "base_vat1": 810,
        "base_vat2": 0,
        "base_vat3": 0,
        "base_vat4": 0,
        "base_vat5": 0,
        "vat_type1": "NAT",
        "rate_vat1": 21,
        "rate_vat2": 0,
        "rate_vat3": 0,
        "rate_vat4": 0,
        "rate_vat5": 0,
        "vat1": 170.1,
        "vat2": 0,
        "vat3": 0,
        "vat4": 0,
        "vat5": 0,
        "inc_vat1": 980.1,
        "inc_vat2": 0,
        "inc_vat3": 0,
        "inc_vat4": 0,
        "inc_vat5": 0,
        "sales_agent_id": "ANDRE",
        "credit_mode": 0,
        "payment_term_id": "FDM,30,J",
        "asked_arrival_date": "2015-10-13"
    },
    "line_detail": [{
           "item_id": "B02-LAWNMOWER",
           "unit_id": "PCS",
           "quoted_qty": 5,
           "my_data": {
                "expected_arrival_on": "2023-10-20 12:30:45",
                "warehouse_id": "BXL",
                "spec_vat_rate": 21,
                "to_execute": 0,
                "shipping_datetime": "2023-10-15 18:57:11.000",
                "weight": 1000,
                "external_ref": 10,
                "item_cost": 572.22,
                "item_cost_std_stamp": 485.293105,
                "value_paid": 810,
                "barcode_reference": "1234567001609",
                "reserved_qty": 10,
                "free_part_qty": 0
           }
        }
    ]
}

Credit Note #

To create a credit note, add the parameter document_type: CNOTE to the main object of the ioi Sales Invoice doctype.

Method: POST

Request: api/method/silicon_ioi.api.resource/ioi Sales Invoice

→ Body :

{
    "prefix_id": "NDC",
    "document_date": "2023-10-12",
    "ioistatus": 1,
    //"order_customer_id": "VOLVO",
//    "delivery_customer_id": "ASMA",
    "invoice_customer_id": "ASMA",
    "document_type": "CNOTE",
    "currency_id": "EUR",
    "my_data":{
        "sales_condition_id": "DISTRIB",
        "sales_catalog_id": "STANDARD",
        "delivery_condition_id": "NORMAL",
        "language": "fr",
        "external_ref": "TEST external ref",
        "shipping_datetime": "2023-10-16 23:00:11.000",
        "expected_arrival_on": "2023-10-23",
        "responsible_id": "Administrator",
        "base_discount": 0,
        "extra_discount": 0,
        "financial_discount": 0,
        "vat_type": "NAT",
        "wo_vat1": 810,
        "wo_vat2": 0,
        "wo_vat3": 0,
        "wo_vat4": 0,
        "wo_vat5": 0,
        "base_vat1": 810,
        "base_vat2": 0,
        "base_vat3": 0,
        "base_vat4": 0,
        "base_vat5": 0,
        "vat_type1": "NAT",
        "rate_vat1": 21,
        "rate_vat2": 0,
        "rate_vat3": 0,
        "rate_vat4": 0,
        "rate_vat5": 0,
        "vat1": 170.1,
        "vat2": 0,
        "vat3": 0,
        "vat4": 0,
        "vat5": 0,
        "inc_vat1": 980.1,
        "inc_vat2": 0,
        "inc_vat3": 0,
        "inc_vat4": 0,
        "inc_vat5": 0,
        "sales_agent_id": "ANDRE",
        "credit_mode": 0,
        "payment_term_id": "FDM,30,J",
        "asked_arrival_date": "2015-10-13"
    },
    "line_detail": [{
        "sales_condition_id": "DISTRIB",
        "sales_catalog_id": "STANDARD",
           "item_id": "B02-LAWNMOWER",
           "unit_id": "PCS",
           "invoiced_qty": 1,
//           "unit_price": 1350,
//            "vat_type": "NAT",
            "vat_rate": 21,
//            "vat_code":
           "my_data": {
                "expected_arrival_on": "2023-10-20 12:30:45",
                "warehouse_id": "BXL",
                "spec_vat_rate": 21,
                "to_execute": 0,
                "shipping_datetime": "2023-10-15 18:57:11.000",
                "weight": 1000,
                "value_paid": 810,
                "barcode_reference": "1234567001609",
                "reserved_qty": 0,
                "free_part_qty": 0
           }
        }
    ]
}

Cette page vous a-t-elle aidé ?