Adds an existing subscription to a subscription group. For sites making use of the Relationship Billing and Customer Hierarchy features, it is possible to add existing subscriptions to subscription groups.
Passing group parameters with a target containing a type and optional id is all that's needed. When the target parameter specifies a "customer" or "subscription" that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions.
Note: In order to add an existing subscription to a subscription group, it must belong to either the same customer record as the target, or be within the same customer hierarchy.
Rather than specifying a customer, the target parameter could instead simply have a value of
"self" which indicates the subscription will be paid for not by some other customer, but by the subscribing customer,"parent" which indicates the subscription will be paid for by the subscribing customer's parent within a customer hierarchy, or"eldest" which indicates the subscription will be paid for by the root-level customer in the subscribing customer's hierarchy.To create a new subscription into a subscription group, reference the following: Create Subscription in a Subscription Group
The username is a Maxio Chargify API key and the password is x. Basic authentication works only with the US and EU environments, which connect to chargify.com directly. The Maxio API Gateway environment does not accept Basic authentication.
In: header
The Chargify id of the subscription.
application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
curl -X POST \ --url 'https://subdomain.chargify.com/subscriptions/1/group.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "group": { "target": { "type": "subscription", "id": 32987 }, "billing": { "accrue": true, "align_date": true, "prorate": true } }}'