Project API


For purposes of this API description, all URLs are relative to the base url of http://localhost:8080/lf2u

Also, all data is in JSON format. A GET request will return JSON. A PUT or POST will submit a JSON document.

To keep things simple, no authentication is required to access any resource.

All use cases marked with [*] are not required as part of the final delivery for this project.

The following abbreviations are used throughout this document:

  • cid: customer id
  • fid: farm id
  • gcpid: general catalog product id
  • fspid: farm store product id
  • oid: order id
  • mrid: manager report id
  • frid: farmer report id
  • mid: manager id

Farmers


POST /farmers

Creates an account and returns (in the body of the response) the ID of the account.

'Location' header with link to /farmers/{fid} where {fid} is the newly assigned ID for the farmer account.

HTTP response code: 201 (Created) if everything is ok. 400 (Bad Request) if any of the required data is missing or is invalid.

Resource URL

/farmers

Parameters

farm_info: Information about the farm

  • name (required): the name of the farm
  • address (required): the address of the farm
  • phone (requied): the phone number for the farm
  • web (optional): the URL for the farm's website

personal_info: Contact information for the farmer

  • name (required): farmer's name
  • email (required): farmer's email address
  • phone (requied): farmer's phone number

delivers_to (required): Zip codes the farm delivers to

Example Request

  
POST http://localhost:8080/lf2u/farmers

Here is data being POST-ed

  
{ "farm_info": { "name": "SafeHouse Farm Alpacas", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "http://www.openherd.com/" }, "personal_info": { "name": "John Smith", "email": "john.smith@example.com", "phone": "123-456-7890" }, "delivers_to": ["60010", "60011", "60067"] }

Example Response

  
{ "fid": "123" }

^Top^ ^Farmers^


PUT /farmers/{fid}

Updates the account identified by {fid}. The payload of the request replaces the existing account.

HTTP response code: 200 (OK). The body of the response will be empty.

If the account identified by {fid} doesn't exist, then the HTTP response code will be 404 (Not Found).

Resource URL

/farmers/{fid}

Parameters

farm_info: Information about the farm

  • name (required): the name of the farm
  • address (required): the address of the farm
  • phone (requied): the phone number for the farm
  • web (optional): the URL for the farm's website

personal_info: Contact information for the farmer

  • name (required): farmer's name
  • email (required): farmer's email address
  • phone (requied): farmer's phone number

delivers_to (required): Zip codes the farm delivers to

Example Request

  
PUT http://localhost:8080/lf2u/farmers/123

Here is data being PUT.

  
{ "farm_info": { "name": "Tall Trees", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "" }, "personal_info": { "name": "Eva Smith", "email": "eva.smith@example.com", "phone": "123-456-7890" }, "delivers_to": ["60010", "60011"] }

Example Response

The body of the response is empty.

^Top^ ^Farmers^


GET /farmers/{fid}

Returns detailed information about the farm account identified by {fid}.

HTTP response code: 200 (OK) or 404 (Not found) if the account identified by {fid} doesn't exist.

Resource URL

/farmers/{fid}

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/farmers/123

Example Response

  
{ "fid": "123", "farm_info": { "name": "Tall Trees", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "" }, "personal_info": { "name": "Eva Smith", "email": "eva.smith@example.com", "phone": "123-456-7890" }, "delivers_to": ["60010", "60011"] }

^Top^ ^Farmers^


GET /farmers[?zip=ddddd]

Returns an array of farmers that have accounts with LF2U. If the zip parameter is specified then only return those farmers that deliver in the zip code.

HTTP response code: 200 (OK).

Resource URL

/farmers[?zip=ddddd]

Parameters

zip (optional): five digits

Example Request

  
GET http://localhost:8080/lf2u/farmers?zip=60010

Example Response

  
[{ "fid": "123", "name": "Tall Trees" }]

^Top^ ^Farmers^


GET /farmers/{fid}/products

Returns an array of all products in the store identified by the farmer ID {fid}.

HTTP response code: 200 (OK) if {fid} is valid, 404 (Not Found) otherwise.

Resource URL

/farmers/{fid}/products

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/farmers/123/products

Example Response

  
[{ "fspid": "345", "name": "Potatoes", "note": "These Russets are ideal for light and fluffy mashed potatoes.", "start_date": "10-01", "end_date": "", "price": 0.29, "product_unit": "lb", "image": "" }, { "fspid": "346", "name": "Eggplant", "note": "Deep purple skin; average size is 2lb", "start_date": "08-15", "end_date": "10-30", "price": 2.75, "product_unit": "piece", "image": "" }]

^Top^ ^Farmers^


POST /farmers/{fid}/products

Adds product from the general (LF2U) catalog to the farmer store identified by {fid}.

The body of the response will contain the ID of the product entry in farmer's store. 'Location' header with link to /farmers/{fid}/products/{fspid} where {fspid} is the newly assigned ID for the the product in farmer's store.

HTTP response code: 201 (Created).

Resource URL

/farmers/{fid}/products

Parameters

gcpid (required): the ID of the generic product in the general (LF2U) catalog.

note (optional): a personal description of the product; will be displayed next to the general catalog product name when the customer looks at farmer's store.

start_date (optional): date of the year, e.g. "MM-DD" when the product becomes available; if not specified then the product is available starting with the first day of the year.

end_date (optional): date of the year, e.g. "MM-DD" when the product is last available; if not specified, then the product is available through the last day of the year.

price (required): price per unit of product.

product_unit (required): what is the unit for which the price is defined, e.g. "lb", "floz", "Kg", etc.

image (optional): URL for the picture of this store product.

Example Request

  
POST http://localhost:8080/lf2u/farmers/123/products

Here is data being POST-ed

  
{ "gcpid": "125", "note": "These Russets are ideal for light and fluffy mashed potatoes.", "start_date": "10-01", "end_date": "", "price": 0.29, "product_unit": "lb", "image": "" }

Example Response

  
{ "fspid": "345" }

^Top^ ^Farmers^


POST /farmers/{fid}/products/{fspid}

NOTE: throughout this API we use PUT for updates, the reason we're using POST in this case is to show partial updates.

Modifies product identified by {fspid} in the farmer's store identified by {fid}.

HTTP response code: 200 (OK). The body of the response will be empty. If the account identified by {fid} doesn't exist or the product identified by {fspid} don't exist, then the HTTP response code will be 404 (Not Found). 'Location' header with link to /farmers/{fid}/products/{fspid}.

Resource URL

/farmers/{fid}/products/{fspid}

Parameters

note (optional): a personal description of the product; will be displayed next to the general catalog product name when the customer looks at farmer's store.

start_date (optional): date of the year, e.g. "MM-DD" when the product becomes available; if not specified then the product is available starting with the first day of the year.

end_date (optional): date of the year, e.g. "MM-DD" when the product is last available; if not specified, then the product is available through the last day of the year.

price (optional): price per unit of product.

product_unit (optional): what is the unit for which the price is defined, e.g. "lb", "floz", "Kg", etc.

image (optional): URL for the picture of this store product.

Example Request

  
POST http://localhost:8080/lf2u/farmers/123/products/345

Here is data being POST-ed

  
{ "price": 0.37 }

Example Response

The body of the response is empty.

^Top^ ^Farmers^


GET /farmers/{fid}/products/{fspid}

Get the detail for product identified by {fspid} in the farmer's store identified by {fid}.

HTTP response code: 200 (OK). If the account identified by {fid} doesn't exist or the product identified by {fspid} don't exist, then the HTTP response code will be 404 (Not Found).

Resource URL

/farmers/{fid}/products/{fspid}

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/farmers/123/products/345

Example Response

  
{ "fspid": "345", "note": "These Russets are ideal for light and fluffy mashed potatoes.", "start_date": "10-01", "end_date": "", "price": 0.29, "product_unit": "lb", "image": "" }

^Top^ ^Farmers^


Reports


GET /farmers/{fid}/reports

Returns an array of available report IDs with their corresponding names. The same reports are available to all farmers.

HTTP response code: 200 (OK).

Resource URL

/farmers/{fid}/reports

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/farmers/123/reports

Example Response

  
[{ "frid": "701", "name": "Orders to deliver today" }, { "frid": "702", "name": "Orders to deliver tomorrow" }, { "frid": "703", "name": "Revenue report" }, { "frid": "704", "name": "Orders delivery report" }]

^Top^ ^Reports^


GET /farmers/{fid}/reports/{frid}[?start_date=YYYYMMDD&end_date=YYYYMMDD]

Returns the report identified by {frid} populated with data that is specific to the farm identified by {fid}. If a start_date and end_date are provided, then use those to narrow the result set for the report.

HTTP response code: 200 (OK) or 404 (Not Found) if {fid} or {frid} are invalid.

Resource URL

/farmers/{fid}/reports/{frid}

Parameters

start_date (optional): the start date for the date range of the report.

end_date (optional): the end date for the date range of the report.

Example Request

  
GET http://localhost:8080/lf2u/farmers/127/reports/701

Example Response

  
{ "frid": 701, "name": "Orders to deliver today", "orders": [{ "oid": "456", "products_total": 10.57, "delivery_charge": 5.00, "order_total": 15.57, "status": "open", "order_date": "20161020", "planned_delivery_date": "20161021", "actual_delivery_date": "", "ordered_by": { "name": "Virgil B", "email": "virgil@example.com", "phone": "312-456-7890" }, "delivery_address": "10 West 31st ST, Chicago IL 60616", "note": "Room SB-214", "order_detail": [{ "fspid": 345, "name": "Potatoes", "order_size": "8 lb", "price": "0.29 per lb", "line_item_total": 2.32 }, { "fspid": 346, "name": "Eggplant", "order_size": "3 piece", "price": "2.75 per piece", "line_item_total": 8.25 }] }, { "oid": "459", "products_total": 7.50, "delivery_charge": 5.00, "order_total": 12.50, "status": "open", "order_date": "20161020", "planned_delivery_date": "20161021", "actual_delivery_date": "", "ordered_by": { "name": "John Doe", "email": "john.doe@example.com", "phone": "123-456-7890" }, "delivery_address": "123 Main ST, Chicago IL 60617", "note": "Please leave with building attendant.", "order_detail": [{ "fspid": 347, "name": "Tomatoes", "order_size": "5 lb", "price": "1.50 per lb", "line_item_total": 7.50 }] }] }

Another Example Request

  
GET http://localhost:8080/lf2u/farmers/127/reports/703?start_date=20161019&end_date=20161019

Example Response

  
{ "frid": 703, "name": "Revenue report", "start_date": "20161019", "end_date": "20161019", "orders_placed": 9, "orders_cancelled": 2, "orders_delivered": 7, "products_revenue": 513.98, "delivery_revenue": 15 }

^Top^ ^Farmers^


GET /farmers/{fid}/delivery_charge

Returns the current value of the delivery fee for the farm identified by {fid}.

HTTP response code: 200 (OK).

Resource URL

/farmers/{fid}/delivery_charge

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/farmers/123/delivery_charge

Example Response

  
{ "delivery_charge": 9.95 }

^Top^ ^Farmers^


POST /farmers/{fid}/delivery_charge

Modifies the delivery charge.

HTTP response codes: 204 (No Content), 400 (Bad Request) if data is missing from the request or is malformed. 'Location' header with link to /admin/{fid}/delivery_charge. The body of the response will be empty.

Resource URL

/farmers/{fid}/delivery_charge

Parameters

delivery_charge (required): the new delivery charge (aka delivery fee) amount.

Example Request

  
POST http://localhost:8080/lf2u/farmers/123/delivery_charge

Here is data being POST-ed

  
{ "delivery_charge": 5.00 }

^Top^ ^Farmers^


Customers


POST /customers

Creates an account and returns (in the body of the response) the ID of the account.

'Location' header with link to /customers/{cid} where {cid} is the newly assigned ID for the farmer account.

HTTP response code: 201 (Created).

Resource URL

/customers

Parameters

  • name (required): customer name
  • street (required): the street address of the customer
  • zip (required): the zip code of the customer
  • phone (requied): customer's phone number
  • email (required): customer's email address

Example Request

  
POST http://localhost:8080/lf2u/customers

Here is data being POST-ed

  
{ "name": "Virgil B", "street": "10 West 31st Street, #214", "zip": "60616", "phone": "312-567-5146", "email": "virgilb@example.com" }

Example Response

  
{ "cid": "85" }

^Top^ ^Customers^


PUT /customers/{cid}

Replaces the account information for the account identified by {cid} with the information in the body of the PUT request.

HTTP response code: 200 (OK). The body of the response will be empty. If the account identified by {cid} doesn't exist, then the HTTP response code will be 404 (Not Found).

Resource URL

/customers/{cid}

Parameters

  • name (required): customer name
  • street (required): the street address of the customer
  • zip (required): the zip code of the customer
  • phone (requied): customer's phone number
  • email (required): customer's email address

Example Request

  
PUT http://localhost:8080/lf2u/customers/85

Here is data being PUT

  
{ "name": "Virgil B", "street": "1405 W Palatine Rd, Hoffman Estates", "zip": "60192", "phone": "847-963-8845", "email": "virgilb@example.com" }

Example Response

The body of the response is empty.

^Top^ ^Customers^


GET /customers/{cid}

Returns detailed information about the customer identified by {cid}.

HTTP response code: 200 (OK) or 404 (Not found) if the account identified by {cid} doesn't exist.

Resource URL

/customers/{cid}

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/customers/85

Example Response

  
{ "cid": "85", "name": "Virgil B", "street": "10 West 31st Street, #214", "zip": "60616", "phone": "312-567-5146", "email": "virgilb@example.com" }

^Top^ ^Customers^


POST /customers/{cid}/orders

Creates an order for the customer identified by {cid} and returns (in the body of the response) the ID of the order.

'Location' header with link to /customers/{cid}/orders/{oid} where {oid} is the newly assigned ID for the order.

HTTP response code: 201 (Created). If {cid} doesn't exist then the response code is 404.

Resource URL

/customers/{cid}/orders

Parameters

  • fid (required): this the id of the farmer with whom the order will be placed
  • fspid (required): this the id of the product in the farmer store
  • amount (required): how much of the product to be purchased, e.g. 1.5
  • delivery_note (optional): delivery instructions

NOTE: the units for "amount" will be those listed for the product in the farmer's catalog. For example, if the product is potatoes and the "product_unit" for potatoes is "lb", then an order where the "amount" is 1.5 is understood to be 1.5 lb.

Example Request

  
POST http://localhost:8080/lf2u/customers/85/orders

Here is data being POST-ed

  
{ "fid": "123", "order_detail": [ { "fspid": "345", "amount": 1.5 }, { "fspid": "346", "amount": 8 } ], "delivery_note": "Please leave with building attendant." }

Example Response

  
{ "oid": "97" }

^Top^ ^Customers^


GET /customers/{cid}/orders

Returns an array of all orders placed by the customer identified by {cid}.

HTTP response code: 200 (OK) if {cid} is valid, 404 (Not Found) otherwise.

Resource URL

/customers/{cid}/orders

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/customers/85/orders

Example Response

  
[{ "oid": "97", "order_date": "20161021", "planned_delivery_date": "20161022", "actual_delivery_date": "", "status": "open", "fid": "123" }]

^Top^ ^Customers^


GET /customers/{cid}/orders/{oid}

Returns order detailed for the order identified by {oid) placed by the customer identified by {cid}.

HTTP response code: 200 (OK) if {cid} and {oid} are valid, 404 (Not Found) otherwise.

Resource URL

/customers/{cid}/orders/{oid}

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/customers/85/orders/97

Example Response

  
{ "oid": "97", "order_date": "20161021", "planned_delivery_date": "20161022", "actual_delivery_date": "", "status": "open", "farm_info": { "fid": "123", "name": "Tall Trees", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "" }, "order_detail": [{ "fspid": "345", "name": "Potatoes", "amount": "1.5 lb", "price": "0.29 per lb", "line_item_total": 0.43 }, { "fspid": "346", "name": "Eggplant", "amount": "8 piece", "price": "2.75 per piece", "line_item_total": 22.00 }], "delivery_note": "Please leave with building attendant.", "products_total": 22.43, "delivery_charge": 5.00, "order_total": 27.43 }

^Top^ ^Customers^


POST /customers/{cid}/orders/{oid}

Cancels the order identified by {oid} placed by customer {cid}.

HTTP response codes: 204 (No Content), 400 (Bad Request) if data is missing from the request or is malformed. 'Location' header with link to /customers/{cid}/orders/{oid}. The body of the response will be empty.

Resource URL

/customers/{cid}/orders/{oid}

Parameters

status (required): the only acceptable value is "cancelled".

Example Request

  
POST http://localhost:8080/lf2u/customers/85/orders/97

Here is data being POST-ed

  
{ "status": "cancelled" }

^Top^ ^Customers^


Managers


GET /managers/catalog

Returns an array of all products in the general catalog.

HTTP response code: 200 (OK).

Resource URL

/managers/catalog

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/managers/catalog

Example Response

  
[{ "gcpid": "125", "name": "Potatoes" }, { "gcpid": "126", "name": "Tomatoes" }, { "gcpid": "127", "name": "Eggplant" }]

^Top^ ^Managers^


POST /managers/catalog

Takes a product and adds it to the catalog. The body of the response will contain the ID of the new product.

HTTP response code: 201 (Created).

Resource URL

/managers/catalog

Parameters

name (required): the name of the product

Example Request

  
POST http://localhost:8080/lf2u/managers/catalog

Here is data being POST-ed

  
{ "name": "Potatoes" }

Example Response

  
{ "gcpid": "125" }

^Top^ ^Managers^


POST /managers/catalog/{gcpid}

Updates the catalog product identified by {gcpid}.

HTTP response code: 200 (OK) if the product identified by {gcpid} exists, otherwise 404 (Not found).

Resource URL

/managers/catalog/{gcpid}

Parameters

name (required): the name of the product

Example Request

  
POST http://localhost:8080/lf2u/managers/catalog/125

Here is data being POST-ed

  
{ "name": "Potatoes (red)" }

Example Response

The body of the response is empty.

^Top^ ^Managers^


GET /managers/accounts

Returns an array of all manager accounts. The system always starts with a manager account; this manager can then create another account, etc.

HTTP response code: 200 (OK).

Resource URL

/managers/accounts

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/managers/accounts

Example Response

  
[{ "mid": "0", "name": "Super User", "created_by": "System" "create_date": "20161001", "phone": "123-0987-654", "email": "superuser@example.com" }, { "mid": "79", "name": "Johnny Smith", "created_by": "Super User" "create_date": "20161015", "phone": "123-0987-659", "email": "johnny.smith@example.com" }]

^Top^ ^Managers^


GET /managers/accounts/{mid}

Returns the account information for the manager identified by {mid}.

HTTP response code: 200 (OK) if {mid} exists, otherwise 404 (Not Found)

Resource URL

/managers/accounts/{mid}

Parameters

None

Example Request

  
GET http://localhost:8080/lf2u/managers/accounts/79

Example Response

  
{ "mid": "79", "name": "Johnny Smith", "created_by": "Super User" "create_date": "20161015", "phone": "123-0987-659", "email": "johnny.smith@example.com" }

^Top^ ^Managers^


Reports


GET /managers/reports

Returns an array of available report IDs with their corresponding names.

HTTP response code: 200 (OK).

Resource URL

/managers/reports

Parameters

None.

Example Request

  
GET http://localhost:8080/lf2u/managers/reports

Example Response

  
[{ "mrid": "1", "name": "Orders placed today" }, { "mrid": "2", "name": "Orders placed yesterday" }, { "mrid": "3", "name": "Revenue for previous month" }, { "mrid": "4", "name": "Revenue yesterday" }, { "mrid": "5", "name": "Revenue yesterday by zip code" }]

^Top^ ^Reports^


GET /managers/reports/{mrid}[?start_date=YYYYMMDD&end_date=YYYYMMDD]

Returns the report identified by {mrid}. If a start_date and end_date are provided, then use those to narrow the result set for the report.

HTTP response code: 200 (OK) or 404 (Not Found) if {mrid} is invalid.

Resource URL

/managers/reports/{mrid}

Parameters

start_date (optional): the start date for the date range of the report.

end_date (optional): the end date for the date range of the report.

Example Request

  
GET http://localhost:8080/lf2u/managers/reports/2

Example Response

  
{ "mrid": "2", "name": "Orders placed yesterday", "orders_placed": 19, "orders_delivered": 11, "orders_open": 5, "orders_cancelled": 3 }

Another Example Request

  
GET http://localhost:8080/lf2u/managers/reports/3

Example Response

  
{ "mrid": "3", "name": "Revenue for last month", "start_date": "20160901", "end_date": "20160930", "orders_placed": 84, "orders_delivered": 80, "orders_open": 1, "orders_cancelled": 3, "total_revenue": 2222.25, "total_products_revenue": 1638.25, "total_delivery_revenue": 584, "lf2u_management_fee": 0.03, "total_lftu_fees": 66.67, "total_payable_to_farms": 2155.59, "by_farmer": [{ "fid": "123", "name": "Tall Trees", "orders_placed": 35, "orders_delivered": 34, "orders_open": 1, "orders_cancelled": 0, "total_revenue": 896.50, "products_revenue": 726.50, "delivery_revenue": 170, "lftu_fees": 26.90, "payable_to_farm": 869.61 }, { "fid": "127", "name": "Spotted Cow", "orders_placed": 49, "orders_delivered": 46, "orders_open": 0, "orders_cancelled": 3, "total_revenue": 1325.75, "products_revenue": 911.75, "delivery_revenue": 414, "lftu_fees": 39.77, "payable_to_farm": 1285.98 }] }

^Top^ ^Managers^


Search

GET /search?topic=topicword&key=keyword

Returns all entities within the "topic" ("topicword" can be one of "farm", "customer", "order") that match the "key" ("keyword" is a single word string, e.g. "bob", "123-4", etc.)

HTTP response code: 200 (OK), or 404 if "topicword" has a value that's not allowed.

Resource URL

/search?topic=topicword&key=keyword

Parameters

topic (required): the topic for search. The value for topic can be any of "farm", "customer", "order".

key (required): the search key. Anything that matches the keyword (the value of key) will be included in the result set. The search is case insensitive. If keyword is empty, then match everything.

Example Request

  
GET http://localhost:8080/lf2u/search?topic=farm&key=smith

Example Response

  
[{ "fid": "123", "farm_info": { "name": "Tall Trees", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "" }, "personal_info": { "name": "Eva Smith", "email": "eva.smith@example.com", "phone": "123-456-7890" }, "delivers_to": ["60010", "60011"] }]

Here is another example, this time for the "customer" topic.

Example Request

  
GET http://localhost:8080/lf2u/search?topic=customer&key=virgil

Example Response

  
[{ "cid": "85", "name": "Virgil B", "street": "10 West 31st Street, #214", "zip": "60616", "phone": "312-567-5146", "email": "virgilb@example.com" }]

Here is an example with the "order" topic.

Example Request

  
GET http://localhost:8080/lf2u/search?topic=order&key=97

Example Response

  
[{ "oid": "97", "order_date": "20161021", "planned_delivery_date": "20161022", "actual_delivery_date": "", "status": "open", "customer_info": { "cid": "85", "name": "Virgil B", "street": "1405 W Palatine Rd, Hoffman Estates", "zip": "60192", "phone": "847-963-8845", "email": "virgilb@example.com" }, "farm_info": { "fid": "123", "name": "Tall Trees", "address": "25550 W Cuba Rd, Barrington, IL 60010", "phone": "847-651-2140", "web": "" }, "order_detail": [{ "fspid": "345", "name": "Potatoes", "amount": "1.5 lb", "price": "0.29 per lb", "line_item_total": 0.43 }, { "fspid": "346", "name": "Eggplant", "amount": "8 piece", "price": "2.75 per piece", "line_item_total": 22.00 }], "delivery_note": "Please leave with building attendant.", "products_total": 22.43, "delivery_charge": 5.00, "order_total": 27.43 }]

^Top^ ^Search^


Delivery

POST /delivery/{oid}

Updates the order identified by {oid}.

HTTP response code: 200 (OK) if the order identified by {oid} exists, otherwise 404 (Not found).

Resource URL

/delivery/{oid}

Parameters

None.

Example Request

  
POST http://localhost:8080/lf2u/delivery/97

Here is data being POST-ed

  
{ "status": "delivered" }

Example Response

The body of the response is empty.

^Top^ ^Delivery^


Last update: Nov 9, 2016 Virgil Bistriceanu cs445 Computer Science

$Id: project-api.html,v 1.14 2016/11/09 23:15:20 virgil Exp $