You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the php API which the frontend of MyKitchen will talk to.
A ? in a variable name means it is optional. In the case where all variables have ?, at least one of them is required.
Responses
Status Codes
status
meaning
extras
1
success
0
failure
error: tells you what went wrong, missing: tells you missing variable data
Endpoints
Users
POST users/create
variable
datatype
desc
user_name
string (50)
The unique username which will define a user: indy4ksu
user_pass
string (32, md5)
The md5'd password of a user. md5 this BEFORE sending
The options for the delivery type. Local pick-up means it is not a delivery.
kdm_range ?
int (0-255)
The mile range to allow people to order. If they are further away, then discourage them.
POST delivery_methods/delete
variable
datatype
desc
id
int
The id of the delivery method you want to delete
Transactions
Stores the transactions for when a user buys something from a kitchen. Adding transaction amounts up gives the profits a kitchen has.
GET transactions/select
variable
datatype
desc
id ?
int
The id of the transaction you want the information of
kitchen_id ?
int
The id of the kitchen you want to get the transactions of
user_id ?
int
The id of the user you want to get the transactions of
page ?
int
The page number of the results you want (default: 1), 25 transactions per page
Stripe Payments
POST Stripe/ChargeCard
This also adds a record to the Transactions table. You can read from this table in a user or kitchen profile to display how their net credit/debit.
variable
datatype
desc
kitchen_id
int
The id of the kitchen to receive payment
user_id
int
The id of the user to be charged
card_number
int
The card number for payment (XXXX-XXXX-XXXX-XXXX)
card_name
str
The name on the card (JON DOE)
card_exp_m
int
The expiration month (XX)
card_exp_y
int
The expiration year (XXXX)
card_cvc
int
The card CVC code (XXX)
amount
float
The amount in dollars to charge
Password Reset
Send a password change request to a given user's email address. The user will need to use the code from their email to verify.
POST password_reset/request
This requests a password reset on the target email. If the email exists in the users database, they will be emailed with a 6 digit code.
The password change request will be active for 5 minutes, if they do not reset their password in that time they will need to request again.
variable
datatype
desc
user_email
string
The id of the kitchen to receive payment
POST password_reset/change
This changes the password of a user if their reset code was correct.
The password change request will be active for 5 minutes, if they do not reset their password in that time they will need to request again.
The password needs to be md5'd or else once the user's password is changed, the user will not be able to log in.
variable
datatype
desc
user_email
string
The id of the kitchen to receive payment
reset_code
int
The 6-digit code the user received in their email
password
string (32, md5)
The md5'd password the user will be changed to.
About
This is the php API which the frontend of MyKitchen will talk to.