OGWUGO API DOCUMENTATION

  1. Home
  2. Docs
  3. OGWUGO API DOCUMENTATION
  4. Ogwugo Food
  5. CART

CART

FOOD CART

Header Authorization: required.

Header Authentication : not required.

Add menu to cart.

PATH

[POST]   /cart/menu/add 

 

Param type required comment
product_id
int 1
user_id
int 1  > 0
cart_id
int 1 0 for new cart
quantity
int 1
filters
[] 1
form array with option_name_id,option_value_sn respectively::  {"5":"1","6":"9"} thus filters[option_name_id] = option_value_sn 
eg: filters[5] = 2 
from "attributes_array" in product details

RESPONSE:  first cart, returns cart id to use for next request

NB: it is required in mobile app, user must login before adding item to cart. thus:user_id in the table above cannot be zero
{
    "data": {
        "cart_id": "3",
        "user_id": "16"
    },
    "status": "success",
    "message": "Done adding to cart",
    "error": {
        "msq": "product added to cart",
        "detail": "added product to cart",
        "code": 404
    }
}

 

 

 

 

 

Remove Item from cart

PATH

[POST]   /cart/menu/remove 

 

Param type required comment

user_id
int 1  > 0
cart_id
int 1 0 for new cart
item_id
int 1

(Also deletes the cart if the product removed is the last products. RETURNS 'cart_empty' = 1 IF CART IS NOW EMPTY)

 

EMPTY THE CART

[POST]   /cart/menu/empty 

user_id, cart_id         REQUIRED

 

 

UPDATE CART ITEMS QUANTITY

PATH

[POST]   /cart/update/menu/quantity 

 

Param type required comment
user_id
int 0 cart that belong to a user may require header authentication.
cart_id
int 1  > 0
item_id
[] 1
X-form data array)
quantity
[] 1 X-form data array)
product_id
[] 1 X-form data array OF ALL PRODUCTS)

 

 

 

 

 

GET SINGLE CART DETAILS

PATH

[REQUEST]   /cart/local/detail 
Param type required comment
user_id
int 0 cart that belong to a user may require header authentication.
cart_id
int 1  > 0

GETTING CART PRICE FROM CART DETAILS
/cart/local/detail
what happens if user choose buyer_pickup.
at this point buyer_pickup is not selected yet. if you know the buyer will select it, then total invoice amount is =
( service_breakdown.packaging_fee + cart_price ) -- from response

 

 

 

 

 

6. UPDATE ADDRESS AND SHIPPER

method: [POST]

path:

[POST]   /cart/update/address 

updates the user address or shipping company in a cart to enable calculating shipping fee on the fly.

DataType [default] Detail
cart_id int. req
shipper_id int 0 to use default
user_id  int. reg, must be >0
address_id int  0 to use default
x-form data url-encoded

 

 

7. UPDATE SHIPPER

method: [POST]

path:

[POST]   /cart/menu/update/shipper 
DataType [default] Detail
cart_id int. req
shipper_id int 0 to use default
user_id  int. reg, must be >0
x-form data url-encoded

 

 

 

Was this article helpful to you? Yes No

How can we help?