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

# Attribute a deposit

> Permissions required: **Deposit Attribution**

Attribute a deposit by providing information about the originator. Only attributions in `PENDING` status can be attributed; on success the status moves from `PENDING` to `UNDER_REVIEW`. For attributions performed via API the attributionType will always be `CLIENT_API`.



## OpenAPI

````yaml /knowledge-base/openapi/v4.yaml patch /deposit-attributions/{depositTransactionId}
openapi: 3.1.0
info:
  title: Anchorage Digital Account APIs (v4)
  version: 4.0.0-beta
  description: >-
    Reference for the Anchorage Digital v4 API, the surface behind Crypto as a
    Service: account management (accounts and the account tree, beneficiaries,
    freeze/unfreeze/close), balances and transactions, trusted destinations,
    orders and allocations, withdrawals, deposit instructions, deposit
    attributions, the policy engine (policies, approval keys), and supported
    asset types. Approval groups, endorsements, compliance profiles, customers
    (onboarding), fee configuration updates, interest enrollment, funding
    allocations, and destination removal are under construction and return
    mocked data only.


    Status: BETA. The v4 API is available in the sandbox only
    (https://api.anchorage-staging.com/v4) and is not available in production
    yet. The contract may change until general availability. Which endpoints are
    live, in final testing, or under construction:
    https://docs.anchorage.com/platform/developers/caas/caas-overview


    Authentication: every request carries an `Api-Access-Key` header. Every
    POST, PATCH, and DELETE additionally requires an `Idempotency-Key`, and is
    signed with `Api-Signature` (hex-encoded Ed25519 over
    `timestamp_epoch_seconds + uppercase(http_method) + request_path +
    request_body`) plus `Api-Timestamp` (unix epoch seconds).


    Pagination: list endpoints accept `after` (cursor) and `limit` (page size, 1
    to 1000, default 100) and return a `page.endCursor` to continue from. Errors
    use a common envelope with a human-readable `message`; batch endpoints
    return a result per item instead.


    Guides: https://docs.anchorage.com/platform/developers/caas/caas-overview
servers:
  - url: https://api.anchorage-staging.com/v4
security:
  - Api-Access-Key: []
tags:
  - name: Accounts
  - name: Compliance Profiles
  - name: Balances
  - name: Transactions
  - name: Trusted Destinations
  - name: Orders & Allocations
  - name: Withdrawals
  - name: Deposit Instructions
  - name: Deposit Attributions
  - name: Policies
  - name: Approval Groups
  - name: Endorsements
  - name: Customers
  - name: Asset Types
paths:
  /deposit-attributions/{depositTransactionId}:
    patch:
      tags:
        - Deposit Attributions
      summary: Attribute a deposit
      description: >-
        Permissions required: **Deposit Attribution**


        Attribute a deposit by providing information about the originator. Only
        attributions in `PENDING` status can be attributed; on success the
        status moves from `PENDING` to `UNDER_REVIEW`. For attributions
        performed via API the attributionType will always be `CLIENT_API`.
      operationId: performDepositAttribution
      parameters:
        - name: depositTransactionId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9A-Fa-f]+$
            description: >-
              The 32-character hexadecimal transactionId where the
              transactionType is `DEPOSIT`
            example: 0e2b2f9d8d104f1e960b28567255045f
          description: The transactionId where the transactionType is `DEPOSIT`.
        - name: Idempotency-Key
          in: header
          schema:
            type: string
          required: true
          description: >-
            Client-supplied key that deduplicates retried requests. Reusing a
            key returns the original result instead of repeating the action.
        - name: Api-Signature
          in: header
          required: true
          schema:
            type: string
            pattern: ^[0-9A-Fa-f]{128,160}$
          description: >-
            A hex-encoded Ed25519 signature of `timestamp_epoch_seconds +
            uppercase(http_method) + request_path + request_body`.
        - name: Api-Timestamp
          in: header
          required: true
          schema:
            type: integer
            format: int64
          description: Current timestamp, represented as unix epoch seconds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerformDepositAttributionRequest'
      responses:
        '200':
          description: Deposit attributed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformDepositAttributionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
components:
  schemas:
    PerformDepositAttributionRequest:
      title: Perform Deposit Attribution Request
      type: object
      properties:
        originatorName:
          type: string
          minLength: 1
          description: >-
            The name of the originator of this deposit. This field is required
            in order to perform an attribution.
          example: John Doe
        originatorCountry:
          type: string
          minLength: 2
          maxLength: 2
          description: >-
            The country code ([ISO 3166-1
            alpha-2](https://www.iso.org/iso-3166-country-codes.html)) of the
            originator of this deposit. This field is required in order to
            perform an attribution.
          example: US
        sourceWalletType:
          type: string
          minLength: 1
          enum:
            - CUSTODIAL
            - SELF_HOSTED
          description: "The type of wallet being used by the deposit originator:\n\n\t* `CUSTODIAL` - The wallet owner does not have complete control over the wallet as they do not have the private key; a third party does. This key is needed to conduct transfers. Examples of custodial wallets include: Binance, Coinbase, Kraken, and Bitgo.\n\t* `SELF_HOSTED` - The wallet owner has complete control over the wallet as they have the private key. Examples of self-hosted wallets include: Metamask, Trust Wallet, Ledger Nano X, Trezor One, Electrum, Exodus, and Phantom.\n\n\tThis field is required in order to perform an attribution.\n"
          example: CUSTODIAL
        notes:
          type: string
          description: Additional notes for the deposit attribution.
          example: US
      required:
        - originatorName
        - originatorCountry
        - sourceWalletType
      additionalProperties: false
    PerformDepositAttributionResponse:
      title: Perform Deposit Attribution Response
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/PerformDepositAttributionResult'
    ErrorDetails:
      title: ErrorDetails
      type: object
      properties:
        message:
          description: A human-readable message providing more details about the error.
          example: Missing required field 'amount'.
          type: string
      required:
        - message
    PerformDepositAttributionResult:
      title: Perform Deposit Attribution Result
      type: object
      properties:
        depositTransactionId:
          type: string
          pattern: ^[0-9A-Fa-f]+$
          description: >-
            The 32-character hexadecimal transactionId where the transactionType
            is `DEPOSIT`
          example: 0e2b2f9d8d104f1e960b28567255045f
        status:
          type: string
          description: The confirmation status once the attribution is performed.
          enum:
            - UNDER_REVIEW
          default: UNDER_REVIEW
  securitySchemes:
    Api-Access-Key:
      type: apiKey
      name: Api-Access-Key
      in: header
      description: An API key associated with a security role

````

## Related topics

- [Attribute a deposit](https://docs.anchorage.com/knowledge-base/porto/api-reference/v2/deposit-attribution/attribute-a-deposit.md)
- [Attribute a deposit as spam](https://docs.anchorage.com/knowledge-base/api-reference/v4/deposit-attributions/attribute-a-deposit-as-spam.md)
