Orders

Return a Order.

Parameters
  • idpath integerRequired

    Return a Order by specific id.

  • includequery string

    Include associations (delimited with comma). Available associations: addresses, elements, business.

    Example: business,elements

GET/api/v1/orders/{id}

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "833a6878-118c-4baa-a6f1-0526e3f06d40",
    "type": "orders",
    "links": {
      "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40"
    },
    "attributes": {
      "accepted-at": null,
      "collection-at": null,
      "collection-code": null,
      "currency": "GBP",
      "customer-name": null,
      "dishes-cost-cents": 0,
      "driver-location-lat": null,
      "driver-location-long": null,
      "estimated-delivery-in": 0,
      "estimated-time-of-dropoff": null,
      "estimated-time-of-pickup": null,
      "notes": "{}",
      "other-rejection-reason": null,
      "origin": null,
      "hubrise-source": null,
      "hubrise-service-type": null,
      "pickup-at-business": false,
      "placed-at": null,
      "reject-reason": null,
      "shipping-cost-cents": 0,
      "shipping-cost-for-business-cents": 0,
      "shipping-cost-for-customer-cents": 0,
      "short-id": 0,
      "state": "draft",
      "time-wish": null,
      "total-cost-cents": 0,
      "unavailable-elements": null,
      "updated-at": "2022-11-22T14:49:17.744Z",
      "user-email": "aleksandra.bochenska+bo@netguru.com",
      "user-phone": null,
      "user-phone-country-code": null,
      "user-phone-country-prefix": null,
      "with-orkestro-delivery": false
    },
    "relationships": {
      "addresses": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/addresses",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/addresses"
        }
      },
      "elements": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/elements",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/elements"
        }
      },
      "business": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/business",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/business"
        }
      }
    }
  }
}

Create Order

Create a order of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a order of a business.

    • typestringRequired

      Provide Order type. Current selection is only orders.

    • relationshipsformData, object

      Relationships object with business object.

      • businessformData, object

        Add a relationships link between Order and related Business.

        • idstring

          Related Business id.

        • typestring

          Business type; business.

POST/api/v1/orders

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "833a6878-118c-4baa-a6f1-0526e3f06d40",
    "type": "orders",
    "links": {
      "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40"
    },
    "attributes": {
      "accepted-at": null,
      "collection-at": null,
      "collection-code": null,
      "currency": "GBP",
      "customer-name": null,
      "dishes-cost-cents": 0,
      "driver-location-lat": null,
      "driver-location-long": null,
      "estimated-delivery-in": 0,
      "estimated-time-of-dropoff": null,
      "estimated-time-of-pickup": null,
      "notes": "{}",
      "other-rejection-reason": null,
      "origin": null,
      "hubrise-source": null,
      "hubrise-service-type": null,
      "pickup-at-business": false,
      "placed-at": null,
      "reject-reason": null,
      "shipping-cost-cents": 0,
      "shipping-cost-for-business-cents": 0,
      "shipping-cost-for-customer-cents": 0,
      "short-id": 0,
      "state": "draft",
      "time-wish": null,
      "total-cost-cents": 0,
      "unavailable-elements": null,
      "updated-at": "2022-11-22T14:49:17.744Z",
      "user-email": "aleksandra.bochenska+bo@netguru.com",
      "user-phone": null,
      "user-phone-country-code": null,
      "user-phone-country-prefix": null,
      "with-orkestro-delivery": false
    },
    "relationships": {
      "addresses": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/addresses",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/addresses"
        }
      },
      "elements": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/elements",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/elements"
        }
      },
      "business": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/business",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/business"
        }
      }
    }
  }
}

Update Order

Update an Order.

Parameters
  • idpath integerRequired

    Update a Order by specific id.

  • dataformData, objectRequired

    Form Data needed when updating a Order.

    • idstringRequired

      Provide Order id.

    • typestringRequired

      Provide Order type. Current selection is only orders.

    • attributesformData, object

      Attributes object.

      • delivery_idstring

        Delivery UUID.

      • notesundefined

        Notes regarding the Order and Delivery.

      • pickup_at_businessundefined

      • shipping_cost_centsinteger

      • shipping_cost_for_business_centsinteger

      • shipping_cost_for_customer_centsinteger

      • statestring

      • time_wishstring

      • user_emailstring

        User email address.

      • user_phonestring

        User phone number.

      • user_phone_country_codestring

        User phone number country code.

      • user_phone_country_prefixstring

        User phone number prefix.

PATCH/api/v1/orders/{id}

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "833a6878-118c-4baa-a6f1-0526e3f06d40",
    "type": "orders",
    "links": {
      "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40"
    },
    "attributes": {
      "accepted-at": null,
      "collection-at": null,
      "collection-code": null,
      "currency": "GBP",
      "customer-name": null,
      "dishes-cost-cents": 0,
      "driver-location-lat": null,
      "driver-location-long": null,
      "estimated-delivery-in": 0,
      "estimated-time-of-dropoff": null,
      "estimated-time-of-pickup": null,
      "notes": "{}",
      "other-rejection-reason": null,
      "origin": null,
      "hubrise-source": null,
      "hubrise-service-type": null,
      "pickup-at-business": false,
      "placed-at": null,
      "reject-reason": null,
      "shipping-cost-cents": 0,
      "shipping-cost-for-business-cents": 0,
      "shipping-cost-for-customer-cents": 0,
      "short-id": 0,
      "state": "draft",
      "time-wish": null,
      "total-cost-cents": 0,
      "unavailable-elements": null,
      "updated-at": "2022-11-22T14:55:01.874Z",
      "user-email": "iorderedapizza@test.com",
      "user-phone": null,
      "user-phone-country-code": null,
      "user-phone-country-prefix": null,
      "with-orkestro-delivery": false
    },
    "relationships": {
      "addresses": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/addresses",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/addresses"
        }
      },
      "elements": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/elements",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/elements"
        }
      },
      "business": {
        "links": {
          "self": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/relationships/business",
          "related": "/orders/833a6878-118c-4baa-a6f1-0526e3f06d40/business"
        }
      }
    }
  }
}

Delete Order

Delete a Order.

Parameters
  • idpath integerRequired

    Delete a Order by specific id.

DELETE/api/v1/orders/{id}

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

Reject Order

Reject an Order.

Parameters
  • idpath integerRequired

    Update a Reject Order by specific id.

  • dataformData, objectRequired

    Form Data needed when rejecting an Order.

    • idstringRequired

      Provide Order id.

    • typestringRequired

      Provide Order type. Current selection is only orders.

    • attributesformData, object

      Attributes object.

      • reject_reasonstring

        The reject reason from the following options; other, dishes_unavailable, kitchen_full, no_delivery_person, almost_closing_time.

      • other_rejection_reasonstring

        If reject reason is other. Provided written reason not fitting to other categories.

      • unavailable_elementsstring

        Unavailable elements UUIDs delimeted by comma

PATCH/api/v1/orders/{id}/reject

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "153aa44c-3fea-4e10-acd5-6a67ee9e77de",
    "type": "orders",
    "links": { "self": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de" },
    "attributes": {
      "acceptedAt": null,
      "collectionAt": null,
      "collectionCode": null,
      "currency": "GBP",
      "customerName": null,
      "dishesCostCents": 51699,
      "driverLocationLat": null,
      "driverLocationLong": null,
      "estimatedDeliveryIn": 0,
      "estimatedTimeOfDropoff": null,
      "estimatedTimeOfPickup": null,
      "notes": {},
      "otherRejectionReason": null,
      "origin": null,
      "hubriseSource": null,
      "hubriseServiceType": null,
      "pickupAtBusiness": true,
      "placedAt": "2022-11-22T15:29:24.098Z",
      "rejectReason": "kitchen_full",
      "shippingCostCents": 0,
      "shippingCostForBusinessCents": 0,
      "shippingCostForCustomerCents": 0,
      "shortId": 441,
      "state": "rejected",
      "timeWish": "as soon as possible",
      "totalCostCents": 51699,
      "unavailableElements": null,
      "updatedAt": "2022-11-22T15:30:25.649Z",
      "userEmail": "aleksandra.bochenska+clientnew@netguru.com",
      "userPhone": "999999999",
      "userPhoneCountryCode": "PL",
      "userPhoneCountryPrefix": "48",
      "withOrkestroDelivery": false
    },
    "relationships": {
      "addresses": {
        "links": {
          "self": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/relationships/addresses",
          "related": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/addresses"
        }
      },
      "elements": {
        "links": {
          "self": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/relationships/elements",
          "related": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/elements"
        }
      },
      "business": {
        "links": {
          "self": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/relationships/business",
          "related": "/orders/153aa44c-3fea-4e10-acd5-6a67ee9e77de/business"
        }
      }
    }
  }
}

Order Elements

Return all elements for specific order.

Parameters
  • idpath integerRequired

    Return all elements for specific order by id.

  • includequery string

    Include associations (delimited with comma). Available associations: element_options

  • pagequery integer

    Page offset to fetch.

  • per_pagequery integer

    Number of results to return per page.

GET/api/v1/orders/{id}/elements

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

  const data = await res.json();
}

RESPONSE

{
  "data": [
    {
      "id": "c47dcd01-d875-4960-8df1-e436e3b04fd1",
      "type": "elements",
      "links": {
        "self": "/elements/c47dcd01-d875-4960-8df1-e436e3b04fd1"
      },
      "attributes": {
        "currency": "GBP",
        "dish-name": "Test Dish",
        "dish-price-per-item-cents": 3000,
        "notes": null,
        "subsum-cents": 3000,
        "units": 1
      },
      "relationships": {
        "element-options": {
          "links": {
            "self": "/elements/c47dcd01-d875-4960-8df1-e436e3b04fd1/relationships/element-options",
            "related": "/elements/c47dcd01-d875-4960-8df1-e436e3b04fd1/element-options"
          }
        }
      }
    }
  ],
  "meta": {
    "total-count": 1,
    "total-pages": 1
  }
}

Orkestro Order

Return an Orkestro Order.

Parameters
  • idpath integerRequired

    Return an Orkestro Order by specific id.

GET/api/v1/orders/{id}/orkestro

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

    const data = await res.json();
  }

RESPONSE


Create Orkestro Order

Create an Orkestro Order.

Parameters
  • idpath integerRequired

    Provided an Orkestro Order id.

  • dataformData, objectRequired

    Form Data needed when creating an Orkestro Order.

    • idstringRequired

      Provided an Orkestro Order id.

    • typestringRequired

      Provide Order type. Current selection is only orders.

POST/api/v1/orders/{id}/orkestro

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

    const data = await res.json();
  }

RESPONSE