Catering

Return a Catering.

Parameters
  • idpath integerRequired

    Return a Catering by specific catering id.

  • includequery string

    Include associations (delimited with comma). Available associations: business, user, address

    Example: business,address

GET/api/v1/caterings/{id}

  {
    const res = await fetch(`${BASE_URL}/api/v1/caterings/${id}`, {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json'
      }});

    const data = await res.json();
  }

RESPONSE


Create Catering

Create a catering of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a catering of a business.

    • typestringRequired

      Provide Catering type. Current selection is only caterings.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • namestringRequired

      • emailstringRequired

      • datedateRequired

        Date should be formated as a ISO date.

      • fromintegerRequired

      • tointegerRequired

      • number_of_servingsintegerRequired

      • address_post_codestringRequired

      • address_streetstringRequired

      • address_street_numberstringRequired

      • address_citystringRequired

      • address_country_codestringRequired

      • phonestring

      • phone_country_codestring

      • phone_country_prefixstring

      • specificationsstring

      • type_of_eventstring

      • user_namestring

      • chef_attendanceundefined

      • cutleryundefined

      • company_namestring

      • outdoorsundefined

      • corporate_eventundefined

      • number_of_waitersinteger

      • address_notesstring

      • address_region_codestring

      • marketing_feedbackstring

      • currencystring

      • auth_tokenstring

      • consent_gdprstring

      • menufile

    • relationshipsformData, object

      Relationships object with business and user objects.

      • businessformData, object

        Add a relationships link between catering and related Business.

        • typestring

        • idstring

          Related Business id.

      • userformData, object

        Add a relationships link between catering and related User.

        • typestring

        • idstring

          Related User id.

POST/api/v1/caterings

  {
    const res = await fetch(`${BASE_URL}/api/v1/caterings`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)});

    const data = await res.json();
  }

RESPONSE


Update Catering

Update a Catering.

Parameters
  • idpath integerRequired

    Update a Catering by specific catering id.

  • dataformData, objectRequired

    Form Data needed when creating a catering of a business.

    • id.stringRequired

      Provide Catering id.

    • typestring

      Provide Catering type. Current selection is only caterings.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • namestringRequired

      • datedateRequired

        Date should be formated as a ISO date.

      • fromintegerRequired

      • tointegerRequired

      • type_of_eventstring

      • outdoorsundefined

      • corporate_eventundefined

      • company_namestring

      • number_of_servingsinteger

      • specificationsinteger

      • menufile

      • chef_attendanceundefined

      • number_of_waitersinteger

      • cutleryundefined

      • price_centsinteger

      • currencystring

PATCH/api/v1/caterings/{id}

  {
    const res = await fetch(`${BASE_URL}/api/v1/caterings/${id}`, {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)});

    const data = await res.json();
  }

RESPONSE


Delete Catering

Delete a Catering.

Parameters
  • idpath integerRequired

    Delete a Catering by specific catering id.

DELETE/api/v1/caterings/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/caterings/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}