Using the API
Get an access token
Send a GraphQL request
const res = bunny.createSubscription('Acme Yachts', 'Jill', 'McGill', '[email protected]', 'free', {
trial: true,
tenantCode: '123456'
})response = BunnyApp::Subscription.create(
product_plan_code: 'starter',
options: {
account_name: "Superdesk",
first_name: "Meg",
last_name: "La Don",
email: "[email protected]",
trial: true,
tenant_code: "123456",
tenant_name: "Superdesk"
}
)curl --location 'https://SUBDOMAIN.bunny.com/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--data-raw '{"query":"mutation subscriptionCreate ($attributes: SubscriptionAttributes!) { subscriptionCreate (attributes: $attributes) { subscription { id account { id name contacts { id firstName lastName } } trialStartDate trialEndDate startDate endDate state plan { code name } priceList { code name } tenant { id code name } } errors }}","variables":{"attributes":{"account":{"billingContact":{"firstName":"Bruce","lastName":"Wayne","email":"[email protected]"},"name":"Superdesk"},"trial":true,"priceListCode":"free","tenant":{"code":"tenant-123"}}}}'Last updated
Was this helpful?
