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

# List a location's refused cards

> The cards the chargers at a location you reach with basic access or more refused in the last 7
days, one line per card and charger, last refused first: why, who refused it, and how often. A
card is refused when the answer to its card check was not `Accepted`, or when no answer came in
time. Below `sensitive` access a card shows its last three characters and no `card_id`.
Refusals from before a charger changed hands are not shown. A location you do not reach is a
404; one you reach with less access is a 403.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /locations/{location}/refused-cards
openapi: 3.1.0
info:
  title: Plugchoice API
  description: >-
    Every request sends an access token as `Authorization: Bearer …`, unless an
    operation says otherwise.


    Errors are problems (RFC 9457, `application/problem+json`): `code` says what
    went wrong, and a failed validation lists the fields in `errors`.


    A list answers one page: `{"data": [...], "next_cursor": ...,
    "previous_cursor": ...}`. Pass a cursor back as `cursor` to get that page,
    and `limit` (1 to 100, default 25) for its size.


    Within v4, changes only add: new operations, new optional parameters, new
    fields and new enum values. Ignore fields you do not know, and accept enum
    values you do not know. Requests that send a field the operation does not
    know are refused, so a typo does not pass unnoticed.
  version: '4'
servers:
  - url: https://api.plugchoice.com/v4
security:
  - bearer: []
paths:
  /locations/{location}/refused-cards:
    get:
      tags:
        - cards
      summary: Cards refused at a location
      description: >-
        The cards the chargers at a location you reach with basic access or more
        refused in the last 7

        days, one line per card and charger, last refused first: why, who
        refused it, and how often. A

        card is refused when the answer to its card check was not `Accepted`, or
        when no answer came in

        time. Below `sensitive` access a card shows its last three characters
        and no `card_id`.

        Refusals from before a charger changed hands are not shown. A location
        you do not reach is a

        404; one you reach with less access is a 403.
      operationId: list_location_refused_cards
      parameters:
        - name: location
          in: path
          description: The location's id
          required: true
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Limit'
        - name: cursor
          in: query
          description: >-
            A place in the list, from `next_cursor` or `previous_cursor`. Pass
            it back as given.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A page of the cards refused at the location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_RefusedCard'
        default:
          description: >-
            A problem (RFC 9457). `code` says which; the field errors come with
            `validation_failed`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer:
            - locations:read
components:
  schemas:
    Limit:
      type: integer
      description: How many results one page holds.
      default: 25
      maximum: 100
      minimum: 1
    Page_RefusedCard:
      type: object
      description: One page of a list.
      required:
        - data
        - next_cursor
        - previous_cursor
      properties:
        data:
          type: array
          items:
            type: object
            description: >-
              A card a charger at a location refused in the last 7 days: every
              refusal of that card at that

              charger, told by the last one.
            required:
              - id_tag
              - charger
              - refused_by
              - refusal_count
              - first_refused_at
              - refused_at
              - card_id
              - operator
              - reason
            properties:
              card_id:
                type:
                  - string
                  - 'null'
                format: uuid
                description: >-
                  The location's card with this id (ignoring case), the newest
                  when it has two; null when

                  the location has none, and below `sensitive` access.
              charger:
                $ref: '#/components/schemas/ChargerReference'
                description: The charger that refused it.
              first_refused_at:
                type: string
                format: date-time
                description: When the charger first refused it in the 7 days.
              id_tag:
                type: string
                description: >-
                  The id it showed the charger (OCPP 1.6's idTag, or 2.x's
                  idToken), as the charger sent it.

                  Below `sensitive` access it shows its last three characters:
                  `••••34A`.
              operator:
                oneOf:
                  - $ref: '#/components/schemas/Operator'
                    description: >-
                      The other backoffice that refused it, when `refused_by` is
                      `operator`; null otherwise.
                  - type: 'null'
              reason:
                oneOf:
                  - $ref: '#/components/schemas/RefusalReason'
                    description: >-
                      Why, the last time; null for an answer this API does not
                      know.
                  - type: 'null'
              refusal_count:
                type: integer
                format: int64
                description: >-
                  How often the charger refused it in the 7 days, the last time
                  included.
              refused_at:
                type: string
                format: date-time
                description: When the charger last refused it.
              refused_by:
                $ref: '#/components/schemas/RefusedBy'
                description: Who refused it, the last time.
        next_cursor:
          type:
            - string
            - 'null'
          description: The cursor of the page after this one; null on the last page.
        previous_cursor:
          type:
            - string
            - 'null'
          description: The cursor of the page before this one; null on the first page.
    Problem:
      type: object
      description: An error response body (RFC 9457).
      required:
        - type
        - title
        - status
        - code
      properties:
        code:
          type: string
          description: >-
            The kind of problem, for code to act on, such as
            `validation_failed`. Treat a code you do

            not know by the status.
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title; left out

            when there is not.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: >-
            With `validation_failed`: the fields that broke a rule; left out
            when there are none.
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 0
        title:
          type: string
          description: A short summary of the kind of problem.
        type:
          type: string
          description: >-
            The page that explains this kind of problem: its `code` with
            hyphens, as

            `https://developer.plugchoice.com/api/errors/validation-failed`.
    ChargerReference:
      type: object
      description: A charger, as a transaction names it.
      required:
        - id
        - identity
      properties:
        id:
          type: string
          format: uuid
          description: The charger's id.
        identity:
          type: string
          description: 'The name it connects with: its OCPP charge point identity.'
    Operator:
      type: object
      description: >-
        Another backoffice (a CPO's or eMSP's OCPP server) a charger's calls are
        relayed to.
      required:
        - host
        - name
      properties:
        host:
          type: string
          description: 'The host of its OCPP server: `ocpp.example.com`.'
        name:
          type:
            - string
            - 'null'
          description: >-
            Its name, as Plugchoice knows the backoffice; null for a host it
            does not know.
    RefusalReason:
      type: string
      description: >-
        Why a card was refused: the card status the charger was answered with,
        as OCPP names it

        (1.6's `AuthorizationStatus` and 2.x's `AuthorizationStatusEnumType`),
        or `no_answer`.

        Accept values you do not know: more may come.
      enum:
        - blocked
        - expired
        - invalid
        - concurrent_tx
        - no_credit
        - not_allowed_type_evse
        - not_at_this_location
        - not_at_this_time
        - unknown
        - no_answer
    RefusedBy:
      type: string
      description: 'Who refused a card. Accept values you do not know: more may come.'
      enum:
        - plugchoice
        - operator
        - nobody
    FieldError:
      type: object
      description: One field that broke a rule.
      required:
        - field
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            The rule it broke, for code to act on: `missing_field`,
            `unknown_field`, `invalid_type`,

            `invalid`, or `taken` (a value that must be unique, such as a card's
            id at a location,

            and is not).
        field:
          type: string
          description: >-
            Where the field is in the request, such as `name` or
            `connectors[0].max_current`.
        message:
          type: string
          description: What is wrong, in English.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An access token from `accounts.plugchoice.com`, for a personal API
        token, a person signed in through an app, or an OAuth client.

````

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