MarginEdge
App · 25 actions
Read a restaurant's orders and invoices, vendors, products and prices, inventories, recipes and sales and profit-and-loss reports.
Actions
| Action | What it does |
|---|---|
| Get count sheet | Get one count sheet with its sections. |
| Get inventory | Get one inventory count with its sections. |
| Get order | Get one order with its line items, taxes, charges and invoice attachments. |
| Get orders export | Get an orders export's status and, once it's COMPLETED, the link to download its file. |
| Get product price history | Get what a product cost over time. |
| Get product units | Get the units a product is counted, bought and reported in, with their prices and ratios. |
| Get profit and loss report | Get income, cost of goods, labor and expenses for a period, for one restaurant or each restaurant in a group. |
| Get sales report | Get total sales and sales by category for a period, for one restaurant or each restaurant in a group. |
| List categories | List a restaurant's accounting categories and their types. |
| List count sheets | List a restaurant's inventory count sheets. |
| List inventories | List a restaurant's inventory counts and their value, newest first. |
| List inventory items | List what was counted in one section of an inventory, with quantities and values. |
| List new items | List vendor items first bought in a period (the New Item Review report), newest first, with whether each was reviewed. |
| List orders | List a restaurant's orders (vendor invoices), 100 at a time, by the day they were entered or by invoice date. |
| List products | List a restaurant's products with their latest price, categories and, if asked, barcodes. |
| List recipe cost history | List how recipes' costs changed over a period of at most a year. |
| List recipe ingredients | List the ingredients of a restaurant's recipes, or of one recipe, with quantities and costs. |
| List recipes | List a restaurant's recipes with their cost, menu price and plate cost. |
| List restaurant groups | List the restaurant groups the API key can reach and the restaurants in each. |
| List restaurants | List the restaurants (restaurant units) the API key can reach, with the ID every other step asks for. |
| List vendor item packaging | List the pack sizes a vendor sells one item in. |
| List vendor items | List the items a restaurant buys from one vendor and the product each is mapped to. |
| List vendor items for product | List every vendor item mapped to one product, with each pack size's price and when it was last ordered. |
| List vendors | List a restaurant's vendors and their account numbers. |
| Start orders export | Ask MarginEdge to prepare a file of every order in a period. |
Get count sheet
Get one count sheet with its sections.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Count sheet
count_sheet_idtextRequired - The count sheet to read.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"countsheetId": "example",
"disabled": true,
"lastModifiedDate": "example",
"name": "example",
"origin": "example",
"sections": [
{
"categoryId": "example",
"categoryName": "example",
"itemCount": 1,
"name": "example",
"position": 1,
"sectionId": "example"
}
]
}
}Get inventory
Get one inventory count with its sections.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Inventory ID
inventory_idtextRequired - The inventory's ID, from 'List inventories'.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"closedDate": "example",
"countsheetId": "example",
"countsheetName": "example",
"inventoryDate": "example",
"inventoryId": "example",
"nextPage": "example",
"savedDate": "example",
"sections": [
{
"name": "example",
"position": 1,
"sectionId": "example"
}
],
"status": "example",
"totalValue": 1
}
}Get order
Get one order with its line items, taxes, charges and invoice attachments.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Order ID
order_idtextRequired - The order's ID, from 'List orders'.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"attachments": [
{
"attachmentId": 1,
"attachmentUrl": "example"
}
],
"createdDate": "example",
"creditAmount": 1,
"customerNumber": "example",
"deliveryCharges": 1,
"inputTaxCredits": 1,
"invoiceDate": "example",
"invoiceNumber": "example",
"isCredit": true,
"lineItems": [
{
"categoryId": "example",
"companyConceptProductId": "example",
"linePrice": 1,
"packagingId": 1,
"productReportByUnit": "example",
"productUnitPrice": 1,
"quantity": 1,
"unitPrice": 1,
"vendorItemCode": "example",
"vendorItemName": "example"
}
],
"orderId": "example",
"orderTotal": 1,
"otherCharges": 1,
"otherDescription": "example",
"paymentAccount": "example",
"status": "example",
"tax": 1,
"vendorId": "example",
"vendorName": "example"
}
}Get orders export
Get an orders export's status and, once it's COMPLETED, the link to download its file.
Inputs
- Export ID
export_request_idtextRequired - The exportRequestId from 'Start orders export'.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"completedAt": "example",
"downloadUrl": "example",
"endDate": "example",
"expiresAt": "example",
"exportRequestId": "example",
"exportType": "example",
"invoiceEndDate": "example",
"invoiceStartDate": "example",
"restaurantUnitCount": 1,
"restaurantUnitScope": "example",
"startDate": "example",
"status": "PENDING",
"submittedAt": "example"
}
}Get product price history
Get what a product cost over time. Without dates, the last 12 months.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Product ID
product_idtextRequired - The product's companyConceptProductId, from 'List products'.
- From
start_datedate - From this day.
- Until
end_datedate - Until this day.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"companyConceptProductId": "example",
"nextPage": "example",
"priceHistory": [
{
"date": "example",
"price": 1,
"unitName": "example"
}
]
}
}Get product units
Get the units a product is counted, bought and reported in, with their prices and ratios.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Product ID
product_idtextRequired - The product's companyConceptProductId, from 'List products'.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"companyConceptProductId": "example",
"productName": "example",
"units": [
{
"isCountByUnit": true,
"isReportByUnit": true,
"isUsedOnInventory": true,
"packagingName": "example",
"parentUnit": "example",
"price": 1,
"quantity": 1,
"ratio": 1,
"ratioDisplay": "example",
"unit": "example"
}
]
}
}Get profit and loss report
Get income, cost of goods, labor and expenses for a period, for one restaurant or each restaurant in a group.
Inputs
- Restaurant
restaurant_unit_idtext - The restaurant (MarginEdge restaurant unit) to read.
- Restaurant group
group_idtext - A restaurant group to report on instead of one restaurant, one report per restaurant in it. Choose a restaurant or a group.
- Start date
start_datedateRequired - The first day of the period.
- End date
end_datedateRequired - The last day of the period.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"failedRestaurantUnitIds": [
1
],
"profitAndLossReports": [
{
"cogs": {
"categories": [
{
"id": 1,
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"total": 1,
"totalPercentOfSales": 1
},
"companyId": 1,
"companyName": "example",
"conceptId": 1,
"conceptName": "example",
"currency": "example",
"endDate": "example",
"expenses": {
"categories": [
{
"id": 1,
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"total": 1,
"totalPercentOfSales": 1
},
"income": {
"categories": [
{
"id": 1,
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"total": 1,
"totalPercentOfSales": 1
},
"labor": {
"categories": [
{
"id": 1,
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"items": [
{
"name": "example",
"percentOfSales": 1,
"total": 1
}
],
"total": 1,
"totalPercentOfSales": 1
},
"restaurantUnitId": 1,
"restaurantUnitName": "example",
"startDate": "example",
"summary": {
"controllableProfit": 1,
"controllableProfitPercentOfSales": 1,
"grossProfit": 1,
"grossProfitPercentOfSales": 1,
"primeCostPercentOfSales": 1,
"primeCostTotal": 1
}
}
]
}
}Get sales report
Get total sales and sales by category for a period, for one restaurant or each restaurant in a group.
Inputs
- Restaurant
restaurant_unit_idtext - The restaurant (MarginEdge restaurant unit) to read.
- Restaurant group
group_idtext - A restaurant group to report on instead of one restaurant, one report per restaurant in it. Choose a restaurant or a group.
- Start date
start_datedateRequired - The first day of the period.
- End date
end_datedateRequired - The last day of the period.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"failedRestaurantUnitIds": [
1
],
"salesReports": [
{
"categories": [
{
"id": 1,
"name": "example",
"percentOfTotalSales": 1,
"total": 1
}
],
"companyId": 1,
"companyName": "example",
"conceptId": 1,
"conceptName": "example",
"currency": "example",
"endDate": "example",
"restaurantUnitId": 1,
"restaurantUnitName": "example",
"startDate": "example",
"summary": {
"totalSales": 1
}
}
]
}
}List categories
List a restaurant's accounting categories and their types.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"categories": [
{
"accountingCode": "example",
"categoryId": "example",
"categoryName": "example",
"categoryType": "example"
}
],
"nextPage": "example"
}
}List count sheets
List a restaurant's inventory count sheets.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"countsheets": [
{
"countsheetId": "example",
"disabled": true,
"lastCountDate": "example",
"lastModifiedDate": "example",
"name": "example",
"origin": "example"
}
],
"nextPage": "example"
}
}List inventories
List a restaurant's inventory counts and their value, newest first. A date range is at most 365 days.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Count sheet
count_sheet_idtext - Only inventories taken with this count sheet.
- Start date
start_datedate - Counted on or after this day.
- End date
end_datedate - Counted on or before this day.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"inventories": [
{
"closedDate": "example",
"countsheetId": "example",
"countsheetName": "example",
"firstClosedDate": "example",
"inventoryDate": "example",
"inventoryId": "example",
"origin": "example",
"savedDate": "example",
"status": "example",
"totalValue": 1
}
],
"nextPage": "example"
}
}List inventory items
List what was counted in one section of an inventory, with quantities and values.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Inventory ID
inventory_idtextRequired - The inventory's ID, from 'List inventories'.
- Section ID
section_idtextRequired - The section's ID, from 'Get inventory'.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"items": [
{
"companyConceptProductId": "example",
"itemId": "example",
"position": 1,
"price": 1,
"productId": "example",
"productName": "example",
"quantity": 1,
"unit": "example",
"unitSize": 1,
"value": 1
}
],
"nextPage": "example"
}
}List new items
List vendor items first bought in a period (the New Item Review report), newest first, with whether each was reviewed. Without dates, the last 90 days.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Scope
scopetext - Just this restaurant (the default), or every restaurant of its company or concept.One of:
unit,company,concept. - Review status
review_statustext - Reviewed items, items still to review, or both (the default).One of:
ALL,REVIEWED,UNREVIEWED. - From
start_datedate - From this day.
- Until
end_datedate - Until this day.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"newItemReviews": [
{
"categoryName": "example",
"categoryTypeName": "example",
"companyConceptProductId": 1,
"firstPurchasedDate": "example",
"invoiceNumber": "example",
"orderId": 1,
"packaging": "example",
"price": 1,
"productName": "example",
"quantity": 1,
"restaurantUnitId": 1,
"restaurantUnitName": "example",
"resultedInNewProduct": true,
"reviewed": true,
"reviewedBy": "example",
"reviewedDate": "example",
"unit": "example",
"vendorId": 1,
"vendorItemFirstSeenDate": "example",
"vendorItemId": 1,
"vendorItemName": "example",
"vendorName": "example"
}
],
"nextPage": "example",
"reviewedCount": 1,
"scope": "example",
"unreviewedCount": 1
}
}List orders
List a restaurant's orders (vendor invoices), 100 at a time, by the day they were entered or by invoice date.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Entered from
start_datedate - Orders entered in MarginEdge on or after this day. Give a start and end date, or an invoice start and end date.
- Entered until
end_datedate - Orders entered in MarginEdge on or before this day.
- Invoice dated from
invoice_start_datedate - Orders whose invoice is dated on or after this day.
- Invoice dated until
invoice_end_datedate - Orders whose invoice is dated on or before this day.
- Status
order_statustext - Only orders at this processing stage.One of:
PREPROCESSING,EDI_PENDING(Edi pending),IMAGE_PENDING(Image pending),INITIAL_REVIEW(Initial review),RECONCILIATION,FINAL_REVIEW(Final review),AM_REVIEW(Am review),PENDING_APPROVAL(Pending approval),CLOSED. - Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"orders": [
{
"createdDate": "example",
"customerNumber": "example",
"invoiceDate": "example",
"invoiceNumber": "example",
"orderId": "example",
"orderTotal": 1,
"paymentAccount": "example",
"status": "example",
"vendorId": "example",
"vendorName": "example"
}
]
}
}List products
List a restaurant's products with their latest price, categories and, if asked, barcodes.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Include barcodes
include_barcodestrue/false - Also return each product's barcodes.
- Barcode
barcodetext - Only the product with this barcode.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"products": [
{
"barcodes": [
{
"code": "example",
"name": "example",
"unit": "example",
"unitSize": 1
}
],
"categories": [
{
"categoryId": "example",
"percentAllocation": 1
}
],
"centralProductId": "example",
"companyConceptProductId": "example",
"itemCount": 1,
"latestPrice": 1,
"productName": "example",
"reportByUnit": "example",
"taxExempt": true
}
]
}
}List recipe cost history
List how recipes' costs changed over a period of at most a year. Without dates, the last year.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Recipe
recipe_idnumber - Only this recipe.
- From
start_datedate - From this day.
- Until
end_datedate - Until this day.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"recipeCostHistories": [
{
"recipeCost": 1,
"recipeId": "example",
"recipeName": "example",
"recordedDate": "example"
}
]
}
}List recipe ingredients
List the ingredients of a restaurant's recipes, or of one recipe, with quantities and costs.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Recipe
recipe_idnumber - Only this recipe.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"recipeIngredients": [
{
"companyConceptProductId": "example",
"ingredientCost": 1,
"ingredientId": "example",
"ingredientName": "example",
"ingredientPosition": 1,
"ingredientType": "example",
"notes": "example",
"quantity": 1,
"recipeId": "example",
"recipeName": "example",
"subRecipeId": "example",
"unit": "example",
"yieldPercentage": 1
}
]
}
}List recipes
List a restaurant's recipes with their cost, menu price and plate cost.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Recipe
recipe_idnumber - Only this recipe.
- Inactive
inactivetrue/false - Only inactive recipes (on) or only active ones (off).
- Plate cost out of range
plate_cost_out_of_boundstrue/false - Only recipes whose plate cost is outside their alert range.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"recipes": [
{
"createdDate": "example",
"isInactive": true,
"isPlateCostOutOfBounds": true,
"lastModifiedDate": "example",
"lastRecipeCostUpdate": "example",
"menuPrice": 1,
"onInventory": true,
"plateCostPercentage": 1,
"recipeCategoryType": "example",
"recipeCost": 1,
"recipeId": "example",
"recipeName": "example",
"recipeTypeId": "example",
"recipeTypeName": "example",
"unit": "example",
"yieldQuantity": 1
}
]
}
}List restaurant groups
List the restaurant groups the API key can reach and the restaurants in each.
Inputs
- Company ID
company_idtext - Only groups of this company ID.
- Concept ID
concept_idtext - Only groups of this concept ID.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"groups": [
{
"companyId": 1,
"companyName": "example",
"conceptId": 1,
"conceptName": "example",
"groupCategoryId": "example",
"groupCategoryName": "example",
"id": "example",
"lastModifiedDate": "example",
"name": "example",
"units": [
{
"unitId": 1,
"unitName": "example"
}
]
}
],
"nextPage": "example"
}
}List restaurants
List the restaurants (restaurant units) the API key can reach, with the ID every other step asks for.
Inputs
None.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"restaurants": [
{
"id": 1,
"name": "example"
}
]
}
}List vendor item packaging
List the pack sizes a vendor sells one item in.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Vendor
vendor_idtextRequired - The vendor that sells the item.
- Vendor item code
vendor_item_codetextRequired - The vendor's item code, from 'List vendor items'.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"packagings": [
{
"packagingId": "example",
"packagingName": "example",
"quantity": 1,
"unit": "example"
}
]
}
}List vendor items
List the items a restaurant buys from one vendor and the product each is mapped to.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Vendor
vendor_idtextRequired - The vendor whose items to list.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"vendorItems": [
{
"centralVendorId": "example",
"centralVendorItemId": "example",
"companyConceptProductId": "example",
"productName": "example",
"vendorId": "example",
"vendorItemCode": "example",
"vendorItemId": "example",
"vendorItemName": "example",
"vendorName": "example"
}
]
}
}List vendor items for product
List every vendor item mapped to one product, with each pack size's price and when it was last ordered.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Product ID
product_idtextRequired - The product's companyConceptProductId, from 'List products'.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"companyConceptProductId": "example",
"nextPage": "example",
"productName": "example",
"reportByUnit": "example",
"unit": "example",
"vendorItems": [
{
"vendorId": "example",
"vendorItemCode": "example",
"vendorItemConversions": [
{
"conversionRatio": 1,
"lastOrderedDate": "example",
"orderGuide": true,
"packaging": "example",
"price": 1,
"quantity": 1,
"unit": "example",
"vendorProductUnitId": "example"
}
],
"vendorItemId": "example",
"vendorItemName": "example",
"vendorName": "example"
}
]
}
}List vendors
List a restaurant's vendors and their account numbers.
Inputs
- Restaurant
restaurant_unit_idtextRequired - The restaurant (MarginEdge restaurant unit) to read.
- Next page
next_pagetext - The nextPage value from an earlier answer, to read the next 100 records.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"nextPage": "example",
"vendors": [
{
"centralVendorId": "example",
"vendorAccounts": [
{
"vendorAccountNumber": "example"
}
],
"vendorId": "example",
"vendorName": "example"
}
]
}
}Start orders export
Ask MarginEdge to prepare a file of every order in a period. 'Get orders export' says when it's ready and gives its download link.
Inputs
- Entered from
start_datedate - Orders entered in MarginEdge on or after this day. Give a start and end date, or an invoice start and end date.
- Entered until
end_datedate - Orders entered in MarginEdge on or before this day.
- Invoice dated from
invoice_start_datedate - Orders whose invoice is dated on or after this day.
- Invoice dated until
invoice_end_datedate - Orders whose invoice is dated on or before this day.
- Restaurants
restaurant_unit_idslist - Only these restaurants. Leave empty for every restaurant the key can reach.
Outputs
dataobject- The response from MarginEdge.
Example output
{
"data": {
"completedAt": "example",
"downloadUrl": "example",
"endDate": "example",
"expiresAt": "example",
"exportRequestId": "example",
"exportType": "example",
"invoiceEndDate": "example",
"invoiceStartDate": "example",
"restaurantUnitCount": 1,
"restaurantUnitScope": "example",
"startDate": "example",
"status": "PENDING",
"submittedAt": "example"
}
}