Learn how to use sites to organize your business and provide the setup necessary to interact with Chargify via the API. If you need help after reading this, please let us know so we can help and also improve this documentation.
When you are new to Chargify, we will create your first site for you after you choose a currency. Sites are simply “containers” for your products, customers, and subscriptions. You can use Chargify with just one site, although most merchants will want two sites at a minimum – one for testing and one for production.
To manage your sites, login to Chargify and view your sites.
From here you can:
- Create a new site
- Go to any site dashboard
- Clone any site (ie. Make a copy of the structure of a site, including: products, components, families, etc)
- Edit any site (currency, name, date/time format, timezone, etc)
- Delete any site
To begin, create a site (make sure to put it in test mode) and pick a subdomain that you will remember for use in your API calls.
Sites are restricted to a single currency, so it is common to create a site that is named using that currency - for example: “Acme USD”, “Acme GBP”, etc.
For more information about sites, including: switching sites, clearing site data, cloning - please see this documentation.
Every site has the ability to have one or more API keys associated with it to allow API access. The subdomain name is used in API calls to direct what site should be used in the context of the API call.
For example, if you have a site called “Acme, Inc.” with the subdomain “acme” then you would use a call similar to:
curl -u <API_KEY>:X -H Accept:application/json -X GET https://acme.chargify.com/subscriptions.json
The host is always in the form
https://<SUBDOMAIN>.chargify.com followed by the URI for the API resource you are trying to access. In this last example, that would be
/subscriptions.json as that is the URI of the resource to get a list of subscriptions in JSON.
Please see our API documentation for more information.
Clearing your site data is very useful in specific circumstances:
- When in development/test, clearing your site data allows you remove records that you added in for testing.
- When moving to production/live mode, clearing your site data is necessary for allowing your gateway to actually process real money.
Clearing your site data can be done in the following methods:
To clear your site data via the website, please see the following.
There are a few options for clearing your site data, which match the settings available if you perform this action through the website. The most basic is clearing all your data:
curl -u <API_KEY>:X -H Accept:application/json -X POST https://acme.chargify.com/sites/clear_data.json
For more information about the parameters for clearing your site data using the API, please see the API documentation.
After you’ve created a new site, you should check out the following articles: