Recurly Site API

The Site API from Recurly — 2 operation(s) for site.

Operations 2

GET /sites List sites #
GET /sites/{site_id} Fetch a site #

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-line-item-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-create-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-invoice-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-add-on-create-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-purchase-create-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-billing-attempt-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-create-request-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-line-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscription-offer-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-subscriber-dto-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-transaction-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-recovery-invoice-create-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-dunning-campaign-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-invoice-collection-schema.json
📊
JSONSchema
https://artifacts.apis.io/recurly/json-schema/recurly-dunning-campaign-list-schema.json

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/recurly:recurly-site-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

recurly-site-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Recurly Site API
  version: v2021-02-25
  description: 'Operations tagged Site across 2 of this provider''s published API definitions: recurly-v3-v2021-02-25-api.yaml, recurly-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://v3.recurly.com
- url: https://v3.eu.recurly.com
security:
- api_key: []
tags:
- name: Site
paths:
  /sites:
    get:
      operationId: list_sites
      summary: List sites
      description: 'This route is most useful for finding a site''s ID for subsequent requests.


        See the Pagination Guide to learn how to use pagination in the API and Client Libraries.'
      tags:
      - Site
      parameters:
      - $ref: '#/components/parameters/accept_header'
      - $ref: '#/components/parameters/ids'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/sort_dates'
      - $ref: '#/components/parameters/filter_state'
      responses:
        '200':
          description: A list of sites.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteList'
        '400':
          description: Invalid or unpermitted parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-code-samples:
      - lang: Node.js
        source: "const sites = client.listSites({ params: { limit: 200 } })\n\nfor await (const site of sites.each()) {\n  console.log(site.subdomain)\n}\n"
      - lang: Python
        source: "params = {\"limit\": 200}\nsites = client.list_sites(params=params).items()\nfor site in sites:\n    print(site.subdomain)\n"
      - lang: .NET
        source: "var optionalParams = new ListSitesParams()\n{\n    Limit = 200\n};\nvar sites = client.ListSites(optionalParams);\nforeach(Site site in sites)\n{\n    Console.WriteLine(site.Subdomain);\n}\n"
      - lang: Ruby
        source: "params = {\n  limit: 200\n}\nsites = @client.list_sites(params: params)\nsites.each do |site|\n  puts \"Site: #{site.subdomain}\"\nend\n"
      - lang: Java
        source: "ListSitesParams params = new ListSitesParams();\nparams.setLimit(200); // Pull 200 records at a time\nfinal Pager<Site> sites = client.listSites(params);\n\nfor (Site site : sites) {\n    System.out.println(site.getSubdomain());\n}\n"
      - lang: PHP
        source: "$options = [\n  'params' => [\n    'limit' => 200\n  ]\n];\n$sites = $client->listSites($options);\n\nforeach($sites as $site) {\n  echo 'Site: ' . $site->getSubdomain() . PHP_EOL;\n}\n"
      - lang: Go
        source: "listParams := &recurly.ListSitesParams{\n\tSort:  recurly.String(\"created_at\"),\n\tOrder: recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\n\nsites, err := client.ListSites(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor sites.HasMore() {\n\terr := sites.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, site := range sites.Data() {\n\t\tfmt.Printf(\"Site %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tsite.Id,\n\t\t\tsite.Subdomain,\n\t\t)\n\t}\n}"
      x-readme:
        code-samples:
        - language: node
          code: "const sites = client.listSites({ params: { limit: 200 } })\n\nfor await (const site of sites.each()) {\n  console.log(site.subdomain)\n}\n"
          name: Node.js
        - language: python
          code: "params = {\"limit\": 200}\nsites = client.list_sites(params=params).items()\nfor site in sites:\n    print(site.subdomain)\n"
          name: Python
        - language: csharp
          code: "var optionalParams = new ListSitesParams()\n{\n    Limit = 200\n};\nvar sites = client.ListSites(optionalParams);\nforeach(Site site in sites)\n{\n    Console.WriteLine(site.Subdomain);\n}\n"
          name: .NET
        - language: ruby
          code: "params = {\n  limit: 200\n}\nsites = @client.list_sites(params: params)\nsites.each do |site|\n  puts \"Site: #{site.subdomain}\"\nend\n"
          name: Ruby
        - language: java
          code: "ListSitesParams params = new ListSitesParams();\nparams.setLimit(200); // Pull 200 records at a time\nfinal Pager<Site> sites = client.listSites(params);\n\nfor (Site site : sites) {\n    System.out.println(site.getSubdomain());\n}\n"
          name: Java
        - language: php
          code: "$options = [\n  'params' => [\n    'limit' => 200\n  ]\n];\n$sites = $client->listSites($options);\n\nforeach($sites as $site) {\n  echo 'Site: ' . $site->getSubdomain() . PHP_EOL;\n}\n"
          name: PHP
        - language: go
          code: "listParams := &recurly.ListSitesParams{\n\tSort:  recurly.String(\"created_at\"),\n\tOrder: recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\n\nsites, err := client.ListSites(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor sites.HasMore() {\n\terr := sites.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, site := range sites.Data() {\n\t\tfmt.Printf(\"Site %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tsite.Id,\n\t\t\tsite.Subdomain,\n\t\t)\n\t}\n}"
          name: Go
    servers:
    - url: https://v3.recurly.com
    - url: https://v3.eu.recurly.com
  /sites/{site_id}:
    get:
      operationId: get_site
      summary: Fetch a site
      tags:
      - Site
      parameters:
      - $ref: '#/components/parameters/accept_header'
      - $ref: '#/components/parameters/site_id'
      responses:
        '200':
          description: A site.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
        '404':
          description: Incorrect site ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-code-samples:
      - lang: Node.js
        source: "try {\n  const site = await client.getSite(siteId)\n  console.log('Fetched site: ', site)\n} catch (err) {\n  if (err instanceof recurly.errors.NotFoundError) {\n    // If the request was not found, you may want to alert the user or\n    // just return null\n    console.log('Resource Not Found')\n  } else {\n    // If we don't know what to do with the err, we should\n    // probably re-raise and let our web framework and logger handle it\n    console.log('Unknown Error: ', err)\n  }\n}\n"
      - lang: Python
        source: "try:\n    site = client.get_site(site_id)\n    print(\"Got Site %s\" % site)\nexcept recurly.errors.NotFoundError:\n    # If the resource was not found, you may want to alert the user or\n    # just return nil\n    print(\"Resource Not Found\")\n"
      - lang: .NET
        source: "try\n{\n    Site site = client.GetSite(siteId);\n    Console.WriteLine($\"Fetched site {site.Id}\");\n}\ncatch (Recurly.Errors.NotFound ex)\n{\n    // If the resource was not found\n    // we may want to alert the user or just return null\n    Console.WriteLine($\"Resource Not Found: {ex.Error.Message}\");\n}\ncatch (Recurly.Errors.ApiError ex)\n{\n    // Use ApiError to catch a generic error from the API\n    Console.WriteLine($\"Unexpected Recurly Error: {ex.Error.Message}\");\n}\n"
      - lang: Ruby
        source: "begin\n  site = @client.get_site(site_id: site_id)\n  puts \"Got Site #{site}\"\nrescue Recurly::Errors::NotFoundError\n  # If the resource was not found, you may want to alert the user or\n  # just return nil\n  puts \"Resource Not Found\"\nend\n"
      - lang: Java
        source: "try {\n    final Site site = client.getSite(siteId);\n    System.out.println(\"Fetched site: \" + site.getId());\n  } catch (NotFoundException e) {\n    // If the resource was not found\n    // we may want to alert the user or just return null\n    System.out.println(\"Resource Not Found: \" + e.getError().getMessage());\n} catch (ApiException e) {\n    // Use ApiException to catch a generic error from the API\n    System.out.println(\"Unexpected Recurly Error: \" + e.getError().getMessage());\n}\n"
      - lang: PHP
        source: "try {\n    $site = $client->getSite($site_id);\n\n    echo 'Got Site:' . PHP_EOL;\n    var_dump($site);\n} catch (\\Recurly\\Errors\\NotFound $e) {\n    // Could not find the resource, you may want to inform the user\n    // or just return a NULL\n    echo 'Could not find resource.' . PHP_EOL;\n    var_dump($e);\n} catch (\\Recurly\\RecurlyError $e) {\n    // Something bad happened... tell the user so that they can fix it?\n    echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;\n}\n"
      - lang: Go
        source: "site, err := client.GetSite(siteID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Site: %s\", site.Id)"
      x-readme:
        code-samples:
        - language: node
          code: "try {\n  const site = await client.getSite(siteId)\n  console.log('Fetched site: ', site)\n} catch (err) {\n  if (err instanceof recurly.errors.NotFoundError) {\n    // If the request was not found, you may want to alert the user or\n    // just return null\n    console.log('Resource Not Found')\n  } else {\n    // If we don't know what to do with the err, we should\n    // probably re-raise and let our web framework and logger handle it\n    console.log('Unknown Error: ', err)\n  }\n}\n"
          name: Node.js
        - language: python
          code: "try:\n    site = client.get_site(site_id)\n    print(\"Got Site %s\" % site)\nexcept recurly.errors.NotFoundError:\n    # If the resource was not found, you may want to alert the user or\n    # just return nil\n    print(\"Resource Not Found\")\n"
          name: Python
        - language: csharp
          code: "try\n{\n    Site site = client.GetSite(siteId);\n    Console.WriteLine($\"Fetched site {site.Id}\");\n}\ncatch (Recurly.Errors.NotFound ex)\n{\n    // If the resource was not found\n    // we may want to alert the user or just return null\n    Console.WriteLine($\"Resource Not Found: {ex.Error.Message}\");\n}\ncatch (Recurly.Errors.ApiError ex)\n{\n    // Use ApiError to catch a generic error from the API\n    Console.WriteLine($\"Unexpected Recurly Error: {ex.Error.Message}\");\n}\n"
          name: .NET
        - language: ruby
          code: "begin\n  site = @client.get_site(site_id: site_id)\n  puts \"Got Site #{site}\"\nrescue Recurly::Errors::NotFoundError\n  # If the resource was not found, you may want to alert the user or\n  # just return nil\n  puts \"Resource Not Found\"\nend\n"
          name: Ruby
        - language: java
          code: "try {\n    final Site site = client.getSite(siteId);\n    System.out.println(\"Fetched site: \" + site.getId());\n  } catch (NotFoundException e) {\n    // If the resource was not found\n    // we may want to alert the user or just return null\n    System.out.println(\"Resource Not Found: \" + e.getError().getMessage());\n} catch (ApiException e) {\n    // Use ApiException to catch a generic error from the API\n    System.out.println(\"Unexpected Recurly Error: \" + e.getError().getMessage());\n}\n"
          name: Java
        - language: php
          code: "try {\n    $site = $client->getSite($site_id);\n\n    echo 'Got Site:' . PHP_EOL;\n    var_dump($site);\n} catch (\\Recurly\\Errors\\NotFound $e) {\n    // Could not find the resource, you may want to inform the user\n    // or just return a NULL\n    echo 'Could not find resource.' . PHP_EOL;\n    var_dump($e);\n} catch (\\Recurly\\RecurlyError $e) {\n    // Something bad happened... tell the user so that they can fix it?\n    echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;\n}\n"
          name: PHP
        - language: go
          code: "site, err := client.GetSite(siteID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Site: %s\", site.Id)"
          name: Go
    servers:
    - url: https://v3.recurly.com
    - url: https://v3.eu.recurly.com
components:
  parameters:
    ids:
      name: ids
      in: query
      description: "Filter results by their IDs. Up to 200 IDs can be passed at once using\ncommas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.\n\n**Important notes:**\n\n* The `ids` parameter cannot be used with any other ordering or filtering\n  parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)\n* Invalid or unknown IDs will be ignored, so you should check that the\n  results correspond to your request.\n* Records are returned in an arbitrary order. Since results are all\n  returned at once you can sort the records yourself.\n"
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
    order:
      name: order
      in: query
      description: Sort order.
      schema:
        default: desc
        $ref: '#/components/schemas/AlphanumericSortEnum'
    filter_state:
      name: state
      in: query
      description: Filter by state.
      schema:
        $ref: '#/components/schemas/ActiveStateEnum'
    limit:
      name: limit
      in: query
      description: Limit number of records 1-200.
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 20
    accept_header:
      name: Accept
      in: header
      description: The API version to use for this request, e.g. `application/vnd.recurly.v2021-02-25`. Requests without a versioned `Accept` header return a 406 response.
      required: true
      schema:
        default: application/vnd.recurly.v2021-02-25
        $ref: '#/components/schemas/AcceptHeaderEnum'
    site_id:
      name: site_id
      in: path
      description: Site ID or subdomain. For ID no prefix is used e.g. `e28zov4fw0v2`. For subdomain use prefix `subdomain-`, e.g. `subdomain-recurly`.
      required: true
      schema:
        type: string
    sort_dates:
      name: sort
      in: query
      description: 'Sort field. You *really* only want to sort by `updated_at` in ascending

        order. In descending order updated records will move behind the cursor and could

        prevent some records from being returned.

        '
      schema:
        default: created_at
        $ref: '#/components/schemas/TimestampSortEnum'
  schemas:
    ActiveStateEnum:
      type: string
      enum:
      - active
      - inactive
    AlphanumericSortEnum:
      type: string
      enum:
      - asc
      - desc
    ErrorTypeEnum:
      type: string
      enum:
      - bad_request
      - immutable_subscription
      - internal_server_error
      - invalid_api_key
      - invalid_api_version
      - invalid_content_type
      - invalid_permissions
      - invalid_token
      - missing_feature
      - not_found
      - rate_limited
      - service_not_available
      - simultaneous_request
      - tax_service_error
      - transaction
      - unauthorized
      - unavailable_in_api_version
      - unknown_api_version
      - validation
    AcceptHeaderEnum:
      type: string
      enum:
      - application/vnd.recurly.v2021-02-25
      - application/vnd.recurly.v2021-02-25+json
    Settings:
      type: object
      properties:
        billing_address_requirement:
          description: '- full:      Full Address (Street, City, State, Postal Code and Country)

            - streetzip: Street and Postal Code only

            - zip:       Postal Code only

            - none:      No Address

            '
          readOnly: true
          $ref: '#/components/schemas/AddressRequirementEnum'
        accepted_currencies:
          type: array
          items:
            type: string
            description: 3-letter ISO 4217 currency code.
          readOnly: true
        default_currency:
          type: string
          description: The default 3-letter ISO 4217 currency code.
          readOnly: true
    SiteList:
      type: object
      properties:
        object:
          type: string
          title: Object type
          description: Will always be List.
        has_more:
          type: boolean
          description: Indicates there are more results on subsequent pages.
        next:
          type: string
          description: Path to subsequent page of results.
        data:
          type: array
          items:
            $ref: '#/components/schemas/Site'
    TimestampSortEnum:
      type: string
      enum:
      - created_at
      - updated_at
    Site:
      type: object
      properties:
        id:
          type: string
          title: Site ID
          readOnly: true
          maxLength: 13
        object:
          type: string
          title: Object type
          readOnly: true
        subdomain:
          type: string
          readOnly: true
          maxLength: 100
        public_api_key:
          type: string
          title: Public API Key
          readOnly: true
          maxLength: 50
          description: This value is used to configure RecurlyJS to submit tokenized billing information.
        mode:
          title: Mode
          maxLength: 15
          readOnly: true
          $ref: '#/components/schemas/SiteModeEnum'
        address:
          $ref: '#/components/schemas/Address'
        settings:
          $ref: '#/components/schemas/Settings'
        features:
          type: array
          title: Features
          description: A list of features enabled for the site.
          items:
            readOnly: true
            $ref: '#/components/schemas/FeaturesEnum'
        created_at:
          type: string
          format: date-time
          title: Created at
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated at
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          title: Deleted at
          readOnly: true
    Address:
      type: object
      properties:
        phone:
          type: string
          title: Phone number
        street1:
          type: string
          title: Street 1
          maxLength: 50
        street2:
          type: string
          title: Street 2
          maxLength: 50
        city:
          type: string
          title: City
        region:
          type: string
          title: State/Province
          description: State or province.
        postal_code:
          type: string
          title: Zip/Postal code
          description: Zip or postal code.
        country:
          type: string
          title: Country
          description: Country, 2-letter ISO 3166-1 alpha-2 code.
        geo_code:
          type: string
          maxLength: 20
          description: Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled.
    AddressRequirementEnum:
      type: string
      enum:
      - full
      - none
      - streetzip
      - zip
    Error:
      type: object
      properties:
        type:
          title: Type
          $ref: '#/components/schemas/ErrorTypeEnum'
        message:
          type: string
          title: Message
        params:
          type: array
          title: Parameter specific errors
          items:
            type: object
            properties:
              param:
                type: string
    SiteModeEnum:
      type: string
      enum:
      - development
      - production
      - sandbox
    FeaturesEnum:
      type: string
      enum:
      - credit_memos
      - manual_invoicing
      - only_bill_what_changed
      - subscription_terms
  securitySchemes:
    api_key:
      type: http
      description: Enter the API key as the username and set the password to an empty string. You can locate and manage your API keys from the [API Credentials](https://app.recurly.com/go/developer/api_keys) page.
      scheme: basic
x-refined-from:
- recurly-v3-v2021-02-25-api.yaml
- recurly-openapi.yml
x-readme:
  explorer-enabled: false