Customers API Calls

These are the methods for working with Customers in MyFreestone®. Customers may log in to your portal and purchase/view content.

Methods and Examples

Get a Customer

Get a specific Customer by ID.

Method/URL

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

Return [status]

(object) - A Customer object [200]

Create a Customer

Create a new Customer with the supplied parameters.

Method/URL

POST https://api.myfreestone.com/customer/

Authentication Level

20

Parameters

(string) first_name (required) - The customer's first name
(string) last_name (required) - The customer's last name
(string) email (required) - The customer's email address
(string) company - The customer's company
(string) title - The customer's title
(string) billing_first_name - The customer's billing first name
(string) billing_last_name - The customer's billing last name
(string) billing_address1 - The customer's billing address
(string) billing_address2 - The customer's billing address (line 2)
(string) billing_city - The customer's city
(int) billing_state - The customer's billing state ID
(string) billing_zip - The customer's billing zip
(string) billing_phone - The customer's billing phone
(int) billing_country_id - The customer's billing country ID
(string) shipping_first_name - The customer's shipping first name
(string) shipping_last_name - The customer's shipping last name
(string) shipping_address1 - The customer's shipping address
(string) shipping_address2 - The customer's shipping address (line 2)
(string) shipping_city - The customer's shipping city
(int) shipping_state - The customer's shipping state ID
(string) shipping_zip - The customer's shipping zip
(string) shipping_phone - The customer's shipping phone
(int) shipping_country_id - The customer's shipping country ID
(string) external_id (required)* - If external api request - The customer's external ID

Return [status]

(object) - The newly created Customer object [201]

Update a Customer

Update the specified Customer with the supplied parameters.

Method/URL

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

Authentication Level

20

Parameters

(string) first_name - The customer's first name
(string) last_name - The customer's last name
(string) email - The customer's email address
(string) company - The customer's company
(string) title - The customer's title
(string) billing_first_name - The customer's billing first name
(string) billing_last_name - The customer's billing last name
(string) billing_address1 - The customer's billing address
(string) billing_address2 - The customer's billing address (line 2)
(string) billing_city - The customer's city
(int) billing_state - The customer's billing state ID
(string) billing_zip - The customer's billing zip
(string) billing_phone - The customer's billing phone
(int) billing_country_id - The customer's billing country ID
(string) shipping_first_name - The customer's shipping first name
(string) shipping_last_name - The customer's shipping last name
(string) shipping_address1 - The customer's shipping address
(string) shipping_address2 - The customer's shipping address (line 2)
(string) shipping_city - The customer's shipping city
(int) shipping_state - The customer's shipping state ID
(string) shipping_zip - The customer's shipping zip
(string) shipping_phone - The customer's shipping phone
(int) shipping_country_id - The customer's shipping country ID
(string) external_id - The customer's external ID

Return [status]

(null) - [204]

Get a Customer selection

Get a paginated selection of Customers.

Method/URL

GET https://api.myfreestone.com/customer/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, first_name, last_name, email, LastLogin}
(string) sort_order - The direction in which sorting should take place. {desc, asc}
(string) term - Search term. Can search by first name, last name, email or external ID
(string) fields - specified customer fields to be returned (comma delimited) to speed up processing

Return [status]

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

Get a Customer by External ID

Get a specific Customer by their External ID.

Method/URL

GET https://api.myfreestone.com/customer/by_external_id/{external_id}

Return [status]

(object) - The matching Customer record [200]

Get Customer Memberships

Get a list of all the Memberships a Customer has.

Method/URL

GET https://api.myfreestone.com/customer/{id}/memberships

Return [status]

(array) - An array of Membership objects [200]

Get a Customer Membership

Get a specified Membership for a Customer

Method/URL

GET https://api.myfreestone.com/customer/{id}/membership/{membership_id}

Return [status]

(object) - A Membership object [200]

Add a Customer Membership

Add a Membership to a specified Customer.

Method/URL

POST https://api.myfreestone.com/customer/{id}/membership

Authentication Level

20

Parameters

(int) level - The Membership Level
(string) provider_member_num - An external ID to tie to the Membership
(string) date_expires - The date the Membership expires

Return [status]

(null) - [201]

Update a Customer Membership

Update a Customer Membership with the supplied parameters.

Method/URL

PUT https://api.myfreestone.com/customer/{id}/membership/{membership_id}

Authentication Level

20

Parameters

(int) level - The Membership Level
(string) provider_member_num - An external ID to tie to the Membership
(string) date_expires - The date the Membership expires

Return [status]

(null) - [204]

Delete a Customer Membership

Remove a specific Customer's specified Membership.

Method/URL

DELETE https://api.myfreestone.com/customer/{id}/membership/{membership_id}

Authentication Level

20

Return [status]

(null) - [204]

Get Customer Group Memberships

Get a list of all the Group Memberships a Customer has.

Method/URL

GET https://api.myfreestone.com/customer/{id}/group_memberships

Return [status]

(array) - An array of Group Membership objects [200]

Get a Customer Group Membership

Get a specified Group Membership for a Customer

Method/URL

GET https://api.myfreestone.com/customer/{id}/group_membership/{group_membership_id}

Return [status]

(object) - A Group Membership object [200]

Add a Customer Group Membership

Add a Group Membership to a specified Customer.

Method/URL

POST https://api.myfreestone.com/customer/{id}/group_membership

Authentication Level

20

Parameters

(int) group_id (required) - The Group ID
(string) external_id - An external ID to tie to the Group Membership

Return [status]

(null) - [201]

Update a Customer Group Membership

Update a Customer Group Membership with the supplied parameters.

Method/URL

PUT https://api.myfreestone.com/customer/{id}/group_membership/{group_membership_id}

Authentication Level

20

Parameters

(int) group_id (required) - The Group ID
(string) external_id - An external ID to tie to the Group Membership

Return [status]

(null) - [204]

Delete a Customer Group Membership

Remove a specific Customer's specified Group Membership.

Method/URL

DELETE https://api.myfreestone.com/customer/{id}/group_membership/{group_membership_id}

Authentication Level

20

Return [status]

(null) - [204]

Get Customer Credit Reporting Organization Memberships

Get a list of all the CRO Memberships a Customer has.

Method/URL

GET https://api.myfreestone.com/customer/{id}/cro_memberships

Return [status]

(array) - An array of CRO Membership objects [200]

Get a Customer Credit Reporting Organization Membership

Get a specified CRO Membership for a Customer

Method/URL

GET https://api.myfreestone.com/customer/{id}/cro_membership/{cro_membership_id}

Return [status]

(object) - A CRO Membership object [200]

Add a Customer Credit Reporting Organization Membership

Add a CRO Membership to a specified Customer.

Method/URL

POST https://api.myfreestone.com/customer/{id}/cro_membership

Authentication Level

20

Parameters

(int) cro_id (required) - The CRO ID
(string) cro_member_num - An external ID to tie to the CRO Membership
(string) date_expires - Expiration date for the CRO Membership

Return [status]

(null) - [201]

Update a Customer Credit Reporting Organization Membership

Update a Customer CRO Membership with the supplied parameters.

Method/URL

PUT https://api.myfreestone.com/customer/{id}/cro_membership/{cro_membership_id}

Authentication Level

20

Parameters

(int) cro_id - The CRO ID
(string) cro_member_num - An external ID to tie to the CRO Membership
(string) date_expires - Expiration date for the CRO Membership

Return [status]

(null) - [204]

Delete a Customer Group Membership

Remove a specific Customer's specified CRO Membership.

Method/URL

DELETE https://api.myfreestone.com/customer/{id}/cro_membership/{cro_membership_id}

Authentication Level

20

Return [status]

(null) - [204]

Get Customer Credits

Get a list of all credits available to a customer along with submission status.

Method/URL

GET https://api.myfreestone.com/customer/{id}/credits

Return [status]

(array) - An array of Credit objects [200]

Get a Customer Credit selection

Get a paginated selection of Customer Credits.

Method/URL

GET https://api.myfreestone.com/customer/{id}/credits/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, customer_id, medium_topic_id, status_id, keycode, order_id, topic_id}
(string) sort_order - The direction in which sorting should take place. {desc, asc}
(string) term - Search term. Can search by first name, last name, email or external ID

Return [status]

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

Get all orders of a Customer

Get a all orders of a specific Customer by ID.

Method/URL

GET https://api.myfreestone.com/customer/{id}/orders

Return [status]

(object) - An array of order objects [200]

Customer Checkpoints

Get the Customer Checkpoints for a given Topic

Method/URL

GET https://api.myfreestone.com/customer/{id}/checkpoints/{topic_id}

Return [status]

(object) - A Topic Feedback object [200]

Get Customer Credits Detail

Get all submitted credit records for a customer. Data provided includes credit reporting organization (if applicable), credit information, and order information for each submitted credit record.

Method/URL

GET https://api.myfreestone.com/customer/{id}/customer_credits

Parameters

(int) course_id - The seminar id.
(string) from_date - From: The completed date of customer credit in YYYY-MM-DD format.
(string) to_date - TO: The completed date of customer credit in YYYY-MM-DD format.

Return [status]

(object/mixed) - An array of object consisting of customer credit records [200]