> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cryptoprocessing.us/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](/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.lt.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.deposits'
                sender_type:
                  $ref: '#/components/schemas/sender_type.deposits'
                sender_data:
                  $ref: '#/components/schemas/sender_data'
              required:
                - currency
                - foreign_id
                - sender_data
                - sender_type
                - end_user_reference
            examples:
              USDC address:
                value:
                  currency: USDC
                  foreign_id: user_12345
                  end_user_reference: user_12345
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
              USDC address with EUR conversion:
                value:
                  currency: USDC
                  convert_to: EUR
                  foreign_id: user_12345
                  end_user_reference: user_12345
                  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:
                USDC address:
                  value:
                    data:
                      id: 3859599
                      currency: USDC
                      address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                      tag: null
                      foreign_id: user_12345
                      end_user_reference: user_12345
                USDC address with EUR conversion:
                  value:
                    data:
                      id: 3859601
                      currency: USDC
                      convert_to: EUR
                      address: '0x360669C460894e27fc875cf674268D81f9e6512c'
                      tag: null
                      foreign_id: user_12345
                      end_user_reference: user_12345
        '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: Invalid currency
                Currency not allowed without conversion:
                  summary: This currency requires convert_to to be set
                  value:
                    errors:
                      currency: Currency is not allowed without conversion
                Invalid convert_to:
                  summary: convert_to currency doesn't exist
                  value:
                    errors:
                      convert_to: Invalid currency
                convert_to not allowed without conversion:
                  summary: convert_to currency not supported for conversion
                  value:
                    errors:
                      convert_to: Currency is not allowed without conversion
                Invalid end_user_reference:
                  summary: end_user_reference must not contain an email address
                  value:
                    errors:
                      end_user_reference: >-
                        The end user reference must not contain an email
                        address.
                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.
                Address cannot be issued:
                  summary: This end_user_reference cannot receive a new address
                  value:
                    errors:
                      sender_data: Address cannot be issued for that end_user_reference
                Malformed JSON:
                  summary: Invalid JSON body
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/HeaderAuthorization'
        '422':
          description: >
            Unprocessable entity. An infrastructure or blockchain-related error
            occurred

            while issuing the address.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                  error_code:
                    type: string
              examples:
                Blockchain error:
                  summary: Infrastructure failure while issuing the address
                  value:
                    errors:
                      - Something went wrong, please try again shortly
                    error_code: blockchain_error
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.deposits:
      type: string
      description: >
        Permanent ID of the customer in your system. Used to group, track, and
        analyze transactions made by a specific customer. Must not contain
        personal data, such as the user's name or email address.
    sender_type.deposits:
      type: string
      enum:
        - natural
        - legal
      description: >
        Type of the merchant's customer who sends the funds.


        Use `natural` if the sender is an individual person and `legal` if the
        sender is a legal entity. The selected type determines which fields must
        be included in `sender_data`.
    sender_data:
      type: object
      description: >
        Must contain the details of the merchant's customer who sends the funds.


        - If `sender_type` is `natural`, include `first_name`, `last_name`, and
        `date_of_birth`. Do not include `legal_name` or
        `country_of_registration`.

        - If `sender_type` is `legal`, include `legal_name` and
        `country_of_registration`. Do not include `first_name`, `last_name`, or

        `date_of_birth`.
      required:
        - first_name
        - last_name
        - date_of_birth
        - legal_name
        - country_of_registration
      properties:
        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.
        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.
        date_of_birth:
          type: string
          description: >-
            The sender's date of birth, YYYY-MM-DD. This is required for a
            natural person. For a legal entity, do not include this parameter.
        legal_name:
          type: string
          maxLength: 255
          description: >-
            The company's name. This is required for a legal entity. For a
            natural person, do not include this parameter.
        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-forbidden) 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](/merchant-administration/generate-and-activate-api-keys).
      in: header
      name: X-Processing-Key

````