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

# Create a deposit

> This endpoint allows you to create a deposit.



## OpenAPI

````yaml post /deposits
openapi: 3.0.0
info:
  title: Hub2 Service · Api
  description: |-
    This is the Hub2 api reference |
          Please check https://docs.hub2.io/ for the full documentation |
          Rate limits of endpoints are here : https://docs.hub2.io/en/details/limits.html.
  version: 2.177.0
  contact:
    name: Hub2
    url: https://www.hub2.io/
    email: contact@hub2.io
servers: []
security: []
tags:
  - name: Payments
    description: >-
      Best known as the PAY-IN API, it provides endpoints for merchants to
      perform Hub2 PAY-IN transactions.
  - name: Transfers
    description: >-
      Best known as the PAY-OUT API, it provides endpoints for merchants to
      perform Hub2 PAY-OUT transactions.
  - name: IRT
    description: International Remittance Transfers
  - name: Balance
    description: ''
  - name: Webhooks
    description: ''
  - name: Provisioning
    description: ''
  - name: Payment on Terminal
    description: ''
  - name: Receipt
    description: ''
  - name: Sms
    description: ''
  - name: Data
    description: ''
  - name: Compliance
    description: ''
  - name: Recipient
    description: ''
  - name: Delegation
    description: ''
  - name: Deposits
    description: ''
  - name: Payment Links
    description: ''
  - name: Subscription Links
    description: ''
  - name: Submerchants
    description: ''
  - name: Bill Payments
    description: ''
  - name: Subscriptions
    description: ''
  - name: Subscription Intents
    description: >-
      Enrolls a customer in card-on-file recurring debits and tracks how each
      enrollment ended.
  - name: Instant Payment
    description: >-
      Instant payment (PI SPI, BCEAO) resources, such as the aliases naming your
      accounts in the national directory.
paths:
  /deposits:
    post:
      tags:
        - Deposits
      summary: Create a deposit
      description: This endpoint allows you to create a deposit.
      operationId: DepositController_createDeposit
      parameters:
        - name: ApiKey
          in: header
          description: >-
            Your api key. To create a key, please get into our dashboard. If you
            don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: MerchantId
          in: header
          description: >-
            Your merchant ID. This information is available in our dashboard. If
            you don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: Environment
          in: header
          description: >-
            Allow you to choose between the sandbox mode to perform some tests
            or the live mode for real world transactions.
          required: true
          schema:
            type: string
            enum:
              - live
              - sandbox
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDepositDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInvalidInputErrorAlias'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbiddenRequestErrorAlias'
        '409':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInvalidRequestErrorAlias'
        '429':
          description: 'ThrottlerException: Too Many Requests'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequestErrorAlias'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalErrorAlias'
components:
  schemas:
    CreateDepositDto:
      type: object
      properties:
        amount:
          type: number
          description: The amount to deposit
          example: 1000
        currency:
          type: string
          description: The currency of the deposit
          example: XOF
        description:
          type: string
          description: Description of the deposit
          maxLength: 300
        accountType:
          type: string
          description: >-
            The account type to deposit funds on. Only TRANSFER, TRANSFER_IRT
            and CROSS_BORDER are allowed for deposits.
          enum:
            - transfer
            - transfer-irt
            - cross-border
          default: transfer
        method:
          description: Informations about HUB2 account
          allOf:
            - $ref: '#/components/schemas/CreateDepositMethodDto'
      required:
        - amount
        - currency
        - accountType
        - method
    DepositDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the deposit
        merchantId:
          type: string
          description: Merchant identifier
        merchantName:
          type: string
          description: Merchant display name
        merchantAccountId:
          type: string
          description: Merchant account identifier
        matchingCode:
          type: string
          description: Reference to use for the bank transfer
        description:
          type: string
          description: Description of the deposit
          maxLength: 300
        amount:
          type: number
          description: Amount of the deposit
        currency:
          type: string
          description: Currency of the deposit (ISO 4217 format)
        accountType:
          type: string
          enum:
            - collection
            - transfer
            - transfer-irt
            - delegated
            - cross-border
          description: Type of merchant account
        method:
          description: Method used for the deposit
          allOf:
            - $ref: '#/components/schemas/DepositMethodDto'
        status:
          type: string
          enum:
            - created
            - failed
            - pending
            - successful
          description: Status of the deposit
        statusDetails:
          type: string
          enum:
            - waiting_provider
            - waiting_proof
            - unverified
            - verified
            - mismatch
          description: Status details of the deposit
        mode:
          type: string
          enum:
            - live
            - sandbox
          description: Application mode (e.g., live or sandbox)
        fees:
          description: List of fees associated with the deposit
          type: array
          items:
            $ref: '#/components/schemas/DepositFee'
        createdAt:
          type: string
          description: Date and time when the deposit was created
        createdBy:
          type: string
          description: User id or merchant id who created the deposit
        updatedAt:
          type: string
          description: Date and time when the deposit was last updated
        failureCause:
          type: object
          description: Optional failure cause details
        nextAction:
          type: object
          description: Next action required, if any
        legalData:
          description: Legal data of the deposit
          allOf:
            - $ref: '#/components/schemas/DepositLegalDataDto'
      required:
        - id
        - merchantId
        - merchantAccountId
        - matchingCode
        - amount
        - currency
        - accountType
        - method
        - status
        - statusDetails
        - mode
        - fees
        - createdAt
        - createdBy
        - updatedAt
    ApiInvalidInputErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP status.
          enum:
            - 400
          example: 400
        code:
          type: string
          description: >-
            The error code, e.g. `wrong_provider`, `invalid_url`,
            `invalid_sandbox_msisdn`, `credit_card_fees_not_supported`,
            `override_business_id`, `override_business_name`, `signature_error`,
            `merchant_not_found`,
            `payment_information.recipient_phone_plain_forbidden`,
            `transfer_information.recipient_phone_plain_forbidden`,
            `forbidden_special_chars`, `ci.mtn.description_too_big`. `Bad
            Request` for DTO validation failures and other uncoded 400s.
          example: wrong_provider
        message:
          description: >-
            What is wrong with the request. An array of messages when the
            payload fails DTO validation.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: >-
            Provider 'unknown_provider' does not exist for country 'CI' and
            method 'mobile_money'.
        request_id:
          type: string
          description: >-
            Identifier of the request, to quote when contacting the Support
            team.
      required:
        - status
        - code
        - message
        - request_id
    ApiUnauthorizedErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 401
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiUnauthorizedError'
      required:
        - status
        - error
    ApiForbiddenRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 403
          example: 403
        error:
          description: Error object
          allOf:
            - $ref: '#/components/schemas/ForbiddenErrorObject'
      required:
        - status
        - error
    ApiInvalidRequestErrorAlias:
      type: object
      properties:
        httpStatus:
          type: number
          description: Http status
          enum:
            - 409
          example: 409
        type:
          type: string
          description: Error type
          example: invalid_request
        code:
          type: string
          description: Error code
          enum:
            - unsupported_action
          example: unsupported_action
        message:
          type: string
          description: Error message
          example: This action is not supported
      required:
        - httpStatus
        - type
        - code
        - message
    ApiTooManyRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 429
          example: 429
        error:
          type: string
          description: Error
          example: 'ThrottlerException: Too Many Requests'
      required:
        - status
        - error
    ApiInternalErrorAlias:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: internal_error
        code:
          type: string
          description: The error code for this error.
          example:
            - internal_error
            - wrong_credentials
            - not_granted
            - live_mode_not_granted
        message:
          type: string
          description: The error message describing what happens to throw this error.
          example: An error occurred on our system. Please try again later.
      required:
        - type
        - code
        - message
    CreateDepositMethodDto:
      type: object
      properties:
        type:
          type: string
          description: The method selected to make this Deposit
          example: bank_transfer
          enum:
            - bank_transfer
        hub2Iban:
          type: string
          description: The HUB2 IBAN to deposit funds to
          example: FR7630006000011234567890189
      required:
        - type
        - hub2Iban
    DepositMethodDto:
      type: object
      properties:
        type:
          type: string
          description: The method selected to make this Deposit
          example: bank_transfer
          enum:
            - bank_transfer
        hub2Iban:
          type: string
          description: The HUB2 IBAN to deposit funds to
          example: FR7630006000011234567890189
        country:
          type: string
          description: The country code derived from the IBAN
          example: FR
        provider:
          type: string
          description: The bank provider derived from the bank account
          example: ecobank
      required:
        - type
        - hub2Iban
        - country
        - provider
    DepositFee:
      type: object
      properties: {}
    DepositLegalDataDto:
      type: object
      properties:
        proofDocuments:
          description: Proof documents
          type: array
          items:
            type: string
      required:
        - proofDocuments
    InternalApiUnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: authorization_error
        code:
          type: string
          description: The internal error code describing what happened.
          enum:
            - bad_payment_intent_token
            - wrong_credentials
          example: wrong_credentials
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: L'ID marchand et/ou la clé d'API sont incorrects.
      required:
        - type
        - code
        - message
    ForbiddenErrorObject:
      type: object
      properties:
        statusCode:
          type: number
          description: Http status
          enum:
            - 403
          example: 403
        message:
          type: string
          description: Detailed error message
          example: Forbidden
        error:
          type: string
          description: Error name
      required:
        - statusCode
        - message
        - error

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.