# Precoro

> Create and update purchase orders and requisitions, approve documents, look up invoices, receipts, expenses, payments, suppliers and catalog items, and follow new and approved documents in Precoro.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/precoro

## Actions

### Add purchase order item

Add an item to a purchase order.

**Inputs**

- Purchase order (`idn`, text, required): The purchase order's number in Precoro (its IDN), such as 16.
- Name (`name`, text, required): The item's name.
- Quantity (`quantity`, number, required): How many to order. At least 0.
- Unit price (`price`, number, required): The price of one. At least 0.
- Unit (`unit`, text): The unit of measure, such as pcs.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "id": 1,
    "name": "example",
    "ordered": 1,
    "price": 1,
    "purchaseOrder": {
      "id": 1
    },
    "status": 1,
    "unit": "example"
  }
}
```

### Approve document

Approve a document waiting for your approval, as the user the API key belongs to.

**Inputs**

- Document type (`document_type`, text, required): The kind of document. One of: `purchaseorders` (Purchase order), `purchaserequisitions` (Purchase requisition), `invoices` (Invoice or credit note), `receipts` (Receipt), `expenses` (Expense), `warehouserequests` (Warehouse request).
- Document (`idn`, text, required): The document's number in Precoro (its IDN), such as 16.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "approvalInfo": {},
    "budgetedSum": 1,
    "createDate": "example",
    "creator": {
      "email": "example",
      "firstname": "example",
      "id": 1,
      "lastname": "example"
    },
    "currency": "example",
    "customName": "example",
    "expenseNumber": "example",
    "externalId": "example",
    "id": 1,
    "idn": "example",
    "invoiceNumber": "example",
    "invoicedSum": 1,
    "isServiceOrder": true,
    "issueDate": "example",
    "items": {
      "data": [
        {
          "currency": "example",
          "description": "example",
          "id": 1,
          "name": "example",
          "ordered": 1,
          "price": 1,
          "received": 1,
          "sku": "example",
          "status": 1,
          "type": 1,
          "unit": "example"
        }
      ]
    },
    "legalEntity": {
      "id": 1,
      "name": "example"
    },
    "location": {
      "id": 1,
      "name": "example"
    },
    "logicType": 1,
    "netSum": 1,
    "note": "example",
    "purchaseOrder": {
      "id": 1,
      "idn": "example"
    },
    "receiptNumber": "example",
    "requiredDate": "example",
    "status": 1,
    "statusPayment": 1,
    "statusReceiving": 1,
    "statusSending": 1,
    "sum": 1,
    "sumPaid": 1,
    "supplier": {
      "id": 1,
      "name": "example"
    },
    "updateDate": "example"
  }
}
```

### Create purchase order

Create a purchase order to a supplier, as a draft, with its items.

**Inputs**

- Supplier (`supplier_id`, text, required): The supplier.
- Location (`location_id`, text, required): The location the goods are for. You must have access to it.
- Currency (`currency`, text, required): The currency. It must be one of your company's currencies. One of: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, and 145 more.
- Needed by (`required_date`, date, required): The date the goods are needed by.
- Items (`items`, list, required): The items to order: each a name, a quantity and a unit price.
- Legal entity (`legal_entity_id`, text): The legal entity. Required when your company uses legal entities.
- Note (`note`, text): A note on the purchase order.
- Custom fields (`custom_fields`, list): Document custom fields to fill in: each the custom field's ID and its value (for a dropdown field, the option's ID). Every required custom field must be filled in.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "id": 1,
    "idn": "example"
  }
}
```

### Create purchase requisition

Create a purchase requisition, a request to buy, as a draft with its items. Submit it for approval with Submit document for approval.

**Inputs**

- Location (`location_id`, text, required): The location the goods are for. You must have access to it.
- Currency (`currency`, text, required): The currency. It must be one of your company's currencies. One of: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, and 145 more.
- Needed by (`required_date`, date, required): The date the goods are needed by.
- Items (`items`, list, required): The items to request: each a quantity, a unit price, and either a name or a catalog item's ID, with the supplier's ID if you know it.
- Legal entity (`legal_entity_id`, text): The legal entity. Required when your company uses legal entities.
- Budget (`budget_id`, text): The budget line to charge.
- Note (`note`, text): A note on the requisition.
- Custom fields (`custom_fields`, list): Document custom fields to fill in: each the custom field's ID and its value (for a dropdown field, the option's ID). Every required custom field must be filled in.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "id": 1,
    "idn": "example"
  }
}
```

### Create supplier

Add a supplier, with a contact if you have one.

**Inputs**

- Name (`name`, text, required): The supplier's name. No two suppliers can share a name.
- Currencies (`currencies`, list): The currencies you buy in from them. One or more of: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, and 145 more.
- Supplier code (`unique_code`, text): Your own code for the supplier. It must be unique.
- Contact email (`contact_email`, text): The contact person's email.
- Contact name (`contact_name`, text): The contact person's name.
- Contact phone (`contact_phone`, text): The contact person's phone.
- Phone (`phone`, text): The supplier's phone number.
- Address (`legal_address`, text): The supplier's street address.
- City (`city`, text): The city.
- State (`state`, text): The state or region, such as NY.
- Postal code (`postal_code`, text): The ZIP or postal code.
- Country (`country`, text): The country. One of: `AD` (Andorra), `AE` (United Arab Emirates), `AF` (Afghanistan), `AG` (Antigua & Barbuda), `AI` (Anguilla), `AL` (Albania), `AM` (Armenia), `AO` (Angola), `AQ` (Antarctica), `AR` (Argentina), and 240 more.
- Tax number type (`tax_payer_type`, text): The kind of tax number. One of: `1` (EIN), `2` (TIN), `3` (Tax ID), `4` (VAT number), `5` (GST).
- Tax number (`tax_payer_number`, text): The tax number.
- Business registration number (`business_registration_number`, text): The business registration number. It must be unique.
- Conditions (`conditions`, text): Payment or delivery conditions to show on orders.
- Delivery days (`delivery_period`, number): How many days delivery usually takes. At least 0.
- Minimum order (`minimum_sum`, number): The smallest order the supplier takes. At least 0.
- Note (`note`, text): A note about the supplier.
- All legal entities (`all_legal_entities`, true/false): Whether every legal entity can buy from this supplier. Leave on unless your company limits suppliers by legal entity. Default: `true`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "city": "example",
    "conditions": "example",
    "contacts": {
      "data": [
        {
          "email": "example",
          "firstName": "example",
          "phone": "example"
        }
      ]
    },
    "country": "example",
    "createDate": "example",
    "currencies": [
      "example"
    ],
    "currency": "example",
    "deliveryPeriod": 1,
    "enable": true,
    "externalId": "example",
    "id": 1,
    "legalAddress": "example",
    "minimumSum": 1,
    "name": "example",
    "note": "example",
    "phone": "example",
    "postalCode": "example",
    "state": "example",
    "status": 1,
    "taxPayerLabel": "example",
    "taxPayerNumber": "example",
    "taxPayerType": 1,
    "uniqueCode": "example",
    "updateDate": "example"
  }
}
```

### Delete purchase order item

Remove an item from a purchase order.

**Inputs**

- Purchase order (`idn`, text, required): The purchase order's number in Precoro (its IDN), such as 16.
- Line ID (`line_id`, number, required): The line's ID, which Add purchase order item returns (the ``id`` of an entry under ``items``). At least 1.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {}
}
```

### Get catalog item

Get an item from your catalog.

**Inputs**

- Item (`item_id`, text, required): The catalog item.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "createDate": "example",
    "currency": "example",
    "description": "example",
    "externalId": "example",
    "hiddenInCatalog": true,
    "id": 1,
    "link": "example",
    "name": "example",
    "price": 1,
    "sku": "example",
    "supplier": {
      "id": 1
    },
    "type": 1,
    "unit": "example",
    "updateDate": "example"
  }
}
```

### Get document

Get a purchase order, purchase requisition, invoice, credit note, receipt, expense or warehouse request by its number, with its items.

**Inputs**

- Document type (`document_type`, text, required): The kind of document. One of: `purchaseorders` (Purchase order), `purchaserequisitions` (Purchase requisition), `invoices` (Invoice or credit note), `receipts` (Receipt), `expenses` (Expense), `warehouserequests` (Warehouse request).
- Document (`idn`, text, required): The document's number in Precoro (its IDN), such as 16.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "approvalInfo": {},
    "budgetedSum": 1,
    "createDate": "example",
    "creator": {
      "email": "example",
      "firstname": "example",
      "id": 1,
      "lastname": "example"
    },
    "currency": "example",
    "customName": "example",
    "expenseNumber": "example",
    "externalId": "example",
    "id": 1,
    "idn": "example",
    "invoiceNumber": "example",
    "invoicedSum": 1,
    "isServiceOrder": true,
    "issueDate": "example",
    "items": {
      "data": [
        {
          "currency": "example",
          "description": "example",
          "id": 1,
          "name": "example",
          "ordered": 1,
          "price": 1,
          "received": 1,
          "sku": "example",
          "status": 1,
          "type": 1,
          "unit": "example"
        }
      ]
    },
    "legalEntity": {
      "id": 1,
      "name": "example"
    },
    "location": {
      "id": 1,
      "name": "example"
    },
    "logicType": 1,
    "netSum": 1,
    "note": "example",
    "purchaseOrder": {
      "id": 1,
      "idn": "example"
    },
    "receiptNumber": "example",
    "requiredDate": "example",
    "status": 1,
    "statusPayment": 1,
    "statusReceiving": 1,
    "statusSending": 1,
    "sum": 1,
    "sumPaid": 1,
    "supplier": {
      "id": 1,
      "name": "example"
    },
    "updateDate": "example"
  }
}
```

### Get supplier

Get a supplier with its contacts and payment details.

**Inputs**

- Supplier (`supplier_id`, text, required): The supplier.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "city": "example",
    "conditions": "example",
    "contacts": {
      "data": [
        {
          "email": "example",
          "firstName": "example",
          "phone": "example"
        }
      ]
    },
    "country": "example",
    "createDate": "example",
    "currencies": [
      "example"
    ],
    "currency": "example",
    "deliveryPeriod": 1,
    "enable": true,
    "externalId": "example",
    "id": 1,
    "legalAddress": "example",
    "minimumSum": 1,
    "name": "example",
    "note": "example",
    "phone": "example",
    "postalCode": "example",
    "state": "example",
    "status": 1,
    "taxPayerLabel": "example",
    "taxPayerNumber": "example",
    "taxPayerType": 1,
    "uniqueCode": "example",
    "updateDate": "example"
  }
}
```

### List budgets

List your budgets with what has been spent and what is left.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "availableSum": 1,
        "createDate": "example",
        "endDate": "example",
        "fullName": "example",
        "id": 1,
        "name": "example",
        "parentBudgetId": 1,
        "startDate": "example",
        "sum": 1,
        "type": 1
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List catalog items

List the items in your catalog, oldest first, optionally only those added or changed since a time.

**Inputs**

- Changed since (`modified_since`, date and time): Only items added or changed since this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "createDate": "example",
        "currency": "example",
        "description": "example",
        "externalId": "example",
        "hiddenInCatalog": true,
        "id": 1,
        "link": "example",
        "name": "example",
        "price": 1,
        "sku": "example",
        "supplier": {
          "id": 1
        },
        "type": 1,
        "unit": "example",
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List expenses

List expenses, oldest first, filtered by when they changed or were approved, or by status.

**Inputs**

- Changed since (`modified_since`, date and time): Only records created or changed since this time.
- Statuses (`statuses`, list): Only documents in these statuses. Leave empty for every status. One or more of: `0` (Open (draft)), `1` (Pending approval), `2` (Approved), `3` (Rejected), `4` (Partly paid), `5` (Paid), `7` (In revision), `8` (Canceled), `10` (Approval review), `11` (Closed).
- Approved after (`approved_after`, date and time): Only documents approved at or after this time.
- Approved before (`approved_before`, date and time): Only documents approved before this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "currency": "example",
        "customName": "example",
        "expenseNumber": "example",
        "id": 1,
        "idn": "example",
        "issueDate": "example",
        "legalEntity": {
          "id": 1,
          "name": "example"
        },
        "location": {
          "id": 1,
          "name": "example"
        },
        "netSum": 1,
        "note": "example",
        "requiredDate": "example",
        "status": 1,
        "sum": 1,
        "sumPaid": 1,
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List invoices

List invoices and credit notes, oldest first, filtered by when they changed or were approved, their status or their type.

**Inputs**

- Changed since (`modified_since`, date and time): Only records created or changed since this time.
- Statuses (`statuses`, list): Only documents in these statuses. Leave empty for every status. One or more of: `0` (Open (draft)), `1` (Pending approval), `2` (Approved), `3` (Rejected), `4` (Partly paid), `5` (Paid), `6` (Awaiting confirmation), `7` (In revision), `8` (Canceled), `9` (Pending receipt), `10` (Approval review), `11` (Closed).
- Types (`types`, list): Only these kinds. Choose Credit note for credit notes alone. Leave empty for every kind. One or more of: `0` (Standard invoice), `1` (Credit note), `2` (Invoice from a purchase order), `3` (Recurring invoice), `4` (Invoice from a service order).
- Approved after (`approved_after`, date and time): Only documents approved at or after this time.
- Approved before (`approved_before`, date and time): Only documents approved before this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "currency": "example",
        "customName": "example",
        "externalId": "example",
        "id": 1,
        "idn": "example",
        "invoiceNumber": "example",
        "issueDate": "example",
        "legalEntity": {
          "id": 1,
          "name": "example"
        },
        "location": {
          "id": 1,
          "name": "example"
        },
        "logicType": 1,
        "netSum": 1,
        "note": "example",
        "purchaseOrder": {
          "id": 1,
          "idn": "example"
        },
        "requiredDate": "example",
        "status": 1,
        "sum": 1,
        "sumPaid": 1,
        "supplier": {
          "id": 1,
          "name": "example"
        },
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List legal entities

List your company's legal entities.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "businessRegistrationNumber": "example",
        "createDate": "example",
        "id": 1,
        "legalAddress": "example",
        "name": "example",
        "phone": "example",
        "taxPayerNumber": "example",
        "taxPayerType": 1
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List locations

List your company's locations.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "createDate": "example",
        "fullAddress": "example",
        "id": 1,
        "name": "example",
        "phone": "example",
        "uniqueCode": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List payments

List payments made on invoices and purchase orders, oldest first.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "externalId": "example",
        "id": 1,
        "idn": "example",
        "invoice": {
          "id": 1,
          "idn": "example"
        },
        "logicType": 1,
        "payDate": "example",
        "purchaseOrder": {
          "id": 1,
          "idn": "example"
        },
        "status": 1,
        "sumPaid": 1
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List purchase orders

List purchase orders, oldest first, filtered by when they changed or were approved, their status or their type.

**Inputs**

- Changed since (`modified_since`, date and time): Only records created or changed since this time.
- Statuses (`statuses`, list): Only documents in these statuses. Leave empty for every status. One or more of: `0` (Open (draft)), `1` (Pending approval), `2` (Approved), `3` (Rejected), `4` (Stopped (blanket order)), `5` (Purchased), `6` (Awaiting confirmation), `7` (In revision), `8` (Canceled), `10` (Approval review), `11` (Closed).
- Types (`types`, list): Only purchase orders of these types. Leave empty for every type. One or more of: `0` (Standard), `1` (Blanket), `2` (From requisitions), `3` (Recurring), `4` (Blanket per total), `5` (Service), `6` (Recurring service), `7` (Service from requisitions).
- Approved after (`approved_after`, date and time): Only documents approved at or after this time.
- Approved before (`approved_before`, date and time): Only documents approved before this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "currency": "example",
        "customName": "example",
        "externalId": "example",
        "id": 1,
        "idn": "example",
        "invoicedSum": 1,
        "isServiceOrder": true,
        "legalEntity": {
          "id": 1,
          "name": "example"
        },
        "location": {
          "id": 1,
          "name": "example"
        },
        "logicType": 1,
        "netSum": 1,
        "note": "example",
        "requiredDate": "example",
        "status": 1,
        "statusPayment": 1,
        "statusReceiving": 1,
        "statusSending": 1,
        "sum": 1,
        "supplier": {
          "id": 1,
          "name": "example"
        },
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List purchase requisitions

List purchase requisitions, oldest first, filtered by when they changed or were approved, or by status.

**Inputs**

- Changed since (`modified_since`, date and time): Only records created or changed since this time.
- Statuses (`statuses`, list): Only documents in these statuses. Leave empty for every status. One or more of: `0` (Open (draft)), `1` (Pending approval), `2` (Approved), `3` (Rejected), `5` (Purchased), `7` (In revision), `8` (Canceled), `10` (Approval review), `11` (Closed).
- Approved after (`approved_after`, date and time): Only documents approved at or after this time.
- Approved before (`approved_before`, date and time): Only documents approved before this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "budgetedSum": 1,
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "currency": "example",
        "customName": "example",
        "id": 1,
        "idn": "example",
        "legalEntity": {
          "id": 1,
          "name": "example"
        },
        "location": {
          "id": 1,
          "name": "example"
        },
        "note": "example",
        "requiredDate": "example",
        "status": 1,
        "sum": 1,
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List receipts

List receipts of delivered goods, oldest first, filtered by when they changed or were approved, or by status.

**Inputs**

- Changed since (`modified_since`, date and time): Only records created or changed since this time.
- Statuses (`statuses`, list): Only documents in these statuses. Leave empty for every status. One or more of: `0` (Open (draft)), `1` (Pending approval), `2` (Approved), `3` (Rejected), `6` (Awaiting confirmation), `7` (In revision), `8` (Canceled), `10` (Approval review), `11` (Closed).
- Approved after (`approved_after`, date and time): Only documents approved at or after this time.
- Approved before (`approved_before`, date and time): Only documents approved before this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "createDate": "example",
        "creator": {
          "email": "example",
          "firstname": "example",
          "id": 1,
          "lastname": "example"
        },
        "currency": "example",
        "customName": "example",
        "externalId": "example",
        "id": 1,
        "idn": "example",
        "legalEntity": {
          "id": 1,
          "name": "example"
        },
        "location": {
          "id": 1,
          "name": "example"
        },
        "note": "example",
        "purchaseOrder": {
          "id": 1,
          "idn": "example"
        },
        "receiptNumber": "example",
        "requiredDate": "example",
        "status": 1,
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List suppliers

List your suppliers, oldest first, optionally only those added or changed since a time.

**Inputs**

- Changed since (`modified_since`, date and time): Only suppliers added or changed since this time.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "approvalDate": "example",
        "city": "example",
        "conditions": "example",
        "contacts": {
          "data": [
            {
              "email": "example",
              "firstName": "example",
              "phone": "example"
            }
          ]
        },
        "country": "example",
        "createDate": "example",
        "currencies": [
          "example"
        ],
        "currency": "example",
        "deliveryPeriod": 1,
        "enable": true,
        "externalId": "example",
        "id": 1,
        "legalAddress": "example",
        "minimumSum": 1,
        "name": "example",
        "note": "example",
        "phone": "example",
        "postalCode": "example",
        "state": "example",
        "status": 1,
        "taxPayerLabel": "example",
        "taxPayerNumber": "example",
        "taxPayerType": 1,
        "uniqueCode": "example",
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### List users

List the users in your company.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.
- Results per page (`per_page`, text): How many results to return on a page. Leave empty for Precoro's default. One of: `10`, `20`, `50`, `100`, `200`.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "createDate": "example",
        "email": "example",
        "firstname": "example",
        "id": 1,
        "lastname": "example",
        "locale": "example",
        "location": {
          "id": 1
        },
        "phone": "example",
        "position": "example",
        "updateDate": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "current_page": 1,
        "has_next_page": true,
        "links": {
          "next": "example",
          "previous": "example"
        },
        "per_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}
```

### Reject document

Reject a document waiting for your approval, as the user the API key belongs to.

**Inputs**

- Document type (`document_type`, text, required): The kind of document. One of: `purchaseorders` (Purchase order), `purchaserequisitions` (Purchase requisition), `invoices` (Invoice or credit note), `receipts` (Receipt), `expenses` (Expense), `warehouserequests` (Warehouse request).
- Document (`idn`, text, required): The document's number in Precoro (its IDN), such as 16.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "approvalInfo": {},
    "budgetedSum": 1,
    "createDate": "example",
    "creator": {
      "email": "example",
      "firstname": "example",
      "id": 1,
      "lastname": "example"
    },
    "currency": "example",
    "customName": "example",
    "expenseNumber": "example",
    "externalId": "example",
    "id": 1,
    "idn": "example",
    "invoiceNumber": "example",
    "invoicedSum": 1,
    "isServiceOrder": true,
    "issueDate": "example",
    "items": {
      "data": [
        {
          "currency": "example",
          "description": "example",
          "id": 1,
          "name": "example",
          "ordered": 1,
          "price": 1,
          "received": 1,
          "sku": "example",
          "status": 1,
          "type": 1,
          "unit": "example"
        }
      ]
    },
    "legalEntity": {
      "id": 1,
      "name": "example"
    },
    "location": {
      "id": 1,
      "name": "example"
    },
    "logicType": 1,
    "netSum": 1,
    "note": "example",
    "purchaseOrder": {
      "id": 1,
      "idn": "example"
    },
    "receiptNumber": "example",
    "requiredDate": "example",
    "status": 1,
    "statusPayment": 1,
    "statusReceiving": 1,
    "statusSending": 1,
    "sum": 1,
    "sumPaid": 1,
    "supplier": {
      "id": 1,
      "name": "example"
    },
    "updateDate": "example"
  }
}
```

### Submit document for approval

Send a draft document, such as a new purchase requisition, on to its approval process.

**Inputs**

- Document type (`document_type`, text, required): The kind of document. One of: `purchaseorders` (Purchase order), `purchaserequisitions` (Purchase requisition), `invoices` (Invoice or credit note), `receipts` (Receipt), `expenses` (Expense), `warehouserequests` (Warehouse request).
- Document (`idn`, text, required): The document's number in Precoro (its IDN), such as 16.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "approvalDate": "example",
    "approvalInfo": {},
    "budgetedSum": 1,
    "createDate": "example",
    "creator": {
      "email": "example",
      "firstname": "example",
      "id": 1,
      "lastname": "example"
    },
    "currency": "example",
    "customName": "example",
    "expenseNumber": "example",
    "externalId": "example",
    "id": 1,
    "idn": "example",
    "invoiceNumber": "example",
    "invoicedSum": 1,
    "isServiceOrder": true,
    "issueDate": "example",
    "items": {
      "data": [
        {
          "currency": "example",
          "description": "example",
          "id": 1,
          "name": "example",
          "ordered": 1,
          "price": 1,
          "received": 1,
          "sku": "example",
          "status": 1,
          "type": 1,
          "unit": "example"
        }
      ]
    },
    "legalEntity": {
      "id": 1,
      "name": "example"
    },
    "location": {
      "id": 1,
      "name": "example"
    },
    "logicType": 1,
    "netSum": 1,
    "note": "example",
    "purchaseOrder": {
      "id": 1,
      "idn": "example"
    },
    "receiptNumber": "example",
    "requiredDate": "example",
    "status": 1,
    "statusPayment": 1,
    "statusReceiving": 1,
    "statusSending": 1,
    "sum": 1,
    "sumPaid": 1,
    "supplier": {
      "id": 1,
      "name": "example"
    },
    "updateDate": "example"
  }
}
```

### Update purchase order

Change a purchase order's date, supplier, legal entity, note or custom fields.

**Inputs**

- Purchase order (`idn`, text, required): The purchase order's number in Precoro (its IDN), such as 16.
- Needed by (`required_date`, date): A new date the goods are needed by.
- Supplier (`supplier_id`, text): A new supplier.
- Legal entity (`legal_entity_id`, text): The legal entity. Required when your company uses legal entities.
- Note (`note`, text): A new note.
- Custom fields (`custom_fields`, list): Document custom fields to fill in: each the custom field's ID and its value (for a dropdown field, the option's ID). Every required custom field must be filled in.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "id": 1,
    "idn": "example",
    "location": {
      "id": 1,
      "name": "example"
    },
    "note": "example",
    "requiredDate": "example",
    "status": 1,
    "supplier": {
      "id": 1,
      "name": "example"
    }
  }
}
```

### Update purchase order item

Change the quantity or price of an item on a purchase order.

**Inputs**

- Purchase order (`idn`, text, required): The purchase order's number in Precoro (its IDN), such as 16.
- Line ID (`line_id`, number, required): The line's ID, which Add purchase order item returns (the ``id`` of an entry under ``items``). At least 1.
- Quantity (`quantity`, number): The new quantity. At least 0.
- Unit price (`price`, number): The new price of one. At least 0.

**Outputs**

- `data` (object): The response from Precoro.

**Example output**

```json
{
  "data": {
    "id": 1,
    "ordered": 1,
    "price": 1,
    "status": 1
  }
}
```
