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

# Generate a user deposit address

> Generate a deposit address for a user

Deposits sent to this address are attributed to the user identified by `foreign_id`.

<Note>
  CryptoProcessing is required to collect sender data in compliance with the MiCA regulations. For more details, see [**User data collection**](/api-reference/user-data-collection). The `sender_data` and the `end_user_reference` you provide must be associated with the same customer.
</Note>


## OpenAPI

````yaml POST /addresses/take
openapi: 3.0.0
info:
  title: Merchant Backend V2
  version: '1.0'
  description: Documentation for merchant backend processing endpoints
servers:
  - url: https://app.cryptoprocessing.com/api/v2
security:
  - xProcessingKey: []
tags:
  - name: Status
  - name: Balance
  - name: Currencies
  - name: Deposit addresses
  - name: Withdrawal
  - name: Exchange
  - name: Invoices
  - name: Transactions
paths:
  /addresses/take:
    post:
      tags:
        - Deposit addresses
      summary: Generate a crypto address
      description: Generate a deposit address for a user
      operationId: post-addresses-take
      parameters:
        - $ref: '#/components/parameters/XProcessingSignatureHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: >-
                    The currency to receive. For a list of all available
                    currencies, see [API currency
                    codes](/api-reference/currency-codes).
                convert_to:
                  type: string
                  description: >-
                    Automatically convert all deposits to this currency. If
                    omitted, no automatic conversion is applied.
                foreign_id:
                  type: string
                  description: >-
                    The unique ID of the customer who will be depositing to this
                    address. It will be returned with every callback to make it
                    easy for you to identify the customer within your system.
                    The same `foreign_id` can be reused across multiple
                    addresses that belong to the same customer. This parameter
                    must not include any personal data.
                end_user_reference:
                  $ref: '#/components/schemas/end_user_reference'
                sender_type:
                  $ref: '#/components/schemas/sender_type'
                sender_data:
                  type: object
                  description: >-
                    If the sender is a natural person, include their
                    `first_name`, `last_name`, `date_of_birth` and `email`. If
                    the sender is a legal entity, include the `legal_name`,
                    `country_of_registration` and `email`.
                  properties:
                    first_name:
                      $ref: '#/components/schemas/sender_data_first_name'
                    last_name:
                      $ref: '#/components/schemas/sender_data_last_name'
                    date_of_birth:
                      $ref: '#/components/schemas/sender_data_date_of_birth'
                    email:
                      $ref: '#/components/schemas/sender_data_email'
                    legal_name:
                      $ref: '#/components/schemas/sender_data_legal_name'
                    country_of_registration:
                      $ref: '#/components/schemas/sender_data_country_of_registration'
                  required:
                    - first_name
                    - last_name
                    - date_of_birth
                    - legal_name
                    - country_of_registration
              required:
                - currency
                - foreign_id
                - sender_data
                - sender_type
                - end_user_reference
            examples:
              BTC address:
                value:
                  currency: BTC
                  foreign_id: test_foreign_id
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
              BTC address with EUR conversion:
                value:
                  currency: BTC
                  convert_to: EUR
                  foreign_id: test_foreign_id
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
              XRP address:
                value:
                  currency: XRP
                  foreign_id: test_foreign_id
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        format: int32
                        description: Address ID.
                      currency:
                        type: string
                        description: Currency code.
                      convert_to:
                        type: string
                        description: >-
                          The currency all deposits to this address will be
                          converted to. It is only returned if you included
                          `convert_to` in the request.
                      address:
                        type: string
                        description: The generated address.
                      tag:
                        type: string
                        description: >-
                          Destination tag/memo for currencies that require it.
                          `Null` for currencies that do not require tags.
                      foreign_id:
                        type: string
                        description: >-
                          ID of the customer who will be depositing to this
                          address.
                      end_user_reference:
                        type: string
                        description: Permanent ID of the customer in your system.
              examples:
                BTC address:
                  value:
                    data:
                      id: 240407213
                      currency: BTC
                      address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc
                      tag: null
                      foreign_id: test_foreign_id
                      end_user_reference: test_end_user_reference
                BTC address with EUR conversion:
                  value:
                    data:
                      id: 240407212
                      currency: BTC
                      convert_to: EUR
                      address: tb1qezlewt2mx36azu5qyx9yff7565z0u9p94vn2ha
                      tag: null
                      foreign_id: test_foreign_id
                      end_user_reference: test_end_user_reference
                XRP address:
                  value:
                    data:
                      id: 240407214
                      currency: XRP
                      address: rM14rKSU62kRCemQswiRSgKcTxJkGyx38g
                      tag: 240407214
                      foreign_id: test_foreign_id
                      end_user_reference: test_end_user_reference
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Missing currency:
                  summary: currency field is required
                  value:
                    errors:
                      currency: The currency field is required.
                Missing foreign_id:
                  summary: foreign_id field is required
                  value:
                    errors:
                      foreign_id: The foreign id field is required.
                Currency not enabled:
                  summary: Currency not enabled for client
                  value:
                    errors:
                      currency: The selected currency is not enabled for your account.
                Currency not found:
                  summary: Currency doesn't exist
                  value:
                    errors:
                      currency: The selected currency is invalid.
                Invalid convert_to:
                  summary: convert_to currency not supported for conversion
                  value:
                    errors:
                      convert_to: >-
                        Exchange operation is not available for this currency
                        pair.
                Amount below minimum:
                  summary: Amount below the minimum deposit limit
                  value:
                    errors:
                      amount: The amount is less than the minimum deposit limit.
                Amount exceeds maximum:
                  summary: Amount exceeds maximum deposit limit
                  value:
                    errors:
                      amount: The amount is greater than the maximum deposit limit.
                Amount not supported:
                  summary: Amount field not supported for this currency
                  value:
                    errors:
                      amount: The amount field is not supported for the currency.
                Invalid sender_type:
                  summary: sender_type must be "natural" or "legal"
                  value:
                    errors:
                      sender_type: The selected sender type is invalid.
                KYC data incomplete:
                  summary: Incomplete KYC sender_data
                  value:
                    errors:
                      sender_data.first_name: The sender data.first name field is required.
                      sender_data.last_name: The sender data.last name field is required.
                Multiple validation errors:
                  summary: Multiple fields failed validation
                  value:
                    errors:
                      currency: The currency field is required.
                      foreign_id: The foreign id field is required.
                Malformed JSON:
                  summary: Invalid JSON body
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/HeaderAuthorization'
components:
  parameters:
    XProcessingSignatureHeader:
      name: X-Processing-Signature
      in: header
      required: true
      description: >-
        Hex-encoded HMAC-SHA512 signature of the request body, [generated using
        your secret key](/api-reference/authentication).
      schema:
        type: string
  schemas:
    end_user_reference:
      type: string
      description: >-
        A persistent internal user ID used to track all requests for the same
        end user. Must be consistent across requests and must not contain
        personal data, such as the user's name or email address. Put customer
        personal details in `sender_data`.
    sender_type:
      type: string
      enum:
        - natural
        - legal
      description: >-
        Whether the sender is a natural person (`natural`) or a legal entity
        (`legal`).
    sender_data_first_name:
      type: string
      maxLength: 255
      description: >-
        The sender's first name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    sender_data_last_name:
      type: string
      maxLength: 255
      description: >-
        The sender's last name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    sender_data_date_of_birth:
      type: string
      format: Y-m-d
      description: >-
        The sender's date of birth. For a legal entity, do not include this
        parameter.
    sender_data_email:
      type: string
      description: >-
        The sender's email. You can optionally include this parameter for both
        natural persons and legal entities. The formatting of the value is
        checked to make sure it is a valid email address.
    sender_data_legal_name:
      type: string
      description: >-
        The company's name. This is required for a legal entity. For a natural
        person, do not include this parameter.
    sender_data_country_of_registration:
      type: string
      description: >-
        The company's country of registration (ISO alpha-3 format, three
        characters). This is required for a legal entity. For a natural person,
        do not include this parameter.
    ValidationOrMalformedJson:
      oneOf:
        - type: object
          title: ValidationError
          description: One or more request parameters failed validation.
          properties:
            errors:
              type: object
              additionalProperties:
                type: string
        - type: object
          title: MalformedJson
          description: >-
            The request body is not valid JSON or the Content-Type header is not
            set to `application/json`.
          properties:
            error:
              type: string
            code:
              type: string
  responses:
    HeaderAuthorization:
      description: |
        Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: Human-readable error message.
              code:
                type: string
                description: Error code.
            description: >-
              Invalid or missing headers. Refer to
              [Errors](/api-reference/errors#403) for troubleshooting steps.
          examples:
            Bad signature header:
              value:
                error: Bad signature header
                code: bad_header_signature
            No signature header:
              value:
                error: No signature header
                code: required_header_signature
            Bad key header:
              value:
                error: Bad key header
                code: bad_header_key
            No key header:
              value:
                error: No key header
                code: required_header_key
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/integration-guide/get-your-api-key).
      in: header
      name: X-Processing-Key

````