Recipes

GET
https://api.prezo.es/public/v1/recipes
所需模块:配方

The business's recipes with cost and sale figures per restaurant, and the POS codes they are sold under. Figures are for the whole recipe.

参数

查询参数
restaurantId
integer可选

Narrows to one restaurant.

page
integer可选

Page, from 1.

perPage
integer可选

Items per page: 100 by default, up to 500.

请求示例

import os

import requests

response = requests.get(
    "https://api.prezo.es/public/v1/recipes",
    headers={
        "Authorization": f"Bearer {os.environ['PREZO_API_KEY']}",
        "Accept": "application/json",
    },
)

print(response.json())

响应

Successful response.

{
  "data": [
    {
      "id": 8842,
      "name": "Hamburguesa de la casa",
      "type": "sale",
      "portions": 1,
      "yieldQuantity": "1.000",
      "yieldUnit": "ud",
      "targetFoodCostPercent": "30.00",
      "posProducts": [
        {
          "integration": {
            "id": 7,
            "name": "Revo"
          },
          "code": "PLU-42",
          "restaurantId": 1204
        }
      ],
      "restaurants": [
        {
          "restaurant": {
            "id": 1204,
            "name": "Local Gràcia"
          },
          "totalCost": "4.6100",
          "foodCost": "3.4200",
          "labourCost": "0.9000",
          "fixedCost": "0.2500",
          "materialCost": "0.0400",
          "salePrice": "13.50",
          "vatRate": "10.00",
          "salePriceWithoutVat": "12.2727",
          "foodCostPercent": "27.87",
          "marginPercent": "62.44",
          "suggestedSalePrice": "12.54"
        }
      ]
    }
  ],
  "meta": {
    "currentPage": 1,
    "perPage": 100,
    "total": 1,
    "lastPage": 1
  },
  "links": {
    "first": "https://api.prezo.es/public/v1/...?page=1",
    "prev": null,
    "next": null,
    "last": "https://api.prezo.es/public/v1/...?page=1"
  }
}