Orders
#
Fetch OrdersReturn the list of orders for the current user.
#
ParamsName | Type |
---|---|
None | None |
#
Create Order using Site IDCreate a new order for the current user.
By default, orders are created with a state of created
. If you wish to provide a different OrderState
, you can provide that optional argument. If you do not wish to provide a different state, omit the parameter.
Most orders will have a pickup time of “ASAP”. If you have a different pickup window, you can pass a pickupWindow
parameter. If you want the default of “ASAP”, omit the parameter.
#
ParamsThis function only needs an object as a param.
Name | Type | Example | |
---|---|---|---|
siteId | Int | 15942 | |
pid | Str | '573836' | |
customerInfo | CustomerInfo | {name: 'Lamia Selmane',carType: 'Tesla',carColor: 'Silver',licensePlate: 'AB 0496' phone: '555-555-5555',} | |
pickupWindow | PickupWindow | {start: new Date().toISOString(),end: new Date('2022-12-02').toISOString(),} | |
orderState | Str | 'delayed' | |
pickupType | Str | 'delivery' |
#
Example#
Create Order using Site Partner IdentifierIf the app does not have the Flybuy siteID
or only wants to create the order if the site operational status is live
, the sitePartnerIdentifier
can be used to create an order. An orderPartnerIdentifier
and customerInfo
also need to be provided. This customer information does not need to be the same as the customer that is logged in. It should be the information for the person that is picking up the order.
Optionally, the orderState
, pickupType
, and pickupWindow
can be set when creating an order if these are not created via a backend integration.
Most orders will have a pickup time of “ASAP”. If you have a different pickup window, you can pass a pickupWindow
parameter. If you want the default of “ASAP”, omit the parameter.
#
ParamsThis function only needs an object as a param.
Name | Type | Example | |
---|---|---|---|
sitePartnerIdentifier | Str | sitePartnerIdentifier: '15942' | |
orderPid | Str | orderPartnerIdentifier: '573836' | |
customerInfo | CustomerInfo | {name: 'Lamia Selmane',carType: 'Tesla',carColor: 'Silver',licensePlate: 'AB 0496' phone: '555-555-5555',} | |
pickupWindow | PickupWindow | {start: new Date().toISOString(),end: new Date('2022-12-02').toISOString(),} | |
orderState | Str | 'delayed' | |
pickupType | Str | 'delivery' |
#
Example#
Claim OrderClaim an order for the current customer.
#
ParamsName | Type | Example |
---|---|---|
pid | Str | '9898899' |
customerInfo | CustomerInfo | {name: 'Lamia Selmane',carType: 'Tesla',carColor: 'Silver',licensePlate: 'AB 0496',phone: '555-555-5555',} |
pickupType | Str | 'pickup' |
#
Example#
Update Order StateYou can update an order’s state, if necessary, with any valid state:
#
ParamsName | Type | Example |
---|---|---|
orderID | Int | 46084566 |
state | Str | 'ready' |
#
Example#
Update Order Customer State#
ParamsName | Type | Example |
---|---|---|
orderID | Int | 46084566 |
state | Str | 'departed' |
#
Example#
Send spot identifier#
ParamsName | Type | Example | Description |
---|---|---|---|
orderID | Int | 46084566 | |
state | Str | 'waiting' | |
spot | Str | '1' | Max 35 characters |
#
Example#
Rate OrderIf you collect customer ratings in your app, you can pass them to Flybuy.
#
ParamsName | Type | Example |
---|---|---|
orderID | Int | 46084566 |
rating | Int | 5 |
comments | Str | 'Awesome!' |
#
Example#
Listen to orders updateSet up event listeners to get updates about orders.