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

# Simulate credit

> Use this endpoint to simulate crediting funds to a deposit account.

Use this endpoint to simulate crediting funds to a deposit account.

Simulate a direct deposit of funds to a user account by including the deposit account number of the account to be credited. You can find the account number in the `account_number` field of the response when you create a new deposit account. Alternatively, you can retrieve it by sending a `GET` request to the `/depositaccounts/user/{user_token}` endpoint. For more information, see [Direct Deposit](https://www.marqeta.com/docs/core-api/direct-deposits/).

You can view the full request body structure on the [Simulations 2.0 — Direct Deposits](https://www.marqeta.com/docs/core-api/simulations-direct-deposits) page.

## Request body

See [Request Body](https://www.marqeta.com/docs/core-api/simulations-direct-deposits).

## Sample request body

```json JSON lines wrap theme={null}
{
  "amount": 10,
  "account_number": "**ACCOUNT_NUMBER**",
  "settlement_date": "2025-02-03T13:22:42Z",
  "earlyPayEligible": false
}
```

## Response body

See [Response Body](https://www.marqeta.com/docs/core-api/simulations-direct-deposits).

## Sample response body

```json JSON lines wrap theme={null}
{
  "token": "**DIRECT_DEPOSIT_TOKEN**",
  "user_token": "**USER_TOKEN**",
  "type": "CREDIT",
  "state": "PENDING",
  "state_reason": "testing",
  "amount": 10,
  "created_time": "2025-03-23T19:34:05Z",
  "direct_deposit_account_token": "**DIRECT_DEPOSIT_ACCT_TOKEN**",
  "last_modified_time": "2025-03-23T19:34:05Z",
  "settlement_date": "2025-02-03T13:22:42Z"
}
```


## OpenAPI

````yaml POST /simulations/directdeposits/credit
openapi: 3.0.3
info:
  title: Simulations 2.0 API
  description: >-
    This OpenAPI specification can be used in Postman and for Simulations client
    generation.
  contact:
    name: Marqeta
    email: support@marqeta.com
  version: 3.0.0
  x-docs-collection: Core API
servers:
  - url: https://sandbox-api.marqeta.com/v3
security: []
tags:
  - name: Simulations 2.0 — Card Transactions
    description: >-
      The Marqeta platform provides you with a production environment and a
      sandbox.

      The main difference between the production and sandbox environments is
      that your production environment communicates with a payment card network.

      This communication allows your program's cards to pay for goods and
      services by initiating live transactions over the card network.


      There are two types of sandbox environments available:


      * *Public sandbox:* A single-user environment where you can begin building
      your program and experiment with the Marqeta platform.

      * *Private sandbox:* A multi-user environment where you can integrate your
      application with the Marqeta platform.


      All funds and transactions are simulated in both types of sandbox
      environments.


      Unlike the production environment, a sandbox does not communicate with a
      card network, so the cards you create within them cannot be used to
      conduct real-world transactions.

      Therefore, you must rely on simulated transactions in order to test all
      objects you create within a sandbox.

      The sandbox environments provide a set of endpoints that let you simulate
      various types of card network transactions, such as authorizations,
      reversals, and balance inquiries.

      These endpoints are available only within the sandbox, so the details on
      this page do not apply to production.


      To use the Simulations API for card transactions:


      * Create a card in your sandbox environment.

      * Use the `/simulations/cardtransactions/*` endpoints to simulate
      transaction event types. Each endpoint is its own event type.

      * Use the `/webhooks` endpoint to send optional customer notifications for
      system events.


      To use the Simulations API for direct deposits, see
      <</core-api/simulations-direct-deposits, Simulations 2.0 — Direct
      Deposits>>.


      [NOTE]

      You can use link:https://www.postman.com[Postman, window="_blank"] to run
      requests for <</core-api/simulations-card-transactions, card transaction>>
      and <</core-api/simulations-direct-deposits, direct deposit>> simulations
      endpoints.

      This collection of requests has been saved as a YAML file for your
      convenience.

      To access the YAML file, see <</core-api/postman-collection-simulations,
      Postman Collection for Simulations 2.0>>.


      All card transaction simulations endpoints share the same request/response
      model, as described below.
  - name: Simulations 2.0 — Direct Deposits
    description: >-
      The Marqeta platform provides you with a production environment and a
      sandbox.

      The main difference between the production and sandbox environments is
      that your production environment communicates with a payment card network.

      This communication allows your program's cards to pay for goods and
      services by initiating live transactions over the card network.


      There are two types of sandbox environments available:


      * *Public sandbox:* A single-user environment where you can begin building
      your program and experiment with the Marqeta platform.

      * *Private sandbox:* A multi-user environment where you can integrate your
      application with the Marqeta platform.


      All funds and transactions are simulated in both types of sandbox
      environments.


      Unlike the production environment, a sandbox does not communicate with a
      card network, so the cards you create within them cannot be used to
      conduct real-world transactions.

      Therefore, you must rely on simulated transactions in order to test all
      objects you create within a sandbox.

      The sandbox environments provide a set of endpoints that let you simulate
      various types of card network transactions, such as authorizations,
      reversals, and balance inquiries.

      These endpoints are available only within the sandbox, so the details on
      this page do not apply to production.


      To use the Simulations API for direct deposits:


      * Create a card in your sandbox environment.

      * Use the `/simulations/directdeposits/*` endpoints to simulate
      transaction event types. Each endpoint is its own event type.

      * Use the `/webhooks` endpoint to send optional customer notifications for
      system events.


      To use the Simulations API for card transactions, see
      <</core-api/simulations-card-transactions, Simulations 2.0 — Card
      Transactions>>.


      [NOTE]

      You can use link:https://www.postman.com[Postman, window="_blank"] to run
      requests for <</core-api/simulations-card-transactions, card transaction>>
      and <</core-api/simulations-direct-deposits, direct deposit>> simulations
      endpoints.

      This collection of requests has been saved as a YAML file for your
      convenience.

      To access the YAML file, see <</core-api/postman-collection-simulations,
      Postman Collection for Simulations 2.0 >>.


      All direct deposit simulations endpoints share the same request/response
      model, as described below.
paths:
  /simulations/directdeposits/credit:
    post:
      tags:
        - Simulations 2.0 — Direct Deposits
      summary: Simulate credit
      description: >-
        Use this endpoint to simulate crediting funds to a deposit account.


        Simulate a direct deposit of funds to a user account by including the
        deposit account number of the account to be credited.

        You can find the account number in the `account_number` field of the
        response when you create a new deposit account.

        Alternatively, you can retrieve it by sending a `GET` request to the
        `/depositaccounts/user/{user_token}` endpoint.

        For more information, see <</diva-api/direct-deposits, Direct Deposit>>.


        You can view the full request body structure on the
        <</core-api/simulations-direct-deposits#SimulationRequestBody,
        Simulations 2.0 — Direct Deposits>> page.
      operationId: DirectDepositsCreditEvent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectDepositSimulationRequest'
            example:
              amount: 10
              account_number: '**ACCOUNT_NUMBER**'
              settlement_date: '2025-02-03T13:22:42Z'
              earlyPayEligible: false
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectDepositSimulationResponse'
              example:
                token: '**DIRECT_DEPOSIT_TOKEN**'
                user_token: '**USER_TOKEN**'
                type: CREDIT
                state: PENDING
                state_reason: testing
                amount: 10
                created_time: '2025-03-23T19:34:05Z'
                direct_deposit_account_token: '**DIRECT_DEPOSIT_ACCT_TOKEN**'
                last_modified_time: '2025-03-23T19:34:05Z'
                settlement_date: '2025-02-03T13:22:42Z'
        '404':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DirectDepositSimulationRequest:
      x-tags:
        - Simulations 2.0 — Direct Deposits
      properties:
        account_number:
          description: The account number of the user to debit or credit.
          x-allowableValues: Valid account number belonging to an active user with an active card
          type: string
        amount:
          description: Amount of the transaction.
          x-allowableValues: |-
            Format: 0.00

            Must be greater than zero
          type: number
        company_discretionary_data:
          description: Company-specific data provided by the direct deposit originator.
          maxLength: 20
          minLength: 0
          type: string
        company_entry_description:
          description: Company-specific data provided by the direct deposit originator.
          maxLength: 10
          minLength: 0
          type: string
        company_identification:
          description: Alphanumeric code that identifies the direct deposit originator.
          maxLength: 10
          minLength: 0
          type: string
        company_name:
          description: Name of the direct deposit originator.
          maxLength: 16
          minLength: 0
          type: string
        earlyPayEligible:
          description: Indicates whether the transaction is eligible for early pay.
          x-allowableValues: '`true`, `false`'
          default: false
          type: boolean
        individual_identification_number:
          description: >-
            Accounting number by which the recipient is known to the direct
            deposit originator.
          maxLength: 22
          minLength: 0
          type: string
        individual_name:
          description: Identity of the direct deposit recipient.
          maxLength: 35
          minLength: 0
          type: string
        settlement_date:
          description: Date when the credit or debit is applied.
          x-allowableValues: 'Format: yyyy-mm-ddThh:mm:ssZ'
          format: date-time
          type: string
        standard_entry_class_code:
          description: Three-letter code identifying the type of entry.
          maxLength: 3
          minLength: 0
          type: string
        token:
          description: >-
            Unique identifier of the direct deposit transaction.


            If you do not include a token, the system generates one
            automatically.

            This token is used in other API calls.

            Marqeta recommends that you enter a string that you can remember for
            the token, rather than having the system generate a token for you.

            This value cannot be updated.
          maxLength: 36
          minLength: 0
          type: string
        type:
          description: >-
            Provides information about whether funds are being debited from or
            credited to the account.
          enum:
            - CREDIT
            - DEBIT
          type: string
          readOnly: true
      required:
        - account_number
        - amount
        - settlement_date
      type: object
    DirectDepositSimulationResponse:
      x-tags:
        - Simulations 2.0 — Direct Deposits
      properties:
        type:
          description: Whether funds are being debited from or credited to the account.
          enum:
            - CREDIT
            - DEBIT
          type: string
        state:
          description: Current status of the direct deposit record.
          enum:
            - PENDING
            - APPLIED
            - REVERSED
            - REJECTED
          type: string
        state_reason:
          description: Explains the current state of the direct deposit record.
          x-allowableValues: 255 char max
          type: string
        state_reason_code:
          description: A standard code describing the reason for the current state.
          x-allowableValues: Valid three-character code
          type: string
        token:
          description: Unique identifier of the direct deposit record.
          x-allowableValues: Existing direct deposit record token
          type: string
        user_token:
          description: >-
            Unique identifier of the user associated with the direct deposit
            record.
          x-allowableValues: Existing user token
          type: string
        amount:
          description: Amount being debited or credited.
          x-allowableValues: Existing amount in 0.00 decimal format
          type: number
        business_token:
          description: >-
            Unique identifier of the business associated with the direct deposit
            record.
          x-allowableValues: Existing business token
          type: string
        company_discretionary_data:
          description: Company-specific data provided by the direct deposit originator.
          x-allowableValues: 20 char max
          type: string
        company_entry_description:
          description: Description of the purpose of the direct deposit.
          x-allowableValues: 10 char max
          type: string
        company_identification:
          description: Alphanumeric code that identifies the direct deposit originator.
          x-allowableValues: 10 char max
          type: string
        company_name:
          description: Name of the direct deposit originator.
          x-allowableValues: 16 char max
          type: string
        created_time:
          description: Date and time when the deposit account was created, in UTC.
          x-allowableValues: 'Format: yyyy-MM-dd''T''HH:mm:ssZ'
          format: date-time
          type: string
        direct_deposit_account_token:
          description: Unique identifier of the affected deposit account.
          x-allowableValues: 36 char max
          type: string
        individual_identification_number:
          description: >-
            Accounting number by which the recipient is known to the direct
            deposit originator.
          x-allowableValues: 255 char max
          type: string
        individual_name:
          description: Name of the direct deposit recipient.
          x-allowableValues: 22 char max
          type: string
        last_modified_time:
          description: >-
            Date and time when the direct deposit account was last modified, in
            UTC.
          x-allowableValues: |-
            date-time

            *Format:*   +
            yyyy-MM-ddThh:mm:ssZ
          format: date-time
          type: string
        settlement_date:
          description: Date and time when the credit or debit is applied, in UTC.
          x-allowableValues: |-
            date-time

            *Format:*   +
            yyyy-MM-ddThh:mm:ssZ
          format: date-time
          type: string
        standard_entry_class_code:
          description: Three-letter code identifying the type of entry.
          x-allowableValues: |-
            - `ACK`
            - `ADV`
            - `ARC`
            - `ATX`
            - `BOC`
            - `CCD`
            - `CIE`
            - `COR`
            - `CTX`
            - `DNE`
            - `ENR`
            - `IAT`
            - `MTE`
            - `POP`
            - `POS`
            - `PPD`
            - `RCK`
            - `SHR`
            - `TEL`
            - `TRC`
            - `TRX`
            - `WEB`
            - `XCK`
          type: string
      type: object
    Error:
      type: object
      title: Error
      properties:
        error_code:
          type: string
        error_message:
          type: string

````

## Related topics

- [Simulations 2.0 — Direct Deposits Overview](https://www.marqeta.com/docs/core-api/simulations-direct-deposits.md)
- [Simulate OCT](https://www.marqeta.com/docs/core-api/simulating-transactions/simulate-oct.md)
- [Simulate refund](https://www.marqeta.com/docs/core-api/simulations-card-transactions/refunds/simulate-refund.md)
- [Simulate authorization](https://www.marqeta.com/docs/core-api/simulations-card-transactions/authorizations/simulate-authorization-v2.md)
- [Simulate debit](https://www.marqeta.com/docs/core-api/simulations-direct-deposits/simulate-debit.md)
