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

# Record Cross-chain Withdrawal

> Record a withdrawal burn (Starknet to an EVM chain or Solana); Chipi verifies it against the burn itself

```bash cURL theme={null}
curl -X POST "https://api.chipipay.com/v1/transactions/record-cross-chain-withdrawal" \
  -H "Authorization: Bearer sk_prod_xxxx" \
  -H "x-api-key: pk_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "burnTxHash": "0x07d61890...",
    "walletAddress": "0x03329497...",
    "destChain": "Base",
    "destDomain": 6,
    "recipient": "0x879f50787Ab4A36aA3cDf971691BFC8058DA203c",
    "token": "USDC",
    "amount": "7.810000",
    "feeBps": 12,
    "finality": "fast"
  }'
```

```json 200 Response theme={null}
{
  "burnTxHash": "0x07d61890...",
  "destChain": "Base",
  "destDomain": 6,
  "recipient": "0x879f50787Ab4A36aA3cDf971691BFC8058DA203c",
  "recipientOwner": null,
  "amount": "7.81",
  "status": "PENDING",
  "destTxHash": null,
  "sponsoredByChipi": true,
  "feeBps": 12,
  "finality": "fast",
  "verifiedOnChain": true
}
```

> [!WARNING]
>
> The values you send are what your client believes. Chipi reads the burn's own `DepositForBurn` event: the burn must be USDC from `walletAddress`, and its amount, destination domain and mint recipient replace yours (for Solana, the recipient must be `recipientOwner`'s USDC token account). `feeBps` is capped at Circle's live fee. When the receipt is not indexed yet, your values are stored with `verifiedOnChain: false` and finalize verifies them before any USDC moves.


## OpenAPI

````yaml POST /transactions/record-cross-chain-withdrawal
openapi: 3.1.0
info:
  title: Chipi Pay API
  description: >-
    REST API for creating self-custodial wallets, executing gasless
    transactions, and purchasing services on Starknet.
  version: 14.0.0
  license:
    name: MIT
servers:
  - url: https://api.chipipay.com/v1
security:
  - bearerAuth: []
    apiKeyAuth: []
tags:
  - name: Wallets
    description: Create and manage self-custodial Starknet wallets
  - name: Transactions
    description: Record and query blockchain transactions
  - name: SKUs
    description: Browse available services for purchase
  - name: SKU Purchases
    description: Purchase services using blockchain payments
  - name: Exchanges
    description: Currency conversion rates
  - name: Cross-chain
    description: >-
      USDC in and out of a Chipi wallet through Circle's CCTP V2 (Base and other
      EVM chains, Solana)
paths:
  /transactions/record-cross-chain-withdrawal:
    post:
      tags:
        - Cross-chain
      summary: Record Cross-chain Withdrawal
      description: >-
        Record a withdrawal burn (Starknet → EVM or Solana) after the wallet's
        gasless deposit_for_burn. Chipi reads the burn's own DepositForBurn
        event: it must burn USDC from walletAddress, and its amount, destination
        domain and mint recipient replace the values sent here (for Solana the
        recipient must be the owner's USDC token account). feeBps is capped at
        Circle's live fee. If the receipt is not indexed yet the client's values
        are stored unverified and finalize verifies them. Idempotent on the burn
        hash.
      operationId: recordCrossChainWithdrawal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordCrossChainWithdrawalBody'
      responses:
        '200':
          description: Withdrawal recorded (PENDING)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrossChainWithdrawal'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Wallet not found for this API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    RecordCrossChainWithdrawalBody:
      type: object
      properties:
        burnTxHash:
          type: string
          description: The Starknet deposit_for_burn transaction hash. Idempotency key.
        walletAddress:
          type: string
          description: >-
            The Chipi wallet that burned. The burn's DepositForBurn event must
            name it as the depositor.
        destChain:
          type: string
          description: Destination chain label, e.g. "Base"
        destDomain:
          type: integer
          description: >-
            Circle CCTP domain of the destination chain. Replaced by the burn's
            own value.
        recipient:
          type: string
          description: >-
            Destination address (EVM) or Solana owner. For EVM, replaced by the
            burn's own mint recipient.
        recipientOwner:
          type: string
          description: 'Solana only: the owner whose USDC token account the burn mints to'
        token:
          $ref: '#/components/schemas/ChainToken'
        amount:
          type: string
          description: >-
            Human USDC amount, e.g. "7.810000". Replaced by the burn's own
            amount.
        feeBps:
          type: number
          description: >-
            The fee quoted for this route, in basis points. Capped at Circle's
            live fee.
        finality:
          $ref: '#/components/schemas/CctpFinality'
      required:
        - burnTxHash
        - walletAddress
        - destChain
        - destDomain
        - recipient
        - token
        - amount
    CrossChainWithdrawal:
      type: object
      properties:
        burnTxHash:
          type: string
        destChain:
          type: string
        destDomain:
          type: integer
        recipient:
          type: string
        recipientOwner:
          type: string
          nullable: true
        amount:
          type: string
          description: Human USDC
        status:
          type: string
          enum:
            - PENDING
            - COMPLETE
            - FAILED
        destTxHash:
          type: string
          nullable: true
          description: The destination receiveMessage transaction, once COMPLETE
        failureReason:
          type: string
          nullable: true
        sponsoredByChipi:
          type: boolean
        feeBps:
          type: number
          nullable: true
        finality:
          type: string
          nullable: true
        verifiedOnChain:
          type: boolean
          description: >-
            Whether amount, destDomain and recipient were read from the burn's
            own DepositForBurn event
      required:
        - burnTxHash
        - destChain
        - destDomain
        - recipient
        - amount
        - status
        - sponsoredByChipi
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
    ChainToken:
      type: string
      enum:
        - USDC
        - USDC_E
        - USDT
        - DAI
        - ETH
        - STRK
        - SLINK
        - ALF
        - BROTHER
        - ARB
        - DOC
        - MXNB
        - WLD
        - WBTC
        - OTHER
      description: Token identifier
    CctpFinality:
      type: string
      enum:
        - fast
        - standard
      description: >-
        fast: Circle attests after a few confirmations, for a fee taken from the
        amount. standard: free, attested at the source chain's hard finality.
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized — invalid or missing API key / bearer token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded (100 requests/minute per API key)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token — use your secret key (sk_prod_xxx) for server-side calls,
        or the user's JWT for client-side calls
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Chipi public API key (pk_xxx)

````

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