# Integrating with Recurly

Drivetrain can connect with Recurly using an API key and subdomain.

[Prerequisites](#prerequisites)

[Integrations Steps](#integrations-steps)\
&#x20;  [Step 1: Obtain an API Key](#step-1-obtain-an-api-key)\
&#x20;  [Step 2: Get your Recurly subdomain](#step-2-get-your-recurly-subdomain)

## Prerequisites

To connect Recurly to Drivetrain via API, you need:

* An account/user with “Integrations” permissions in Recurly. These permissions are required to create an API key.

### Integrations Steps <a href="#integrations-steps" id="integrations-steps"></a>

#### Step 1: Obtain an API Key <a href="#step-1-obtain-an-api-key" id="step-1-obtain-an-api-key"></a>

**Option A: Obtain Existing API Key**

1. Log in to your [Recurly account](https://app.recurly.com/login).
2. In the navigation bar on the left, select **Integrations > API Credentials**.

<figure><img src="/files/jKEyoc5DHsCfh1iC6JV6" alt="" width="188"><figcaption></figcaption></figure>

3. Find your private API key and make a note of it.

<figure><img src="/files/L3lsq3HFO90ci4CtwFxe" alt=""><figcaption></figcaption></figure>

**Option B: Generate a Recurly API Key**

1. Navigate to **Integrations > API Credentials**.
2. Scroll to the bottom and select **Add Private API Key**.
3. Assign a name to your API key, jot down its purpose, and specify the third-party application it's intended for.

<figure><img src="/files/n8Yy9oDgeTz8mTWGDE87" alt=""><figcaption></figcaption></figure>

4. Confirm by clicking **Save Changes**.

#### Step 2: Get your Recurly subdomain <a href="#step-2-get-your-recurly-subdomain" id="step-2-get-your-recurly-subdomain"></a>

1. While logged into your Recurly account, look at the address bar at the top of your web browser and find your subdomain. Your subdomain is the part of the URL between https\:// and recurly.com. It is usually the same as your company name.

<figure><img src="/files/lRPnP6m3YjsFdUXXWZ40" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
That’s it! Inform your customer success manager and share the API Key and subdomain with them so that they can get started!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.drivetrain.ai/integration-guide/integrate-with-drivetrain/billing-and-invoicing/integrating-with-recurly.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
