> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List what custom fields can be attached to

> The resources a definition can describe, from the server's own
registry (`Spree.custom_fields.enabled_resources`).

Read this rather than carrying a list: a resource an extension
registers appears here without a client release, and a `resource_type`
that is not listed is refused on create.

`resource_type` is the value to send; `name` is what a merchant calls
it — send the value back verbatim rather than deriving it from the name.


**Required scope:** `read_settings` (for API-key authentication).



## OpenAPI

````yaml /api-reference/admin.yaml get /api/v3/admin/custom_field_definitions/resource_types
openapi: 3.0.3
info:
  title: Admin API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: >
    Spree Admin API v3 - Administrative API for managing products, orders, and
    store settings.


    ## Authentication


    The Admin API requires a secret API key passed in the `x-spree-api-key`
    header.

    Secret API keys can be generated in the Spree admin dashboard.


    ## Response Format


    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.

    Single resource endpoints return a flat JSON object.


    ## Resource IDs


    Every resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,

    `variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,

    request bodies, and Ransack filters all accept them directly.


    ## Error Handling


    Errors return a consistent format:

    ```json

    {
      "error": {
        "code": "validation_error",
        "message": "Validation failed",
        "details": { "name": ["can't be blank"] }
      }
    }

    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Admin user login, logout, token refresh, and current user profile
  - name: Allowed Origins
    description: CORS allowlist for storefront and admin client origins
  - name: API Keys
    description: Secret and publishable API keys
  - name: Categories
    description: >-
      Hierarchical product categories — tree management, repositioning, and
      product assignments
  - name: Channels
    description: >-
      Sales channels, product publication across channels, and per-channel order
      routing rules
  - name: Custom Fields
    description: >-
      Custom field definitions for products, variants, customers, and other
      resources
  - name: Customer Groups
    description: >-
      Customer groups for segmenting customers (e.g. wholesale, VIP) used by
      pricing and promotions
  - name: Customers
    description: Customer profiles, addresses, credit cards, and store credits
  - name: Email Templates
    description: >-
      Customer email templates, the email layout and shared partials: drafts,
      previews, publishing and history
  - name: Exports
    description: Async CSV exports of admin resources
  - name: Files
    description: Uploading the files that product media, imports, logos and documents use
  - name: Fulfillments
    description: Order fulfillments — shipments, fulfill, cancel, resume, split
  - name: Gift Cards
    description: Gift cards and gift card batches
  - name: Imports
    description: >-
      Async CSV imports of admin resources, with per-row status and failed-row
      retry
  - name: Markets
    description: >-
      Markets — geographic groupings of countries used for pricing, tax, and
      fulfillment rules
  - name: Option Types
    description: >-
      Option types and option values used to build product variants (e.g. Size,
      Color)
  - name: Orders
    description: Orders, order items, applied gift cards, and applied store credits
  - name: Payment Methods
    description: Configured payment providers and their available types
  - name: Payments
    description: Order payments — list, capture, void
  - name: Pricing
    description: >-
      Prices and price lists for currency-, market-, and customer-group-specific
      pricing
  - name: Products
    description: >-
      Products, taxons/categories, product custom field values, and bulk product
      operations
  - name: Policies
    description: The store's legal documents — terms of service, privacy, returns, shipping
  - name: Reasons
    description: >-
      Merchant-owned vocabularies for why a return, claim, refund, cancellation
      or tax exemption happened
  - name: Promotions
    description: Promotions, promotion rules, promotion actions, and coupon codes
  - name: Refunds
    description: Order refunds
  - name: Settings
    description: Store-level settings — store profile, tags, and configuration
  - name: Staff
    description: Admin users, roles, and invitations to the store
  - name: Stock Locations
    description: Warehouses and physical fulfillment locations
  - name: Store Credits
    description: Prepaid customer balances across all customers, and each balance's ledger
  - name: Variants
    description: >-
      Product variants — the individual SKUs (size/color combinations) sold
      under a product
  - name: Webhooks
    description: Webhook endpoints and webhook delivery history
paths:
  /api/v3/admin/custom_field_definitions/resource_types:
    get:
      tags:
        - Custom Field Definitions
      summary: List what custom fields can be attached to
      description: |-
        The resources a definition can describe, from the server's own
        registry (`Spree.custom_fields.enabled_resources`).

        Read this rather than carrying a list: a resource an extension
        registers appears here without a client release, and a `resource_type`
        that is not listed is refused on create.

        `resource_type` is the value to send; `name` is what a merchant calls
        it — send the value back verbatim rather than deriving it from the name.


        **Required scope:** `read_settings` (for API-key authentication).
      parameters:
        - name: x-spree-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: resource types found
          content:
            application/json:
              example:
                data:
                  - resource_type: address
                    name: Addresses
                  - resource_type: category
                    name: Categories
                  - resource_type: claim
                    name: Claims
                  - resource_type: collection
                    name: Collections
                  - resource_type: company
                    name: Companies
                  - resource_type: credit_card
                    name: Credit Cards
                  - resource_type: customer
                    name: Customers
                  - resource_type: delivery_method
                    name: Delivery Methods
                  - resource_type: exchange
                    name: Exchanges
                  - resource_type: fulfillment
                    name: Fulfillments
                  - resource_type: gift_card
                    name: Gift Cards
                  - resource_type: line_item
                    name: Line Items
                  - resource_type: media
                    name: Media
                  - resource_type: newsletter_subscriber
                    name: Newsletter Subscribers
                  - resource_type: option_type
                    name: Option Types
                  - resource_type: option_value
                    name: Option Values
                  - resource_type: order
                    name: Orders
                  - resource_type: payment_method
                    name: Payment Methods
                  - resource_type: payment_source
                    name: Payment Sources
                  - resource_type: payment
                    name: Payments
                  - resource_type: product_type
                    name: Product Types
                  - resource_type: product
                    name: Products
                  - resource_type: promotion
                    name: Promotions
                  - resource_type: purchase_order
                    name: Purchase Orders
                  - resource_type: refund
                    name: Refunds
                  - resource_type: return
                    name: Returns
                  - resource_type: seller
                    name: Sellers
                  - resource_type: stock_level
                    name: Stock Levels
                  - resource_type: stock_transfer
                    name: Stock Transfers
                  - resource_type: store_credit
                    name: Store Credits
                  - resource_type: store
                    name: Stores
                  - resource_type: tax_rate
                    name: Tax Rates
                  - resource_type: variant
                    name: Variants
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        resource_type:
                          type: string
                          example: seller
                        name:
                          type: string
                          example: Sellers
      security:
        - api_key: []
          bearer_auth: []
      x-codeSamples:
        - lang: javascript
          label: Spree Admin SDK
          source: >-
            import { createAdminClient } from '@spree/admin-sdk'


            const client = createAdminClient({
              baseUrl: 'https://your-store.com',
              secretKey: 'sk_xxx',
            })


            // What a definition can be attached to. Comes from the server's
            registry, so

            // a resource an extension adds shows up here without a client
            release.

            const { data: resourceTypes } = await
            client.customFieldDefinitions.resourceTypes()
        - lang: bash
          label: Spree CLI
          source: spree api get /custom_field_definitions/resource_types
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: x-spree-api-key
      in: header
      description: Secret API key for admin access
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for admin user authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.