Core Resources for Building an Integration

This guide outlines the key API and webhook resources for building integrations and workflows. When you’re finished, you will be able to build integrations and workflows to 3rd party systems.

API Webhooks iPaaS


API Summary

Chargify Feature
API
You Need
1. Completed Design Your Integration
2. Developer(s) experienced with integrating systems, data modification, and APIs.
Code
Yes
Difficulty
◉◉

API Core Resources

If you are coding your own integration, then you have a strong understanding of the needs of your project. These Core Resources will help you the most.

Resource

Description

Full API Documentation

All API endpoints and examples

Full Developer Documentation

Developer documentation resources

Get an API Key

Get an API Key

Authentication Example

Chargify’s API uses Basic Authentication. Your API Key and Password are structured like API_Key:X where X or x (upper or lowercase) is your password. See the example below for a quickstart.

API Guidelines

Full API Guidelines

Rate Limits

Information about rate limits.


Test Authentication

// GET SAMPLE, list subscriptions. Replace SUBDOMAIN, APIKEY.
// Copy/paste in terminal

curl https://SUBDOMAIN.chargify.com/subscriptions.json \
-X GET \
-u APIKEY:x \
-H 'Content-Type: application/json'

API Code Generator

The core resources for writing API calls to Chargify. API Documentation Code Generator

1. Find your language (22 Languages & 25 Frameworks)

Resource

Description

Shell

  • cURL
  • HTTPie
  • Wget

Javascript

  • Fetch
  • XMLHttpRequest
  • jQuery
  • Axios

Node

  • Native
  • Request
  • Unirest
  • Fetch
  • Axios

Python

  • Python 3
  • Request

Go

 

C

 

Obj-C

 

OCaml

 

C#

  • HttpClient
  • RestSharp

Java

  • AsyncHttp
  • NetHttp
  • OkHttp
  • Unirest

Http

 

OCaml

 

C#

 

Java

 

Http

 

Clojure

 

Kotlin

 

PHP

  • pecl/http 1
  • pecl/http 2
  • cURL

Powershell

  • WebRequest
  • RestMethod

R

 

Ruby

 

Swift

 

2. Learn how to use the code generator
In the API documentation, choose an endpoint, and on the right hand side click to select a language or framework. For example, it is simple to find a Create Subscription example using Node.js with the Axios Framework.

code-generator.gif

 

3. Try some code samples
As an example, here are API requests to read subscriptions, each is made in a different language. The examples were pulled directly from the List Subscriptions endpoint. In the examples below, you would need to replace your subdomain and base64key.

For more examples, in all of the available languages and frameworks, explore the API documentation.

 

cURL Node Python Ruby
curl --request GET \
  --url https://subdomain.chargify.com/subscriptions.json \
  --header 'Authorization: Basic BASE64KEY-HERE' \
  --header 'Content-Type: application/json'

Webhooks Summary

Chargify Feature
Webhooks
You Need
1. Completed Design Your Integration
2.
Developer(s) experienced with webhooks
Code
Yes
Difficulty
◉◉

Webhooks Core Resources

If you are coding your own integration, then you have a strong understanding of the needs of your project. These Core Resources will help you the most.

Resource

Description

Webhook Event Types

In your Chargify Site, go to Config > Settings > Webhooks to view and configure.

Full Webhook Documentation

A full overview of Chargify webhooks.

Add security by using a webhook signature

Ensure the incoming webhook is valid

Example payloads

Full examples

Webhooks Control Panel

Helps with quick testing, determining errors, and more.

Retry a Webhook

Helps with quick testing and retrying errors.

JSON Webhooks

JSON Webhooks have been supported as of July 2022. Email support@chargify.com to enable JSON webhooks. 


Testing Tips

Use these tips to develop faster.

1. Retry webhooks instead of simulating events
One of the most tedious parts of webhook development is simulating events over and over as you write code. Instead, use Chargify's webhook replay feature. Start by simulating the event you care about once, and from there, just replay the event as many times as needed. Replay failed webhooks AND replay successful ones. Go to Tools > Webhooks Panel > checkmark the webhook > click 'Resend Selected Webhooks'.

Screen_Shot_2022-08-04_at_10.51.13_AM.png

2. Know that you can retry webhooks in production
While this is not a testing tip, it may help in your development process. Some billing systems do not have webhook replay, which means that once a webhook fails, that's it. What if that webhook unlocks a user's features in your app? Do you have to go edit a database record to fix the issue for your user? No, simply replay the webhook. Webhooks are available for replay, up to 90 days.
3. Review some webhook workflow examples
Review some conceptual examples, that highlight the coding workflow here.

Important

Chargify does not assist in building, debugging, maintaining, or supporting anything you or a developer builds with iPaaS. However, based on your plan, Chargify can assist with helping you determine which Chargify Webhooks and Chargify APIs to use.

iPaaS Summary

Chargify Feature
Chargify's APIs and Webhooks + 3rd party iPaaS (Integration Platform as a Service)
You Need
1. Completed Design Your Integration
2. Person(s) with technical
experience building (but not coding) integrations, handling data modification, and knowledge of APIs and Webhooks.
3. An iPaaS software
Code
No-code to low-code
Difficulty
◎◎

Building an Integration with iPaaS

If you are not a developer, but need to a) design an integration or b) build an integration with iPaaS, follow these steps:

1. Make a list of your Trigger-Action Statements

In its simplest form, an integration is a collection of triggers and actions. Make your own list of Trigger-Action Statements, which is a collection of all of the functionality your integration needs. Use the examples below to guide you.

Trigger-Action Statements

When trigger in system, action in system


Examples of Trigger-Action Statements
1. When a subscription is canceled in Chargify, update deal record in Hubspot
2. When an invoice is created in Chargify, create an invoice in Netsuite
3. When a customer changes bronze to silver plan in Chargify, update the subscription's component price point in Chargify


Adding Conditionals
Sometimes you only want to perform the action, based on a condition.

When trigger in system, conditional, action in system


Examples of Trigger-Action Statements with Conditionals
1. When a subscription is canceled in Chargify, if the subscription has the churn reason code TRIAL-CANCEL, update deal record in Hubspot
2. When an invoice is created in Chargify, if the invoice type is 'signup', create an invoice in Netsuite
3. When a customer changes bronze to silver plan in Chargify, if the customer subscribes to the user-licenses component, update the subscription's component price point in Chargify

Adding Multiple Steps (multiple actions)
Sometimes you only want to perform multiple actions, with conditionals.

When trigger in system, conditional, action1 in system, action2 in system


Examples of Trigger-Action Statements with Conditionals
1. When a subscription is canceled in Chargify, if the subscription has the churn reason code TRIAL-CANCEL, update deal record in Hubspot, update the company record in Hubspot
2. When an invoice is created in Chargify, if the invoice type is 'signup', create an invoice in Netsuite, mark the invoice paid in Netsuite
3. When a customer changes bronze to silver plan in Chargify, if the customer subscribes to the user-licenses component, read the customer signup date in Chargify, if the signup date was in January, update the subscription's component price point in Chargify

 

2. Choose an iPaaS software

Now that you have a list of your needs, you need to determine if an iPaaS tool actually supports them. Other companies have built 3rd party integrations with Zapier and Cyclr, so we've compiled an overview of the systems, as well as information on how to scope an integration with each system.

 

Zapier

Cyclr

Other iPaaS

Reason to use

Small integrations at affordable cost

-and-

You understand that this integration is your responsibility. Chargify does not help build, debug, maintain, or support the integration.

Any size integration; medium-large businesses; flexibility.

-and-

You understand that this integration is your responsibility. Chargify does not help build, debug, maintain, or support the integration.

Your business already uses one, and it supports your integration needs

-and-

You understand that this integration is your responsibility. Chargify does not help build, debug, maintain, or support the integration.

Best for

Small 1way From integrations

1way From, 1way To, 2way integrations

1way From

Pricing

Starts at $29.99/mo
https://zapier.com/pricing

Starts at
$899/mo
https://cyclr.com/product/pricing

Ranges from
$500/mo - $6000/mo on average

Chargify Triggers

Always use Chargify Webhooks

Always use
Chargify Webhooks

Always use Chargify Webhooks

Chargify Read Actions

7

40+

Typically not many

Chargify Create/Update Actions

5

40+

Typically not many

Supports conditionals

Yes

Yes

Typically yes

Supports multiple steps

Yes

Yes

Typically yes

Other Systems 

4000+

350

Very good

Cron Jobs

?

Yes

Typically yes

3. Scope the integration

Next, you need to determine if the iPaaS supports the scope of your integration (the list of triggers and actions you outlined in step 1). Use the table below.
 

  Data Flow Scope Trigger Scope Action(s)
Zapier Screen_Shot_2022-08-04_at_12.38.57_PM.png Other Use Zapier Webhooks.
All Chargify Webhooks supported.

1. Go to https://zapier.com/apps/chargify/integrations
2.
In "Search for Pairing Apps", search for the System you want to integrate with
3.
Scroll down to the "Supported Triggers and Actions" section
4. Make sure the trigger/action you need exists in Zapier

Screen_Shot_2022-08-04_at_12.38.57_PM.png Screen_Shot_2022-08-04_at_12.38.57_PM.png Use Zapier Webhooks.
All Chargify Webhooks supported.
Same as above.
Note: if your final action is a Chargify API request, use Zapier Code.
Other Screen_Shot_2022-08-04_at_12.38.57_PM.png

See Zapier Scope Actions for steps

Same as above.
Cyclr Screen_Shot_2022-08-04_at_12.38.57_PM.png Other Use Cyclr Webhooks.
All Chargify Webhooks supported.

1. Open Chargify for Cyclr: https://cyclr.com/integrate/chargify (scroll down to the list of actions)
2. Open all connectors for Cyclr, and find the other System: https://cyclr.com/connectors
3. For Chargify and the other System, review the Triggers and Actions. Triggers begin the integration, and Actions are what you want to do. Next, follow the steps based on your integration type.

Screen_Shot_2022-08-04_at_12.38.57_PM.png Screen_Shot_2022-08-04_at_12.38.57_PM.png  Use Cyclr Webhooks.
All Chargify Webhooks supported.
Same as above
Other Screen_Shot_2022-08-04_at_12.38.57_PM.png  See Cyclr Scope Actions for steps Same as above
Other Screen_Shot_2022-08-04_at_12.38.57_PM.png Other Typically webhooks, check the iPaaS' documentation Check the iPaaS' documentation
Other Screen_Shot_2022-08-04_at_12.38.57_PM.png Same as above Same as above
Screen_Shot_2022-08-04_at_12.38.57_PM.png Screen_Shot_2022-08-04_at_12.38.57_PM.png Same as above Same as above
4. Finalize the design

After following steps 1-3, you should now have a clear idea on exactly how you will proceed with your custom integration. Use the resources below as a guide:

- Building Workflows and Integrations with Zapier
- Building Workflows and Integrations with Cyclr

Was this article helpful?
0 out of 0 found this helpful