APIs

Validate Key

This API helps you to validate the Studiocart API key.

HTTP request
POST/wp-json/sc/v1/webhook/validate/?api_key={sc-api-key}
Response

200

Body
{}

Subscribe

This API helps you register a resthook. 

HTTP request
POST/wp-json/sc/v1/webhook/subscribe/?api_key={sc-api-key}&product_id={product-id}
Request Body

hook_url – string | subscription url
plan_id – integer/array | studiocart product’s plan id
source – string | eg. zapier
status – string | eg. purchased, refunded, lead etc.

Response

200

Body
{"id": "123"}

Delete

This API helps you to delete a resthook. 

HTTP request
POST/wp-json/sc/v1/webhook/delete/
Request Body

id – integer| resthook id

Response

200

Body
{"id": "123"}

List Products

This API helps you to list all the products.

HTTP request
GET/wp-json/sc/v1/webhook/products/
Response

200

Body
[{"id":1,"name":"Product 1"},{"id":2,"name":"Product 2"},{"id":3,"name":"Product 3"}]

List Payment Plans

This API helps you to list all the payment plans for a product.

HTTP request
GET/wp-json/sc/v1/webhook/plans/?product_id=<product_id>
Response

200

Body
[{"id":"my-plan","name":"My Plan"},{"id":"bump","name":"Purchased as a bump"},{"id":"upsell","name":"Purchased as an upsell"}]

Get Latest Orders

This API helps you to get a list of latest orders. 

HTTP request
POST/wp-json/sc/v1/webhook/latest-orders/
Parameters

api_key – string | studiocart api key
product_id – integer

Request Body

plan_id – integer/array
status – string | active, completed, canceled.

Response

200

Body
[{
"order_id": 1234,
"product_name": "Product 1",
"customer_email": "john@doe.com",
"customer_firstname": "John",
"customer_lastname": "Doe",
"customer_name": "John Doe",
"order_status": "paid",
"product_id": "1",
"order_amount": "10.00",
"currency": "USD"
},
{
"order_id": 1233,
"product_name": "Product 1",
"customer_email": "jane@roe.com",
"customer_firstname": "Jane",
"customer_lastname": "Roe",
"customer_name": "Jane Roe",
"order_status": "paid",
"product_id": "1",
"order_amount": "10.00",
"currency": "USD"
}]