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

# Set a card PIN

> Set the PIN of an active physical card.



## OpenAPI

````yaml /openapi-v2.json post /v2/cards/{cardId}/pin
openapi: 3.1.0
info:
  title: Slash Public API V2
  description: >-
    Send money for a Slash legal entity. Every request uses an API key. Transfer
    creation returns a Transfer that links its resulting transactions.
  version: 0.0.1
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
paths:
  /v2/cards/{cardId}/pin:
    parameters:
      - name: x-legal-entity
        in: header
        required: true
        description: >-
          The legal entity to act on. Required on every request; a user API key
          can act on any legal entity its user has access to.
        schema:
          type: string
          pattern: ^le_[a-zA-Z0-9]+$
    post:
      summary: Set a card PIN
      description: Set the PIN of an active physical card.
      parameters:
        - name: cardId
          in: path
          required: true
          description: Card id with the `c_` prefix.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pin:
                  type: string
                  pattern: ^[0-9]{4}$
              required:
                - pin
              additionalProperties: false
      responses:
        '200':
          description: The card.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/card'
        '400':
          $ref: '#/components/responses/PublicApiV2Error400CardsSetPin'
        '401':
          $ref: '#/components/responses/PublicApiV2Error401Unauthorized'
        '403':
          $ref: '#/components/responses/PublicApiV2Error403CardsSetPin'
        '404':
          $ref: '#/components/responses/PublicApiV2Error404CardsSetPin'
        '409':
          $ref: '#/components/responses/PublicApiV2Error409CardsSetPin'
        '429':
          $ref: '#/components/responses/PublicApiV2RateLimited'
        '500':
          $ref: '#/components/responses/PublicApiV2Error500Internal'
      security:
        - api_key: []
components:
  schemas:
    card:
      title: Card
      description: >-
        A virtual or physical card. Its number and security code are only
        available from `GET /v2/cards/{cardId}/details`.
      type: object
      properties:
        id:
          type: string
          description: Card id with the `c_` prefix.
          example: c_2rj4l7hmrrrcv
        type:
          type: string
          enum:
            - virtual
            - physical
        status:
          type: string
          enum:
            - pending
            - awaiting_activation
            - active
            - paused
            - inactive
            - closed
          description: >-
            `pending`: being issued, or waiting for a physical card's fee.
            `awaiting_activation`: a physical card its holder has not activated.
            `active`: approves authorizations. `paused`: declines them.
            `inactive`: deactivated by Slash or the issuer; can only be closed.
            `closed`: permanent.
        name:
          type: string
          example: Ads – Meta
        last4:
          type: string
          description: Absent on physical cards until they are activated.
          example: '4242'
        expiryMonth:
          type: integer
          example: 9
        expiryYear:
          type: integer
          example: 2030
        accountId:
          type: string
          description: Account id with the `sa_group_` prefix.
          example: sa_group_2rj4l7hmrrrcv
        virtualAccountId:
          type: string
          description: Virtual account the card spends from, with the `subaccount_` prefix.
          example: subaccount_2rj4l7hmrrrcv
        cardGroupId:
          type: string
          description: Card group id with the `card_group_` prefix.
          example: card_group_2rj4l7hmrrrcv
        cardProductId:
          type: string
          description: Card product id with the `card_product_` prefix.
          example: card_product_2rj4l7hmrrrcv
        cardholderUserId:
          type: string
          description: The user who holds the card, with the `u_` prefix.
          example: u_2rj4l7hmrrrcv
        controls:
          $ref: '#/components/schemas/card-controls'
        singleUse:
          type: boolean
          description: >-
            Whether the card closes after its first transaction. Virtual cards
            only.
        billingAddress:
          allOf:
            - $ref: '#/components/schemas/address'
          description: >-
            The address checked by address verification (AVS). Absent when the
            legal entity's address is used.
        physical:
          type: object
          description: Present on physical cards.
          properties:
            design:
              type: string
              enum:
                - plastic
                - silver_metal
                - gold_metal
            secondLine:
              type: string
              description: The line embossed under the holder's name.
              example: Computer Services
            shipping:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/address'
                service:
                  type: string
                  enum:
                    - standard
                    - express
                    - priority
                status:
                  type: string
                  enum:
                    - pending
                    - shipped
                    - canceled
                  description: '`pending`: ordered, not yet shipped.'
                carrier:
                  type: string
                  enum:
                    - fedex
                    - usps
                trackingNumber:
                  type: string
                trackingUrl:
                  type: string
                shippedAt:
                  type: string
                  format: date-time
              required:
                - address
                - service
                - status
              additionalProperties: false
          required:
            - design
          additionalProperties: false
        closedReason:
          type: string
          enum:
            - no_longer_needed
            - lost_or_stolen
            - never_arrived
            - damaged
            - closed_by_slash
        createdAt:
          type: string
          format: date-time
        closedAt:
          type: string
          format: date-time
      required:
        - id
        - type
        - status
        - name
        - accountId
        - singleUse
        - createdAt
      additionalProperties: false
    card-controls:
      title: CardControls
      description: >-
        What the card may spend. The controls of its card group apply too.
        Replaced whole on update; `null` clears it.
      type: object
      properties:
        limit:
          $ref: '#/components/schemas/card-controls-limit'
        transactionLimit:
          allOf:
            - $ref: '#/components/schemas/UsdMoney'
          description: The most a single transaction may be.
        merchantCategories:
          allOf:
            - $ref: '#/components/schemas/card-controls-restriction'
          description: Merchant category ids from `GET /v2/merchant-categories`.
        merchantCategoryCodes:
          allOf:
            - $ref: '#/components/schemas/card-controls-restriction'
          description: Four-digit merchant category codes (MCC).
        merchants:
          allOf:
            - $ref: '#/components/schemas/card-controls-restriction'
          description: Merchant ids from `GET /v2/merchants`.
        countries:
          allOf:
            - $ref: '#/components/schemas/card-controls-restriction'
          description: ISO 3166-1 alpha-2 codes of merchant countries.
        recurringPaymentsOnly:
          type: boolean
          description: Approve recurring payments only. An Enterprise feature.
      additionalProperties: false
      example:
        limit:
          amount:
            amount: 500000
            currency: USD
          period: monthly
        transactionLimit:
          amount: 250000
          currency: USD
        merchantCategoryCodes:
          mode: block
          values:
            - '7995'
    address:
      title: Address
      type: object
      properties:
        line1:
          type: string
          minLength: 1
        line2:
          type: string
        city:
          type: string
          minLength: 1
        state:
          type: string
        postalCode:
          type: string
        countryCode:
          type: string
          minLength: 2
          maxLength: 2
          description: ISO 3166-1 alpha-2 country code.
      required:
        - line1
        - city
      additionalProperties: false
    PublicApiV2ErrorInvalidRequestShape:
      title: PublicApiV2ErrorInvalidRequestShape
      description: >-
        The body, query, or headers failed validation, or a required header is
        missing. `details` has one entry per failing location, keyed by JSON
        pointer or header name.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - invalid_request
            details:
              type: object
              properties: {}
              additionalProperties:
                type: string
          required:
            - code
            - details
    PublicApiV2ErrorUnauthorized:
      title: PublicApiV2ErrorUnauthorized
      description: API key authentication is missing or invalid.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbidden:
      title: PublicApiV2ErrorForbidden
      description: >-
        The credential is not permitted to perform this action on the resource.
        When the resource is a field of the request, `details` names that
        `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbiddenLegalEntity:
      title: PublicApiV2ErrorForbiddenLegalEntity
      description: The credential is not permitted to act for the selected legal entity.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotAvailable:
      title: PublicApiV2ErrorNotAvailable
      description: >-
        Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_available
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorUserApiKeyRequired:
      title: PublicApiV2ErrorUserApiKeyRequired
      description: >-
        The API key is scoped to a legal entity rather than a user. Every v2
        request needs a user API key, created under Settings → API keys in the
        Slash dashboard, together with the `x-legal-entity` header.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - user_api_key_required
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotFound:
      title: PublicApiV2ErrorNotFound
      description: >-
        No resource matches the identifier. When the identifier is a field of
        the request, `details` names that `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCardAccountLocked:
      title: PublicApiV2ErrorCardAccountLocked
      description: >-
        Slash has locked the account, during a review or while it closes, so
        cards cannot be issued on it or changed. Contact Slash support.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - account_locked
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCardClosed:
      title: PublicApiV2ErrorCardClosed
      description: Closing is permanent; a closed card cannot change.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - card_closed
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCardNotActive:
      title: PublicApiV2ErrorCardNotActive
      description: Only `active` cards can be paused or have a PIN set.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - card_not_active
            details:
              type: object
              properties:
                status:
                  type: string
                  description: The card’s current status.
                  example: paused
              required:
                - status
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCardNotPhysical:
      title: PublicApiV2ErrorCardNotPhysical
      description: >-
        Only physical cards can be replaced or have a PIN. Virtual cards are
        closed and issued again instead.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - card_not_physical
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCardStatusPending:
      title: PublicApiV2ErrorCardStatusPending
      description: >-
        An earlier status change has not finished at the card issuer. Retry once
        `GET /v2/cards/{cardId}` shows the new status.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - card_status_pending
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInternal:
      title: PublicApiV2ErrorInternal
      description: >-
        Slash could not complete the request. Quote `referenceId` when
        contacting Slash support.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - internal
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    card-controls-limit:
      title: CardControlsLimit
      description: How much may be spent per period.
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/UsdMoney'
        period:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
            - lifetime
          description: >-
            Every period but `lifetime` resets at its boundary in `timezone`;
            `lifetime` never resets.
        startDate:
          type: string
          format: date
          description: >-
            Day the first period starts, today or earlier. Defaults to the start
            of the current period. Not used by `daily`.
          example: '2026-09-01'
        timezone:
          type: string
          description: IANA timezone the period boundaries use. Defaults to UTC.
          example: America/Los_Angeles
      required:
        - amount
        - period
      additionalProperties: false
    UsdMoney:
      type: object
      description: A positive USD amount expressed in cents.
      properties:
        amount:
          type: integer
          minimum: 1
          description: Amount in cents. For example, `1250` represents USD 12.50.
          example: 1250
        currency:
          type: string
          enum:
            - USD
      required:
        - amount
        - currency
      additionalProperties: false
      title: UsdMoney
    card-controls-restriction:
      title: CardControlsRestriction
      description: >-
        With `allow`, only the listed values are approved. With `block`, the
        listed values are declined.
      type: object
      properties:
        mode:
          type: string
          enum:
            - allow
            - block
        values:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            type: string
      required:
        - mode
        - values
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable reason; branch on this, not on `message`. Every
            code an endpoint can return is listed on its reference page; the
            ones shared by all endpoints are explained in the Errors guide.
          example: invalid_request
        message:
          type: string
          description: >-
            Human-readable explanation, safe to show to an operator. Wording may
            change; use `code` and `details` programmatically.
        details:
          type: object
          description: >-
            The values behind `message`, keyed per `code`. For example
            `insufficient_funds` carries `available` and `requested`;
            `invalid_request` from contract validation carries one entry per
            failing field, keyed by JSON pointer. Empty when the code has no
            variable data.
          additionalProperties:
            type: string
          example:
            available: $120.00
            requested: $500.00
        referenceId:
          type: string
          description: Unique id of this failure. Quote it when contacting Slash support.
          example: 4001-2alj5if
      required:
        - code
        - message
        - details
        - referenceId
      additionalProperties: false
      title: Error
  responses:
    PublicApiV2Error400CardsSetPin:
      description: >-
        - `invalid_request (request shape)` — The body, query, or headers failed
        validation, or a required header is missing. `details` has one entry per
        failing location, keyed by JSON pointer or header name.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInvalidRequestShape'
          examples:
            invalid_request_request_shape:
              summary: invalid_request (request shape)
              value:
                code: invalid_request
                message: 'Invalid `cardId`: Expected a valid ID beginning with "c_".'
                details:
                  /cardId: Expected a valid ID beginning with "c_".
                referenceId: 4001-2alj5if
    PublicApiV2Error401Unauthorized:
      description: '- `unauthorized` — API key authentication is missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorUnauthorized'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                code: unauthorized
                message: API key authentication is missing or invalid.
                details: {}
                referenceId: 4011-2alj5if
    PublicApiV2Error403CardsSetPin:
      description: >-
        - `forbidden` — The credential is not permitted to perform this action
        on the resource. When the resource is a field of the request, `details`
        names that `field` and the `id` it received.

        - `forbidden (legal entity)` — The credential is not permitted to act
        for the selected legal entity.

        - `not_available` — Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.

        - `user_api_key_required` — The API key is scoped to a legal entity
        rather than a user. Every v2 request needs a user API key, created under
        Settings → API keys in the Slash dashboard, together with the
        `x-legal-entity` header.
      content:
        application/json:
          schema:
            anyOf:
              - title: forbidden
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbidden'
              - title: forbidden (legal entity)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbiddenLegalEntity'
              - title: not_available
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorNotAvailable'
              - title: user_api_key_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorUserApiKeyRequired'
          examples:
            forbidden_card_id:
              summary: forbidden (cardId)
              value:
                code: forbidden
                message: >-
                  This credential is not permitted to do that on `cardId`
                  c_2rj4l7hmrrrcv.
                details:
                  field: cardId
                  id: c_2rj4l7hmrrrcv
                referenceId: 4031-2alj5if
            forbidden_legal_entity:
              summary: forbidden (legal entity)
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            not_available:
              summary: not_available
              value:
                code: not_available
                message: >-
                  Public API v2 is not yet available. Use Public API v1
                  (https://docs.slash.com/introduction) in the meantime.
                details: {}
                referenceId: 4031-2alj5if
            user_api_key_required:
              summary: user_api_key_required
              value:
                code: user_api_key_required
                message: >-
                  Public API v2 requires a user API key. Create one under
                  Settings → API keys in the Slash dashboard.
                details: {}
                referenceId: 4031-2alj5if
    PublicApiV2Error404CardsSetPin:
      description: >-
        - `not_found` — No resource matches the identifier. When the identifier
        is a field of the request, `details` names that `field` and the `id` it
        received.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorNotFound'
          examples:
            not_found_card_id:
              summary: not_found (cardId)
              value:
                code: not_found
                message: '`cardId` c_2rj4l7hmrrrcv was not found.'
                details:
                  field: cardId
                  id: c_2rj4l7hmrrrcv
                referenceId: 4041-2alj5if
    PublicApiV2Error409CardsSetPin:
      description: >-
        - `account_locked` — Slash has locked the account, during a review or
        while it closes, so cards cannot be issued on it or changed. Contact
        Slash support.

        - `card_closed` — Closing is permanent; a closed card cannot change.

        - `card_not_active` — Only `active` cards can be paused or have a PIN
        set.

        - `card_not_physical` — Only physical cards can be replaced or have a
        PIN. Virtual cards are closed and issued again instead.

        - `card_status_pending` — An earlier status change has not finished at
        the card issuer. Retry once `GET /v2/cards/{cardId}` shows the new
        status.
      content:
        application/json:
          schema:
            anyOf:
              - title: account_locked
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorCardAccountLocked'
              - title: card_closed
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorCardClosed'
              - title: card_not_active
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorCardNotActive'
              - title: card_not_physical
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorCardNotPhysical'
              - title: card_status_pending
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorCardStatusPending'
          examples:
            account_locked:
              summary: account_locked
              value:
                code: account_locked
                message: The card account is locked.
                details: {}
                referenceId: 4091-2alj5if
            card_closed:
              summary: card_closed
              value:
                code: card_closed
                message: The card is closed.
                details: {}
                referenceId: 4091-2alj5if
            card_not_active:
              summary: card_not_active
              value:
                code: card_not_active
                message: The card must be active; it is paused.
                details:
                  status: paused
                referenceId: 4091-2alj5if
            card_not_physical_card_id:
              summary: card_not_physical (cardId)
              value:
                code: card_not_physical
                message: The card is not a physical card.
                details:
                  field: cardId
                  id: c_2rj4l7hmrrrcv
                referenceId: 4091-2alj5if
            card_status_pending:
              summary: card_status_pending
              value:
                code: card_status_pending
                message: The card is still changing status. Retry shortly.
                details: {}
                referenceId: 4091-2alj5if
    PublicApiV2RateLimited:
      description: >-
        The request exceeded the applicable rate limit. The response body is
        plain text, not the error object; clients must not depend on its
        wording.
      content:
        text/plain:
          schema:
            type: string
          example: You are rate limited
    PublicApiV2Error500Internal:
      description: >-
        - `internal` — Slash could not complete the request. Quote `referenceId`
        when contacting Slash support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInternal'
          examples:
            internal:
              summary: internal
              value:
                code: internal
                message: >-
                  An unexpected error occurred. If this keeps happening, contact
                  Slash support with the reference id below.
                details: {}
                referenceId: 5001-2alj5if
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        User API key authentication. Create a key under Settings → API keys in
        the Slash dashboard (https://app.slash.com/global-settings/api-keys) and
        send the `x-legal-entity` header naming the legal entity to act on with
        every request. Keys scoped to a legal entity are rejected with `403
        user_api_key_required`.

````

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