> ## 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 Send Transaction

> Record a token transfer that was executed on-chain

<RequestExample url="https://api.chipipay.com/v1/transactions/record-send" method="POST">
  ```bash cURL theme={null}
  curl -X POST "https://api.chipipay.com/v1/transactions/record-send" \
    -H "Authorization: Bearer sk_prod_xxxx" \
    -H "x-api-key: pk_xxxx" \
    -H "Content-Type: application/json" \
    -d '{
      "transactionHash": "0x1234567890abcdef...",
      "expectedSender": "0x049d365...",
      "expectedRecipient": "0x0abcdef...",
      "expectedToken": "USDC",
      "expectedAmount": "10.5",
      "chain": "STARKNET"
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch(
    "https://api.chipipay.com/v1/transactions/record-send",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer sk_prod_xxxx",
        "x-api-key": "pk_xxxx",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        transactionHash: "0x1234567890abcdef...",
        expectedSender: "0x049d365...",
        expectedRecipient: "0x0abcdef...",
        expectedToken: "USDC",
        expectedAmount: "10.5",
        chain: "STARKNET"
      })
    }
  );

  const transaction = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.chipipay.com/v1/transactions/record-send",
      headers={
          "Authorization": "Bearer sk_prod_xxxx",
          "x-api-key": "pk_xxxx",
          "Content-Type": "application/json"
      },
      json={
          "transactionHash": "0x1234567890abcdef...",
          "expectedSender": "0x049d365...",
          "expectedRecipient": "0x0abcdef...",
          "expectedToken": "USDC",
          "expectedAmount": "10.5",
          "chain": "STARKNET"
      }
  )

  transaction = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Response theme={null}
  {
    "id": "tx_abc123",
    "type": "SEND",
    "chain": "STARKNET",
    "transactionHash": "0x1234567890abcdef...",
    "senderAddress": "0x049d365...",
    "destinationAddress": "0x0abcdef...",
    "token": "USDC",
    "tokenAddress": "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
    "amount": "10500000",
    "status": "PENDING",
    "createdAt": "2025-03-15T10:30:00Z",
    "updatedAt": "2025-03-15T10:30:00Z",
    "apiPublicKey": "pk_xxxx"
  }
  ```
</ResponseExample>

## Notes

* The `expectedAmount` is in human-readable format (e.g., `"10.5"` for 10.5 USDC). The API converts it to raw format internally.
* The transaction is verified on-chain. If the hash doesn't match the expected sender/recipient/amount, the request will fail.


## OpenAPI

````yaml POST /transactions/record-send
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
paths:
  /transactions/record-send:
    post:
      tags:
        - Transactions
      summary: Record Send Transaction
      description: >-
        Record a token transfer transaction that was executed on-chain. This
        creates a transaction record in Chipi for tracking and history purposes.
      operationId: recordSendTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordSendTransactionBody'
      responses:
        '200':
          description: Transaction recorded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    RecordSendTransactionBody:
      type: object
      properties:
        transactionHash:
          type: string
          description: The on-chain transaction hash
        expectedSender:
          type: string
          description: The sender's wallet address
        expectedRecipient:
          type: string
          description: The recipient's wallet address
        expectedToken:
          $ref: '#/components/schemas/ChainToken'
        expectedAmount:
          type: string
          description: The expected transfer amount (human-readable, e.g., "10.5")
        chain:
          $ref: '#/components/schemas/Chain'
      required:
        - transactionHash
        - expectedSender
        - expectedRecipient
        - expectedToken
        - expectedAmount
        - chain
    Transaction:
      type: object
      properties:
        id:
          type: string
          description: Unique transaction identifier
        type:
          type: string
          description: Transaction type
        subType:
          type: string
          description: Transaction sub-type
        chain:
          $ref: '#/components/schemas/Chain'
        transactionHash:
          type: string
          description: On-chain transaction hash
        senderAddress:
          type: string
          description: The sender's wallet address
        destinationAddress:
          type: string
          description: The recipient's wallet address
        contractAddress:
          type: string
          description: The contract that was called
        contractName:
          type: string
        functionName:
          type: string
          description: The contract function that was called
        functionSelector:
          type: string
        token:
          $ref: '#/components/schemas/ChainToken'
        tokenAddress:
          type: string
          description: The token's contract address
        amount:
          type: string
          description: Transfer amount (raw, divide by 10^decimals)
        skuId:
          type: string
          description: SKU ID if this is a service purchase
        skuReference:
          type: string
          description: Reference provided for the SKU purchase
        skuPurchaseAmount:
          type: number
          description: Purchase amount in local currency
        skuPurchaseCurrency:
          $ref: '#/components/schemas/Currency'
        skuFileNumber:
          type: string
          description: File number from the service provider
        status:
          $ref: '#/components/schemas/TxStatus'
        createdAt:
          type: string
          format: date-time
        confirmedAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        apiPublicKey:
          type: string
          description: The API key that created this transaction
        chipiWalletId:
          type: string
          description: Internal wallet ID of the sender
        destinationChipiWalletId:
          type: string
          description: Internal wallet ID of the recipient (if also a Chipi wallet)
      required:
        - id
        - chain
        - transactionHash
        - senderAddress
        - destinationAddress
        - status
        - createdAt
        - updatedAt
        - apiPublicKey
    ChainToken:
      type: string
      enum:
        - USDC
        - USDC_E
        - USDT
        - DAI
        - ETH
        - STRK
        - SLINK
        - ALF
        - BROTHER
        - ARB
        - DOC
        - MXNB
        - WLD
        - WBTC
        - OTHER
      description: Token identifier
    Chain:
      type: string
      enum:
        - STARKNET
        - BASE
        - ARBITRUM
        - OPTIMISM
        - ROOTSTOCK
        - SCROLL
        - WORLDCHAIN
      description: Blockchain network identifier
    Currency:
      type: string
      enum:
        - MXN
        - USD
      description: Fiat currency code
    TxStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - SUCCESS
        - FAILED
        - CANCELLED
      description: Transaction lifecycle status
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
  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)

````