Important: This is a developer level document and WooNinja does not support custom code via our support channels.
The Thinkific Extension for WooCommerce has two REST API endpoints in the namespace ‘thinkific-woocommerce’
http://example.com/wp-json/thinkific-woocommerce/v1/order?order_id=251
This end point returns the current status of the WooCommerce Order as specified in the order_id parameter.
{
thinkific_user_created: true,
enrollment_complete: false,
order_id: 251
}
In this response example, the Thinkific User account has been created but the users enrolments have not yet been created. If you are using this end point for a ‘spinner’ or ‘progress’ screen, you should wait until both of these variables return true.
http://example.com/wp-json/thinkific-woocommerce/v1/course?product_id=123
This end point is similar to the [thinkific_has_purchased_course] shortcode. It determines if a user has previously purchased the specified WooCommerce Product. It falls back to check if the user is enrolled, or was previously enrolled, in the Thinkific Course as connected to the specified WooCommmerce Product.
{
enrolled: true,
product_id: 123
}
In this response example, the user has previously purchased WooCommerce Product ID 123, or they are enrolled (or were previously enrolled) in the Thinkific Course connected to WooCommerce Product ID 123.