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

# Cancel a cash-in

> Cancels a cash-in that is still `pending`: the deposit code stops working and the cash-in becomes `cancelled`, announced by `cashIn.statusChanged`. The cancel takes effect only when the provider confirms it deleted the code. When the customer scans the code while the cancel is in flight, the cash-in becomes `processing` and the request fails with 409 `CashInAlreadyScanned`; when the code had already expired the cash-in becomes `expired` and the request fails with 409 `CashInExpired`. A cash-in that is `processing` or already final fails with 409 `CashInNotCancellable` and nothing changes. When the provider cannot be reached the cash-in stays `pending` and the request can be retried. Pass an Idempotency-Key header to safely retry.



## OpenAPI

````yaml /api-reference/openapi.yaml post /cash-ins/{cashInId}/cancel
openapi: 3.0.3
info:
  title: Polygon OMS Public API
  version: v26.11.3-0001
  description: >-
    Unified API for moving money between crypto and fiat. Three ways to move
    money: Transactions (instant, wallet or card funded, including Cash-In for
    in-person cash deposits), Deposit Addresses (reusable crypto deposit
    configurations), and Virtual Accounts (dedicated bank accounts that
    auto-convert fiat to crypto). Standard transactions follow a two-step flow:
    create a Quote (pricing), then create a Transaction (execution). Cash-in
    codes generate a one-time deposit code for in-person cash deposits at retail
    locations.
  contact:
    name: Polygon OMS
    url: https://oms.polygon.technology
servers:
  - url: https://sandbox-api.polygon.technology/v0.13
    description: Sandbox
  - url: https://api.polygon.technology/v0.13
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Auth
    description: Authentication via OMS API key and secret
  - name: Customers
    description: Customer management and KYC
  - name: Customer
  - name: Wallet
  - name: Quote
  - name: Transaction
  - name: Transfer
  - name: CashIns
  - name: CashLocation
  - name: Sandbox
  - name: VirtualAccount
  - name: Counterparty
  - name: ExternalAccount
  - name: Reference
  - name: DepositAddress
  - name: Indexer
    description: >-
      Read token balances, prices, and transaction history across EVM networks,
      Solana, and Tron. Indexer methods are webRPC calls: each is a `POST` with
      a JSON body, served at `/v1/{Service}/{Method}` on the API host rather
      than under the `/v0.13` base path. Authenticate with a publishable key in
      the `Api-Key` header, or with a bearer token from `POST /auth/token`.
paths:
  /cash-ins/{cashInId}/cancel:
    post:
      tags:
        - CashIns
      summary: Cancel a cash-in
      description: >-
        Cancels a cash-in that is still `pending`: the deposit code stops
        working and the cash-in becomes `cancelled`, announced by
        `cashIn.statusChanged`. The cancel takes effect only when the provider
        confirms it deleted the code. When the customer scans the code while the
        cancel is in flight, the cash-in becomes `processing` and the request
        fails with 409 `CashInAlreadyScanned`; when the code had already expired
        the cash-in becomes `expired` and the request fails with 409
        `CashInExpired`. A cash-in that is `processing` or already final fails
        with 409 `CashInNotCancellable` and nothing changes. When the provider
        cannot be reached the cash-in stays `pending` and the request can be
        retried. Pass an Idempotency-Key header to safely retry.
      operationId: cancelCashIn
      parameters:
        - name: cashInId
          in: path
          required: true
          description: Cash-in ID (`ci_` prefix).
          schema:
            type: string
        - $ref: '#/components/parameters/IdempotencyKeyHeader'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CashIn'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CashInNotFoundErrorResponse'
        '409':
          description: The request conflicts with the current state of the server.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CashInAlreadyScannedErrorResponse'
                  - $ref: '#/components/schemas/CashInExpiredErrorResponse'
                  - $ref: '#/components/schemas/CashInNotCancellableErrorResponse'
                  - $ref: '#/components/schemas/ConcurrentModificationErrorResponse'
        '422':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectMissingCoinmeIDErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
        '502':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderRequestFailedErrorResponse'
        '503':
          description: Service unavailable.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ProviderTimeoutErrorResponse'
                  - $ref: '#/components/schemas/ProviderUnavailableErrorResponse'
components:
  parameters:
    IdempotencyKeyHeader:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        Required on POST and PUT requests. Use a unique value per logical
        mutation attempt, for example a UUID.
      schema:
        type: string
  schemas:
    CashIn:
      type: object
      required:
        - id
        - status
        - customer
        - source
        - destination
        - depositInstructions
        - pricing
        - createdAt
        - updatedAt
        - expiresAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: Cash-in ID (`ci_` prefix).
        status:
          allOf:
            - $ref: '#/components/schemas/CashInStatus'
          description: Current lifecycle status of the cash-in.
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerRef'
          description: The customer that owns this record.
        failure:
          allOf:
            - $ref: '#/components/schemas/Reason'
          description: Why the cash-in failed. Present only when `status` is `failed`.
        source:
          allOf:
            - $ref: '#/components/schemas/CashInstrument'
          description: The retail location the customer deposits cash at.
        destination:
          allOf:
            - $ref: '#/components/schemas/CashInDestinationInstrument'
          description: The customer's wallet the converted funds are delivered to.
        depositInstructions:
          allOf:
            - $ref: '#/components/schemas/CashInDepositInstructions'
          description: The code the customer presents at the retail location.
        pricing:
          allOf:
            - $ref: '#/components/schemas/Pricing'
          description: >-
            The cash amount, what arrives in the wallet, the rate and the fees.
            `pricing.source.amount` is the indicated amount before the cash is
            paid, then the amount authorised at the register once the cash is
            paid.
        transactionId:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: >-
            The Transaction linked to this cash-in. Set once the linked
            transaction exists; null while pending.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Free-form key-value pairs supplied at creation or update.
        createdAt:
          type: string
          format: date-time
          description: When the cash-in was created.
        updatedAt:
          type: string
          format: date-time
          description: When the cash-in was last updated.
        completedAt:
          type: string
          format: date-time
          description: >-
            When the cash-in completed. Present only when `status` is
            `completed`.
        consumedAt:
          type: string
          format: date-time
          description: >-
            Leg 1 start: when the customer scanned the cash-in code at the
            retail location.
        fulfilledAt:
          type: string
          format: date-time
          description: >-
            Leg 1 done: when the cash was loaded and the provider can no longer
            cancel it.
        buyConfirmedAt:
          type: string
          format: date-time
          description: 'Leg 2 done: when the crypto purchase was confirmed.'
        expiresAt:
          type: string
          format: date-time
          description: >-
            Expiry of the `cashInCode` — the single expiry field for a cash-in.
            Refreshing the cash-in issues a new `cashInCode` but does not extend
            this expiry. Once it has passed, the cash-in can no longer be
            refreshed.
      description: >-
        A code-based cash deposit. The customer takes the issued code to a
        retail location and deposits cash, which OMS converts to crypto and
        delivers to the destination. Amounts start as estimates and are
        finalized once the cash is deposited.
      example:
        id: ci_44vxe2xk8gfsjehfcw3npt5bg8
        status: pending
        customer:
          id: cst_vfa0nxw6zvyws9g237jrxn4y7k
        source:
          type: cash
          asset: usd
          details:
            locationId: loc_01H9Xd
            locationName: 'CVS Pharmacy #4521'
            locationAddress:
              line1: 123 Main St
              city: San Francisco
              state: CA
              zipCode: '94105'
              country: US
            locationProvider: greendot
        destination:
          type: walletCrypto
          id: wlt_5h4jzzpr9xre3bamd9ca7qyghn
          asset: usdc
          network: polygon
          details:
            address: '0x7b3a9f2c4d1ea8bf6390ce5d2b7fa104c8e3d9b1'
        pricing:
          source:
            asset: usd
            amount: '200.00'
          destination:
            asset: usdc
            amount: '200.000000'
          fees: []
          exchangeRate: '1.0000'
          fixedAmountSide: source
          sponsorGas: true
        depositInstructions:
          cashInCode: 483 291
        expiresAt: '2026-05-15T18:32:48Z'
        createdAt: '2026-05-15T17:32:48Z'
        updatedAt: '2026-05-15T17:32:48Z'
    UnauthorizedErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - Unauthorized
        code:
          type: number
          enum:
            - 1000
        msg:
          type: string
          enum:
            - unauthorized access
        cause:
          type: string
    CashInNotFoundErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - CashInNotFound
        code:
          type: number
          enum:
            - 10113
        msg:
          type: string
          enum:
            - cash-in not found
        cause:
          type: string
    CashInAlreadyScannedErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - CashInAlreadyScanned
        code:
          type: number
          enum:
            - 10390
        msg:
          type: string
          enum:
            - the cash-in's code was already scanned at the cash location
        cause:
          type: string
    CashInExpiredErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - CashInExpired
        code:
          type: number
          enum:
            - 10392
        msg:
          type: string
          enum:
            - the cash-in has expired
        cause:
          type: string
    CashInNotCancellableErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - CashInNotCancellable
        code:
          type: number
          enum:
            - 10391
        msg:
          type: string
          enum:
            - only a pending cash-in can be cancelled
        cause:
          type: string
    ConcurrentModificationErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ConcurrentModification
        code:
          type: number
          enum:
            - 10232
        msg:
          type: string
          enum:
            - >-
              pair changed since it was inspected; re-read its status and retry
              with the current version
        cause:
          type: string
    ProjectMissingCoinmeIDErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ProjectMissingCoinmeID
        code:
          type: number
          enum:
            - 10073
        msg:
          type: string
          enum:
            - project is not enrolled with a custodial wallet provider
        cause:
          type: string
    InternalErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - Internal
        code:
          type: number
          enum:
            - 10124
        msg:
          type: string
          enum:
            - internal error
        cause:
          type: string
    ProviderRequestFailedErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ProviderRequestFailed
        code:
          type: number
          enum:
            - 10375
        msg:
          type: string
          enum:
            - the provider could not complete the request
        cause:
          type: string
    ProviderTimeoutErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ProviderTimeout
        code:
          type: number
          enum:
            - 10021
        msg:
          type: string
          enum:
            - the provider's refresh service did not respond in time
        cause:
          type: string
    ProviderUnavailableErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ProviderUnavailable
        code:
          type: number
          enum:
            - 10121
        msg:
          type: string
          enum:
            - cash location provider is temporarily unavailable
        cause:
          type: string
    typeId:
      type: string
      pattern: >-
        ^[a-z]+_([0-9a-hjkmnp-tv-z]{26}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$
      description: Public TypeID, e.g. `txn_01h455vb4pex5vsknk084sn02q`.
      x-go-type: string
    CashInStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
        - expired
        - cancelled
      description: >-
        Lifecycle of a cash-in. pending: code issued, awaiting the register
        scan. processing: the barcode was scanned and the purchase outcome is
        pending. completed: converted and delivered. failed: the deposit or
        conversion did not succeed. expired: the code expired before any
        deposit. cancelled: cancelled by the partner, or superseded by a new
        cash-in, before the code was scanned, or voided by the cashier after the
        scan but before the cash was loaded (`fulfilledAt` unset).
    CustomerRef:
      type: object
      required:
        - id
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: The customer id (`cst_` prefix).
      description: >-
        The customer, referenced by id; its name and details are on the customer
        resource.
    Reason:
      type: object
      required:
        - code
        - message
        - retryable
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/ReasonCode'
          description: What went wrong.
        message:
          type: string
          description: A fixed, vendor-neutral sentence for `code`.
        retryable:
          type: boolean
          description: Whether trying the same thing again can succeed.
        bankCode:
          type: string
          description: >-
            The bank's own return code, only on an external account a bank
            return made invalid.
      description: >-
        Why a resource failed, was rejected or became invalid. `message` and
        `retryable` are fixed for each `code`.
    CashInstrument:
      type: object
      required:
        - type
        - asset
      properties:
        type:
          type: string
          enum:
            - cash
        asset:
          type: string
          description: Lowercase asset.
        details:
          $ref: '#/components/schemas/CashInstrumentDetails'
      description: A cash location. It has no id; the location is in `details`.
      title: Cash
    CashInDestinationInstrument:
      type: object
      oneOf:
        - $ref: '#/components/schemas/WalletCryptoInstrument'
        - $ref: '#/components/schemas/WalletExternalInstrument'
      discriminator:
        propertyName: type
        mapping:
          walletCrypto: '#/components/schemas/WalletCryptoInstrument'
          walletExternal: '#/components/schemas/WalletExternalInstrument'
      description: >-
        The wallet a cash-in delivers to: an OMS wallet given by id, or an
        address given without one.
    CashInDepositInstructions:
      type: object
      required:
        - cashInCode
      properties:
        cashInCode:
          type: string
          description: Machine-readable code the customer presents at the register.
      description: The deposit code a customer presents at the retail location.
    Pricing:
      type: object
      required:
        - fees
      properties:
        source:
          allOf:
            - $ref: '#/components/schemas/PricingSide'
          description: The source side, in the source asset.
        destination:
          allOf:
            - $ref: '#/components/schemas/PricingSide'
          description: The destination side, in the destination asset.
        fees:
          type: array
          items:
            $ref: '#/components/schemas/PricingFee'
          description: >-
            Every fee charged across both sides. `[]` when there are none —
            never omitted, never null.
        exchangeRate:
          type: string
          description: >-
            Mid-market rate from the source asset to the destination asset, set
            together with the destination amount. Identity: (source.amount − Σ
            source fees) × exchangeRate = destination.amount + Σ destination
            fees.
        fixedAmountSide:
          type: string
          enum:
            - source
            - destination
          description: >-
            The side whose amount was fixed at creation. OMS calculated the
            other side.
        sponsorGas:
          type: boolean
          description: >-
            Present and `true` when OMS absorbs the destination gas cost;
            omitted otherwise.
      description: >-
        Consolidated economics for a quote, transaction or cash-in: per-side
        amounts, a flat fee list, the mid-market rate and gas sponsorship.
    ReasonCode:
      type: string
      enum:
        - providerError
        - providerRejected
        - providerTimeout
        - expired
        - systemError
        - provisioningTimeout
        - insufficientFunds
        - providerAmountBelowMinimum
        - limitExceeded
        - outsideSellBounds
        - outsideSellVelocityBounds
        - unusableAmount
        - unsupportedCorridor
        - outgoingRailNotEnabled
        - ssnNotVerified
        - riskRejected
        - cardDeclined
        - bankSellDeclined
        - payoutFailed
        - priceMoved
        - returningToSender
        - returnedToSender
        - returnFailed
        - depositFailed
        - attributionTimeout
        - assetMismatch
        - chainMismatch
        - misattributedArrival
        - depositAddressNotActive
        - virtualAccountNotActive
        - counterpartyArchived
        - destinationUnavailable
        - walletClaimed
        - walletBoundToCustodialFlow
        - projectSuspended
        - memoInvalid
        - cashDepositFailed
        - noMatchingNetwork
        - blockchainAddressInUse
        - bankAccountInUse
        - bankAccountRejected
        - deletePendingTimeout
        - providerAccountMissing
        - cardInUse
        - cardLimitReached
        - countryProhibited
        - countryNotSupported
        - cardVerificationDeclined
        - bankVerificationDeclined
        - accountClosed
        - accountFrozenByBank
        - routingOrAccountNumberInvalid
        - accountHolderDeceased
        - accountDoesNotSupportTransfers
        - payeeNameMismatch
        - walletUnreachableOnNetwork
        - billingAddressMismatch
        - cardExpired
        - cardClosedOrLostStolen
        - pushToCardUnsupported
        - cardDeclinedByIssuer
      description: The reasons a resource reports in `failure`.
    CashInstrumentDetails:
      type: object
      properties:
        locationId:
          type: string
        locationName:
          type: string
        locationAddress:
          $ref: '#/components/schemas/Address'
        locationProvider:
          type: string
          description: >-
            The cash network the location belongs to, lowercase, such as
            `greendot`.
      description: Cash location details.
    WalletCryptoInstrument:
      type: object
      required:
        - type
        - asset
        - network
      properties:
        type:
          type: string
          enum:
            - walletCrypto
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: >-
            The wallet (`wlt_`); an older wallet keeps its original `wlt_<uuid>`
            id. Left out while a deposit's receiving wallet is not resolved yet.
        asset:
          type: string
          description: Lowercase asset.
        network:
          type: string
          description: Lowercase blockchain.
        owner:
          $ref: '#/components/schemas/InstrumentOwner'
        details:
          $ref: '#/components/schemas/WalletCryptoInstrumentDetails'
      description: An OMS-custodied crypto wallet.
      title: OMS wallet
    WalletExternalInstrument:
      type: object
      required:
        - type
        - asset
        - network
      properties:
        type:
          type: string
          enum:
            - walletExternal
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: >-
            The external account (`ext_`). Left out for a sender OMS has no
            record of.
        asset:
          type: string
          description: Lowercase asset.
        network:
          type: string
          description: Lowercase blockchain.
        owner:
          $ref: '#/components/schemas/InstrumentOwner'
        details:
          $ref: '#/components/schemas/WalletExternalInstrumentDetails'
      description: A crypto wallet OMS does not custody.
      title: External wallet
    PricingSide:
      type: object
      required:
        - asset
      properties:
        amount:
          type: string
          description: >-
            On the source, the gross amount the customer pays; on the
            destination, the amount that arrives. A decimal string at the
            asset's precision. Always set on the source; set on the destination
            once priced.
        asset:
          type: string
          description: >-
            Lowercase asset of this side, the same as the side's instrument
            asset.
      description: >-
        One side of `pricing`, in that side's asset. Fees are listed in
        `Pricing.fees`.
    PricingFee:
      type: object
      required:
        - type
        - side
        - asset
        - amount
      properties:
        type:
          type: string
          description: >-
            Fee kind. OPEN — clients must tolerate an unrecognised type. Known
            values today: "developer", "oms", "gas".
        side:
          type: string
          enum:
            - source
            - destination
          description: Which side this fee was deducted from.
        asset:
          type: string
          description: Currency this fee is denominated in — that side's asset.
        amount:
          type: string
          description: Fee amount in `asset`, at the asset's precision.
      description: >-
        A fee charged on one side of a quote, transaction or cash-in. A fee is
        listed only when it is not zero.
    Address:
      type: object
      properties:
        line1:
          type: string
          description: Street address, line 1.
        line2:
          type: string
          description: Street address, line 2.
        city:
          type: string
          description: City.
        state:
          type: string
          description: State / province / region.
        country:
          type: string
          description: ISO 3166-1 alpha-2
        zipCode:
          type: string
          description: ZIP / postal code.
      description: A postal address. country is an ISO 3166-1 alpha-2 country code.
    InstrumentOwner:
      type: object
      required:
        - kind
        - id
      properties:
        kind:
          type: string
          enum:
            - counterparty
            - customer
          description: '`counterparty`, or `customer` for another customer''s account.'
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: The counterparty (`ctp_`) or customer (`cst_`).
        name:
          type: string
          description: >-
            The counterparty's name. A customer's name is on the customer
            resource.
      description: Who owns an account that is not the resource's customer's.
    WalletCryptoInstrumentDetails:
      type: object
      properties:
        address:
          type: string
          description: On-chain address.
      description: OMS crypto wallet details.
    WalletExternalInstrumentDetails:
      type: object
      properties:
        address:
          type: string
          description: On-chain address.
        custodian:
          type: string
          description: Who custodies the wallet, in lowerCamelCase.
        otherCustodian:
          type: string
          description: The custodian's name when `custodian` is `other`.
        networkFamily:
          $ref: '#/components/schemas/NetworkFamily'
      description: External wallet details.
    NetworkFamily:
      type: string
      enum:
        - evm
        - solana
        - tron
      description: >-
        Crypto network family for a registered external wallet. A walletExternal
        is registered per family (an EVM address is valid across every EVM
        chain), and the registration covers every served network in that family.
        A create for a family the provider that provisions this project's
        walletExternal accounts does not serve is refused before anything is
        written, with 422 `NetworkFamilyNotServed`; depending on the provider,
        the refusal can be 403 `VendorConfigMissing` instead.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token from POST /auth/token

````