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

# Tokenize a Credit Card

> This endpoint allows you to tokenize a credit card, which will verify its validity and return a token representing the card that can be used for transactions. This method requires PCI compliance on the part of the affiliate or merchant.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/transaction/tokenize-card
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/transaction/tokenize-card:
    post:
      tags:
        - Transaction management
      summary: Tokenize a Credit Card
      description: >-
        This endpoint allows you to tokenize a credit card, which will verify
        its validity and return a token representing the card that can be used
        for transactions. This method requires PCI compliance on the part of the
        affiliate or merchant.
      operationId: tokenizeACreditCard
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example: []
                  properties:
                    sid:
                      type: number
                      description: The ID of the merchant account processing the charge.
                      example: 1234567
                    cardholder_name:
                      type: string
                      description: 'The name of the cardholder. Max: 50.'
                      example: John Doe
                    card_number:
                      type: number
                      description: The 15/16-digit credit card number.
                      example: 1234567812345700
                    expiration_date:
                      type: string
                      description: Expiry date of the card, in the form mm/YYYY.
                      example: 01/2025
                    cvv:
                      type: number
                      description: 'optional The card''s CVV. Min: 3, Max: 4.'
                      example: 123
                      nullable: true
                    billing_address:
                      type: object
                      description: ''
                      example: []
                      properties:
                        addr1:
                          type: string
                          description: >-
                            The cardholder's address line 1. Can be empty string
                            Max: 55.
                          example: 1234 Main St
                          nullable: true
                        addr2:
                          type: string
                          description: 'The cardholder''s address line 2. Max: 55.'
                          example: Suite 100
                          nullable: true
                        city:
                          type: string
                          description: 'The cardholder''s city. Can be empty string Max: 55.'
                          example: New York
                          nullable: true
                        state:
                          type: string
                          description: 'The cardholder''s state. Can be empty string Max: 2.'
                          example: NY
                          nullable: true
                        zip:
                          type: number
                          description: 'The cardholder''s ZIP code. Digits: 5.'
                          example: 10001
                      required:
                        - addr1
                        - city
                        - state
                        - zip
                  required:
                    - sid
                    - cardholder_name
                    - card_number
                    - expiration_date
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    token: abcd1234
                properties:
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        example: abcd1234
                        description: 'The token representing the card. Example: abcd1234'
        '400':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: ''
                    type: object
                    example:
                      errors:
                        card_number:
                          - The card number must be a number.
                    properties:
                      errors:
                        type: object
                        properties:
                          card_number:
                            type: array
                            example:
                              - The card number must be a number.
                            items:
                              type: string
                  - description: ''
                    type: object
                    example:
                      data:
                        message: Validation of card failed.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Validation of card failed.
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Permission Denied.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Permission Denied.
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````