Ogwugo API documentation
SOME API requests require Basic Authentication (Basic Auth).
ALL Responses = JSON
API url: https://ogwugo.com/api/
API V2 DOCUMENTATION
curl --include \
--request POST \
--header "Content-Type: application/json; charset=utf-8" \
--header "Authorization: Basic NGEwMGZmMjdfsghfjkhlgjfhdgssdfgzI5NDBlNjJj" \
test api auth data:
define("api_user", 'ogwugo_service'); define("api_password", 'g578276dsffdba'); define("api_token", 'Basic b2d3dWdvX3NlcnZpY2U6ZzU3ODI3NmRzZmZkYmE=');
API VERSION 2
the API version 2 inplements version1 documentation above
+++++===================================================================================================================================
API endpoint: *siteurl*/api/v2/
(how version 2 implements 1 is: to get banks in version 1 uses /api/banks then in version 2 it will be /api/v2/banks )
LOGIN/REGISTRATION [doc arguments version1 + ] --- that means check version 1 for the data to post including the ones listed here...
cart_id int (required)
platform (ENUM(web,android,ios))
domain (ENUM(local,international,food,gas))
login response:
{
"data": [
{
"id": "1",
"username": "ogwugo",
"email": "[email protected]",
"last_name": "fddgvd",
"first_name": "grgrgrg"
"cart_id": "0"
}
],
"status": "success",
"message": "correct username and password",
"error": {
"detail": "username and password verified",
"code": "202"
}
}
Registration also returns "cart_id": "0" for the authentication domain (ENUM(local,international,food,gas))
NB: DURING LOGIN/ REGISTRATION YOU POST "cart_id" WHY.
if you handle cart non locally, then this cart id most be posted during authenticaton so that it will be added into the user profile.
eg, if a non authenticated user is adding item to cart, whenever he autheticate, if you dont post the cart id generated by the API ALONG, the user will loose the cart.
now, the cart could be for ogwugo local, ogwugo internatioanl or ogwugo food cart, that calls for
domain (ENUM(local,international,food,gas)) default is local
FACEBOOK SOCIAL LOGIN:
returns user details as per login process and sets sessions for user for web api use..
process: authentcate facebook login via facebook javascript API then post the data to the endpoint
the facebook login will register the facebook user or log the user in if already exist.
// FB.api('/me', {locale: 'en_US', fields: 'id,first_name,last_name,email,link,gender,locale,picture,birthday'},
[POST] /auth/social/facebook
PARAMETERS: client_id
email
picture
first_name
last_name
gender
cart_id
platform (ENUM(web,android,ios))
domain (ENUM(local,international,food,gas))
ADD PRODUCT TO CART
[POST] /cart/product/add
PARAMETERS
product_id INT
quantity INT
user_id INT
cart_id INT
platform (ENUM(web,android,ios))
filters array (warning: critically learn how to post this..==> such that if we JSON ENCODE it we get:: {"Color":"Black","Size":"S"} ::
))
RESPONSE
if response action = take_to_product_page
redirect to product page.
REMOVE PRODUCT FROM CART
// this action emty the cart if its last product also removes coupon if the price becomes lower than order cap.
[POST] /cart/product/remove_product
PARAMETERS cart_id INT
item_id INT
RESPONSE : cart_empty = 1 (cart removed if item is now zero after removing)
EMPTY THE CART
remove cart and all product
[REQUEST] /cart/empty_cart
remove the cart based on $_SESSION['localCart'] (v1 APi)
include: cart_id (INT)
user_id (INT) --- v2
UPDATE CART PRODUCT QUANTITIES
[POST] /cart/update_cart
PARAMETERS
cart_id INT
(X-form data array)
quantity[]
item[]
product[]
GET CART DETAILS
[REQUEST] /cart/local_cart
parameter cart_id INT (Optional)
COUPON:
APPLY COUPON TO CART
[POST] /cart/coupon/add
Paramaters:
coupon VARCHAR
cart_id INT
REMOVE COUPON FROM CART
[REQUEST] /cart/coupon/remove
coupon VARCHAR
cart_id INT
/////////////////////////////////////////////////////////////////////////
In version one, we had checkout endpoint. the checkout process in version 2 has two endpoint.
Checkout endpoints creates invoice number and returns the details with invoice amount the user is expected to pay(this comes with shipping fee and transaction fees added.)
1. when the cart is handled locally by the API. (cart not stored in at API/Ogwugo server)
[POST] api/v2/checkout/create/invoice (THIS DOCUMENTATION FOLLOWS THE API VERSION 1 documentation, reference it. as APIv2 extends V1 too)
[POST] api/v2/checkout/non_local/invoice/create
PARAMETERS
cart_id INT
user_id INT
shipping_address INT // delivery address
shipping_fee double optional ()
total_amount double optional
user_new_address boolean(true(1),false(0)) reg
payment_method INT required
delivery_time INT reg
shipping_company INT
comment str
// if we are having new address from user.
if user_new_address == true, we collect the address inputted by the user at checkout and also store it as the user address..
title str [title of address eg my house]
address str reg
city int reg
phone str reg
latitude str
longitude str
ogwugo_area_location INT required
FROM API Documentation you can find list of Delivery time, shipping companies, payment methods, user shipping/delivery addresses, ogwugo_area_location
RESPONSE FORMAT:
{
"data": [
{
"invoice_id": "1",
"user_id": "ogwugo",
"invoice_number": "ogw1000454333", // unique id used for card payment posting
"amount": "5000", // along with shipping fee
"with_paystack_fee": "5250", // if user will use card payment, we have added the bank fee here.. pass to paystack direct.
.
.
.
.
,
}
],
"status": "success",
"message": "",
"error": {
"detail": "",
"code": "202"
}
}
INVOICE:
Manage INVOICE/ORDER
[POST] api/v2/manage_invoice/action
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
action = [ STR(delete,pause,enable)]
Accept Order:
[POST] api/v2/manage_invoice/accept_order
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
comment = [ STR ]
Reject Order:
[POST] api/v2/manage_invoice/reject_order
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
comment = [ STR ]
WISH FAVOURITE LIST
add product to wishlist
[POST] api/v2/wishlist/add
PARAMETER product_id [INT]
user_id [INT optional]
REMOVE PRODUCT
[POST] api/v2/wishlist/remove
PARAMETER product_id [INT]
user_id [INT optional]
list_id [INT]
LIST my product wishlist in paginations..
[GET] api/v2/wishlist/list/{offset}?limit={int}&user_id={INT}
count wishlist: [GET] api/v2/wishlist/list_count?user_id={INT}
SEARCH
Store search: /search/store?q=ntachi
Category Search: /search/category?q=electronics
STATIC PAGES
[GET] api/v2/pages/static?url={str}&format=[html,json]
LIST ALL STATIC PAGES: [GET] api/v2/pages/static/list
STORE:
USER create store
[POST] api/v2/store/create
PARAMETERS
user_id [INT optional]
store_name [str]
store_url [str]
store_form [INT]
store_admin_email
store_admin_username
store_admin_password
SPECIAL PRODUCT REQUEST
[POST] api/v2/request/product
PARAMETERS
user_id [INT optional]
message [text]
list my Special Product Request
[GET] api/v2/request/product/list
gets latest 50 only
PARAMETERS
user_id [INT optional]
view single request
[GET] api/v2/request/product/view
PARAMETERS
user_id [INT optional]
request_id [INT]
WALLET HISTORIES:
latest 50
[GET] api/v2/wallet/history/request
[GET] api/v2/wallet/history/credit
[GET] api/v2/wallet/history/debit
PARAMETERS
user_id [INT optional]
ACCEPT GIFT CARD, if the code is valid credit user wallet
[POST] /api/wallet/giftcard
user_id [INT]
giftcode [string]
ADDRESS CREATE
[POST] api/v2/address/create
user_id
address [string]
phone [string]
latitude [string]
longitude [string]
city [INT]
name [string]
UPDATE ADRESS
[POST] api/v2/address/update/[address_id]
user_id [int optional]
address [STR ]
phone [str ]
name [str ]
latitude [str ]
longitude [str ]
DELETE DRESS
[POST] api/v2/address/delete/[address_id]
user_id [int optional]
address_id [INT ]
NEWSLETER
[POST] api/v2/newsletter/subscribe
user_id [int optional]
name [str]
email [email ]
REVIEW PRODUCT
[POST] api/v2/review/product
star [double 5 max]
name
title
comment
product_id
user_id
PROFILE UPDATE
[POST] api/v2/user/update
user_id
default_address [INT]
default_billing [INT]
default_shippers [INT]
default_payment [INT]
first_name
last_name
social_name
phone
bio [text]
newsletter [boolean: true,null] checkbox not set at null
store_news [boolean: true,null]
// CHANGE Password
[POST] api/v2/user/password
user_id [INT ]
p [STR]
p1 [STR]
p2 [STR]
/////////////////////////////////////////////////
BITCOIN PAYMENT API
generate bitcoin address with invoice details
(returns price in btc, usd, naira, btc adress to pay to.)
[POST]
NB: END OF API V2 documentation: what are you looking for that you did not see, eg list of user address, the API v2 auguments v1 so this is how you get user adress in v2 by referencing the v1 doc.
v1: ../api/address/list/{user_id}
v2 .../api/v2/address/list/{user_id}
so for other endpoints, just add /v2 and we are goos to go..
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==================================================================
OGWUGO FOOD
// AUTHENTICATION
define("api_user", 'ogwugo_service');
define("api_password", 'g578276dsffdba');
define("api_token", 'Basic b2d3dWdvX3NlcnZpY2U6ZzU3ODI3NmRzZmZkYmE=');
this api focus on menu orders, to use features like user regitratio and login, user address, etc refer to core API version 1 for that,
// GET ALL FOOD CATEGORIES
ENDPOINT : ../api/v2/food
||||||||||||| list all food locations
1. [GET] /ogwugo/locations/list
RESPONSE TYPE:
{
"data": [
{
"id": 1,
"name": "ENUGU TOWN",
"city": 12,
"country": "NG",
"status": 1
}
],
"status": "success",
"message": "locations listed",
"error": {
"detail": "all locations listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||| GET CATEGORIES
1. [GET] /categories/list
2. [GET] /categories/list/featured
3. [GET] /category/list/restaurant/{1} // list of category in a restaurant..
RESPONSE SAMPLE for categories:
{
"data": [
{
"id": 1,
"name": "Swallow",
"description": "this is am amazing african food product for all..",
"status": 1,
"image": "uploads/images/1.jpg",
"featured": 0,
"icon": "",
"color": "",
"url": "",
"created_at": "2018-02-19 10:08:12",
"updated_at": "2018-02-19 15:03:19",
"banner_path": "uploads/images/1.jpg"
},
{
"id": 3,
"name": "Drinks",
"description": "",
"status": 1,
"image": "uploads/images/three.jpg",
"featured": 0,
"icon": "",
"color": "",
"url": "",
"created_at": "2018-02-19 10:08:12",
"updated_at": "2018-02-19 15:03:32",
"banner_path": "uploads/images/three.jpg"
}
],
"status": "success",
"message": "categories listed",
"error": {
"detail": "all categories listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET ALL RESTAURANTS
1. [GET] /restaurant/list
2. [GET] /restaurant/list/location/{L} // all restaurant by location ID
3. [GET] /restaurant/featured/list/location/{L} // all featured restaurant by location ID
X. [GET] /category/list/restaurant/{1} // list of category in a restaurant..
RESPONSE FORMAT:
{
"data": [
{
"id": 14,
"logo_url": "UPLOADS/stores/images/1499441676_logo_Store-Logos-Onyx.png",
"url": "onyxapparel",
"name": "Oyenx Apparel",
"banner_url": "UPLOADS/stores/images/1497536183_banner_onyxx-store2.jpg",
"city": "Enugu"
},
{
"id": 15,
"logo_url": "UPLOADS/stores/images/1505317373_logo_Store-Logos-ntachi3.png",
"url": "ntachiosa",
"name": "Ntachi Osa",
"banner_url": "UPLOADS/stores/images/1505399494_banner_Ntachi-Osa4.jpg",
"city": "Enugu"
}
],
"status": "success",
"message": "Restaurants listed",
"error": {
"detail": "all restaurants listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GET OPEN HOURS
[GET] /restaurant/get/open_hours/{restaurant_id}
RESPONSE FORMAT:
{
"data": [
{
"id": 1,
"day": "monday",
"open": "10:30",
"close": "11:20"
}
],
"status": "success",
"message": "Restaurant Open hours listed",
"error": {
"detail": "Restaurants open hrs listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Get restaurant reviews
[GET] /reviews/list/restaurant/{restaurant_id}
[POST] /restaurant/user/review/{restaurant_id}?user_id={n}
PARAMETERS:
user_id INT
title STR
review STR
name STR
star double (1-5)
RESPONSE FORMAT:
{
"data": [
{
"id": 2,
"name": "Ekuma2",
"title": "dhsdggsdg djsdj jgsfjdsj",
"review": "dshgsdhg ghsghdgh gfsgwdfgxgjfgdg gwfgwfu",
"star": ""
},
{
"id": 1,
"name": "Ekuma",
"title": "good one, I love it",
"review": "fjvj jbsdjfj jsdjfj jsjdfjsj jsjfsj jsjsfjx ",
"star": "3"
}
],
"status": "success",
"message": "Restaurant Reviews listed",
"error": {
"detail": "Restaurants review listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RETURN MENU FOR RESTAURANT.
[GET] /restaurant/menu/list/{restaurant_id}
[GET] /restaurant/menu/list/{restaurant_id}?category={n}
[GET] /restaurant/menu/list/featured/{restaurant_id}
RESPONSE FORMAT:
{
"data": [
{
"id": 1,
"name": "NEW FOOD TESTING",
"price": 24321,
"price_sale": 23221,
"remiter_price": 123,
"on_sale": 0,
"weight": 1,
"store": 1,
"status": 1,
"food_category": 1,
"ogwugo_location": 1,
"description": "wew",
"quantity": 123,
"in_stock": 1,
"cost_price": null,
"total_sold": 0,
"tags": null,
"featured": 0,
"created_at": "2018-02-20 10:16:12",
"updated_at": "2018-02-20 10:16:12",
"image": "",
"food_type": "main"
}
],
"status": "success",
"message": "menu listed",
"error": {
"detail": "all menu listed",
"code": "200"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADD PRODUCT TO CART
[POST] /cart/menu/add
PARAMETERS
product_id INT
user_id INT (0 for quest user)
cart_id INT (0 for new cart)
quantity INT
filters Array (warning: critically learn how to post this..==> such that if we JSON ENCODE it we get:: {"Color":"Black","Size":"S"} ::
RESPONSE FORMAT:
{
"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
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[POST] /cart/menu/empty
user_id INT
cart_id INT
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// remove item from cart
[POST] /cart/menu/remove (Also deletes the cart if the product removed is the last products. RETURNS 'cart_empty' = 1 IF CART IS NOW EMPTY)
user_id INT
cart_id INT
item_id INT (warning: this is not product id)
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[POST] /cart/update/menu/quantity
PARAMETERS: INT (X-form data array)
cart_id INT
item_id[]
quantity[]
product_id[]
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADD / REMOVE COUPON
[POST] /cart/coupon/add
[POST] /cart/coupon/remove
PARAMETER:
user_id INT
cart_id INT
coupon STR
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RETRIEVE CART DETAILS
[REQUEST] /cart/local/detail
PARAMETER:
user_id INT
cart_id INT
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CHECK / CREATE INVOICE FROM CART DETAILS..
In version one, we had checkout endpoint. the checkout process in version 2 has two endpoint and now effected food API.
Checkout endpoints creates invoice number and returns the details with invoice amount the user is expected to pay(this comes with shipping fee and transaction fees added.)
1. when the cart is handled locally by the API. (cart not stored in at API/Ogwugo server)
2. When the cart is handled on the OGWUGO DATABASE..
1. [POST] /checkout/invoice/creating (THIS DOCUMENTATION FOLLOWS THE API VERSION 1 documentation, reference it. as APIv2 extends V1 too)
or
2. [POST] /checkout/non_local/invoice/creating
PARAMETERS
cart_id INT
user_id INT
shipping_address INT // delivery address
shipping_fee double optional ()
total_amount double optional
user_new_address boolean(1,0) reg
payment_method INT required
delivery_time INT reg
shipping_company INT
comment str
// if we are having new address from user.
if user_new_address == true, boolean(true(1),false(0)) we collect the address inputted by the user at checkout and also store it as the user address..
title str [title of address eg my house]
address str reg
city int reg
phone str reg
latitude str
longitude str
ogwugo_area_location INT required
FROM API Documentation you can find list of Delivery time, shipping companies, payment methods, user shipping/delivery addresses, ogwugo_area_location
RESPONSE FORMAT:
{
"data": [
{
"invoice_id": "1",
"user_id": "ogwugo",
"invoice_number": "ogw1000454333", // unique id used for card payment posting
"amount": "5000", // along with shipping fee
"with_paystack_fee": "5250", // if user will use card payment, we have added the bank fee here.. pass to paystack direct.
.
.
.
.
,
}
],
"status": "success",
"message": "",
"error": {
"detail": "",
"code": "202"
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// GET user menu order list latest 200
[GET] /order/list/{user_id}
// get single order details
[GET] /order/user/{user_id}?order={order_id}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PAY FOR ORDER/INVOICE: this will follow payment methods..
Pay for order [GET]...: /invoice/pay/{order_id}?user={user_id}&ref={paystack ref}
call this endpoint to verify payments, bitcoin not supported in this method yet.
HOW IT WORK: posting a request to the endpoint; if the user payment method is wallet it will process the payment, deduct
CARD PAYMENT REF from order detail, data.invoice_number & data.paybill_ref used to generate invoice on the payment system sdk using the data.with_paystack_fee
paystack ref: invoice_number (pass this to paystack JS payment sdk)
paybil ref: paybill_ref
PAY ORDER RESPONSE
{
"data": [
{
"title": "wallet payment",
"paid": "1"
}
],
"status": "success",
"message": "",
"error": {
"detail": "",
"code": ""
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MANAGE ORDER?INVOICE
Update Payment method of invoice
[GET]...: /invoice/update/{order_id}?user={user_id}&payment_method_id={id}&ref={paybil or paystack ref}
Manage INVOICE/ORDER
[REQUEST] /manage_invoice/action
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
action = [ STR(delete,pause,enable)]
user INT
Accept Order:
[REQUEST] /manage_invoice/accept_order
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
comment = [ STR ]
user INT
Reject Order:
[REQUEST] /manage_invoice/reject_order
PARAMETERS: invoice_id [INT ]
marketYrID [ INT current market year ID, post it if not in current year..]
comment = [ STR ]
user INT
NB: invoice_id == order ID
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FOOD PACKAGES API
exteends food V2 API Docs
[GET] /packages/list/all
[GET] /packages/list/location/{location_id}
[GET] /packages/list/restaurant/{restaurant_id}
[GET] /packages/list/options/{package_id}
[GET] /packages/list/options/{package_id}/{weekday}
[GET] // packages/get/details/{P}
RESPONSE FORMAT:
{
"data": [
{
"id": 1,
"title": "Chop and save mini",
"image": "",
"price": 3000,
"description": ""
}
],
"status": "success",
"message": "food packages listed",
"error": {
"detail": "all food packages listed",
"code": "200"
}
}
///////////////////////////////////////////////////////////////////
PLACING ORDER FOR FOOD PACKAGE
user can select delivery address or add new one, then, select payment method, etc after which he is redirected to invoice to complete payment
[POST] /package/invoice/order
All PARAMETER
user_id int req
package_id int req
shipping_address int
user_new_address boolean(true(1),false(0)) reg
payment_method int reg
delivery_time int reg
shipping_company int req
comment str
option_item [] (days(int) req
// how to post: for each day say monday, tuesday wednesday
POST day = option_id
eg; monday = 5
tuesday = 55
one can have radio box for form with names monday, tuesday, etc. each option for each day wil have the day name and option_id as value.
option_item must an array equivalent to the number of days we have..
note: for billing_address,shipping_company, payment_method,shipping_address
user have defaults in profile, can be used to set form defaults selection at checkout..
data type: x-www-form-urlencoded.
if user_new_address == true, we collect the address inputted by the user at checkout
if we are having new address from user.. default address neglected, we have no express chekout on mobile
title str [title of address eg my house]
address str reg
city int reg
phone str reg
latitude str
longitude str
coupon str [default 0] reg (even though coupon is not allowed in food subscription yet.)
///////////////////////////////////////////////////////////////////
// pay food Package:
food package subscription is using same invoice as menu order:
use the API for paying for menu food orders to pay invoice..
for that order_id is required, that is invoice_id in Food Package details..
that is /invoice/pay/{order_id}?user={user_id}&ref={paystack ref}
///////////////////////////////////////////////////////////////////
MANAGE ORDER?INVOICE
update payment method, delete,pause,enable, etc
use the menu API to process.
// GET USER SUBSCRIPTIONS.. latest 200..
WARNING: before posting the userID, make sure the user is authenticated at your end. the API will not validate this against the APi authenticated User again
[GET] /packages/user/list/{user_id}
// get single order details
[GET] /package/user/view/{user_id}?order={id_hash}
///////////////////////////////////////////////////////////////////
CHANGE SUBSCRIBED OPTION FOR A DAY
there is an endpoint that returns options for a particular day user wish to change..
/packages/list/options/{package_id}/{weekday}
eg: /packages/list/options/1/monday
so to change option for monday, post (only non dispatched item will be updated)
[POST] /package/option/edit
item_id (int) // to be edited
choice_option_id // new item chosen from list
package_id (int) optional
day (str) required
RIDER API
Rider App uses its own Basic Authentication parameter
{site-url}/api/v2/riders
LOGIN: [POST] /account/login
username[string] and password[string]
PENDING PICK UPS
[GET] /pickups/orders
user_id [INT]
Single order view
[GET] /order/view/{order_id}
PARAMETERS
order_id[INT]
PEnding order pick
[POST] /order/pick
PARAMETERS
order_id [INT]
user_id [INT]
PENDING DELIVERY UPS
items picked up yet to be delivered
[GET] /delivery/orders
user_id [INT]
DELIVER/PAY ORDER
[POST] /deliver/pay
PARAMETERS: acceptance_code
payment_detail
order_id
user_id
ALL MY Handled ORDERS
[GET] /personal/orders
user_id [INT]
FOOD RIDER API
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// the food Riders API arguments Riders Documentation(meaning, they follow the same format..)
{site-url}/api/v2/rider/food
path: /api/v2/rider/food
LOGIN: [POST] /account/login
username[string] and password[string]
PENDING PICK UPS
[GET] /pickups/orders
user_id [INT]
// Single order view
[GET] /order/view/{order_id}
PARAMETERS
order_id[INT]
// Pending order pick assign to me
[POST] /order/pick
PARAMETERS
order_id [INT]
user_id [INT]
PENDING DELIVERY UPS
items picked up yet to be delivered
[GET] /delivery/orders
user_id [INT]
DELIVER/PAY ORDER
[POST] /deliver/pay
PARAMETERS: acceptance_code
payment_detail
order_id
user_id
ALL MY ORDERS
[GET] /personal/orders
user_id [INT]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
API FOR FOOD PACKAGE SUBSCRIPTION RIDER
PENDING PICKUPS
[GET] /subscriptions/{day}/{dispatch}
-----Default == /food/subscription/weekday/all
URL PARAMETERS--> {day} = monday,tuesday,wednesday,thursday,friday
--- {dispatch} = all,pending,dispatched
Query Parameter: pageId [INT] optional
// PICK SUBSCRIPTION ORDER:
[POST] subscription/order/pick
PARAMETERS
order_id [INT] (subscriptions.data.id in JSON data)
user_id [INT] (rider user ID)
// PAY INVOICE..
DELIVER/PAY ORDER
[POST] /subscription/order/pay
PARAMETERS: acceptance_code
payment_detail
invoice_id [INT] WARNING: invoice_id (subscriptions.data.invoice_id in JSON data in subscription list): this is 'invoice_id' NOT 'id'
Also (subscriptions.invoice in JSON data in view single subscription api): this is 'invoice_id' NOT 'id', that is from ([GET] subscription/order/view))
user_id
// ALL SUBSCRIPTIONS ASSIGNED TO ME
[GET] /sub/mine/{day}/{dispatch}
-----Default == /sub/mine/weekday/all
URL PARAMETERS--> {day} = monday,tuesday,wednesday,thursday,friday
--- {dispatch} = all,pending,dispatched
Query Parameter: pageId [INT] optional -- get your page id from pagination in response data too..
user_id [INT] Rider user id
// ALL SUBSCRIPTION ASSIGNED TO ME NOT DELIVERD
[GET] /pending_sub/mine/{day}/{dispatch}
-----Default == /sub/mine/weekday/all
URL PARAMETERS--> {day} = monday,tuesday,wednesday,thursday,friday
--- {dispatch} = all,pending,dispatched
Query Parameter: pageId [INT] optional -- get your page id from pagination in response data too..
user_id [INT] Rider user id
// VIEW SINGLE ORDER COMPLETE DETAIL
[GET] subscription/order/view
PARAMETERS
invoice_hash [STR] 'most important' (subscriptions.data.invoice_hash in JSON data)
order_id [INT] (subscriptions.data.id in JSON data)
user_id [INT] (rider user ID)
you should be looking for the v1 documentation