Below are specific endpoint description you may use with orders within Site Flow:
Order submission endpoint
The base URL of the preferred order submission endpoint for Site Flow is:
https://orders.oneflow.io/api
.
This endpoint has a number of benefits over the generic Site Flow API endpoint when submitting orders:
- it supports computed attributes
- it is an asynchronous endpoint, that is, it supports a better high volume of orders. Because being asynchronous, payload errors are logged in the submission errors page in Site Flow Pro. If the order source doesn’t have access to Site Flow Pro, the PSP can set up a trigger to send back a postback on order submission errors.
- this order submission error is more robust to receiving and handling orders than the generic Site Flow API endpoint.
Currently, there is no deprecation date for the order creation functionality via the generic Site Flow API base URL.
This endpoint only supports order creation. For any other order management API call, the generic Site Flow API endpoint is available.
Create Order
This endpoint submits an order into Site Flow for immediate processing. It uses the newer Order submission endpoint, which is more scalable and robust and offers more capabilities such as compatibility with Products that the destination account has configured with Computed Attributes.
HTTPS Request
POST https://orders.oneflow.io/api/order
The body of the request should be the order structure in JSON format.
HTTPS Response
Submission process
The submission request will be stored in a persistent storage location and will be processed asynchronously.
Response
The response to the caller will happen right after the order request has been stored correctly. This response will be shown, regardless of whether the order is valid or not. The response body will include the following fields:
{
"_id": "5910757 faab8ec6f60127999",
"url": "https://s3.amazonaws.com/order/5910757faab8ec6f60127999",
"timestamp": "2017-04-08T13:41:19.998Z",
"sourceAccountId": "51 bb2fc71745777ba63f3f11"
}
Field | Description |
---|---|
_id | The order identifier. The system will keep this identifier and will save it within the new order |
url | Url to the stored original order content |
timestamp | Date and time of the order submission request |
sourceAccountId | Requester’s account id |
The new API is designed to scale up and down depending on the current demand. The API will limit the number of request it accepts during the time it is scaling up. This will require the requesters to handle the possible 5XX responses trying to resubmit the request after a few seconds, the time the system requires to finish the provision of new instances.
Order payload errors are reported on the ‘Order submission errors’ page in the Site Flow Pro destination account. Furthermore,the destination account can set up an ‘Order Submission Error’ trigger to report back the order submitter a postback with the error details.
Get All Orders
This endpoint retrieves all orders (by page). They are sorted by most recent first.
HTTPS Request
GET https://pro-api.oneflowcloud.com/api/order?page=2&pagesize=3
Query Parameters
Parameter | Default | Description |
---|---|---|
pagesize | 10 | Optional. The size of the page (number of orders) to return |
page | 1 | Optional. Which page to return |
Get an Order
This endpoint retrieves a specific order.
HTTPS Request
GET https://pro-api.oneflowcloud.com/api/order/<ID>
HTTPS Response
If the order was found, the response body is existing order (in JSON format).
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the order to retrieve (will be a 24-character hex string) |
Cancel an Order (by source ID)
This endpoint allows you to cancel a specific order, using the source account name and ID.
HTTPS Request
PUT https://pro-api.oneflowcloud.com/api/order/<sourceAccountName>/<sourceOrderId>/cancel
No request body is necessary.
HTTPS Response
If the order was found and wasn’t already cancelled, the response body is the cancelled order (in JSON format).
URL Parameters
Parameter | Description |
---|---|
sourceAccountName | The name of the source account that the order originated from |
sourceOrderId | The source order ID, specified when the order was submitted |
Get an Order (by source ID)
This endpoint allows you to get a specific order, using the source ID.
HTTPS Request
GET https://pro-api.oneflowcloud.com/api/order/bysourceid/<sourceOrderId>
No request body is necessary.
HTTPS Response
If the order was found, the response body is the order with the source order id (in JSON format).
URL Parameters
Parameter | Description |
---|---|
sourceOrderId | The source order ID, specified when the order was submitted |