Order Stages Create API

Route

POST

Purpose

RESTful API for inserting new rows into order_statuses and order_stages table(s).


Parameters


order_id integer 1
Olio order ID. Required if order_request_id not provided.
order_request_id integer 2
Order Request ID. Required if order_id not provided.
update_status boolean 3 required
Boolean that indicates if the order status record should be updated or not.
stage string 4 required
The stage of the order.
stage_trigger string 5
The stage_trigger of the order.
stage_at_mt string 6
The stage_start_at value timestamp.
created_at_mt string 7
The created_at_fm value timestamp.
created_by_id integer 8
The user that created these records. If provided, populates the created_by with user's first and last name.
created_by string 9
If provided, parameter will override created_by_id logic.
appointment hash 10
Appointment Information.
  • appointment.appt_id integer
  • appointment.appt_confirmed string
  • appointment.appt_duration_time string
  • appointment.appt_start_at string
  • appointment.appt_stop_at string
  • appointment.cancel_reason string
  • appointment.cancel_note string

client hash 11
Sets the client_id and related attributes in order_statuses if provided. Otherwise, additional client data is queried in DB.
  • client.client_id integer
  • client.client_billing_postal_code integer

order hash 12
Sets the order details, if provided.
  • order.notes string
  • order.delivery_rush boolean
  • order.due_date string
  • order.external_id string
  • order.service_type string
  • order.services_addon_array array
  • order.cancel_reason string
  • order.cancel_note string

notes string 13

updated_by string 14

updated_by_id integer 15

notified_at_mt string 16

event_slug string 17

token string 100 required
Authentication token for either an application or session.
application_view string 110
View of application object you would like returned.
application string 200
Slug of application being requested. This is used to determine the role being used to make the request and therefore evaluate if the requester has the correct permissions.
Possible values
  • planoauth
  • planoorder
  • planox2

session_view string 300
View of session object you would like returned.

Request Body Example: application/json

Responses

action-successful 200

This status indicates that the request was successful. If the request returns data, it can be found in the data key.

invalid-token 401

This status is returned when the authentication token passed is invalid.

session-expired 401

This status is returned a session is older than seven days or hasn't been used in 72 hours. The user will need to reauthenticate. We allow our users to save a remember_me preference which will make there sessions last indefinitely.

client-required 401

This status is returned when the user makeing the request doesn't have a client, employee or liaison record. This means that they don't have any roles or permissions. Because we only allow our clients to register as a client, the user should be redirected to the PlanoAuth clients registration page where they can use the `/api/v1/users/client_register` API to register as a client. Eventhough the request will not be successful, this status will still return a `session` object because a session token is needed to register as a user.

missing-param 400

This status is returned when a required param was not passed with the request.

invalid-param 400

This status is returned when a param was invalid when passed. For example, passing an id that doesn't exist or passing an invalid email address.

application-crash 500

This status is returned when there is an internal server error. Please try again later.

mandrill-email-failed 500

This status is returned when there was an issue using Mandrill to send an email. Any time this response is returned, there will be a notification in the production notifications tab so the dev team will be away of the failure. These errors will most likely correlate with a data issue and will need to be invesigated.

invalid-content-type 400

This status is returned if the request was made with the incorrect content-type so the request params could not be read. For more infromation on content-type, please refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type.

route-non-existent 500

Response returned when HTTP route does not exist.

Uncommon Responses

The responses below are not very common.

no-params-decoded Uncommon

This status is returned the request body was decoded, but no params where found.

invalid-encoded-params Uncommon

This status is returned when the request body could not be decoded properly. This generally means that you are requesting a sensative_params API and your request body was not base64 encoded.

route-not-found Uncommon

This status is returned when the route record being requested hasn't been deployed yet.

identify-request-error Uncommon

This status is returned when there is an internal server error before the route could be identified. Please try again later.

service-not-found Uncommon

This status is returned when the route's API service record being requested hasn't been deployed yet.