Skip to content

Create one or more subscriptions

POST
/api/subscriptions
curl --request POST \
--url https://api.usegro.co/api/subscriptions \
--header 'Content-Type: application/json' \
--data '{ "profile_id": "example", "shopify_payment_method_id": "example", "next_delivery_date": "example", "delivery_slot_id": "example", "delivery_address_id": "example", "delivery_amount": 1, "note": "example", "notify_customer": true, "lines": [ { "shopify_product_id": "example", "shopify_variant_id": "example", "product_title": "example", "variant_title": "example", "sku": "example", "price": 1, "quantity": 1, "selling_plan_id": "example", "subscription_variant_id": "example", "selection_items": [ { "slot_id": "example", "shopify_product_id": "example", "shopify_variant_id": "example", "product_title": "example", "variant_title": "example", "quantity": 1, "price": 1 } ] } ] }'

Creates new subscriptions for a profile. Lines split across entities will produce multiple subscription records; the response returns the IDs of every subscription created.

Media typeapplication/json
object
profile_id
required
string
shopify_payment_method_id
required
string
next_delivery_date
required
string
delivery_slot_id
string
nullable
delivery_address_id
string
nullable
delivery_amount
number
nullable
note
string
nullable
notify_customer
boolean
lines
required
Array<object>
object
shopify_product_id
required
string
shopify_variant_id
required
string
product_title
required
string
variant_title
string
nullable
sku
string
nullable
price
required
number
quantity
required
number
>= 1
selling_plan_id
required
string
subscription_variant_id
string
nullable
selection_items
Array<object>
nullable
object
slot_id
required
string
shopify_product_id
required
string
shopify_variant_id
required
string
product_title
required
string
variant_title
string
nullable
quantity
required
number
>= 1
price
required
number

Example generated

{
"profile_id": "example",
"shopify_payment_method_id": "example",
"next_delivery_date": "example",
"delivery_slot_id": "example",
"delivery_address_id": "example",
"delivery_amount": 1,
"note": "example",
"notify_customer": true,
"lines": [
{
"shopify_product_id": "example",
"shopify_variant_id": "example",
"product_title": "example",
"variant_title": "example",
"sku": "example",
"price": 1,
"quantity": 1,
"selling_plan_id": "example",
"subscription_variant_id": "example",
"selection_items": [
{
"slot_id": "example",
"shopify_product_id": "example",
"shopify_variant_id": "example",
"product_title": "example",
"variant_title": "example",
"quantity": 1,
"price": 1
}
]
}
]
}

Subscriptions created

Media typeapplication/json
object
ids
required

IDs of the created subscriptions

Array<string>

Example generated

{
"ids": [
"example"
]
}

Invalid request — see error message for details

Media typeapplication/json

Example

{
"error": "Failed to create subscription"
}