# Apicbase

> Manage a food and beverage library: recipes, ingredients and suppliers, purchase orders, invoices, deliveries and waste.

App · 29 actions. Web page: https://docs.lodol.com/docs/integrations/apicbase

## Actions

### Create ingredient

Add an ingredient to the library.

**Inputs**

- Name (`name`, text, required): The ingredient's name.
- Short name (`short_name`, text): A short name.
- Reference number (`internal_uid`, text): Your reference number for it.
- External ID (`external_uid`, text): An outside system's ID.
- Description (`description`, text): Description.
- Brand (`brand`, text): Brand.
- Category (`category`, text): Category, such as Dairy.
- Subcategory (`subcategory`, text): Subcategory, such as Milk.
- Accounting category (`accounting_category`, text): Accounting category.
- Storage instructions (`storage_instructions`, text): How to store it.
- Shelf life (`shelf_life`, text): How long it keeps.
- Approved (`approved`, true/false): Whether it's approved.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": "example",
    "instance": "example"
  }
}
```

### Create invoice

Record a supplier's invoice against one or more purchase orders.

**Inputs**

- Outlet (`outlet`, text, required): The outlet the invoice is for.
- Supplier (`supplier`, text, required): The supplier who sent it.
- Invoice number (`invoice_number`, text, required): The invoice's number.
- Purchase orders (`purchase_orders`, list, required): The purchase orders it bills, by ID.
- Invoice date (`invoice_date`, date, required): The date on the invoice.
- Due date (`due_date`, date): When it's due.
- Total (`total_amount`, number, required): The invoice total.
- Credit note (`is_credit_note`, true/false): Whether it's a credit note.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "approval_status": "example",
    "approved_by": {
      "id": "example",
      "name": "example"
    },
    "created_at": "example",
    "created_by": {
      "id": "example",
      "name": "example"
    },
    "due_date": "example",
    "id": "example",
    "invoice_date": "example",
    "invoice_number": "example",
    "is_credit_note": true,
    "outlet": {
      "id": "example",
      "name": "example"
    },
    "processing_status": "example",
    "purchase_orders": [
      {
        "id": "example",
        "order_number": "example"
      }
    ],
    "purchase_orders_total_amount": "example",
    "supplier": {
      "id": "example",
      "internal_supplier_id": "example",
      "name": "example"
    },
    "total_amount": "example",
    "total_amount_difference": "example",
    "total_amount_sentence": "example",
    "updated_at": "example"
  }
}
```

### Create purchase order

Start a purchase order for an outlet with one supplier package. It stays In progress until it's sent from Apicbase.

**Inputs**

- Outlet (`outlet`, text, required): The outlet that orders.
- Supplier package (`supplier_package`, text, required): The supplier package to order (its ID).
- Quantity (`quantity`, number): How many packages. At least 0.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "purchase_orders": [
      {
        "delivery_closed": true,
        "expected_delivery_date": "example",
        "id": "example",
        "invoice_number": "example",
        "invoice_status": "example",
        "order_number": "example",
        "order_remarks": "example",
        "ordered_on": "example",
        "outlet": {
          "id": "example",
          "name": "example"
        },
        "owned_by": {
          "first_name": "example",
          "id": "example",
          "last_name": "example",
          "username": "example"
        },
        "packages": [
          {
            "id": "example",
            "quantity_ordered": 1,
            "stock_item": {
              "id": "example",
              "name": "example"
            },
            "supplier_package": {
              "id": "example",
              "supplier_article_number": "example",
              "supplier_product_name": "example"
            },
            "total_theoretical_price": "example"
          }
        ],
        "status": "example",
        "supplier": {
          "company_name": "example",
          "id": "example"
        },
        "theoretical_price": "example"
      }
    ]
  }
}
```

### Create recipe

Add a recipe to the library.

**Inputs**

- Name (`name`, text, required): The recipe's name.
- Servings (`persons`, number, required): How many servings it makes. At least 1.
- Reference (`uid`, text): Your reference number for it.
- Description (`description`, text): Description.
- Cuisine (`cuisine`, text): Cuisine, such as Italian.
- Type (`recipe_type`, text): Course or kind. One of: `amuse_bouche` (Amuse bouche), `base_recipe` (Base recipe), `soup`, `starter`, `entremet`, `main_course` (Main course), `dessert`, `drinks`, `other`.
- Stage (`recipe_stage`, text): Where the recipe is in its life. One of: `development`, `testing`, `complete`, `active`, `discontinued`.
- Season (`season`, text): Season. One of: `all_seasons` (All seasons), `winter`, `spring`, `summer`, `autumn`.
- Category (`category`, text): Category.
- Subcategory (`subcategory`, text): Subcategory.
- Sell price (`sell_price`, number): The selling price.
- Tax % (`tax`, number): The tax rate, in percent.
- Target margin % (`target_profit_margin`, number): The target profit margin, in percent.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": "example",
    "instance": "example"
  }
}
```

### Create supplier

Add a supplier to the library.

**Inputs**

- Name (`name`, text, required): The supplier's company name.
- Contact first name (`contact_first_name`, text): The contact person's first name.
- Contact last name (`contact_last_name`, text): The contact person's last name.
- Order emails (`order_emails`, list): Where purchase orders are emailed.
- Tax number (`tax_number`, text): VAT or tax number.
- Customer number (`customer_number`, text): Your customer number at the supplier.
- Internal ID (`internal_supplier_id`, text): Your own reference for the supplier.
- Delivery fee (`delivery_fee`, number): The standard delivery fee.
- Outlets (`outlets`, list): The outlets that order from this supplier.
- Street (`street`, text): Street.
- Number (`house_number`, text): House number.
- Postal code (`postal_code`, text): Postal code.
- City (`city`, text): City.
- Country (`country`, text): Country.
- Phone (`telephone`, text): Phone number.
- Notes (`notes`, text): Notes.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": "example",
    "instance": "example"
  }
}
```

### Delete invoice

Delete an invoice record.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Delete purchase order

Delete a purchase order.

**Inputs**

- Purchase order (`purchase_order_id`, text, required): The purchase order.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Get ingredient

Get one ingredient with its details, allergens and stock items.

**Inputs**

- Ingredient (`ingredient_id`, text, required): The ingredient.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accounting_category": "example",
    "approved": true,
    "archived": true,
    "brand": "example",
    "category": "example",
    "composition": "example",
    "created_by": "example",
    "created_date": "example",
    "description": "example",
    "external_uid": "example",
    "id": "example",
    "in_use": true,
    "internal_uid": "example",
    "modified_date": "example",
    "name": "example",
    "short_name": "example",
    "storage_instructions": "example",
    "subcategory": "example",
    "url": "example",
    "web_page": "example"
  }
}
```

### Get invoice

Get one invoice record with its purchase orders and files.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "approval_status": "example",
    "approved_by": {
      "id": "example",
      "name": "example"
    },
    "created_at": "example",
    "created_by": {
      "id": "example",
      "name": "example"
    },
    "due_date": "example",
    "id": "example",
    "invoice_date": "example",
    "invoice_number": "example",
    "is_credit_note": true,
    "outlet": {
      "id": "example",
      "name": "example"
    },
    "processing_status": "example",
    "purchase_orders": [
      {
        "id": "example",
        "order_number": "example"
      }
    ],
    "purchase_orders_total_amount": "example",
    "supplier": {
      "id": "example",
      "internal_supplier_id": "example",
      "name": "example"
    },
    "total_amount": "example",
    "total_amount_difference": "example",
    "total_amount_sentence": "example",
    "updated_at": "example"
  }
}
```

### Get purchase order

Get one purchase order with its packages and prices.

**Inputs**

- Purchase order (`purchase_order_id`, text, required): The purchase order.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "delivery_closed": true,
    "expected_delivery_date": "example",
    "id": "example",
    "invoice_number": "example",
    "invoice_status": "example",
    "order_number": "example",
    "order_remarks": "example",
    "ordered_on": "example",
    "outlet": {
      "id": "example",
      "name": "example"
    },
    "owned_by": {
      "first_name": "example",
      "id": "example",
      "last_name": "example",
      "username": "example"
    },
    "packages": [
      {
        "id": "example",
        "quantity_ordered": 1,
        "stock_item": {
          "id": "example",
          "name": "example"
        },
        "supplier_package": {
          "id": "example",
          "supplier_article_number": "example",
          "supplier_product_name": "example"
        },
        "total_theoretical_price": "example"
      }
    ],
    "status": "example",
    "supplier": {
      "company_name": "example",
      "id": "example"
    },
    "theoretical_price": "example"
  }
}
```

### Get recipe

Get one recipe with its ingredients, steps and prices.

**Inputs**

- Recipe (`recipe_id`, text, required): The recipe.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "category": "example",
    "created_by": "example",
    "created_date": "example",
    "cuisine": "example",
    "current_sell_price": {
      "created": "example",
      "pricing": 1,
      "username": "example"
    },
    "description": "example",
    "id": "example",
    "is_stockable_recipe": true,
    "modified_date": "example",
    "name": "example",
    "persons": 1,
    "recipe_class": "example",
    "recipe_stage": "example",
    "recipe_type": "example",
    "season": "example",
    "subcategory": "example",
    "target_profit_margin": "example",
    "tax": "example",
    "uid": "example",
    "url": "example",
    "web_page": "example"
  }
}
```

### Get recipe financials

Get a recipe's food cost, prime cost and profit per serving at an outlet.

**Inputs**

- Recipe (`recipe_id`, text, required): The recipe.
- Outlet (`outlet`, text, required): The outlet whose prices to use.
- Food cost from (`food_cost_mode`, text): Which price each ingredient is costed at: the cheapest (the default), the last ordered, or the average stock value. One of: `cheapest`, `last_ordered` (Last ordered), `average_stock_value` (Average stock value).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "actual_for_one_serving": {
      "profit": "example",
      "profit_margin": "example",
      "sell_price_excl_tax": "example",
      "sell_price_incl_tax": "example"
    },
    "cost_for_one_serving": {
      "ingredients_cost": "example",
      "personnel_cost": "example",
      "prime_cost": "example",
      "total_food_cost": "example",
      "waste": "example"
    },
    "food_cost_mode": "example",
    "id": "example",
    "ingredients": [
      {
        "calculated_cost": "example",
        "id": "example",
        "name": "example",
        "quantity": "example",
        "type": "example",
        "unit": "example"
      }
    ],
    "internal_uid": "example",
    "name": "example",
    "servings": 1,
    "target_for_one_serving": {
      "profit": "example",
      "profit_margin": "example",
      "sell_price_excl_tax": "example",
      "sell_price_incl_tax": "example"
    },
    "tax": "example"
  }
}
```

### Get revenue

Get an outlet's total revenue over a range of dates, from its point of sale.

**Inputs**

- Outlet (`outlet_id`, text, required): The outlet.
- From (`date_from`, date, required): The first day.
- To (`date_to`, date, required): The last day.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "revenue": "example"
  }
}
```

### Get supplier

Get one supplier with its contact, address and ordering settings.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": {
      "city": "example",
      "country": "example",
      "mobile": "example",
      "number": "example",
      "postal_code": "example",
      "street": "example",
      "telephone": "example"
    },
    "contact_first_name": "example",
    "contact_last_name": "example",
    "customer_number": "example",
    "daily_order_threshold": "example",
    "email": "example",
    "id": "example",
    "internal_supplier_id": "example",
    "name": "example",
    "notes": "example",
    "order_approval_enabled": true,
    "standard_delivery_fee": "example",
    "supplier_email_list": [
      "example"
    ],
    "tax_number": "example",
    "url": "example"
  }
}
```

### List deliveries

List received deliveries, optionally by purchase order, supplier, outlet or delivery date.

**Inputs**

- Purchase order ID (`purchase_order_id`, text): Only deliveries for this purchase order.
- Supplier (`supplier_id`, text): Only this supplier.
- Outlet (`outlet_id`, text): Only this outlet.
- Draft (`draft`, true/false): Only drafts (on) or only submitted ones (off).
- Delivered after (`delivered_after`, date): Only deliveries after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest first. One of: `delivery_date` (Delivery date), `-delivery_date` (-delivery date).
- Page (`page`, number): The page to read, from 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "actual_price": "example",
        "delivered_packages": [
          {
            "actual_price": "example",
            "id": "example",
            "quantity_delivered": "example",
            "remarks": "example",
            "supplier_package": {
              "id": "example"
            }
          }
        ],
        "delivery_date": "example",
        "delivery_remarks": "example",
        "discount": "example",
        "draft": true,
        "id": "example",
        "purchase_order": {
          "id": "example",
          "order_number": "example"
        },
        "received_by": {
          "first_name": "example",
          "id": "example",
          "last_name": "example",
          "username": "example"
        },
        "update_stock": true,
        "url": "example"
      }
    ]
  }
}
```

### List ingredients

List the library's ingredients, optionally by name, category, supplier, or when they were added or changed.

**Inputs**

- Name (`name`, text): Only ingredients with this name.
- Category (`category`, text): Only this category.
- Reference number (`internal_uid`, text): Only the ingredient with this reference number.
- Supplier (`supplier`, text): Only ingredients bought from this supplier.
- Added after (`created_after`, date): Only ingredients added after this day.
- Changed after (`modified_after`, date): Only ingredients changed after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest or last first. One of: `name`, `-name`, `created_date` (Created date), `-created_date` (-created date), `modified_date` (Modified date), `-modified_date` (-modified date).
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`page_size`, number): How many records a page holds (10 unless set; at most 200). From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "accounting_category": "example",
        "approved": true,
        "archived": true,
        "brand": "example",
        "category": "example",
        "composition": "example",
        "created_by": "example",
        "created_date": "example",
        "description": "example",
        "external_uid": "example",
        "id": "example",
        "in_use": true,
        "internal_uid": "example",
        "modified_date": "example",
        "name": "example",
        "short_name": "example",
        "storage_instructions": "example",
        "subcategory": "example",
        "url": "example",
        "web_page": "example"
      }
    ]
  }
}
```

### List invoices

List invoice records, optionally by search text, outlet, supplier, approval status or date.

**Inputs**

- Search (`search`, text): Text found in the supplier's name, the invoice number or a purchase order number.
- Outlets (`outlet_ids`, list): Only these outlets.
- Suppliers (`supplier_ids`, list): Only these suppliers.
- Approval statuses (`approval_statuses`, list): Only these approval statuses. One or more of: `RECEIVED`, `PENDING_APPROVAL` (Pending approval), `FLAGGED`, `APPROVED`, `REJECTED`, `PAID`.
- Recorded after (`created_after`, date): Only invoices recorded after this day.
- Changed after (`updated_after`, date): Only invoices changed after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest or largest first. One of: `created_at` (Created at), `-created_at` (-created at), `invoice_date` (Invoice date), `-invoice_date` (-invoice date), `due_date` (Due date), `-due_date` (-due date), `total_amount` (Total amount), `-total_amount` (-total amount).
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`page_size`, number): How many records a page holds (10 unless set; at most 200). From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "approval_status": "example",
        "approved_by": {
          "id": "example",
          "name": "example"
        },
        "created_at": "example",
        "created_by": {
          "id": "example",
          "name": "example"
        },
        "due_date": "example",
        "id": "example",
        "invoice_date": "example",
        "invoice_number": "example",
        "is_credit_note": true,
        "outlet": {
          "id": "example",
          "name": "example"
        },
        "processing_status": "example",
        "purchase_orders": [
          {
            "id": "example",
            "order_number": "example"
          }
        ],
        "purchase_orders_total_amount": "example",
        "supplier": {
          "id": "example",
          "internal_supplier_id": "example",
          "name": "example"
        },
        "total_amount": "example",
        "total_amount_difference": "example",
        "total_amount_sentence": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List outlets

List the library's outlets (kitchens, restaurants, shops).

**Inputs**

- Name (`name`, text): Only outlets with this name.
- Page (`page`, number): The page to read, from 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "description": "example",
        "external_name": "example",
        "id": "example",
        "name": "example",
        "timezone": "example",
        "url": "example"
      }
    ]
  }
}
```

### List purchase orders

List purchase orders, optionally by supplier, outlet, status or order date.

**Inputs**

- Supplier (`supplier`, text): Only this supplier.
- Outlet (`outlet`, text): Only this outlet.
- Status (`status`, text): Only this status. One of: `IN_PROGRESS` (In progress), `ORDERED`, `DELIVERED`, `AWAITING_APPROVAL` (Awaiting approval), `REJECTED`.
- Ordered after (`ordered_after`, date): Only orders placed after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest first. One of: `ordered_on` (Ordered on), `-ordered_on` (-ordered on).
- Page (`page`, number): The page to read, from 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "delivery_closed": true,
        "expected_delivery_date": "example",
        "id": "example",
        "invoice_number": "example",
        "invoice_status": "example",
        "order_number": "example",
        "order_remarks": "example",
        "ordered_on": "example",
        "outlet": {
          "id": "example",
          "name": "example"
        },
        "owned_by": {
          "first_name": "example",
          "id": "example",
          "last_name": "example",
          "username": "example"
        },
        "packages": [
          {
            "id": "example",
            "quantity_ordered": 1,
            "stock_item": {
              "id": "example",
              "name": "example"
            },
            "supplier_package": {
              "id": "example",
              "supplier_article_number": "example",
              "supplier_product_name": "example"
            },
            "total_theoretical_price": "example"
          }
        ],
        "status": "example",
        "supplier": {
          "company_name": "example",
          "id": "example"
        },
        "theoretical_price": "example"
      }
    ]
  }
}
```

### List recipes

List the library's recipes, optionally by name, type, stage, outlet, or when they were added or changed.

**Inputs**

- Name (`name`, text): Only recipes with this name.
- Reference (`uid`, text): Only the recipe with this reference.
- Type (`type`, text): Only this type. One of: `amuse_bouche` (Amuse bouche), `base_recipe` (Base recipe), `soup`, `starter`, `entremet`, `main_course` (Main course), `dessert`, `drinks`, `other`.
- Stage (`stage`, text): Only this stage. One of: `development`, `testing`, `complete`, `active`, `discontinued`.
- Outlet (`outlet`, text): Only recipes linked to this outlet.
- Added after (`created_after`, date): Only recipes added after this day.
- Changed after (`modified_after`, date): Only recipes changed after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest or last first. One of: `name`, `-name`, `created_date` (Created date), `-created_date` (-created date), `modified_date` (Modified date), `-modified_date` (-modified date).
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`page_size`, number): How many records a page holds (10 unless set; at most 200). From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "category": "example",
        "created_by": "example",
        "created_date": "example",
        "cuisine": "example",
        "current_sell_price": {
          "created": "example",
          "pricing": 1,
          "username": "example"
        },
        "description": "example",
        "id": "example",
        "is_stockable_recipe": true,
        "modified_date": "example",
        "name": "example",
        "persons": 1,
        "recipe_class": "example",
        "recipe_stage": "example",
        "recipe_type": "example",
        "season": "example",
        "subcategory": "example",
        "target_profit_margin": "example",
        "tax": "example",
        "uid": "example",
        "url": "example",
        "web_page": "example"
      }
    ]
  }
}
```

### List stock items

List the library's stock items (the packages ingredients are kept in).

**Inputs**

- Name (`name`, text): Only stock items with this name.
- Ingredient ID (`ingredient`, text): Only stock items of this ingredient (its ID).
- Sort by (`ordering`, text): Order. A leading - sorts last first. One of: `name`, `-name`, `modified`, `-modified`.
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`page_size`, number): How many records a page holds (10 unless set; at most 200). From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "active": true,
        "average_price_per_package": "example",
        "base_stock_item_quantity": "example",
        "base_stock_item_unit": "example",
        "content": "example",
        "created_by": "example",
        "gtin_list": [
          "example"
        ],
        "id": "example",
        "main_ingredient_id": "example",
        "main_ingredient_name": "example",
        "modified_date": "example",
        "name": "example",
        "stockable": true,
        "url": "example"
      }
    ]
  }
}
```

### List supplier packages

List the packages suppliers sell, with their article numbers and prices.

**Inputs**

- Supplier (`supplier_id`, text): Only this supplier's packages.
- Stock item ID (`stock_item_id`, text): Only packages of this stock item (its ID).
- Active (`active`, true/false): Only active (on) or inactive (off) packages.
- Orderable (`orderable`, true/false): Only packages that can (on) or can't be ordered.
- Page (`page`, number): The page to read, from 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "active": true,
        "average_price_per_package": "example",
        "id": "example",
        "orderable": true,
        "stock_item": {
          "id": "example",
          "name": "example",
          "url": "example"
        },
        "supplier": {
          "id": "example",
          "name": "example"
        },
        "supplier_article_number": "example",
        "supplier_product_name": "example",
        "url": "example"
      }
    ]
  }
}
```

### List suppliers

List the library's suppliers, optionally by name, email or VAT number.

**Inputs**

- Name (`name`, text): Only suppliers whose name matches.
- Email (`email`, text): Only suppliers with this ordering email.
- VAT number (`vat_number`, text): Only suppliers with this VAT number.
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`page_size`, number): How many records a page holds (10 unless set; at most 200). From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "address": {
          "city": "example",
          "country": "example",
          "mobile": "example",
          "number": "example",
          "postal_code": "example",
          "street": "example",
          "telephone": "example"
        },
        "contact_first_name": "example",
        "contact_last_name": "example",
        "customer_number": "example",
        "daily_order_threshold": "example",
        "email": "example",
        "id": "example",
        "internal_supplier_id": "example",
        "name": "example",
        "notes": "example",
        "order_approval_enabled": true,
        "standard_delivery_fee": "example",
        "supplier_email_list": [
          "example"
        ],
        "tax_number": "example",
        "url": "example"
      }
    ]
  }
}
```

### List waste events

List an outlet's waste events and the stock value lost.

**Inputs**

- Outlet (`outlet_id`, text, required): The outlet.
- Started after (`created_after`, date): Only waste events started after this day.
- Sort by (`ordering`, text): Order. A leading - sorts newest first. One of: `created`, `-created`.
- Page (`page`, number): The page to read, from 1. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next": "example",
    "previous": "example",
    "results": [
      {
        "actual_date": "example",
        "created": "example",
        "created_by": {
          "first_name": "example",
          "id": "example",
          "last_name": "example",
          "username": "example"
        },
        "finished": "example",
        "id": "example",
        "items": [
          {
            "quantity": "example",
            "recipe": {
              "id": "example",
              "name": "example"
            },
            "remarks": "example",
            "stock_item": {
              "id": "example",
              "name": "example"
            },
            "stock_value": "example",
            "waste_category": "example"
          }
        ],
        "name": "example",
        "owned_by": {
          "first_name": "example",
          "id": "example",
          "last_name": "example",
          "username": "example"
        },
        "remarks": "example",
        "status": "example",
        "stock_value": "example"
      }
    ]
  }
}
```

### Set invoice approval status

Approve, flag, reject or mark an invoice paid.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice.
- Approval status (`approval_status`, text, required): The new status. One of: `RECEIVED`, `PENDING_APPROVAL` (Pending approval), `FLAGGED`, `APPROVED`, `REJECTED`, `PAID`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "approval_status": "example",
    "approved_by": {
      "id": "example",
      "name": "example"
    },
    "created_at": "example",
    "created_by": {
      "id": "example",
      "name": "example"
    },
    "due_date": "example",
    "id": "example",
    "invoice_date": "example",
    "invoice_number": "example",
    "is_credit_note": true,
    "outlet": {
      "id": "example",
      "name": "example"
    },
    "processing_status": "example",
    "purchase_orders": [
      {
        "id": "example",
        "order_number": "example"
      }
    ],
    "purchase_orders_total_amount": "example",
    "supplier": {
      "id": "example",
      "internal_supplier_id": "example",
      "name": "example"
    },
    "total_amount": "example",
    "total_amount_difference": "example",
    "total_amount_sentence": "example",
    "updated_at": "example"
  }
}
```

### Update ingredient

Change an ingredient, or archive it. Only the fields given change.

**Inputs**

- Ingredient (`ingredient_id`, text, required): The ingredient.
- Name (`name`, text): The ingredient's name.
- Short name (`short_name`, text): A short name.
- Reference number (`internal_uid`, text): Your reference number for it.
- External ID (`external_uid`, text): An outside system's ID.
- Description (`description`, text): Description.
- Brand (`brand`, text): Brand.
- Category (`category`, text): Category, such as Dairy.
- Subcategory (`subcategory`, text): Subcategory, such as Milk.
- Accounting category (`accounting_category`, text): Accounting category.
- Storage instructions (`storage_instructions`, text): How to store it.
- Shelf life (`shelf_life`, text): How long it keeps.
- Approved (`approved`, true/false): Whether it's approved.
- Archived (`archived`, true/false): Archive it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accounting_category": "example",
    "approved": true,
    "archived": true,
    "brand": "example",
    "category": "example",
    "composition": "example",
    "created_by": "example",
    "created_date": "example",
    "description": "example",
    "external_uid": "example",
    "id": "example",
    "in_use": true,
    "internal_uid": "example",
    "modified_date": "example",
    "name": "example",
    "short_name": "example",
    "storage_instructions": "example",
    "subcategory": "example",
    "url": "example",
    "web_page": "example"
  }
}
```

### Update invoice

Change an invoice record. Only the fields given change.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice.
- Outlet (`outlet`, text): The outlet the invoice is for.
- Supplier (`supplier`, text): The supplier who sent it.
- Invoice number (`invoice_number`, text): The invoice's number.
- Purchase orders (`purchase_orders`, list): The purchase orders it bills, by ID.
- Invoice date (`invoice_date`, date): The date on the invoice.
- Due date (`due_date`, date): When it's due.
- Total (`total_amount`, number): The invoice total.
- Credit note (`is_credit_note`, true/false): Whether it's a credit note.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "approval_status": "example",
    "approved_by": {
      "id": "example",
      "name": "example"
    },
    "created_at": "example",
    "created_by": {
      "id": "example",
      "name": "example"
    },
    "due_date": "example",
    "id": "example",
    "invoice_date": "example",
    "invoice_number": "example",
    "is_credit_note": true,
    "outlet": {
      "id": "example",
      "name": "example"
    },
    "processing_status": "example",
    "purchase_orders": [
      {
        "id": "example",
        "order_number": "example"
      }
    ],
    "purchase_orders_total_amount": "example",
    "supplier": {
      "id": "example",
      "internal_supplier_id": "example",
      "name": "example"
    },
    "total_amount": "example",
    "total_amount_difference": "example",
    "total_amount_sentence": "example",
    "updated_at": "example"
  }
}
```

### Update recipe

Change a recipe. Only the fields given change.

**Inputs**

- Recipe (`recipe_id`, text, required): The recipe.
- Name (`name`, text): The recipe's name.
- Servings (`persons`, number): How many servings it makes. At least 1.
- Reference (`uid`, text): Your reference number for it.
- Description (`description`, text): Description.
- Cuisine (`cuisine`, text): Cuisine, such as Italian.
- Type (`recipe_type`, text): Course or kind. One of: `amuse_bouche` (Amuse bouche), `base_recipe` (Base recipe), `soup`, `starter`, `entremet`, `main_course` (Main course), `dessert`, `drinks`, `other`.
- Stage (`recipe_stage`, text): Where the recipe is in its life. One of: `development`, `testing`, `complete`, `active`, `discontinued`.
- Season (`season`, text): Season. One of: `all_seasons` (All seasons), `winter`, `spring`, `summer`, `autumn`.
- Category (`category`, text): Category.
- Subcategory (`subcategory`, text): Subcategory.
- Sell price (`sell_price`, number): The selling price.
- Tax % (`tax`, number): The tax rate, in percent.
- Target margin % (`target_profit_margin`, number): The target profit margin, in percent.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "category": "example",
    "created_by": "example",
    "created_date": "example",
    "cuisine": "example",
    "current_sell_price": {
      "created": "example",
      "pricing": 1,
      "username": "example"
    },
    "description": "example",
    "id": "example",
    "is_stockable_recipe": true,
    "modified_date": "example",
    "name": "example",
    "persons": 1,
    "recipe_class": "example",
    "recipe_stage": "example",
    "recipe_type": "example",
    "season": "example",
    "subcategory": "example",
    "target_profit_margin": "example",
    "tax": "example",
    "uid": "example",
    "url": "example",
    "web_page": "example"
  }
}
```

### Update supplier

Change a supplier's details. Only the fields given change.

**Inputs**

- Supplier (`supplier_id`, text, required): The supplier.
- Name (`name`, text): The supplier's company name.
- Contact first name (`contact_first_name`, text): The contact person's first name.
- Contact last name (`contact_last_name`, text): The contact person's last name.
- Order emails (`order_emails`, list): Where purchase orders are emailed.
- Tax number (`tax_number`, text): VAT or tax number.
- Customer number (`customer_number`, text): Your customer number at the supplier.
- Internal ID (`internal_supplier_id`, text): Your own reference for the supplier.
- Delivery fee (`delivery_fee`, number): The standard delivery fee.
- Outlets (`outlets`, list): The outlets that order from this supplier.
- Street (`street`, text): Street.
- Number (`house_number`, text): House number.
- Postal code (`postal_code`, text): Postal code.
- City (`city`, text): City.
- Country (`country`, text): Country.
- Phone (`telephone`, text): Phone number.
- Notes (`notes`, text): Notes.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": {
      "city": "example",
      "country": "example",
      "mobile": "example",
      "number": "example",
      "postal_code": "example",
      "street": "example",
      "telephone": "example"
    },
    "contact_first_name": "example",
    "contact_last_name": "example",
    "customer_number": "example",
    "daily_order_threshold": "example",
    "email": "example",
    "id": "example",
    "internal_supplier_id": "example",
    "name": "example",
    "notes": "example",
    "order_approval_enabled": true,
    "standard_delivery_fee": "example",
    "supplier_email_list": [
      "example"
    ],
    "tax_number": "example",
    "url": "example"
  }
}
```
