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

# Create Token

> Payment Tokens support credit card's and ACH bank account information.  Tokens, can be for one time use, or stored and saved to a customers profile.



## OpenAPI

````yaml swagger-001.json POST /v1/tokens
openapi: 3.0.4
info:
  title: Ecrypt API
  description: Ecrypt API
  termsOfService: https://ecrypt.com
  contact:
    name: Dev Support
    url: https://developer.ecrypt.com
    email: devsupport@ecrypt.com
  version: v1
servers:
  - url: https://api.ecrypt.com
    description: Live
security:
  - x-api-key: []
paths:
  /v1/tokens:
    post:
      tags:
        - Tokens
      summary: Create Token
      description: >-
        Payment Tokens support credit card's and ACH bank account information. 
        Tokens, can be for one time use, or stored and saved to a customers
        profile.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Ecrypt.Gateway.Api.Core.Model.Tokens.TokenRequet
          text/json:
            schema:
              $ref: >-
                #/components/schemas/Ecrypt.Gateway.Api.Core.Model.Tokens.TokenRequet
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/Ecrypt.Gateway.Api.Core.Model.Tokens.TokenRequet
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Ecrypt.Gateway.Api.Core.Model.WebAPI.Tokens.TokenResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ecrypt.Gateway.Api.Core.Model.BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '429':
          description: Too Many Requests
components:
  schemas:
    Ecrypt.Gateway.Api.Core.Model.Tokens.TokenRequet:
      type: object
      oneOf:
        - required:
            - creditCard
          properties:
            creditCard:
              $ref: >-
                #/components/schemas/Ecrypt.Gateway.Api.Core.Model.WebAPI.CreditCard
        - required:
            - check
          properties:
            check:
              $ref: '#/components/schemas/Ecrypt.Gateway.Api.Core.Model.Check'
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.WebAPI.Tokens.TokenResponse:
      required:
        - requestId
        - token
      type: object
      properties:
        token:
          maxLength: 64
          minLength: 8
          pattern: ^[0-9A-Za-z-]*$
          type: string
          description: "Token Identifier\r\n\r\nExample: 00000000-0000-0000-0000-000000000000"
        metadata:
          $ref: >-
            #/components/schemas/Ecrypt.Gateway.Api.Core.Model.WebAPI.Tokens.TokenMetadata
        requestId:
          maxLength: 100
          minLength: 1
          type: string
          default: '000000000000000000000'
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/Ecrypt.Gateway.Api.Core.Model.ResponseBaseError
          nullable: true
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.BadRequest:
      required:
        - requestId
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Ecrypt.Gateway.Api.Core.Model.BadRequestError'
          nullable: true
        requestId:
          maxLength: 100
          minLength: 1
          type: string
          default: '000000000000000000000'
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.WebAPI.CreditCard:
      required:
        - accountNumber
        - expires
      type: object
      properties:
        nameOnCard:
          pattern: ^[0-9A-Za-z `',;-]*$
          type: string
          description: Name as it appears on the credit card.
          default: John Doe
          nullable: true
        accountNumber:
          maxLength: 20
          minLength: 13
          pattern: ^[0-9]*$
          type: string
          description: Credit Card primary account number(PAN)
          default: '4111111111111111'
        expires:
          maxLength: 7
          minLength: 4
          pattern: ^[0-9 /]*$
          type: string
          description: "Credit Card Expiry\r\n\r\nFormat: MMYY\r\nExample: 0135 = January 2035"
          default: '0135'
        verificationValue:
          pattern: ^[0-9]*$
          type: string
          description: 3 or 4 digit card verification value(CVV, CVC).
          default: '000'
          nullable: true
        postalCode:
          pattern: ^[0-9A-Za-z -]*$
          type: string
          description: Billing address postal code.
          default: '90210'
          nullable: true
        transactionId:
          type: string
          description: >-
            Processor transaction id.  This is used for processors that support
            re-charge an existing transaction.  INTERNAL USE ONLY
          nullable: true
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.Check:
      required:
        - accountNumber
        - routingNumber
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 0
          pattern: ^[0-9A-Za-z _\-\.,`'()@#!?\/\\:;|+=@%&]*$
          type: string
          description: "Name as it appears on the check.\r\n\r\nExample: John Doe"
          nullable: true
        accountNumber:
          maxLength: 20
          minLength: 7
          pattern: ^[0-9]*$
          type: string
          description: "Account Number as it appears on the check.\r\n\r\nExample: 123123123"
        routingNumber:
          maxLength: 20
          minLength: 8
          pattern: ^[0-9]*$
          type: string
          description: "Routing Number as it appears on the check.\r\n\r\nExample: 123123123"
        checkNumber:
          maxLength: 8
          minLength: 0
          pattern: ^[0-9]*$
          type: string
          description: "Check Number\r\n\r\nExample: 100"
          nullable: true
        accountType:
          $ref: >-
            #/components/schemas/Ecrypt.Gateway.Api.Core.Model.WebAPI.Enums.AccountType
        verification:
          $ref: '#/components/schemas/Ecrypt.Gateway.Api.Core.Model.CheckVerification'
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.WebAPI.Tokens.TokenMetadata:
      type: object
      properties:
        creditCardNumber:
          maxLength: 20
          minLength: 13
          pattern: ^[0-9/*]*$
          type: string
          description: " Credit Card number masked\r\n\r\nExample: 4***********1111"
          nullable: true
        creditCardExpires:
          maxLength: 4
          minLength: 13
          pattern: ^[0-9/*]*$
          type: string
          description: " Credit Card Expires\r\n\r\nExample: 0935"
          nullable: true
        creditCardNetwork:
          maxLength: 20
          minLength: 0
          pattern: ^[A-Za-z -]*$
          type: string
          description: "Credit Card network\r\n\r\nExamples:\r\n- `american express`\r\n- `discover card`\r\n- `mastercard`\r\n- `visa`"
          default: visa
          nullable: true
        creditCardType:
          maxLength: 20
          minLength: 0
          pattern: ^[A-Za-z -]*$
          type: string
          description: "Credit Card type\r\n\r\nExamples:\r\n- `credit`\r\n- `debit`\r\n- `pre-paid`"
          default: credit
          nullable: true
        accountNumber:
          maxLength: 20
          minLength: 8
          pattern: ^[0-9/*]*$
          type: string
          description: "Non-Credit card Account Number masked\r\n\r\nExample: 1*****1111"
          default: 1*****1111
          nullable: true
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.ResponseBaseError:
      type: object
      properties:
        type:
          type: string
        message: {}
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.BadRequestError:
      type: object
      properties:
        type:
          type: string
        message: {}
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.WebAPI.Enums.AccountType:
      enum:
        - 0
        - 1
      type: integer
      description: "Type of account\r\n\r\nExample: CHECKING\r\n*** Supported Values ***\r\n- `CHECKING`\r\n- `SAVINGS`"
      format: int32
      x-enumNames:
        - Checking
        - Savings
    Ecrypt.Gateway.Api.Core.Model.CheckVerification:
      type: object
      properties:
        dob:
          maxLength: 14
          minLength: 8
          pattern: ^[0-9A-Za-z _\-\.\/]*$
          type: string
          description: "Date of Birth\r\n\r\nFormat: MM/DD/YYYY\r\nExample: 01/17/2006 = January 17th 2006"
          nullable: true
        ssn:
          maxLength: 14
          minLength: 8
          pattern: ^[0-9A-Za-z _\-\.\/]*$
          type: string
          description: "Social Security Number\r\n\r\nFormat: DDD-DD-DDDD\r\nExample: 123-45-6789"
          nullable: true
        driversLicense:
          $ref: >-
            #/components/schemas/Ecrypt.Gateway.Api.Core.Model.CheckVerificationDriversLicense
      additionalProperties: false
      nullable: true
    Ecrypt.Gateway.Api.Core.Model.CheckVerificationDriversLicense:
      type: object
      properties:
        number:
          maxLength: 100
          minLength: 0
          pattern: ^[0-9A-Za-z _\-\.\/]*$
          type: string
          description: "Number\r\n\r\nExample: A123456789"
          nullable: true
        state:
          maxLength: 100
          minLength: 0
          pattern: ^[0-9A-Za-z _\-\.\/]*$
          type: string
          description: "State\r\n\r\nFormat: CC\r\nExample: CA = California"
          nullable: true
      additionalProperties: false
      nullable: true
  securitySchemes:
    x-api-key:
      type: apiKey
      description: Authorization by x-api-key inside request's header
      name: x-api-key
      in: header

````