List a subscription's discounts
GET
/api/subscriptions/{id}/discounts
const url = 'https://api.usegro.co/api/subscriptions/example/discounts';const options = { method: 'GET', headers: {Authorization: 'Bearer <token>', 'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.usegro.co/api/subscriptions/example/discounts \ --header 'Authorization: Bearer <token>' \ --header 'X-API-Key: <X-API-Key>'The discounts on the subscription now. Pass include_history=true to also get ones that ran out (EXHAUSTED) or were removed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Query Parameters
Section titled “Query Parameters”include_history
boolean
Also return exhausted and removed discounts
Responses
Section titled “Responses”Media typeapplication/json
object
data
Array<object>
object
id
Gro discount ID, used to remove it
string
shopify_discount_id
The discount on the Shopify contract
string
title
string
discount_code
string
target_type
string
value_type
string
value
A percentage, or a fixed amount in the currency’s main unit (not cents)
number
currency_code
string
recurring_cycle_limit
How many orders it applies to; null for every order
integer
status
string
is_active
boolean
is_shipping_discount
boolean
discount_label
Ready to show, e.g. “10% off”
string
estimated_amount
What an active order discount takes off the current subtotal
number
applied_at
string format: date-time
exhausted_at
string format: date-time
removed_at
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
metadata
object
total
integer
Example
{ "data": [ { "target_type": "ORDER", "value_type": "PERCENTAGE", "status": "ACTIVE" } ]}Subscription not found
Media typeapplication/json