The Firmhouse Logo [FH]
Developer Docs

createSubscription

Creates a new subscription and returns payment redirection URLs.

Arguments

ArgumentDescription
input (CreateSubscriptionInput!)
Parameters for CreateSubscription

CreateSubscriptionInput Arguments

ArgumentDescription
token (ID)
The token of the subscription to update, or creates a new one if one doesn't exist.
companyName (String)
The company name of the customer.
salutation (String)
The customer's salutation (mr,ms,mx).
name (String)
The customer's first name.
lastName (String)
The customer's last name.
address (String)
The customer's address line or street.
zipcode (String)
The customer's zip code or postal code.
houseNumber (String)
The customer's house, building, or appartment number.
city (String)
The customer's city or town.
country (String)
The customer's country code (ISO3661).
state (String)
The customer's state or province (ISO3661-2).
district (String)
The customer's district.
phoneNumber (String)
The customer's phone number (international format).
differentBillingAddress (Boolean)
Whether billing and shipping addresses are the same. Set this flag to `true` to store a separate billing address.
billToCompanyName (String)
The company name of the customer's billing address.
billToSalutation (String)
The customer's billing address salutation (mr,ms,mx).
billToName (String)
The customer's billing address first name.
billToLastName (String)
The customer's billing address last name.
billToAddress (String)
The customer's billing address address line or street.
billToZipcode (String)
The customer's billing address zip code or postal code.
billToHouseNumber (String)
The customer's billing address house, building, or appartment number.
billToCity (String)
The customer's billing address city or town.
billToCountry (String)
The customer's billing address country code (ISO3661).
billToState (String)
The customer's billing address state or province (ISO3661-2).
billToDistrict (String)
The customer's billing address district.
billToPhoneNumber (String)
The customer's billing address phone number (international format).
email (String)
The customer's email address.
termsAccepted (Boolean)
Whether the customer accepted the terms and conditions.
marketingOptIn (Boolean)
Whether the customer accepted optional marketing communication opt-in.
extraFields ([ExtraFieldInput!])
Extra field values for the subscription.
locale (String)
The customer's language/locale. Must be enabled on the project.
skipAutoActivationOnSignup (Boolean)
Don't automatically activate the subscription on signup.
chargeDayOfTheMonth (Int)
The day of the month when the customer is charged.
trialPeriodMonths (Int)
The number of months before the customer is charged for the first time.
customerReference (String)
The field that can be used for your internal reference. For example, internal customer id.
status (SubscriptionStatus)
The current status of the subscription. (default: inactive)
signupCompletedAt (ISO8601DateTime)
The time when the signup was completed.
activatedAt (ISO8601DateTime)
The time the subscription was activated.
cancelledAt (ISO8601DateTime)
The time the subscription was (fully) cancelled.
cancellationStartedAt (ISO8601DateTime)
The time the subscription started the cancellation process (with two-step cancellation)
markedAsNonPayingAt (ISO8601DateTime)
Time time the subscription was marked as non-paying.
mollieCustomerId (String)
The Mollie Customer ID (cst_XXX)
stripeCustomerId (String)
The Stripe Customer ID (cus_XXX)
stripePaymentMethodId (String)
The Stripe Payment Method ID of the active payment method to charge. (pm_XXX)
adyenShopperReference (String)
The Adyen shopper reference being used for charges.
projectToken (ID)
orderedProducts ([OrderedProductInput!])
The products to subscribe to
weChatOpenId (String)
returnUrl (String!)
The URL the customer gets redirected to when signup or initial payment was succesful.
paymentPageUrl (String!)
The URL of the page where your customer can re-initiate the checkout flow if something fails.
planId (ID)
The plan the customer will subscribe to.
discountCode (String)
Discount code to apply when signing up

Return Fields

payment (Payment)
The initial payment object associated with signing up this subscription.
paymentToken (ID)
Deprecated: Will be removed.
paymentUrl (String)
The URL to redirect your customer to to complete the signup payment
returnUrl (String)
The return URL you passed in
subscription (Subscription)
subscriptionToken (ID)
Deprecated: Will be removed. Use the `subscription` field instead.