Recurly
Manage subscriptions, accounts, and invoices for recurring revenue via the
Recurly v3 API (version v2021-02-25).
This tool wraps the core read and create operations of the Recurly API using only the Python standard library — no third-party packages.
What it does
Branches on an operation and calls the matching Recurly v3 endpoint, returning
the raw JSON payload (as a string) plus the HTTP status. Non-2xx responses from
Recurly are returned with their status and body rather than raising, so callers
can react to validation/auth errors.
Operations
| operation | method + path | notes |
|---|---|---|
list_accounts |
GET /accounts?limit=N |
List customer accounts |
get_account |
GET /accounts/{accountId} |
accountId is the Recurly id, or code-{account_code} to look up by your own code |
create_account |
POST /accounts |
Requires code; optional email, firstName, lastName, company |
list_subscriptions |
GET /subscriptions?limit=N |
List subscriptions |
get_subscription |
GET /subscriptions/{subscriptionId} |
Retrieve one subscription |
list_invoices |
GET /invoices?limit=N |
List invoices |
get_invoice |
GET /invoices/{invoiceId} |
invoiceId is the id, or number-{invoice_number} |
API key setup
- Sign in to the Recurly admin UI.
- Go to Integrations > API Credentials.
- Copy your Private API Key.
The key is used as the HTTP Basic auth username with an empty password
(Authorization: Basic base64("<api_key>:")). The v3 API resolves your site
from the API key, so no subdomain or site name is required.
Every request also sends Accept: application/vnd.recurly.v2021-02-25 to pin
the API version.
Inputs
| input | required | default | description |
|---|---|---|---|
apiKey |
yes | — | Recurly private API key |
operation |
yes | — | one of the operations above |
accountId |
for get_account |
"" | account id or code-{account_code} |
subscriptionId |
for get_subscription |
"" | subscription id |
invoiceId |
for get_invoice |
"" | invoice id or number-{invoice_number} |
code |
for create_account |
"" | your unique account code |
email |
no | "" | create_account email |
firstName |
no | "" | create_account first name |
lastName |
no | "" | create_account last name |
company |
no | "" | create_account company |
limit |
no | 20 |
page size for list ops (1–200) |
Outputs
| output | description |
|---|---|
result |
the Recurly response payload as a JSON string |
status |
the HTTP status code as a string (e.g. 200, 201, 404) |
Examples
List the 10 most recent accounts:
{ "apiKey": "ewr1234...", "operation": "list_accounts", "limit": "10" }
Look up an account by your own account code:
{ "apiKey": "ewr1234...", "operation": "get_account", "accountId": "code-acme-co" }
Create a new account:
{
"apiKey": "ewr1234...",
"operation": "create_account",
"code": "acme-co",
"email": "[email protected]",
"firstName": "Ada",
"lastName": "Lovelace",
"company": "Acme Co"
}
List invoices:
{ "apiKey": "ewr1234...", "operation": "list_invoices", "limit": "20" }