Orders API Calls

These are the methods for working with Orders in MyFreestone®.

Methods and Examples

Get an Order

Get a specific Order by ID.

Method/URL

GET https://api.myfreestone.com/order/{id}

Return [status]

(object) - An Order object [200]

Get an Order selection

Get a paginated selection of Orders.

Method/URL

GET https://api.myfreestone.com/order/selection

Parameters

(int) limit - The number of results to retrieve.
(int) offset - The offset of the first result to retrieve.
(string) sort_by - The parameter by which to order the results. {id, timestamp, total, status_id}
(string) sort_order - The direction in which sorting should take place. {desc, asc}
(string) term - Search term to filter by: id, customer_id, customer_name, customer_email.
(int) timestamp_start - Filter out orders before this date/time. {Unix time}
(int) timestamp_end - Filter out orders after this date/time. {Unix time}

Return [status]

(object/mixed) - An object consisting of selection metadata and an array of Order objects [200]

Get an Order's Billing Information

Get the billing information associated with an Order.

Method/URL

GET https://api.myfreestone.com/order/{id}/billing

Return [status]

(object) - An Order Billing object [200]

Get an Order's Shipping Information

Get the shipping information associated with an Order.

Method/URL

GET https://api.myfreestone.com/order/{id}/shipping

Return [status]

(object) - An Order Shipping object [200]

Update an Order

Update a specific Order by ID.

Method/URL

PUT https://api.myfreestone.com/order/{id}

Authentication Level

20

Parameters

(int) status_id - The Order status
(string) date_shipped - The date that the Order shipped
(string) tracking_number - A tracking number for a shipped Order
(string) general_comments - Order comments

Return [status]

(null) - [204]

Update an Order Item's Stream Records

Update a specific Order item's stream records.

Method/URL

PUT https://api.myfreestone.com/order/{id}/item/{order item id)/stream

Authentication Level

20

Parameters

(int) status_id - The stream completion status
(datetime) exp_date - Expiration of stream

Return [status]

(null) - [204]

Get an Order Item's stream records

Gets all the topic stream records of an Order Item.

Method/URL

GET https://api.myfreestone.com/order/{id}/item/{order item id)/stream

Return [status]

(object) - An Order Item Stream object [200]

This will return a launch link which opens the applicable viewer for content.

Method/URL

GET https://api.myfreestone.com/order/{id}/item/{order item id)/streaming_link

Return [status]

(object) - A URL launch link to view order item content [200]

Revoke an Order

Revoke all streaming access and expire all credit for an order while marking orderitems as refunded

Method/URL

PUT https://api.myfreestone.com/order/{id}/revoke

Authentication Level

30

Parameters

(str) revoke_comment (optional) - Revoke comment to be added in the order comment (Default = "Order revoked via API")

Return [status]

(null) - [204]

External Order

Place an order externally using only a customer ID and product code. This endpoint checks if the supplied product code(s) exist on individual courses first. If the product code is not found on any individual courses, it checks for any collections that may match.

Method/URL

POST https://api.myfreestone.com/order/external_order

Authentication Level

20

Parameters

(int) customer_id (required) - AMS Customer/Member ID or Freestone Customer ID
(str) product_code (required) - single product code or JSON numeric array of product codes. Set the group_order parameter to ‘true’ to group all supplied product codes into one order. Cannot group collection product codes.
(str) external_order_id - single AMS order/purchase id or JSON object({"product_code_1":"external_order_id_1","product_code_2":"external_order_id_2"}) for separate orders with different External Order IDs.
(str) allow_duplicate - set this parameter to 'true' if you would like to place an order for customer having an existing active order with the same product code. (Default = false)
(str) group_order - set this parameter to 'true' if you would like to group all supplied product codes for individual courses into one cart and one order. Does not work for Collection product codes. (Default = false).

Return [status]

(str) - Error code 4xx with error message or Success code 200 with JSON encoded associative array of product codes along with success state, cart id, order id, and order item id. If collection order is placed, each course within the collection will have it’s own order id, order item id, AMS product code and freestone product id.