Recurly Items API

The items API from Recurly — 3 operation(s) for items.

GitHub OpenAPI

Operations 6

GET /items List Items #
POST /items Create Item #
GET /items/{item_code} Lookup Item #
PUT /items/{item_code} Update Item #
DELETE /items/{item_code} Deactivate Item #
PUT /items/{item_code}/reactivate Reactivate Item #

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-items-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-items-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Recurly V2 Items 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: Items
  x-displayName: Items
paths:
  /items:
    get:
      summary: List Items
      description: 'Lists all your items in the catalog.


        The client library will automatically fetch the next page of the results. There may be a slight delay when fetching the next page.'
      tags:
      - Items
      operationId: listItems
      parameters:
      - in: query
        name: sort
        schema:
          type: string
          default: created_at
        description: 'The attribute that will be used to order records: `created_at`, `updated_at`.'
      - in: query
        name: order
        schema:
          type: string
          default: desc
        description: 'The order in which products will be returned: `asc` for ascending order, `desc` for descending order.'
      - in: query
        name: begin_time
        schema:
          type: string
          format: date-time
          default: ''
        description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes greater than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
      - in: query
        name: end_time
        schema:
          type: string
          format: date-time
          default: ''
        description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes less than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
      - in: query
        name: cursor
        schema:
          type: string
          default: ''
        description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
      - in: query
        name: per_page
        schema:
          type: integer
          default: '50'
        description: Number of records to return per page, up to a maximum of 200.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Item'
              example: "<items type=\"array\">\n  <item href=\"https://your-subdomain.recurly.com/v2/items/pink_sweaters\">\n    <item_code>pink_sweaters</item_code>\n    <name>Pink Sweaters</name>\n    <description>Favorite Pink Sweaters</description>\n    <external_sku>PS1234</external_sku>\n    <accounting_code>ps0000193</accounting_code>\n    <revenue_schedule_type>evenly</revenue_schedule_type>\n    <tax_exempt type=\"boolean\">false</tax_exempt>\n    <state>active</state>\n    <custom_fields type=\"array\">\n      <custom_field>\n        <name>size</name>\n        <value>large</value>\n      </custom_field>\n    </custom_fields>\n    <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n    <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n    <performance_obligation_id>7ps</performance_obligation_id>\n    <created_at type=\"datetime\">2019-11-21T15:55:19Z</created_at>\n    <updated_at type=\"datetime\">2019-11-21T15:55:19Z</updated_at>\n    <deleted_at nil=\"nil\"></deleted_at>\n  </item>\n  <!-- Continued... -->\n</items>"
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\n$items = Recurly_ItemList::get();\nforeach ($items as $item) {\n  print \"Item: $item->name\\n\";\n}"
      - lang: Ruby
        source: "Recurly::Item.find_each do |item|\n  puts \"Item: #{item.name}\"\nend"
      - lang: Python
        source: "#client version 2.1.6+\nfor item in recurly.Item.all():\n  print(f'Item: {item.name}')\n\n#client version <= 2.1.5\nitems = Item.all()\nwhile items:\n    for item in items:\n        print 'Item: %s' % item\n    try:\n        items = items.next_page()\n    except PageError:\n        items = ()"
      - lang: Dotnet
        source: "using System.Linq;\n\nvar items = Items.List();\nwhile (items.Any())\n{\n  foreach (var item in items)\n    Console.WriteLine(\"Item: \" + item.Name);\n  items = items.Next;\n}"
    post:
      summary: Create Item
      description: Create a new item in the catalog.
      tags:
      - Items
      operationId: createItem
      parameters: []
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: object
              required:
              - item_code
              - name
              properties:
                item_code:
                  type: string
                  default: ''
                  description: Unique code to identify the item. Max of 50 characters.
                name:
                  type: string
                  default: ''
                  description: Item name. Max of 255 characters.
                description:
                  type: string
                  default: ''
                  description: Optional plan description, not displayed.
                external_sku:
                  type: string
                  default: ''
                  description: Stock keeping unit to link the item to other inventory. Max of 50 characters.
                accounting_code:
                  type: string
                  default: ''
                  description: 'Accounting code for invoice line items. Code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 20 characters.'
                revenue_schedule_type:
                  type: string
                  default: evenly
                  description: Optional field for setting a revenue schedule type. This will determine how revenue for the associated Item should be recognized. Available schedule types are never, evenly, at_range_start, or at_range_end.
                state:
                  type: string
                  default: ''
                  description: The current state of the item. Will be either active or inactive. Read-only.
                custom_fields:
                  $ref: '#/components/schemas/CustomFields'
                liability_gl_account_id:
                  $ref: '#/components/schemas/GeneralLedgerAccountId'
                revenue_gl_account_id:
                  $ref: '#/components/schemas/GeneralLedgerAccountId'
                performance_obligation_id:
                  $ref: '#/components/schemas/PerformanceObligationId'
      responses:
        '201':
          description: ''
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Item'
              example: "<item href=\"https://your-subdomain.recurly.com/v2/items/pink_sweaters\">\n  <item_code>pink_sweaters</item_code>\n  <name>Pink Sweaters</name>\n  <description>Favorite Pink Sweaters</description>\n  <external_sku>PS1234</external_sku>\n  <accounting_code>ps0000193</accounting_code>\n  <revenue_schedule_type>evenly</revenue_schedule_type>\n  <tax_exempt type=\"boolean\">false</tax_exempt>\n  <state>active</state>\n  <custom_fields type=\"array\">\n    <custom_field>\n      <name>size</name>\n      <value>large</value>\n    </custom_field>\n  </custom_fields>\n  <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n  <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n  <performance_obligation_id>7ps</performance_obligation_id>\n  <created_at type=\"datetime\">2019-11-21T15:55:19Z</created_at>\n  <updated_at type=\"datetime\">2019-11-21T15:55:19Z</updated_at>\n  <deleted_at nil=\"nil\"></deleted_at>\n</item>"
      x-codeSamples:
      - lang: xml
        source: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<item>\n  <item_code>pink_sweaters</item_code>\n  <name>Pink Sweaters</name>\n  <description>Favorite Pink Sweaters</description>\n  <external_sku>PS1234</external_sku>\n  <accounting_code>ps0000193</accounting_code>\n  <revenue_schedule_type>evenly</revenue_schedule_type>\n  <custom_fields>\n    <custom_field>\n      <name>size</name>\n      <value>large</value>\n    </custom_field>\n  </custom_fields>\n  <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n  <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n  <performance_obligation_id>7ps</performance_obligation_id>\n</item>"
      - lang: PHP
        source: "<?php\n\ntry {\n  $item = new Recurly_Item();\n  $item->item_code = 'pink_sweaters';\n  $item->name = 'Pink Sweaters';\n  $item->description = 'Favorite Pink Sweaters';\n  $item->external_sku = 'PS1234';\n  $item->custom_fields[] = new Recurly_CustomField('size', 'large');\n\n  // legacy revenue recognition\n  $item->accounting_code = 'ps0000193';\n  $item->revenue_schedule_type = 'evenly';\n\n  // Recurly RevRec Standard/Advanced (RA-Managed)\n  // performance obligation IDs will be set to the default if omitted,\n  // but can be explicitly set if desired. general ledger account (gla)\n  // IDs will be `nil` if omitted (using business entity defaults at\n  // purchase time) but can also be explicitly set if desired.\n  $item->performance_obligation_id = $my_pob_id;\n  $item->revenue_gl_account_id = $my_revenue_gla_id;\n  $item->liability_gl_account_id = $my_liability_gla_id;\n\n  $item->create();\n\n  print \"Item: item\";\n} catch (Recurly_ValidationError $e) {\n  print \"Invalid Data: $e\";\n}"
      - lang: Ruby
        source: "item = Recurly::Item.create!(\n  item_code: 'pink_sweaters',\n  name: 'Pink Sweaters',\n  description: 'Favorite Pink Sweaters',\n  external_sku: 'PS1234',\n  custom_fields: [Recurly::CustomField.new(name: 'size', value: 'large')],\n  # legacy revenue recognition\n  accounting_code: 'ps0000193',\n  revenue_schedule_type: 'evenly',\n  # Recurly RevRec Standard/Advanced (RA-Managed)\n  # performance obligation IDs will be set to the default if omitted,\n  # but can be explicitly set if desired. general ledger account (gla)\n  # IDs will be `nil` if omitted (using business entity defaults at\n  # purchase time) but can also be explicitly set if desired.\n  liability_gl_account_id:    liability_gl_account.id,\n  revenue_gl_account_id:      revenue_gl_account.id,\n  performance_obligation_id:  pob.id\n)"
      - lang: Python
        source: "item = recurly.Item(\n item_code = 'pink_sweaters',\n name = 'Pink Sweaters',\n description = 'Favorite Pink Sweaters',\n external_sku = 'PS1234',\n accounting_code = 'ps0000193',\n revenue_schedule_type = 'evenly',\n custom_fields = [recurly.CustomField(name = 'size', value = 'large')],\n # Recurly RevRec Standard/Advanced (RA-Managed)\n # performance obligation IDs will be set to the default if omitted,\n # but can be explicitly set if desired. general ledger account (gla)\n # IDs will be `nil` if omitted (using business entity defaults at\n # purchase time) but can also be explicitly set if desired.\n liability_gl_account_id = liability_gl_account_id,\n revenue_gl_account_id = revenue_gl_account_id,\n performance_obligation_id = performance_obligation_id\n)\nitem.save()"
      - lang: Dotnet
        source: 'var item = new Item("pink_sweaters", "Pink Sweaters"); // item code,

          name


          item.Description = "Favorite Pink Sweaters";

          item.ExternalSku = "PS1234";


          // legacy revenue recognition

          item.AccountingCode = "ps0000193";

          item.RevenueScheduleType = "evenly";


          // Recurly RevRec Standard/Advanced (RA-Managed)

          // performance obligation IDs will be set to the default if omitted,

          // but can be explicitly set if desired. general ledger account (gla)

          // IDs will be `nil` if omitted (using business entity defaults at

          // purchase time) but can also be explicitly set if desired.

          item.LiabilityGlAccountId = liabilityGlaId;

          item.RevenueGlAccountId = revenueGlaId;

          item.PerformanceObligationId = performanceObligationId;


          item.CustomFields.Add(new CustomField("size", "large"));


          item.Create();'
      - lang: Java
        source: 'final Item item = new Item();

          item.setItemCode("itemCode");

          item.setName("Tree Fiddy");


          // Recurly RevRec Standard/Advanced (RA-Managed)

          item.setLiabilityGlAccountId(liabilityGlaId);

          item.setRevenueGlAccountId(revenueGlaId);

          item.setPerformanceObligationId(pobId);


          client.createItem(item);'
  /items/{item_code}:
    get:
      summary: Lookup Item
      description: Lookup an item's details.
      tags:
      - Items
      operationId: lookupItem
      parameters:
      - in: path
        name: item_code
        schema:
          type: string
          default: ''
        required: true
        description: Unique code to identify the item.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Item'
              example: "<item href=\"https://your-subdomain.recurly.com/v2/items/pink_sweaters\">\n  <item_code>pink_sweaters</item_code>\n  <name>Pink Sweaters</name>\n  <description>Favorite Pink Sweaters</description>\n  <external_sku>PS1234</external_sku>\n  <accounting_code>ps0000193</accounting_code>\n  <revenue_schedule_type>evenly</revenue_schedule_type>\n  <tax_exempt type=\"boolean\">false</tax_exempt>\n  <state>active</state>\n  <custom_fields type=\"array\">\n    <custom_field>\n      <name>size</name>\n      <value>large</value>\n    </custom_field>\n  </custom_fields>\n  <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n  <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n  <performance_obligation_id>7ps</performance_obligation_id>\n  <created_at type=\"datetime\">2019-11-21T15:55:19Z</created_at>\n  <updated_at type=\"datetime\">2019-11-21T15:55:19Z</updated_at>\n  <deleted_at nil=\"nil\"></deleted_at>\n</item>"
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\ntry {\n  $item = Recurly_Item::get('pink_sweaters');\n  print \"Item: $item\";\n} catch (Recurly_NotFoundError $e) {\n  print \"Plan not found\";\n}"
      - lang: Ruby
        source: item = Recurly::Item.find('pink_sweaters')
      - lang: Python
        source: item = Item.get('pink_sweaters')
      - lang: Dotnet
        source: var item = Items.Get("pink_sweaters");
    put:
      summary: Update Item
      description: Update an item.
      tags:
      - Items
      operationId: updateItem
      parameters:
      - in: path
        name: item_code
        schema:
          type: string
          default: ''
        required: true
        description: ''
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: object
              properties:
                item_code:
                  type: string
                  default: ''
                  description: Unique code to identify the item. Max of 50 characters.
                name:
                  type: string
                  default: ''
                  description: Item name. Max of 255 characters.
                description:
                  type: string
                  default: ''
                  description: Optional plan description, not displayed.
                external_sku:
                  type: string
                  default: ''
                  description: Stock keeping unit to link the item to other inventory. Max of 50 characters.
                accounting_code:
                  type: string
                  default: ''
                  description: 'Accounting code for invoice line items. Code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 20 characters.'
                revenue_schedule_type:
                  type: string
                  default: evenly
                  description: Optional field for setting a revenue schedule type. This will determine how revenue for the associated Item should be recognized. Available schedule types are never, evenly, at_range_start, or at_range_end.
                state:
                  type: string
                  default: ''
                  description: The current state of the item. Will be either active or inactive. Read-only.
                custom_fields:
                  $ref: '#/components/schemas/CustomFields'
                liability_gl_account_id:
                  $ref: '#/components/schemas/GeneralLedgerAccountId'
                revenue_gl_account_id:
                  $ref: '#/components/schemas/GeneralLedgerAccountId'
                performance_obligation_id:
                  $ref: '#/components/schemas/PerformanceObligationId'
      responses:
        '200':
          description: ''
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Item'
              example: "<item href=\"https://your-subdomain.recurly.com/v2/items/pink_sweaters\">\n  <item_code>pink_sweaters</item_code>\n  <name>Pink Sweaters</name>\n  <description>Second-Favorite Pink Sweaters</description>\n  <external_sku>PS1234</external_sku>\n  <accounting_code>ps0000193</accounting_code>\n  <revenue_schedule_type>evenly</revenue_schedule_type>\n  <tax_exempt type=\"boolean\">false</tax_exempt>\n  <state>active</state>\n  <custom_fields type=\"array\">\n    <custom_field>\n      <name>size</name>\n      <value>large</value>\n    </custom_field>\n  </custom_fields>\n  <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n  <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n  <performance_obligation_id>7ps</performance_obligation_id>\n  <created_at type=\"datetime\">2019-11-21T15:55:19Z</created_at>\n  <updated_at type=\"datetime\">2019-11-21T15:55:19Z</updated_at>\n  <deleted_at nil=\"nil\"></deleted_at>\n</item>"
      x-codeSamples:
      - lang: xml
        source: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<item>\n  <item_code>pink_sweaters</item_code>\n  <description>Second-Favorite Pink Sweaters</description>\n  <liability_gl_account_id>ty4utwr0mrgz</liability_gl_account_id>\n  <revenue_gl_account_id>twyyzw8vcm36</revenue_gl_account_id>\n  <performance_obligation_id>7ps</performance_obligation_id>\n</item>"
      - lang: PHP
        source: "<?php\n\ntry {\n  $item = Recurly_Item::get('pink_sweaters');\n  $item->description = 'Second-Favorite Pink Sweaters';\n\n  // Recurly RevRec Standard/Advanced (RA-Managed)\n  $item->revenue_gl_account_id = $new_revenue_gla_id;\n  $item->liability_gl_account_id = $new_liability_gla_id;\n  $item->performance_obligation_id = $new_pob_id;\n\n  $item->update();\n\n  print \"Item: item\";\n} catch (Recurly_ValidationError $e) {\n  print \"Invalid Data: $e\";\n}"
      - lang: Ruby
        source: "item = recurly.Item.get('pink_sweaters')\nitem.update_attributes(\n  description: \"Second-Favorite Pink Sweaters\",\n  # Recurly RevRec Standard/Advanced (RA-Managed)\n  liability_gl_account_id: updated_liability_gl_account.id,\n  revenue_gl_account_id: updated_revenue_gl_account.id,\n  performance_obligation_id: updated_pob.id\n)"
      - lang: Python
        source: 'item = recurly.Item.get(''pink_sweaters'')

          item.description = ''Second-Favorite Pink Sweaters'',

          # Recurly RevRec Standard/Advanced (RA-Managed)

          item.liability_gl_account_id = liability_gl_account_id,

          item.revenue_gl_account_id = revenue_gl_account_id,

          item.performance_obligation_id = performance_obligation_id


          item.save()'
      - lang: Dotnet
        source: 'var item = Items.Get("pink_sweaters");


          item.Description = "Second-Favorite Pink Sweaters";


          // Recurly RevRec Standard/Advanced (RA-Managed)

          item.LiabilityGlAccountId = liabilityGlaId;

          item.RevenueGlAccountId = revenueGlaId;

          item.PerformanceObligationId = performanceObligationId;


          item.Update();'
      - lang: Java
        source: 'final Item item = client.getItem("updatable_item")


          // Recurly RevRec Standard/Advanced (RA-Managed)

          item.setLiabilityGlAccountId(liabilityGlaId);

          item.setRevenueGlAccountId(revenueGlaId);

          item.setPerformanceObligationId(pobId);


          final Item updatedItem = client.updateItem(item.getItemCode(), item);'
    delete:
      summary: Deactivate Item
      description: Deactivating a item makes it inactive.
      tags:
      - Items
      operationId: deactivateItem
      parameters:
      - in: path
        name: item_code
        schema:
          type: string
          default: ''
        required: true
        description: Unique code to identify the item.
      responses:
        '204':
          description: ''
          content:
            application/xml:
              example: 'Status: 204 No Content'
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\ntry {\n  $item = Recurly_Item::get('pink_sweaters');\n  $item->delete();\n\n  print \"Item: $item\";\n} catch (Recurly_NotFoundError $e) {\n  print \"Item Not Found: $e\";\n}"
      - lang: Ruby
        source: 'item = Recurly::Item.find(''pink_sweaters'')

          item.destroy'
      - lang: Python
        source: 'item = Item.get(''pink_sweaters'')

          item.delete()'
      - lang: Dotnet
        source: 'var item = Items.Get("pink_sweaters");

          item.Deactivate();'
  /items/{item_code}/reactivate:
    put:
      summary: Reactivate Item
      description: Reactivate an inactive item.
      tags:
      - Items
      operationId: reactivateItem
      parameters:
      - in: path
        name: item_code
        schema:
          type: string
          default: ''
        required: true
        description: Unique code to identify the item.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Item'
              example: "<item href=\"https://your-subdomain.recurly.com/v2/items/pink_sweaters\">\n  <item_code>pink_sweaters</item_code>\n  <name>Pink Sweaters</name>\n  <description>Favorite Pink Sweaters</description>\n  <external_sku>PS1234</external_sku>\n  <accounting_code>ps0000193</accounting_code>\n  <revenue_schedule_type>evenly</revenue_schedule_type>\n  <tax_exempt type=\"boolean\">false</tax_exempt>\n  <state>active</state>\n  <custom_fields type=\"array\">\n    <custom_field>\n      <name>size</name>\n      <value>large</value>\n    </custom_field>\n  </custom_fields>\n  <created_at type=\"datetime\">2019-11-21T15:55:19Z</created_at>\n  <updated_at type=\"datetime\">2019-11-21T15:55:19Z</updated_at>\n  <deleted_at nil=\"nil\"></deleted_at>\n</item>"
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\ntry {\n  $item = Recurly_Item::get('pink_sweaters');\n  $item->reactivate();\n\n  print \"Item: $item\";\n} catch (Recurly_NotFoundError $e) {\n  print \"Item Not Found: $e\";\n}"
      - lang: Ruby
        source: 'item = Recurly::Item.find(''pink_sweaters'')

          item.reactivate'
      - lang: Python
        source: 'item = Item.get(''pink_sweaters'')

          item.reactivate()'
      - lang: Dotnet
        source: 'var item = Items.Get("pink_sweaters");

          item.Reactivate();'
components:
  schemas:
    PerformanceObligationId:
      type: string
      title: Performance Obligation ID
      description: 'The ID of a performance obligation. Performance obligations are

        only accessible as a part of the Recurly RevRec Standard and

        Recurly RevRec Advanced features.

        '
      maxLength: 13
      xml:
        name: id
    CustomField:
      type: object
      required:
      - name
      - value
      properties:
        name:
          type: string
          maxLength: 50
          pattern: /^[a-z0-9_-]+$/i
          title: Field name
          description: Fields must be created in the UI before values can be assigned to them.
        value:
          type: string
          maxLength: 255
          title: Field value
          description: Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
    Item:
      type: object
      description: Full item details.
      properties:
        item_code:
          type: string
          default: ''
          description: Unique code to identify the item. Max of 50 characters.
        name:
          type: string
          default: ''
          description: Item name. Max of 255 characters.
        description:
          type: string
          default: ''
          description: Optional plan description, not displayed.
        external_sku:
          type: string
          default: ''
          description: Stock keeping unit to link the item to other inventory. Max of 50 characters.
        accounting_code:
          type: string
          default: ''
          description: 'Accounting code for invoice line items. Code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 20 characters.'
        revenue_schedule_type:
          type: string
          default: evenly
          description: Optional field for setting a revenue schedule type. This will determine how revenue for the associated Item should be recognized.
          enum:
          - never
          - evenly
          - at_range_start
          - at_range_end
        tax_exempt:
          type: boolean
          default: 'false'
          description: '`true` exempts tax on the charge, `false` applies tax on the charge. If not defined, defaults to `false`.'
        state:
          type: string
          default: ''
          description: The current state of the item. Will be either active or inactive. Read-only.
          enum:
          - active
          - inactive
        custom_fields:
          $ref: '#/components/schemas/CustomFields'
        liability_gl_account_id:
          $ref: '#/components/schemas/GeneralLedgerAccountId'
        revenue_gl_account_id:
          $ref: '#/components/schemas/GeneralLedgerAccountId'
        performance_obligation_id:
          $ref: '#/components/schemas/PerformanceObligationId'
        created_at:
          type: string
          format: date-time
          description: The datetime this item was created
        updated_at:
          type: string
          format: date-time
          description: The datetime this item was last updated
    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
    CustomFields:
      type: array
      items:
        $ref: '#/components/schemas/CustomField'
      title: Custom Fields
      description: The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
  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