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

# Read Customer State

> ### Intent

Reads the customer state without changing it.

### When to call it

Call this after your application has received or stored the identifier for the customer state.

### Access boundary

Authorize the request with a token that carries `customers:read` or `customers:write`.

### Successful result

A successful request returns `200`. The response schema below defines the body your integration receives.

export const RubaSocials = () => {
  if (typeof document === "undefined") {
    return null;
  }
  const inject = () => {
    const footer = document.getElementById("footer");
    if (!footer || document.getElementById("ruba-socials")) {
      return false;
    }
    const isDark = document.querySelector("html.dark") || document.querySelector('html[class*="dark"]');
    const lineColor = isDark ? "#383838" : "#e8e8ed";
    const iconColor = isDark ? "#8e8e93" : "#86868b";
    const markColor = isDark ? "#ffffff" : "#08080c";
    const hoverColor = "#0071e3";
    const div = document.createElement("div");
    div.id = "ruba-socials";
    div.style.cssText = `display:flex;align-items:center;gap:20px;padding-top:20px;margin-top:20px;border-top:1px solid ${lineColor};width:100%`;
    const logo = `<a href="https://getruba.com" style="display:inline-flex;height:24px;align-items:center;gap:8px;text-decoration:none;color:${markColor};line-height:1;"><svg width="24" height="24" viewBox="0 0 120 120" aria-hidden="true" style="display:block;flex:none;"><g transform="translate(2.5 0)"><path d="M19 25h59L65.43 47H19a4 4 0 0 1-4-4V29a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M19 73h31.57L38 95H19a4 4 0 0 1-4-4V77a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M85 25h25L70 95H45Z" fill="#007AFF"/></g></svg><span style="display:inline-flex;height:24px;align-items:center;font-weight:600;font-size:15px;color:${markColor};letter-spacing:-0.01em;line-height:1;">Ruba</span></a>`;
    const spacer = `<div style="flex:1"></div>`;
    const ig = `<a href="https://instagram.com/getruba" target="_blank" rel="noopener" aria-label="Instagram" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/></svg></a>`;
    const li = `<a href="https://linkedin.com/company/getruba" target="_blank" rel="noopener" aria-label="LinkedIn" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect x="2" y="9" width="4" height="12"/><circle cx="4" cy="4" r="2"/></svg></a>`;
    const x = `<a href="https://x.com/getruba" target="_blank" rel="noopener" aria-label="X" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>`;
    const github = `<a href="https://github.com/rubadot" target="_blank" rel="noopener" aria-label="GitHub" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .7a11.5 11.5 0 0 0-3.64 22.4c.58.1.79-.25.79-.56v-2.24c-3.22.7-3.9-1.37-3.9-1.37-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.78 1.2 1.78 1.2 1.04 1.77 2.72 1.26 3.38.96.1-.75.4-1.26.74-1.55-2.57-.3-5.27-1.29-5.27-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.47.11-3.05 0 0 .97-.31 3.16 1.18A10.96 10.96 0 0 1 12 6.09c.98 0 1.94.13 2.86.39 2.2-1.49 3.16-1.18 3.16-1.18.63 1.58.23 2.76.11 3.05.74.8 1.19 1.83 1.19 3.09 0 4.42-2.7 5.39-5.28 5.68.42.36.79 1.06.79 2.14v3.28c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z"/></svg></a>`;
    div.innerHTML = logo + spacer + ig + li + x + github;
    footer.appendChild(div);
    return true;
  };
  if (!document.documentElement.dataset.rubaSocialsObserver) {
    document.documentElement.dataset.rubaSocialsObserver = "true";
    const observer = new MutationObserver(() => {
      if (!document.getElementById("ruba-socials")) {
        inject();
      }
    });
    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
  setTimeout(() => {
    if (!inject()) {
      const interval = setInterval(() => {
        if (inject()) {
          clearInterval(interval);
        }
      }, 500);
      setTimeout(() => clearInterval(interval), 10000);
    }
  }, 300);
  return null;
};

<link rel="stylesheet" href="/style.css" />

<RubaSocials />


## OpenAPI

````yaml get /v1/customers/{id}/state
openapi: 3.1.0
info:
  title: Ruba API
  summary: Ruba HTTP and Webhooks API
  description: '**Details:** Read the docs at https://docs.getruba.com/api-reference.'
  version: 2026-04
servers:
  - url: https://api.getruba.com
    description: '**Details:** Production environment.'
    x-speakeasy-server-id: production
  - url: https://sandbox-api.getruba.com
    description: '**Details:** Sandbox environment.'
    x-speakeasy-server-id: sandbox
security: []
tags:
  - name: public
    description: >-
      **Details:** Endpoints shown and documented in the Ruba API documentation
      and available in our SDKs.
  - name: private
    description: >-
      **Details:** Endpoints that should appear in the schema only in
      development to generate our internal JS SDK.
paths:
  /v1/customers/{id}/state:
    get:
      tags:
        - customers
        - public
      summary: Read Customer State
      description: >-
        ### Intent


        Reads the customer state without changing it.


        ### When to call it


        Call this after your application has received or stored the identifier
        for the customer state.


        ### Access boundary


        Authorize the request with a token that carries `customers:read` or
        `customers:write`.


        ### Successful result


        A successful request returns `200`. The response schema below defines
        the body your integration receives.
      operationId: customers:get_state
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: Identifier of the customer.
            title: Id
          description: Identifier of the customer.
      responses:
        '200':
          description: Request completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerState'
        '404':
          description: '**Response:** Customer could not be found.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - oidc:
            - customers:read
            - customers:write
        - pat:
            - customers:read
            - customers:write
        - oat:
            - customers:read
            - customers:write
components:
  schemas:
    CustomerState:
      oneOf:
        - $ref: '#/components/schemas/CustomerStateIndividual'
        - $ref: '#/components/schemas/CustomerStateTeam'
      discriminator:
        propertyName: type
        mapping:
          individual:
            $ref: '#/components/schemas/CustomerStateIndividual'
          team:
            $ref: '#/components/schemas/CustomerStateTeam'
    ResourceNotFound:
      properties:
        error:
          type: string
          const: ResourceNotFound
          title: Error
          examples:
            - ResourceNotFound
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: ResourceNotFound
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomerStateIndividual:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: Unique identifier for the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            Unique identifier for the customer in your system. This must be
            unique within the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          type: string
          title: Email
          description: >-
            **Email:** Email address of the customer. This must be unique within
            the organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Indicates whether the customer email address is verified. The
            address is automatically verified when the customer accesses the
            customer portal using their email address.
          examples:
            - true
        type:
          type: string
          const: individual
          title: Type
          description: '**Type:** Type of customer.'
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name assigned to the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            **Billing Name:** Name that should appear on the customer's
            invoices. Falls back to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: Unique identifier for the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            Unique identifier for the customer's default payment method, if any.
            Use the payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: '**Deleted At:** Timestamp for when the customer was soft deleted.'
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
        active_subscriptions:
          items:
            $ref: '#/components/schemas/CustomerStateSubscription'
          type: array
          title: Active Subscriptions
          description: '**Active Subscriptions:** Customer''s active subscriptions.'
        granted_benefits:
          items:
            $ref: '#/components/schemas/CustomerStateBenefitGrant'
          type: array
          title: Granted Benefits
          description: '**Granted Benefits:** Customer''s active benefit grants.'
        active_meters:
          items:
            $ref: '#/components/schemas/CustomerStateMeter'
          type: array
          title: Active Meters
          description: '**Active Meters:** Customer''s active meters.'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
        - active_subscriptions
        - granted_benefits
        - active_meters
      title: CustomerStateIndividual
      description: |-
        A customer along with additional state information:

        * Active subscriptions
        * Granted benefits
        * Active meters
    CustomerStateTeam:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: Unique identifier for the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            Unique identifier for the customer in your system. This must be
            unique within the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            **Email:** Email address of the customer. This must be unique within
            the organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Indicates whether the customer email address is verified. The
            address is automatically verified when the customer accesses the
            customer portal using their email address.
          examples:
            - true
        type:
          type: string
          const: team
          title: Type
          description: >-
            **Type:** Type of customer. Team customers can have multiple
            members.
          examples:
            - team
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name assigned to the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            **Billing Name:** Name that should appear on the customer's
            invoices. Falls back to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: Unique identifier for the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            Unique identifier for the customer's default payment method, if any.
            Use the payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: '**Deleted At:** Timestamp for when the customer was soft deleted.'
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
        active_subscriptions:
          items:
            $ref: '#/components/schemas/CustomerStateSubscription'
          type: array
          title: Active Subscriptions
          description: '**Active Subscriptions:** Customer''s active subscriptions.'
        granted_benefits:
          items:
            $ref: '#/components/schemas/CustomerStateBenefitGrant'
          type: array
          title: Granted Benefits
          description: '**Granted Benefits:** Customer''s active benefit grants.'
        active_meters:
          items:
            $ref: '#/components/schemas/CustomerStateMeter'
          type: array
          title: Active Meters
          description: '**Active Meters:** Customer''s active meters.'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
        - active_subscriptions
        - granted_benefits
        - active_meters
      title: CustomerStateTeam
      description: |-
        A team customer along with additional state information:

        * Active subscriptions
        * Granted benefits
        * Active meters
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MetadataOutputType:
      additionalProperties:
        anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
      type: object
    Address:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        country:
          type: string
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          title: CountryAlpha2
          examples:
            - US
            - SE
            - FR
          x-speakeasy-enums:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
      type: object
      required:
        - country
      title: Address
    CustomerStateSubscription:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: Unique identifier for the subscription.
          examples:
            - e5149aae-e521-42b9-b24c-abb3d71eea2e
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Map containing values collected through custom fields.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        status:
          type: string
          enum:
            - active
            - trialing
          title: Status
          examples:
            - active
            - trialing
        amount:
          type: integer
          title: Amount
          description: '**Amount:** Amount of the subscription.'
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          description: '**Currency:** Currency of the subscription.'
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/RecurringInterval'
          description: '**Recurring Interval:** Interval at which the subscription recurs.'
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: >-
            **Current Period Start:** Start timestamp of the current billing
            period.
          examples:
            - '2025-02-03T13:37:00Z'
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: '**Current Period End:** End timestamp of the current billing period.'
          examples:
            - '2025-03-03T13:37:00Z'
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: '**Trial Start:** Start timestamp of the trial period, if any.'
          examples:
            - '2025-02-03T13:37:00Z'
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: '**Trial End:** End timestamp of the trial period, if any.'
          examples:
            - '2025-03-03T13:37:00Z'
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Indicates whether the subscription will be canceled at the end of
            the current period.
          examples:
            - false
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            **Canceled At:** Timestamp when the subscription was canceled. The
            subscription might still be active if `cancel_at_period_end` is
            `true`.
          examples:
            - null
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: '**Started At:** Timestamp when the subscription started.'
          examples:
            - '2025-01-03T13:37:00Z'
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: '**Ends At:** Timestamp when the subscription will end.'
          examples:
            - null
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: Unique identifier for the subscribed product.
          examples:
            - d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: Unique identifier for the applied discount, if any.
          examples:
            - null
        meters:
          items:
            $ref: '#/components/schemas/CustomerStateSubscriptionMeter'
          type: array
          title: Meters
          description: Collection of meters associated with the subscription.
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - status
        - amount
        - currency
        - recurring_interval
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - product_id
        - discount_id
        - meters
      title: CustomerStateSubscription
      description: Object representing active customer subscription.
    CustomerStateBenefitGrant:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: Unique identifier for the grant.
          examples:
            - d322132c-a9d0-4e0d-b8d3-d81ad021a3a9
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        granted_at:
          type: string
          format: date-time
          title: Granted At
          description: '**Granted At:** Timestamp when the benefit was granted.'
          examples:
            - '2025-01-03T13:37:00Z'
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: Unique identifier for the benefit concerned by this grant.
          examples:
            - 397a17aa-15cf-4cb4-9333-18040203cf98
        benefit_type:
          $ref: '#/components/schemas/BenefitType'
          description: '**Benefit Type:** Type of the benefit concerned by this grant.'
          examples:
            - custom
        benefit_metadata:
          $ref: '#/components/schemas/MetadataOutputType'
          description: >-
            **Benefit Metadata:** Metadata of the benefit concerned by this
            grant.
          examples:
            - key: value
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantDiscordProperties'
            - $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
            - $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
            - $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
            - $ref: '#/components/schemas/BenefitGrantCustomProperties'
            - $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
            - $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
          title: Properties
      type: object
      required:
        - id
        - created_at
        - modified_at
        - granted_at
        - benefit_id
        - benefit_type
        - benefit_metadata
        - properties
      title: CustomerStateBenefitGrant
      description: Object representing active benefit grant for a customer.
    CustomerStateMeter:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The stable identifier for this record.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: Unique identifier for the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        consumed_units:
          type: number
          title: Consumed Units
          description: Count of consumed units.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: Count of credited units.
          examples:
            - 100
        balance:
          type: number
          title: Balance
          description: >-
            **Balance:** Balance of the meter, i.e. the difference between
            credited and consumed units.
          examples:
            - 75
      type: object
      required:
        - id
        - created_at
        - modified_at
        - meter_id
        - consumed_units
        - credited_units
        - balance
      title: CustomerStateMeter
      description: >-
        Object representing active meter for a customer, with latest consumed
        and credited units.
    RecurringInterval:
      type: string
      enum:
        - day
        - week
        - month
        - year
      title: RecurringInterval
    CustomerStateSubscriptionMeter:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        id:
          type: string
          format: uuid4
          title: Id
          description: The stable identifier for this record.
        consumed_units:
          type: number
          title: Consumed Units
          description: Count of consumed units so far in this billing period.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: Count of credited units so far in this billing period.
          examples:
            - 100
        amount:
          type: integer
          title: Amount
          description: '**Amount:** Amount due in cents so far in this billing period.'
          examples:
            - 0
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: Unique identifier for the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
      type: object
      required:
        - created_at
        - modified_at
        - id
        - consumed_units
        - credited_units
        - amount
        - meter_id
      title: CustomerStateSubscriptionMeter
      description: Current consumption and spending for a subscription meter.
    BenefitType:
      type: string
      enum:
        - custom
        - discord
        - github_repository
        - downloadables
        - license_keys
        - meter_credit
        - feature_flag
        - slack_shared_channel
      title: BenefitType
    BenefitGrantDiscordProperties:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        guild_id:
          type: string
          title: Guild Id
        role_id:
          type: string
          title: Role Id
        granted_account_id:
          type: string
          title: Granted Account Id
      type: object
      title: BenefitGrantDiscordProperties
    BenefitGrantGitHubRepositoryProperties:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        repository_owner:
          type: string
          title: Repository Owner
        repository_name:
          type: string
          title: Repository Name
        permission:
          type: string
          enum:
            - pull
            - triage
            - push
            - maintain
            - admin
          title: Permission
        granted_account_id:
          type: string
          title: Granted Account Id
      type: object
      title: BenefitGrantGitHubRepositoryProperties
    BenefitGrantDownloadablesProperties:
      properties:
        files:
          items:
            type: string
          type: array
          title: Files
      type: object
      title: BenefitGrantDownloadablesProperties
    BenefitGrantLicenseKeysProperties:
      properties:
        user_provided_key:
          type: string
          title: User Provided Key
        license_key_id:
          type: string
          title: License Key Id
        display_key:
          type: string
          title: Display Key
      type: object
      title: BenefitGrantLicenseKeysProperties
    BenefitGrantCustomProperties:
      properties: {}
      type: object
      title: BenefitGrantCustomProperties
    BenefitGrantFeatureFlagProperties:
      properties: {}
      type: object
      title: BenefitGrantFeatureFlagProperties
    BenefitGrantSlackSharedChannelProperties:
      properties:
        invited_email:
          type: string
          title: Invited Email
        channel_id:
          type: string
          title: Channel Id
        channel_name:
          type: string
          title: Channel Name
        invite_id:
          type: string
          title: Invite Id
        invite_url:
          type: string
          title: Invite Url
        connected_team_id:
          type: string
          title: Connected Team Id
      type: object
      title: BenefitGrantSlackSharedChannelProperties
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: /.well-known/openid-configuration
    pat:
      type: http
      description: >-
        **Authentication:** You can generate a **Personal Access Token** from
        your [settings](https://getruba.com/settings).
      scheme: bearer
    oat:
      type: http
      description: >-
        **Authentication:** You can generate an **Organization Access Token**
        from your organization's settings.
      scheme: bearer

````