API
Trials API
Published
Last updated
Using this API you are able to tell SaaS Insights how long a trial is for any new subscription.
Required parameters
chargeId
The subscription charge – this is the appSubscription.id returned from the appSubscriptionCreate mutation. We only require the integer, e.g. gid://shopify/AppSubscription/123
Required attributes
days
Number of trial days
Example using cURL
curl -G -X PUT https://saasinsights.com/api/public/trial/123 \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H "Authorization: Bearer {token}" \
-d days=30
Example Response
{
"data": {
"charge_id": "123",
"trial_days": 30,
"occurred_at": 1698093575,
"expected_conversion_at": 1741305599,
"abandoned_at": null,
"app": {
"id": "01953c7d-3525-c982-1234-ea14c069fd7d",
"name": "Demo App",
"shopify_id": "123"
},
"customer": {
"id": "018c7ea6-fda3-907f-1718-80acf20476d0",
"shopify_id": "20591242816",
"name": "Demo Store",
"domain": "demo-store.myshopify.com",
"url": "https://saasinsights.com/customers/018c7ea6-fda3-907f-1718-80acf20476d0"
},
"plan": {
"name": "Monthly Plan",
"price": 2999,
"price_formatted": "$29.99",
"interval": "mo",
"trial_days": 7
}
}
}