MarginEdge Vendors API

Vendors and their items and packaging

OpenAPI Specification

marginedge-vendors-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: MarginEdge Public Categories Vendors API
  version: 1.0.0
  description: Read-only public API for retrieving invoice, order, product, vendor, category, and restaurant-unit data from the MarginEdge restaurants you are authorized to access. The API supports one-way data retrieval only (MarginEdge to your application) and is included with any MarginEdge subscription. Authentication uses an API key sent in the x-api-key header. List responses are paged via an opaque nextPage cursor.
  contact:
    name: MarginEdge Developer Support
    url: https://developer.marginedge.com/
  x-spec-source: Derived from the published MarginEdge developer portal (developer.marginedge.com) API reference and embedded API definitions.
servers:
- url: https://api.marginedge.com/public
  description: MarginEdge Public API
security:
- ApiKeyAuth: []
tags:
- name: Vendors
  description: Vendors and their items and packaging
paths:
  /vendors:
    get:
      operationId: getVendors
      summary: MarginEdge Get Vendors
      tags:
      - Vendors
      description: Get Vendors.
      parameters:
      - name: restaurantUnitId
        in: query
        required: true
        schema:
          type: string
        example: 12345
      - name: nextPage
        in: query
        required: false
        schema:
          type: string
        example: eyJsYXN0SWQiOiAiMTIzNDUifQ==
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVendorsResponseModel'
              examples:
                GetVendors200Example:
                  summary: Default getVendors 200 response
                  x-microcks-default: true
                  value:
                    nextPage: eyJsYXN0SWQiOiAiMTIzNDUifQ==
                    vendors:
                    - vendorId: me-vendor-9f3a2b
                      vendorName: Sample Vendor
                      centralVendorId: me-centralvendor-9f3a2b
                      vendorAccounts:
                      - vendorAccountNumber: INV-100245
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /vendors/{vendorId}/vendorItems:
    get:
      operationId: getVendorItems
      summary: MarginEdge Get Vendor Items
      tags:
      - Vendors
      description: Get Vendor Items.
      parameters:
      - name: restaurantUnitId
        in: query
        required: true
        schema:
          type: string
        example: 12345
      - name: vendorId
        in: path
        required: true
        schema:
          type: string
        example: me-vendor-9f3a2b
      - name: nextPage
        in: query
        required: false
        schema:
          type: string
        example: eyJsYXN0SWQiOiAiMTIzNDUifQ==
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVendorItemsResponseModel'
              examples:
                GetVendorItems200Example:
                  summary: Default getVendorItems 200 response
                  x-microcks-default: true
                  value:
                    vendorItems:
                    - vendorItemCode: example
                      centralVendorItemId: me-centralvendoritem-9f3a2b
                      vendorId: me-vendor-9f3a2b
                      companyConceptProductId: me-companyconceptproduct-9f3a2b
                      vendorName: Sample Vendor
                      centralVendorId: me-centralvendor-9f3a2b
                      productName: Sample Product
                    nextPage: eyJsYXN0SWQiOiAiMTIzNDUifQ==
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /vendors/{vendorId}/vendorItems/{vendorItemCode}/packaging:
    get:
      operationId: getVendorItemsPackaging
      summary: MarginEdge Get Vendor Items Packaging
      tags:
      - Vendors
      description: Get Vendor Items Packaging.
      parameters:
      - name: restaurantUnitId
        in: query
        required: true
        schema:
          type: string
        example: 12345
      - name: vendorId
        in: path
        required: true
        schema:
          type: string
        example: me-vendor-9f3a2b
      - name: vendorItemCode
        in: path
        required: true
        schema:
          type: string
        example: VIC-88231
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVendorItemsPackagingResponseModel'
              examples:
                GetVendorItemsPackaging200Example:
                  summary: Default getVendorItemsPackaging 200 response
                  x-microcks-default: true
                  value:
                    packagings:
                    - unit: case
                      quantity: 3
                      packagingName: Sample Packaging
                      packagingId: me-packaging-9f3a2b
                    nextPage: eyJsYXN0SWQiOiAiMTIzNDUifQ==
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    GetVendorItemsPackagingResponseModel:
      type: object
      properties:
        packagings:
          type: array
          items:
            type: object
            properties:
              unit:
                type: string
                description: Unit this packaging is measured in
                example: case
              quantity:
                type: number
                description: Quantity of the packaging unit present in this packaging
                example: 3
              packagingName:
                type: string
                description: Name of the packaging in MarginEdge
                example: Sample Packaging
              packagingId:
                type: string
                description: Identifier of the packaging for this vendor item that was purchased
                example: me-packaging-9f3a2b
        nextPage:
          type: string
          description: Unique key for the next page of results
          example: eyJsYXN0SWQiOiAiMTIzNDUifQ==
    GetVendorsResponseModel:
      type: object
      properties:
        nextPage:
          type: string
          description: Unique key for the next page of results
          example: eyJsYXN0SWQiOiAiMTIzNDUifQ==
        vendors:
          type: array
          items:
            type: object
            properties:
              vendorId:
                type: string
                description: Unique identifier of the vendor within this restaurant unit
                example: me-vendor-9f3a2b
              vendorName:
                type: string
                description: Name of the vendor in MarginEdge
                example: Sample Vendor
              centralVendorId:
                type: string
                description: Unique identifier of the vendor centrally (across all restaurant units in MarginEdge)
                example: me-centralvendor-9f3a2b
              vendorAccounts:
                type: array
                items:
                  type: object
                  properties:
                    vendorAccountNumber:
                      type: string
                      description: The vendor’s account number for this restaurant
                      example: INV-100245
    GetVendorItemsResponseModel:
      type: object
      properties:
        vendorItems:
          type: array
          items:
            type: object
            properties:
              vendorItemCode:
                type: string
                description: Vendor’s item code or SKU identifying the item
                example: example
              centralVendorItemId:
                type: string
                description: Unique identifier of this vendor item in MarginEdge (across all restaurant units/vendors)
                example: me-centralvendoritem-9f3a2b
              vendorId:
                type: string
                description: Unique identifier of the vendor within this restaurant unit
                example: me-vendor-9f3a2b
              companyConceptProductId:
                type: string
                description: Identifier of the product (unique within the company concept this restaurant belongs to) this item is assigned to in MarginEdge
                example: me-companyconceptproduct-9f3a2b
              vendorName:
                type: string
                description: Name of the vendor in MarginEdge
                example: Sample Vendor
              centralVendorId:
                type: string
                description: Unique identifier of the vendor centrally (across all restaurant units in MarginEdge)
                example: me-centralvendor-9f3a2b
              productName:
                type: string
                description: Name of the product
                example: Sample Product
        nextPage:
          type: string
          description: Unique key for the next page of results
          example: eyJsYXN0SWQiOiAiMTIzNDUifQ==
  responses:
    NotFound:
      description: Resource not found
    Forbidden:
      description: Forbidden (missing or invalid API key, or restaurant not authorized)
    ServerError:
      description: Internal server error
    BadRequest:
      description: Bad request
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued through the MarginEdge developer portal.