Subscriptions Mutations

CreateSubscription

Creates a new recurring subscription.

Parameters:

ParameterTypeDescription
inputSubscriptionInput!Subscription data.

Example Query:

mutation CreateSubscription($input: SubscriptionInput!) {
  CreateSubscription(input: $input) {
    id
    label
    status
  }
}

UpdateSubscription

Updates an existing recurring subscription.

Parameters:

ParameterTypeDescription
idInt!ID of the subscription.
inputSubscriptionInput!Updated data.

BulkCreateSubscriptions

Creates multiple subscriptions from a template for several customers.

Parameters:

ParameterTypeDescription
inputBulkCreateSubscriptionsInput!Bulk creation settings.

DeleteSubscription / DeleteSubscriptions

Deletes one or multiple subscriptions.


GenerateSubscriptionDocuments

Manually triggers the generation of documents for a subscription cycle on a specific date.

Parameters:

ParameterTypeDescription
subscription_idInt!Parent ID.
run_atDateExecution date.
publishedBooleanWhether to publish generated documents.

BatchUpdateSubscriptionLineItemPrices

Updates prices for recurring items across multiple subscriptions based on specific rules.


CreatePendingSubscriptionShippingOrder

Creates a pending shipping order for a subscription run invoice.

Parameters:

ParameterTypeDescription
run_invoice_idID!ID of the subscription run invoice.

Example Query:

mutation CreatePendingSubscriptionShippingOrder($run_invoice_id: ID!) {
  CreatePendingSubscriptionShippingOrder(run_invoice_id: $run_invoice_id) {
    id
    status
    shipping_order {
      id
      label
    }
  }
}
Return TypeDescription
SubscriptionRunInvoiceThe subscription run invoice with created shipping order.

AddCustomerToSubscription

Adds a customer to an existing subscription.

Parameters:

ParameterTypeDescription
subscription_idID!ID of the subscription.
inputAddSubscriptionCustomerInput!Customer data.

Example Query:

mutation AddCustomerToSubscription($subscription_id: ID!, $input: AddSubscriptionCustomerInput!) {
  AddCustomerToSubscription(subscription_id: $subscription_id, input: $input) {
    id
    customer {
      id
      label
    }
    status
  }
}
Return TypeDescription
SubscriptionCustomerThe added customer relationship.

RemoveCustomerFromSubscription

Removes a customer from a subscription.

Parameters:

ParameterTypeDescription
subscription_idID!ID of the subscription.
subscription_customer_idID!ID of the subscription customer to remove.

Example Query:

mutation RemoveCustomerFromSubscription($subscription_id: ID!, $subscription_customer_id: ID!) {
  RemoveCustomerFromSubscription(subscription_id: $subscription_id, subscription_customer_id: $subscription_customer_id)
}
Return TypeDescription
Booleantrue if successful.

PauseCustomerOnSubscription

Pauses a customer's participation in a subscription.

Parameters:

ParameterTypeDescription
subscription_idID!ID of the subscription.
subscription_customer_idID!ID of the subscription customer to pause.

Example Query:

mutation PauseCustomerOnSubscription($subscription_id: ID!, $subscription_customer_id: ID!) {
  PauseCustomerOnSubscription(subscription_id: $subscription_id, subscription_customer_id: $subscription_customer_id)
}
Return TypeDescription
Booleantrue if successful.

ReactivateCustomerOnSubscription

Reactivates a previously paused customer on a subscription.

Parameters:

ParameterTypeDescription
subscription_idID!ID of the subscription.
subscription_customer_idID!ID of the subscription customer to reactivate.

Example Query:

mutation ReactivateCustomerOnSubscription($subscription_id: ID!, $subscription_customer_id: ID!) {
  ReactivateCustomerOnSubscription(subscription_id: $subscription_id, subscription_customer_id: $subscription_customer_id)
}
Return TypeDescription
Booleantrue if successful.

UpdateSubscriptionCustomer

Updates a customer's settings on a subscription.

Parameters:

ParameterTypeDescription
subscription_idID!ID of the subscription.
inputUpdateSubscriptionCustomerInput!Updated customer data.

Example Query:

mutation UpdateSubscriptionCustomer($subscription_id: ID!, $input: UpdateSubscriptionCustomerInput!) {
  UpdateSubscriptionCustomer(subscription_id: $subscription_id, input: $input) {
    id
    customer {
      id
      label
    }
    discount
    discount_type
  }
}
Return TypeDescription
SubscriptionCustomerThe updated customer relationship.

RetrySubscriptionRunInvoice

Retries processing a failed subscription run invoice.

Parameters:

ParameterTypeDescription
idID!ID of the subscription run invoice.
publishedBooleanWhether to publish the generated document.

Example Query:

mutation RetrySubscriptionRunInvoice($id: ID!, $published: Boolean) {
  RetrySubscriptionRunInvoice(id: $id, published: $published) {
    id
    status
    invoice {
      id
      label
    }
  }
}
Return TypeDescription
SubscriptionRunInvoiceThe retried subscription run invoice.

GenerateSubscriptionNumber

Generates a unique number for a new subscription.

Parameters:

ParameterTypeDescription
location_idIDOptional location ID for the number format.

Example Query:

mutation GenerateSubscriptionNumber($location_id: ID) {
  GenerateSubscriptionNumber(location_id: $location_id)
}
Return TypeDescription
StringGenerated subscription number.

Input Data Types

SubscriptionInput

FieldTypeDescription
idIntID for updates.
labelStringSubscription reference number.
statusSubscriptionStatusInitial or updated status.
frequency_unitSubscriptionFrequencyUnitFrequency unit (day, week, month, year).
frequency_intervalIntNumber of units between executions.
max_cyclesIntLimit of runs before termination.
starts_atDateStart date.
ends_atDateEnd date.
next_run_atDateOverride next run date.
auto_create_shipping_orderBooleanAutomate shipment creation.
invoice_as_draftBooleanAutomate invoice as draft.
currencyCurrencyInputBilling currency.
exchange_rateFloatExchange rate.
tax_typeTaxTypeTax calculation method.
default_discountFloatDefault discount rate.
discount_typeDiscountTypeDiscount type.
notesStringPublic notes.
internal_notesStringPrivate notes.
for_the_attention_ofStringRecipient name.
external_referenceStringMerchant reference.
customerCustomerInputLinked customer.
price_levelPriceLevelInputPrice level override.
account_representativeAccountRepresentativeInputResponsible agent.
seasonSeasonInputLinked season.
invoice_pdf_templatePdfTemplateInputInvoice design.
shipping_order_pdf_templatePdfTemplateInputShipping order design.
billing_addressAddressInputBilling address.
shipping_addressAddressInputShipping address.
line_items[LineItemSubscriptionInput]Recurring items.
custom_fields[EntityCustomFieldInput]Custom fields for this entity.
customers[SubscriptionCustomerInput]List of customers.

LineItemSubscriptionInput

FieldTypeDescription
idIDLine item ID (for updates).
location_idStringLocation ID.
locationLocationInputLocation details.
variant_idStringVariant ID.
variantVariantInputVariant details.
quantityFloatQuantity.
priceFloatUnit price.
calculate_price_from_componentsBooleanCalculate price from components.
drop_shippingIntDrop shipping flag.
parent_idIntParent line item ID (for kits).
weightIntWeight.
descriptionStringLine item description.
replace_labelBooleanReplace label with description.
discount_typeDiscountTypeDiscount type (amount, percentage).
discountFloatDiscount value.
discount_rule_idIDApplied discount rule ID.
discount_rule_amountFloatDiscount rule amount.
tax_amountFloatTax amount.
ecotaxFloatEcotax amount.
tax_codes[TaxCodeInput]Tax codes.
temporary_idIDTemporary ID for kits & packaging.
kit_line_item_idIDKit line item ID.
typeStringLine item type.
batch_numbers[BatchNumberLineItemInput]Batch numbers.

SubscriptionCustomerInput

FieldTypeDescription
idIDCustomer subscription ID (for updates).
customerCustomerInput!Customer data (required).
joined_atDateDate customer joined.
left_atDateDate customer left.
billing_addressAddressInputBilling address.
shipping_addressAddressInputShipping address.
discountFloatCustomer-specific discount.
discount_typeDiscountTypeDiscount type (amount or percentage).
statusStringCustomer status.

BulkCreateSubscriptionsInput

FieldTypeDescription
customer_ids[Int!]IDs of target customers.
templateSubscriptionInput!Base configuration template.
pricing_modeSubscriptionBulkPricingMode!How to calculate prices for each customer.
use_customer_discountBooleanApply individual customer discounts.
use_customer_addressesBooleanUse each customer's default addresses.
use_customer_account_representativeBooleanUse customer-assigned representatives.
use_customer_locationBooleanUse customer-assigned stock locations.
use_customer_price_levelBooleanUse customer-assigned price levels.
use_customer_currencyBooleanUse customer-assigned currencies.

BatchUpdateSubscriptionLineItemPricesInput

FieldTypeDescription
subscription_ids[Int]Specific subscriptions to update.
rules[SubscriptionPriceRuleInput!]Pricing update rules.

SubscriptionPriceRuleInput

FieldTypeDescription
variant_idInt!ID of the product variant.
priceFloatExplicit price (for fixed mode).
modeSubscriptionPriceRuleMode!Update strategy.
valueFloatValue for increase or fixed modes.

AddSubscriptionCustomerInput

FieldTypeDescription
customerCustomerInput!Customer to add.
joined_atDateDate customer joined.
prorata_modeAddSubscriptionCustomerProrataModeProrata calculation mode.
publishedBooleanWhether the customer is active.
billing_addressAddressInputBilling address.
shipping_addressAddressInputShipping address.
discountFloatCustomer-specific discount.
discount_typeDiscountTypeDiscount type (percentage/amount).
statusStringInitial status.

UpdateSubscriptionCustomerInput

FieldTypeDescription
idIDSubscription customer ID.
customerCustomerInputUpdated customer reference.
joined_atDateDate customer joined.
left_atDateDate customer left.
billing_addressAddressInputBilling address.
shipping_addressAddressInputShipping address.
discountFloatCustomer-specific discount.
discount_typeDiscountTypeDiscount type (percentage/amount).
statusStringCustomer status.

Enums

SubscriptionStatus

ValueDescription
draftNot yet active.
activeActive and generating documents.
pausedTemporarily stopped.
cancelledPermanently terminated.

SubscriptionFrequencyUnit

ValueDescription
dayExecutes daily.
weekExecutes weekly.
monthExecutes monthly.
yearExecutes yearly.

SubscriptionBulkPricingMode

ValueDescription
fixed_pricesUse prices specified in the template.
customer_price_levelCalculate prices based on customer's level.

SubscriptionPriceRuleMode

ValueDescription
fixedSets the price to a specific value.
increase_amountIncreases the current price by a fixed amount.
increase_percentageIncreases the current price by a percentage.

AddSubscriptionCustomerProrataMode

ValueDescription
prorata_nowCalculate prorata immediately based on remaining time in the current cycle.
wait_next_runWait until the next scheduled run to include the customer.

DiscountType

ValueDescription
amountFixed discount amount.
percentagePercentage-based discount.

TaxType

ValueDescription
exclusiveTax calculated on top of the net price.
inclusiveTax included in the displayed price.