Recurly General Ledger Accounts API

A general ledger account is an account of record used to sort, store and summarize a company's transactions. Recurly supports the balance sheet (Liability) account and income (Revenue) account to be attached to business entities, plans, or at the item level. When invoices are created, system can default to the accounts based on the GL Accounts attached at the plan/item level. The accounts can be defaulted from the business entity level as well. These accounts will be used in the Revenue Recognition module to create the revenue journals that can be posted into Merchant GL system. Revenue and Liability accounts can defined in the system using this API or via the General Ledger Accounting page in the Admin UI and then used at the plan/item level. Recurly allows merchants to default the accounts at the following levels: - Business Entities (default) - Plans - Base Price - Setup Fee - Add-ons - Items - Charges - Gift Cards - Shipping Methods - Credits If you are interested in Recurly Revenue Recognition features, please contact a Recurly customer service representative.

GitHub OpenAPI

Operations 4

GET /general_ledger_accounts List general ledger accounts #
POST /general_ledger_accounts Create a new general ledger account #
GET /general_ledger_accounts/{general_ledger_account_id} Lookup general ledger account #
PUT /general_ledger_accounts/{general_ledger_account_id} Update a general ledger account #

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-general-ledger-accounts-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-general-ledger-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Recurly V2 General Ledger Accounts API
  description: '# Getting Started

    Welcome to the reference documentation for Recurly''s XML API v2. Here you will find a complete

    reference for all API v2 operations. If you''re building a new product, or just getting started with Recurly, we recommend

    using our newer JSON API v3. Now let''s get started with API v2. # Authentication

    ##### API Authentication (HTTP Basic)

    Recurly uses HTTP Basic Authentication—your Private API key is securely encrypted by the SSL channel. If you are testing the API calls via the command line with cURL, try:


    ```

    curl -H ''Accept: application/xml'' \

    -H ''X-Api-Version: 2.29'' \

    -H ''Content-Type: application/xml; charset=utf-8'' \

    -u ''[apikey]'' \

    https://[subdomain].recurly.com/v2/accounts

    ```


    Replace `[apikey]` and `[subdomain]` with the appropriate values for your site. ##### Calculating your own authorization header

    Most programming languages encode the authorization header automatically. With HTTP Basic Authentication, the `Authorization` header is a string containing a Base-64 encoded username and password. In the case of Recurly''s API, you need only specify the username as your API key. If your library requires a password, set it to an empty string. ```

    "Authorization": "Basic " + base64_encode(API Key)

    ```


    ##### Additional Request Headers

    **Accept Header**


    Recurly API v2 returns results as XML. Your requests should always include the header requesting the results as XML:


    ```

    Accept: application/xml

    ```


    **Content-Type Header**


    When sending data to Recurly in a POST or PUT request, your request must specify the content type of your request:


    ```

    Content-Type: application/xml; charset=utf-8

    ```


    **X-Api-Version Header**


    When sending data to Recurly, your request should specify the API version you''re attempting to interact with:

    ```

    X-Api-Version: 2.29

    ```

    You learn more about the different versions in the API Versioning section. ##### Public API Key

    Recurly uses two types of API keys: public and private. The Public API key is used by Recurly.js to identify its requests as belonging to your Recurly site. This key can be safely included in Javascript code. Recurly provides each site with one Public Key. The Public API Key can be regenerated on the API Credentials page. ##### Private API Keys


    ###### Treat your Private API Keys like passwords! The API key allows access to your site''s data. Do not include it in Javascript code exposed to browsers. Recurly supports the use of multiple Private API keys, which can be used to integrate third party services using unique, controlled credentials. **Limits & Pricing**


    Merchants on the Starter or grandfathered Recurly plans or merchants in sandbox mode will be granted 5 private API keys. Merchants on Recurly''s Professional plan will be granted 10 private API keys. **Default Key**


    Your default private API key should be used to integrate Recurly with your backend systems. There will be at least one key active at all times. **Additional Keys**


    Additional private API keys should be used to connect your Recurly data to additional sources, like analytics software, accounting packages, or email tools. Recurly recommends clearly labeling the name of each key to identify the associated vendor. **Regenerating Private API Keys**


    Your API key can be regenerated by clicking on the Regenerate button on the API credentials page. When you generate a private API key, you have two options:


    1. Block the old key immediately. This is primarily recommended when the security of a key has been compromised. 2. Allow the old key access for 12 hours. This is primarily used when updating systems and a smooth transition between keys is needed. *If a private API key is changed, an email alert will be sent to your Recurly Site Technical Contact.*


    **Read-Only Keys**


    When creating a private key, you will have the option to set the key to “read-only”. This means the API key may make GET requests but cannot not PUT, POST or DELETE requests.'
  version: '2.29'
servers:
- url: https://{subdomain}.{domain}/v2
  variables:
    subdomain:
      description: Subdomain of your Recurly site.
      default: my-super-successful-company
    domain:
      description: Domain of your Recurly site.
      default: recurly.com
security:
- api_key: []
tags:
- name: general_ledger_accounts
  x-displayName: General Ledger Accounts
  description: 'A general ledger account is an account of record used to sort, store

    and summarize a company''s transactions. Recurly supports the balance

    sheet (Liability) account and income (Revenue) account to be attached

    to business entities, plans, or at the item level.


    When invoices are created, system can default to the accounts based

    on the GL Accounts attached at the plan/item level. The accounts can

    be defaulted from the business entity level as well.


    These accounts will be used in the Revenue Recognition module to create

    the revenue journals that can be posted into Merchant GL system.


    Revenue and Liability accounts can defined in the system using this

    API or via the General Ledger Accounting page in the Admin UI and then

    used at the plan/item level.


    Recurly allows merchants to default the accounts at the following levels:

    - Business Entities (default)

    - Plans

    - Base Price

    - Setup Fee

    - Add-ons

    - Items

    - Charges

    - Gift Cards

    - Shipping Methods

    - Credits


    If you are interested in Recurly Revenue Recognition features, please

    contact a Recurly customer service representative.'
paths:
  /general_ledger_accounts:
    get:
      tags:
      - general_ledger_accounts
      operationId: list_general_ledger_accounts
      summary: List general ledger accounts
      parameters:
      - in: query
        name: account_type
        schema:
          type: string
        description: 'The account type of general ledger accounts to return: `liability`, `revenue`.'
      responses:
        '200':
          description: Returns a list of general ledger accounts on your site.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/GeneralLedgerAccountsList'
              examples:
                getAllGla:
                  $ref: '#/components/examples/GeneralLedgerAccountsListResponse'
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\n// in addition to FilterCriteria, can also filter by account type:\ntry {\n  $glas = Recurly_GeneralLedgerAccountList::getByAccountType(\"revenue\");\n  foreach ($glas as $gla) {\n    print \"Account: $gla->code\\n\";\n  }\n} catch(Recurly_Error $e) {\n    print(\"Caught an error:\\n\");\n    print($e);\n}"
      - lang: Python
        source: "# account_type is an optional filter and can take either 'liability' or 'revenue'\nglas = GeneralLedgerAccount.all(account_type='revenue')\n\nfor general_ledger_account in glas:\n  print(f'General Ledger Account: {general_ledger_account}')"
      - lang: Ruby
        source: "# optional filter (revenue, liability)\noptions = { account_type: 'revenue' }\n\nRecurly::GeneralLedgerAccount.find_each(options) do |gla|\n  puts \"General Ledger Account: #{gla.inspect}\"\nend"
      - lang: Dotnet
        source: "var glas = GeneralLedgerAccounts.List();\n\n// in addition to FilterCriteria, can also filter by account type:\n// var glas = GeneralLedgerAccounts.List(GeneralLedgerAccountType.Liability);\n\ndo\n{\n    foreach (var gla in glas)\n    {\n        Console.WriteLine(\"GLA ({0}): {1}\", gla.AccountType, gla.Code);\n    }\n\n    glas = glas.Next;\n} while (glas.HasNextPage());"
      - lang: Java
        source: "final GeneralLedgerAccounts generalLedgerAccounts = client.getGeneralLedgerAccounts();\n\n// Can filter by account type.\n// final GeneralLedgerAccount glas = client.getGeneralLedgerAccounts(\"revenue\");\n\nfor (GeneralLedgerAccount generalLedgerAccount : generalLedgerAccounts) {\n    System.out.println(\"GeneralLedgerAccount: \" + generalLedgerAccount);\n}"
    post:
      tags:
      - general_ledger_accounts
      operationId: create_general_ledger_account
      summary: Create a new general ledger account
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/GeneralLedgerAccountCreate'
            examples:
              glaCreateRequest:
                $ref: '#/components/examples/GeneralLedgerAccountCreateRequest'
      responses:
        '201':
          description: A new general ledger account.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/GeneralLedgerAccount'
              examples:
                createGla:
                  $ref: '#/components/examples/GeneralLedgerAccountResponse'
      x-codeSamples:
      - lang: PHP
        source: "<?php\ntry {\n  $gla = new Recurly_GeneralLedgerAccount();\n  $gla->code = $code;\n\n  // account type can be liability or revenue\n  $gla->account_type = 'liability';\n  $gla->description = $description;\n  $gla->create();\n  print \"General Ledger Account: $gla\\n\";\n} catch (Exception $e) {\n  print \"Error: $e\";\n}"
      - lang: Python
        source: "# account_type can be 'liability' or 'revenue'\ngla = GeneralLedgerAccount(\n  code=gla_code,\n  account_type='revenue',\n  description=\"An optional description\"\n)\n\ngla.save()"
      - lang: Ruby
        source: "begin\n  gla_description = Faker::Hipster.words(number: 3).join(' ')\n  gla_code = Faker::Lorem.characters(number: 6)\n  Recurly::GeneralLedgerAccount.create!(\n    description: gla_description,\n    code: gla_code,\n    account_type: 'revenue'\n  )\nrescue Recurly::Error => e\n  puts e.inspect\nend"
      - lang: Dotnet
        source: "// account type can be Liability or Revenue\nvar gla = new GeneralLedgerAccount(yourAccountingCode, GeneralLedgerAccountType.Liability)\n{\n  Description = \"An optional description\",\n};\n\ngla.Create();"
      - lang: Java
        source: '// account type can be liability or revenue

          final GeneralLedgerAccount gla = new GeneralLedgerAccount();

          gla.setCode("code1");

          gla.setAccountType(["revenue"|"liability"]);

          gla.setDescription("Look at this fun General Ledger Account description!");

          final GeneralLedgerAccount glaResponse = client.createGeneralLedgerAccount(gla);'
  /general_ledger_accounts/{general_ledger_account_id}:
    get:
      tags:
      - general_ledger_accounts
      operationId: lookup_general_ledger_account
      summary: Lookup general ledger account
      parameters:
      - $ref: '#/components/parameters/general_ledger_account_id'
        required: true
      responses:
        '200':
          description: The general ledger account.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/GeneralLedgerAccount'
              examples:
                getOneGla:
                  $ref: '#/components/examples/GeneralLedgerAccountResponse'
      x-codeSamples:
      - lang: PHP
        source: "<?php\ntry {\n  $general_ledger_account = Recurly_GeneralLedgerAccount::get($id);\n  print(\"General Ledger Account: $general_ledger_account\\n\");\n} catch(Recurly_Error $e) {\n  print(\"Caught an error:\\n\");\n  print($e);\n}"
      - lang: Python
        source: gla = GeneralLedgerAccount.get(existing_gla_id)
      - lang: Ruby
        source: "begin\n  gla = Recurly::GeneralLedgerAccount.find(id)\n  puts \"General Ledger Account code: #{gla.code}\"\nrescue Recurly::Error => e\n  puts e.inspect\nend"
      - lang: Dotnet
        source: var gla = GeneralLedgerAccounts.Get(existingGlaId);
      - lang: Java
        source: final GeneralLedgerAccount generalLedgerAccount = client.getGeneralLedgerAccount(glaId);
    put:
      tags:
      - general_ledger_accounts
      operationId: update_general_ledger_account
      summary: Update a general ledger account
      parameters:
      - $ref: '#/components/parameters/general_ledger_account_id'
      requestBody:
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/GeneralLedgerAccountUpdate'
            examples:
              glaUpdateRequest:
                $ref: '#/components/examples/GeneralLedgerAccountUpdateRequest'
        required: true
      responses:
        '200':
          description: The updated general ledger account.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/GeneralLedgerAccount'
              examples:
                updateGla:
                  $ref: '#/components/examples/GeneralLedgerAccountResponse'
        '404':
          description: Incorrect site or general ledger account ID.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
      - lang: PHP
        source: "<?php\ntry {\n  $general_ledger_account->description = 'A new general_ledger_account description';\n  $general_ledger_account->update();\n  print(\"New gla: $general_ledger_account\\n\");\n  }\ncatch (Recurly_ValidationError $e) {\n  print($e->getMessage().\"\\n\");\n}"
      - lang: Python
        source: 'gla = GeneralLedgerAccount.get(existing_gla_id)


          # can also update the code, but _not_ the account_type

          gla.description = "New description"


          gla.save()'
      - lang: Ruby
        source: "begin\n  gla = Recurly::GeneralLedgerAccount.find(id)\n  gla.update_attributes(\n    description: \"New description\"\n  )\n  gla.save!\nrescue Recurly::Error => e\n  puts e.inspect\nend"
      - lang: Dotnet
        source: 'var gla = GeneralLedgerAccounts.Get(existingGlaId);


          // can also update the Code, but _not_ the AccountType

          gla.Description = "This is a new description";


          gla.Update();'
      - lang: Java
        source: 'final GeneralLedgerAccount gla = client.getGeneralLedgerAccount(existingGlaId);

          gla.setDescription("This is a new description");

          final GeneralLedgerAccount updatedGla = client.updateGeneralLedgerAccount(existingGlaId, gla);'
components:
  schemas:
    GeneralLedgerAccountCreate:
      type: object
      description: Create a new liability or revenue general ledger account.
      properties:
        code:
          $ref: '#/components/schemas/GeneralLedgerAccountCode'
        description:
          $ref: '#/components/schemas/GeneralLedgerAccountDescription'
        account_type:
          $ref: '#/components/schemas/GeneralLedgerAccountTypeEnum'
      required:
      - account_type
      - code
      xml:
        name: general_ledger_account
    GeneralLedgerAccountsList:
      type: array
      items:
        $ref: '#/components/schemas/GeneralLedgerAccount'
      xml:
        name: general_ledger_accounts
    Error:
      type: object
      title: Error
      properties:
        symbol:
          type: string
        description:
          type: string
      xml:
        name: error
    GeneralLedgerAccountCode:
      type: string
      title: Accounting code for the ledger account.
      description: 'Unique code to identify the ledger account. Each code must start

        with a letter or number. The following special characters are

        allowed: `-_.,:`

        '
      pattern: /^[A-Za-z0-9](( *)?[\-A-Za-z0-9_.,:])*$/
      example: 100abc
      maxLength: 255
      xml:
        name: code
    GeneralLedgerAccountDescription:
      type: string
      title: Description
      description: Optional description.
      example: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      maxLength: 255
      xml:
        name: description
    GeneralLedgerAccountTypeEnum:
      type: string
      enum:
      - liability
      - revenue
      xml:
        name: account_type
    GeneralLedgerAccountId:
      type: string
      title: General Ledger Account ID
      description: 'The ID of a general ledger account. General ledger accounts are

        only accessible as a part of the Recurly RevRec Standard and

        Recurly RevRec Advanced features.

        '
      maxLength: 13
      example: iiznlrvdt8py
      xml:
        name: id
    GeneralLedgerAccountUpdate:
      type: object
      description: Update an existing general ledger account.
      properties:
        code:
          $ref: '#/components/schemas/GeneralLedgerAccountCode'
        description:
          $ref: '#/components/schemas/GeneralLedgerAccountDescription'
      xml:
        name: general_ledger_account
    GeneralLedgerAccount:
      type: object
      description: Full general ledger account details.
      properties:
        id:
          $ref: '#/components/schemas/GeneralLedgerAccountId'
        code:
          $ref: '#/components/schemas/GeneralLedgerAccountCode'
        description:
          $ref: '#/components/schemas/GeneralLedgerAccountDescription'
        account_type:
          $ref: '#/components/schemas/GeneralLedgerAccountTypeEnum'
        created_at:
          type: string
          format: date-time
          title: Created at
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Last updated at
          readOnly: true
      xml:
        name: general_ledger_account
  examples:
    GeneralLedgerAccountCreateRequest:
      summary: Create a General Ledger Account
      value: "<general_ledger_account>\n  <account_type>liability</account_type>\n  <code>350</code>\n  <description>Loch Ness</description>\n</general_ledger_account>"
    GeneralLedgerAccountsListResponse:
      summary: All General Ledger Account
      value: "<general_ledger_accounts type=\"array\">\n    <general_ledger_account href=\"https://your-subdomain.recurly.com/v2/general_ledger_accounts/ty0r8j3km4jn\">\n        <id>ty0r8j3km4jn</id>\n        <code>revenue_code</code>\n        <account_type>revenue</account_type>\n        <description>I AM REVENUE</description>\n        <created_at type=\"datetime\">2023-11-22T02:49:17Z</created_at>\n        <updated_at type=\"datetime\">2023-11-22T02:52:51Z</updated_at>\n    </general_ledger_account>\n    <general_ledger_account href=\"https://your-subdomain.recurly.com/v2/general_ledger_accounts/tr8f9wdjffc6\">\n        <id>tr8f9wdjffc6</id>\n        <code>liability_code</code>\n        <account_type>liability</account_type>\n        <description>I AM LIABILITY</description>\n        <created_at type=\"datetime\">2023-10-18T21:07:33Z</created_at>\n        <updated_at type=\"datetime\">2023-10-25T16:18:19Z</updated_at>\n    </general_ledger_account>\n  </general_ledger_accounts>"
    GeneralLedgerAccountUpdateRequest:
      summary: Update a General Ledger Account
      value: "<general_ledger_account>\n  <code>350</code>\n  <description>Loch Ness</description>\n</general_ledger_account>"
    GeneralLedgerAccountResponse:
      summary: One General Ledger Account
      value: "<general_ledger_account href=\"https://your-subdomain.recurly.com/v2/general_ledger_accounts/tr8dacswuk0n\">\n  <id>tr8dacswuk0n</id>\n  <code>350</code>\n  <account_type>liability</account_type>\n  <description>Loch Ness</description>\n  <created_at type=\"datetime\">2023-10-18T20:56:25Z</created_at>\n  <updated_at type=\"datetime\">2023-10-18T20:56:25Z</updated_at>\n</general_ledger_account>"
  parameters:
    general_ledger_account_id:
      name: general_ledger_account_id
      in: path
      description: General Ledger Account ID
      required: true
      schema:
        $ref: '#/components/schemas/GeneralLedgerAccountId'
  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-provenance:
  method: harvested
  publisher: Recurly
  source: https://raw.githubusercontent.com/recurly/recurly-client-ruby/master/openapi/api.yaml
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)