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

# Simulate a stored credential

> **Sandbox only.** Creates a stored credential of the specified type. The credential may be used for `cash_in` and `cash_out` transactions. This endpoint is not available in the production environment.




## OpenAPI

````yaml /openapi.yaml post /sandbox/credential
openapi: 3.0.1
info:
  title: Push API
  version: 0.0.1
servers:
  - url: https://api.pushcash.com
    description: Production API
  - url: https://sandbox.pushcash.com
    description: Sandbox API used for developing an integration with Push
security:
  - bearer: []
tags:
  - name: user
  - name: tokenization
  - name: authorization
  - name: intent
  - name: dispute
  - name: refund
  - name: accounts
  - name: transactions
  - name: transfer
  - name: simulation
paths:
  /sandbox/credential:
    post:
      tags:
        - simulation
      summary: Simulate a stored credential
      description: >
        **Sandbox only.** Creates a stored credential of the specified type. The
        credential may be used for `cash_in` and `cash_out` transactions. This
        endpoint is not available in the production environment.
      operationId: simulateCredential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - type
              properties:
                user_id:
                  type: string
                  description: The push identifier for the user
                  example: user_28CJjV7P4Go5PNJvfzghiD
                type:
                  type: string
                  description: The type of credential to create
                  enum:
                    - secure_debit
                    - card_only_credit
                    - card_only_debit
                    - apple_pay
                    - apple_pay_debit
                card_last4:
                  type: string
                  description: >-
                    The last 4 digits of the card number to display for the
                    credential. Must be exactly 4 digits; generated when
                    omitted.
                  pattern: ^[0-9]{4}$
                  example: '9010'
      responses:
        '200':
          description: The created credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCredential'
              example:
                id: cred_0BnD2LlVo1XbcQzQVeIdmY
                created_at: '2023-05-27T09:45:12.789Z'
                card_last4: '9010'
                authenticated: true
                type: apple_pay_debit
                account_last4: null
                bank_name: null
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    UserCredential:
      type: object
      example:
        id: cred_7YlA9IiSl8UZvNwNSbFajV
        created_at: '2023-05-24T20:15:18.158Z'
        card_last4: '4444'
        authenticated: true
        type: secure_debit
        account_last4: '0685'
        bank_name: Chase Bank
      properties:
        id:
          type: string
          description: The unique identifier assigned by Push
        created_at:
          type: string
          format: date-time
          description: When the payment credential was created (ISO 8061 date string)
        card_last4:
          type: string
          description: The last 4 digits of the card number
        authenticated:
          type: boolean
          description: >-
            For `secure_debit` credentials, whether the user has authenticated
            with the bank.
        type:
          description: >
            The type of payment credential:

            - `secure_debit`: A debit card which can be used for withdrawals and
            deposits

            - `card_only_credit`: A credit card which can be used for deposits
            alone

            - `card_only_debit`: A debit card which can be used for deposits
            alone

            - `apple_pay_debit`: A debit card stored via Apple Pay which can be
            used for withdrawals alone
          type: string
          enum:
            - secure_debit
            - card_only_credit
            - card_only_debit
            - apple_pay_debit
        account_last4:
          type: string
          description: >-
            For authenticated `secure_debit` credentials, the last 4 digits of
            the bank account number for the user's account. This field is `null`
            otherwise.
          nullable: true
        bank_name:
          type: string
          description: >-
            For `secure_debit` credentials, the name of the user's bank. This
            field is `null` otherwise.
          nullable: true
      required:
        - id
        - created_at
        - card_last4
        - authenticated
        - type
        - account_last4
        - bank_name
    error:
      description: Description of the error encountered from the API request
      type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````