Browse documentation

Carebit API

Payment Methods

Stored card PaymentMethods for Patients with an active connection to the Organization.

Required API scopes: payment_methods.read

Endpoints

Scroll this page to read every Payment Methods endpoint, or jump to one below.

get/v1/patients/:id/payment_methods

List a Patient's PaymentMethods

Returns stored card PaymentMethods for a Patient with an active connection to the Organization. Requires payment_methods.read. Only PaymentMethods that the Organization has ResourcePermissions to access are included. Expired cards are included and marked with is_expired. Use a PaymentMethod id as payment_method_id on POST /v1/payments to charge that card.

Required API scopes: payment_methods.read

Parameters

  • id

    path · required

    string

    -

  • limit

    query

    integer

    The maximum number of items to return. Defaults to 25; the maximum is 100.

  • starting_after

    query

    string

    Return items after this resource ID. You cannot use this with cursor.

  • cursor

    query

    string

    The next_cursor value from the previous page. You cannot use this with starting_after.

Responses

200

Paginated list of PaymentMethod objects.

  • dataarrayrequired
    • itemsobject
      • brandstring | nullrequired

        The card brand, such as visa or mastercard.

        Allowed values: amex | bacs_debit | diners | discover | klarna | mastercard | visa | null

      • created_atstring · date-timerequired

        An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

      • creation_sourcestring | nullrequired

        How this PaymentMethod was stored.

        Allowed values: patient | payment | staff_member | null

      • expiry_monthinteger | nullrequired

        The card expiry month, from 1 to 12.

      • expiry_yearinteger | nullrequired

        The four-digit card expiry year.

      • idstring · uuidrequired

        The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.

      • is_defaultbooleanrequired

        Whether this is the Patient's default stored card for Organizations that can access it. POST /v1/payments charges this card when payment_method_id is omitted.

      • is_expiredbooleanrequired

        Whether the card expiry date has passed. Expired PaymentMethods cannot be charged.

      • last_4_digitsstring | nullrequired

        The last four digits of the stored card.

      • linksobjectrequired

        URLs to related resources.

        • patientstring | null · urirequired

          The full URL of a related resource.

      • objectanyrequired

        Discriminator value emitted at object.

      • patient_idstring | null · uuidrequired

        The Patient who owns this PaymentMethod.

      • payment_method_typestringrequired

        The stored payment method type. Currently always card.

        Allowed values: card

      • updated_atstring · date-timerequired

        An ISO 8601 timestamp in UTC, with a Z suffix. For example, 2026-07-01T09:00:00Z.

  • has_morebooleanrequired

    Whether another page is available after next_cursor.

  • next_cursorstring | nullrequired

    The value to pass as cursor for the next page. Null on the last page.

  • objectanyrequired

    Always list.

  • urlstringrequired

    The API path that returned this list.

Example
{
  "object": "list",
  "data": 
    
      "id": "00000000-0000-4000-8000-000000000036",
      "object": "payment_method",
      "brand": "amex",
      "created_at": "2026-01-01T09:00:00Z",
      "creation_source": "patient",
      "expiry_month": 1,
      "expiry_year": 1,
      "is_default": true,
      "is_expired": true,
      "last_4_digits": "4242",
      "links": 
        "patient": "https://api.carebit.co/v1/patients/00000000-0000-4000-8000-000000000004"
      },
      "patient_id": "00000000-0000-4000-8000-000000000004",
      "payment_method_type": "card",
      "updated_at": "2026-01-01T09:00:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": "eyJzdGFydF90aW1lIjoiMjAyNi0wMS0wMVQwOTowMDowMFoifQ",
  "url": "/v1/patients/00000000-0000-4000-8000-000000000004/payment_methods"
}
401

The access token is missing, invalid, expired, or revoked.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
403

The access token lacks the required scope, or the project is disabled.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
404

The Patient was not found in the Organization.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}
429

Too many requests. Retry after the delay indicated by Retry-After.

  • errorobjectrequired

    The structured details that describe why the request failed.

    • codestringrequired

      The machine-readable error code.

    • errorsarray | null

      Additional errors from a failed validation.

      • itemsobject
        • codestring

          The machine-readable code for this validation error.

        • messagestring

          A message that explains this validation error.

        • paramstring | null

          The name of the parameter that caused this validation error, when known.

    • messagestringrequired

      A message that explains the error and how to resolve it.

    • paramstring | null

      The name of the parameter that caused the error, when known.

    • typestringrequired

      The high-level category of the error.

      Allowed values: authentication_error | permission_error | invalid_request_error | rate_limit_error | api_error

Example
{
  "error": 
    "code": "resource_missing",
    "errors": 
      
        "code": "resource_missing",
        "message": "The requested resource was not found.",
        "param": "patient_id"
      }
    ],
    "message": "The requested resource was not found.",
    "param": "patient_id",
    "type": "authentication_error"
  }
}

Prefer plain text? Append ?format=md or send Accept: text/markdown to receive this page as raw Markdown.