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

# Get card details

> Gets details about a particular card based on the BIN. Use the currency, amount, and other fields to apply any Flow rules that may put requirements on the card.

Retrieves details about a card using card's BIN or a stored `payment_method_id`. This endpoint requires the `embed` scope.


## OpenAPI

````yaml /openapi.speakeasy.json GET /card-details
openapi: 3.1.0
info:
  title: Gr4vy
  description: The Gr4vy API.
  version: 1.0.0
servers:
  - url: https://api.sandbox.{id}.gr4vy.app
    x-speakeasy-server-id: sandbox
    variables:
      id:
        default: example
        description: The subdomain for your Gr4vy instance.
  - url: https://api.{id}.gr4vy.app
    x-speakeasy-server-id: production
    variables:
      id:
        default: example
        description: The subdomain for your Gr4vy instance.
security:
  - bearerAuth: []
tags:
  - name: 3DS scenarios
    description: Manage and create 3DS scenarios in sandbox.
  - name: Account updater
    description: Schedule stored cards for an account update.
  - name: Audit logs
    description: Query user activity.
  - name: Buyers
    description: Manage buyers.
  - name: Buyers - Gift cards
    description: Query gift cards for buyers.
  - name: Buyers - Payment methods
    description: Query payment methods for buyers.
  - name: Buyers - Shipping details
    description: Manage shipping details for buyers.
  - name: Card details
    description: Returns information about a card.
  - name: Card scheme definitions
    description: List definitions for card schemes.
  - name: Checkout sessions
    description: Manage checkout sessions.
  - name: Digital wallets - Sessions
    description: Create sessions for digital wallets like Apple Pay and Google Pay.
  - name: Digital wallets - Setup
    description: Manage digital wallets like Apple Pay and Google Pay.
  - name: Gift cards
    description: Manage stored gift cards.
  - name: Insights
    description: Retrieve Insights data.
  - name: Insights - Presets
    description: Manage presets for Insights.
  - name: Merchant accounts
    description: Manage merchant accounts in an instance.
  - name: Merchant accounts - 3DS configuration
    description: Manage 3DS profiles for merchant accounts.
  - name: Monitoring
    description: Manage monitoring and alerting.
  - name: Payment links
    description: Manage payment links.
  - name: Payment methods
    description: Manage stored payment methods.
  - name: Payment methods - Definitions
    description: Manage payment method definitions.
  - name: Payment methods - Network tokens
    description: Manage network tokens for stored payment methods.
  - name: Payment methods - Payment service tokens
    description: Manage payment service tokens for stored payment methods.
  - name: Payment options
    description: Fetch a list of payment options to display at checkout.
  - name: Payment service definitions
    description: Fetch info about the definition of each payment service.
  - name: Payment services
    description: Manage configured payment services.
  - name: Payouts
    description: Payout API.
  - name: Refunds
    description: Manage transaction refunds.
  - name: Reports
    description: Manage one-off and scheduled reports.
  - name: Reports - Executions
    description: Manage executions of reports.
  - name: Transactions
    description: Manage transaction.
  - name: Transactions - Actions
    description: Read Flow actions triggered for a transaction.
  - name: Transactions - Chargebacks
    description: Read transaction chargeback data.
  - name: Transactions - Chargeback reversals
    description: Read transaction chargeback reversal data.
  - name: Transactions - Settlements
    description: Read transaction settlement data.
  - name: Transactions - Sessions
    description: Manage transaction session data.
  - name: Webhook subscriptions
    description: Manage webhook subscriptions.
paths:
  /card-details:
    get:
      tags:
        - Card details
      summary: Get card details
      description: >-
        Gets details about a particular card based on the BIN. Use the currency,
        amount, and other fields to apply any Flow rules that may put
        requirements on the card.
      operationId: get_card_details
      parameters:
        - name: currency
          in: query
          required: true
          schema:
            type: string
            description: The three-letter ISO currency code.
            examples:
              - USD
            title: Currency
          description: The three-letter ISO currency code.
        - name: bin
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 8
                minLength: 6
                pattern: ^\d+$
              - type: 'null'
            description: The bank identification number (BIN) of the card.
            examples:
              - '411111'
            title: Bin
          description: The bank identification number (BIN) of the card.
        - name: payment_method_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: The ID of the payment method to check, instead of the `bin`.
            examples:
              - 123e4567-e89b-12d3-a456-426614174000
            title: Payment Method Id
          description: The ID of the payment method to check, instead of the `bin`.
        - name: country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^[A-Z]{2}$
                examples:
                  - DE
                  - GB
                  - US
              - type: 'null'
            description: The two-letter ISO country code.
            examples:
              - US
            title: Country
          description: The two-letter ISO country code.
        - name: amount
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: The payment amount in the smallest currency unit.
            examples:
              - 1299
            title: Amount
          description: The payment amount in the smallest currency unit.
        - name: intent
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - authorize
                  - capture
                title: TransactionIntent
                x-speakeasy-unknown-values: allow
              - type: 'null'
            description: The transaction intent.
            examples:
              - authorize
            default: authorize
            title: Intent
          description: The transaction intent.
        - name: is_subsequent_payment
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Whether this is a subsequent payment.
            examples:
              - false
            title: Is Subsequent Payment
          description: Whether this is a subsequent payment.
        - name: merchant_initiated
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Whether the transaction is merchant-initiated
            examples:
              - false
            title: Merchant Initiated
          description: Whether the transaction is merchant-initiated
        - name: metadata
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Additional metadata for the transaction in JSON format
            examples:
              - '{"source": "web"}'
            title: Metadata
          description: Additional metadata for the transaction in JSON format
        - name: payment_source
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - ecommerce
                  - moto
                  - recurring
                  - installment
                  - card_on_file
                title: TransactionPaymentSource
                description: >-
                  The way payment method information made it to this
                  transaction.
                x-speakeasy-unknown-values: allow
              - type: 'null'
            description: The source of the transaction payment
            examples:
              - web
            title: Payment Source
          description: The source of the transaction payment
        - name: x-gr4vy-merchant-account-id
          in: header
          required: false
          description: The ID of the merchant account to use for this request.
          x-speakeasy-name-override: merchant_account_id
          schema:
            type: string
            description: The ID of the merchant account to use for this request.
            examples:
              - default
            title: X-Gr4Vy-Merchant-Account-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardDetail'
        '400':
          description: The request was invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: The request was unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: >-
            The credentials were invalid or the caller did not have permission
            to act on the resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: The resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '405':
          description: The request method was not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error405'
        '409':
          description: A duplicate record was found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error409'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '425':
          description: The request was too early.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error425'
        '429':
          description: Too many requests were made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error429'
        '500':
          description: The server encountered an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
        '502':
          description: The server encountered an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error502'
        '504':
          description: The server encountered an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error504'
components:
  schemas:
    CardDetail:
      properties:
        type:
          type: string
          const: card-detail
          title: Type
          description: Always `card-detail`.
          default: card-detail
          examples:
            - card-detail
        id:
          anyOf:
            - type: string
              maxLength: 8
              minLength: 6
              pattern: ^\d+$
            - type: 'null'
          title: Id
          description: The Bank Identification Number (BIN) of the card.
          examples:
            - '123456'
            - '345678'
        card_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Card Type
          description: The type of the card.
          examples:
            - credit
            - debit
            - prepaid
        scheme:
          anyOf:
            - type: string
              enum:
                - accel
                - amex
                - bancontact
                - carte-bancaire
                - cirrus
                - culiance
                - dankort
                - diners-club
                - discover
                - eftpos-australia
                - elo
                - hipercard
                - jcb
                - maestro
                - mastercard
                - mir
                - nyce
                - other
                - pulse
                - qcard
                - rupay
                - star
                - uatp
                - unionpay
                - visa
              title: CardScheme
              x-speakeasy-unknown-values: allow
            - type: 'null'
          description: The card scheme/network.
          examples:
            - visa
            - mastercard
            - amex
        additional_schemes:
          anyOf:
            - items:
                type: string
                enum:
                  - accel
                  - amex
                  - bancontact
                  - carte-bancaire
                  - cirrus
                  - culiance
                  - dankort
                  - diners-club
                  - discover
                  - eftpos-australia
                  - elo
                  - hipercard
                  - jcb
                  - maestro
                  - mastercard
                  - mir
                  - nyce
                  - other
                  - pulse
                  - qcard
                  - rupay
                  - star
                  - uatp
                  - unionpay
                  - visa
                title: CardScheme
                x-speakeasy-unknown-values: allow
              type: array
            - type: 'null'
          title: Additional Schemes
          description: Additional schemes of the card besides the primary scheme.
          examples:
            - - eftpos-australia
        scheme_icon_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Scheme Icon Url
          description: URL to the card scheme's icon.
          examples:
            - >-
              https://cdn.example.gr4vy.app/assets/icons/card-schemes/mastercard.svg
        country:
          anyOf:
            - type: string
              pattern: ^[A-Z]{2}$
              examples:
                - DE
                - GB
                - US
            - type: 'null'
          title: Country
          description: The country code associated with the card.
          examples:
            - US
            - GB
            - DE
        required_fields:
          anyOf:
            - $ref: '#/components/schemas/RequiredFields'
            - type: 'null'
          description: Fields that are required for this card type.
          examples:
            - address:
                postal_code: true
              cvv: true
      additionalProperties: false
      type: object
      title: CardDetail
    Error400:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `bad_request`
          default: bad_request
          examples:
            - bad_request
        status:
          type: integer
          title: Status
          description: Always `400`.
          default: 400
          examples:
            - 400
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Generic error
          examples:
            - Request failed validation
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error400
    Error401:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `unauthorized`
          default: unauthorized
          examples:
            - unauthorized
        status:
          type: integer
          title: Status
          description: Always `401`.
          default: 401
          examples:
            - 401
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: No valid API authentication found
          examples:
            - No valid API authentication found
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error401
    Error403:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `forbidden`
          default: forbidden
          examples:
            - forbidden
        status:
          type: integer
          title: Status
          description: Always `403`.
          default: 403
          examples:
            - 403
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Generic error
          examples:
            - Request failed validation
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error403
    Error404:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `not_found`
          default: not_found
          examples:
            - not_found
        status:
          type: integer
          title: Status
          description: Always `404`.
          default: 404
          examples:
            - 404
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: The resource could not be found
          examples:
            - The resource could not be found
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error404
    Error405:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `method_not_allowed`
          default: method_not_allowed
          examples:
            - method_not_allowed
        status:
          type: integer
          title: Status
          description: Always `405`.
          default: 405
          examples:
            - 405
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Method Not Allowed
          examples:
            - Method Not Allowed
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error405
    Error409:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `duplicate_record`
          default: duplicate_record
          examples:
            - duplicate_record
        status:
          type: integer
          title: Status
          description: Always `409`.
          default: 409
          examples:
            - 409
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Generic error
          examples:
            - Request failed validation
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
        resource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Id
          description: The ID of the conflicting resource.
          examples:
            - cdc70639-cb9c-4222-a73f-b8ce39f7821b
      additionalProperties: false
      type: object
      title: Error409
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Error425:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `too_early`
          default: too_early
          examples:
            - too_early
        status:
          type: integer
          title: Status
          description: Always `425`.
          default: 425
          examples:
            - 425
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Generic error
          examples:
            - Request failed validation
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error425
    Error429:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `too_many_requests`
          default: too_many_requests
          examples:
            - too_many_requests
        status:
          type: integer
          title: Status
          description: Always `429`.
          default: 429
          examples:
            - 429
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Generic error
          examples:
            - Request failed validation
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error429
    Error500:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `server_error`
          default: server_error
          examples:
            - server_error
        status:
          type: integer
          title: Status
          description: Always `500`.
          default: 500
          examples:
            - 500
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Request could not be processed
          examples:
            - Request could not be processed
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error500
    Error502:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `bad_gateway`
          default: bad_gateway
          examples:
            - bad_gateway
        status:
          type: integer
          title: Status
          description: Always `502`.
          default: 502
          examples:
            - 502
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Request could not be processed
          examples:
            - Request could not be processed
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error502
    Error504:
      properties:
        type:
          type: string
          const: error
          title: Type
          description: Always `error`.
          default: error
          examples:
            - error
        code:
          type: string
          title: Code
          description: Always `gateway_timeout`
          default: gateway_timeout
          examples:
            - gateway_timeout
        status:
          type: integer
          title: Status
          default: 504
        message:
          type: string
          title: Message
          description: A human readable message that provides more context to the error.
          default: Request could not be processed
          examples:
            - Request could not be processed
        details:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Details
          description: A list of details that further ellaborate on the error.
          default: []
      additionalProperties: false
      type: object
      title: Error504
    RequiredFields:
      properties:
        first_name:
          type: boolean
          title: First Name
          description: Defines if the `first_name` field for a buyer is required.
          default: false
          examples:
            - true
        last_name:
          type: boolean
          title: Last Name
          description: Defines if the `last_name` field for a buyer is required.
          default: false
          examples:
            - true
        email_address:
          type: boolean
          title: Email Address
          description: Defines if the `email_address` field for a buyer is required.
          default: false
          examples:
            - true
        phone_number:
          type: boolean
          title: Phone Number
          description: Defines if the `phone_number` field for a buyer is required.
          default: false
          examples:
            - true
        tax_id:
          type: boolean
          title: Tax Id
          description: Defines if the `tax_id` field for a buyer is required.
          default: false
          examples:
            - true
        address:
          $ref: '#/components/schemas/RequiredAddressFields'
          description: Defines if the `address` fields required for the buyer.
      additionalProperties: false
      type: object
      required:
        - address
      title: RequiredFields
    ErrorDetail:
      properties:
        location:
          description: >-
            The part of the request where the property can be found that caused
            the error.
          examples:
            - body
          type: string
          enum:
            - query
            - body
            - path
            - header
            - unknown
          title: ErrorLocation
          x-speakeasy-unknown-values: allow
        pointer:
          anyOf:
            - type: string
              format: json-pointer
            - type: string
          title: Pointer
          description: A JSON pointer for the particular property that caused the error.
          examples:
            - /currency
        message:
          type: string
          title: Message
          description: A human-readdable explanation of the error.
          examples:
            - 'Unknown ISO 4217 currency code: USX'
        type:
          type: string
          title: Type
          description: The type of error that was raised for this property.
          examples:
            - value_error
      additionalProperties: false
      type: object
      required:
        - location
        - pointer
        - message
        - type
      title: ErrorDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    RequiredAddressFields:
      properties:
        organization:
          type: boolean
          title: Organization
          description: >-
            Defines if the `organization` field for a buyer's address is
            required.
          default: false
          examples:
            - true
        house_number_or_name:
          type: boolean
          title: House Number Or Name
          description: >-
            Defines if the `house_number_or_name` field for a buyer's address is
            required.
          default: false
          examples:
            - true
        line1:
          type: boolean
          title: Line1
          description: Defines if the `line1` field for a buyer's address is required.
          default: false
          examples:
            - true
        line2:
          type: boolean
          title: Line2
          description: Defines if the `line2` field for a buyer's address is required.
          default: false
          examples:
            - true
        city:
          type: boolean
          title: City
          description: Defines if the `city` field for a buyer's address is required.
          default: false
          examples:
            - true
        postal_code:
          type: boolean
          title: Postal Code
          description: >-
            Defines if the `postal_code` field for a buyer's address is
            required.
          default: false
          examples:
            - true
        state:
          type: boolean
          title: State
          description: Defines if the `state` field for a buyer's address is required.
          default: false
          examples:
            - true
        state_code:
          type: boolean
          title: State Code
          description: Defines if the `state_code` field for a buyer's address is required.
          default: false
          examples:
            - true
        country:
          type: boolean
          title: Country
          description: Defines if the `country` field for a buyer's address is required.
          default: false
          examples:
            - true
      additionalProperties: false
      type: object
      title: RequiredAddressFields
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````