> ## 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.

# Refresh a cash-in deposit code

> Regenerates the deposit code for an existing cash-in that has not yet expired, returning a fresh `cashInCode`. The cash-in's `expiresAt` is unchanged, so a refresh does not buy the customer more time; once it has passed, the request fails with 422 `RefreshExpired`. Pass an Idempotency-Key header to safely retry.

A per-cash-in refresh guard returns 429 when the total-refresh cap is hit (`RefreshLimitReached`) or when refreshed inside the minimum interval (`RefreshTooFrequent`, with a `Retry-After` header) — protecting the upstream provider and bounding stored refresh history.



## OpenAPI

````yaml /api-reference/openapi.yaml post /cash-ins/{cashInId}/refresh
openapi: 3.0.3
info:
  title: Polygon OMS Public API
  version: v26.10.01-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: CashIns
  - name: CashLocation
  - name: Sandbox
  - name: VirtualAccount
  - name: Counterparty
  - name: ExternalAccount
  - name: Reference
  - name: DepositAddress
paths:
  /cash-ins/{cashInId}/refresh:
    post:
      tags:
        - CashIns
      summary: Refresh a cash-in deposit code
      description: >-
        Regenerates the deposit code for an existing cash-in that has not yet
        expired, returning a fresh `cashInCode`. The cash-in's `expiresAt` is
        unchanged, so a refresh does not buy the customer more time; once it has
        passed, the request fails with 422 `RefreshExpired`. Pass an
        Idempotency-Key header to safely retry.


        A per-cash-in refresh guard returns 429 when the total-refresh cap is
        hit (`RefreshLimitReached`) or when refreshed inside the minimum
        interval (`RefreshTooFrequent`, with a `Retry-After` header) —
        protecting the upstream provider and bounding stored refresh history.
      operationId: refreshCashIn
      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'
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidStatusErrorResponse'
        '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:
                $ref: '#/components/schemas/ConcurrentModificationErrorResponse'
        '422':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefreshExpiredErrorResponse'
        '429':
          description: >-
            The cash-in cannot be refreshed because it reached the refresh limit
            or was refreshed too recently.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/RefreshLimitReachedErrorResponse'
                  - $ref: '#/components/schemas/RefreshTooFrequentErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
        '502':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderRefreshFailedErrorResponse'
        '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
        - type
        - status
        - customerId
        - source
        - destination
        - cash
        - location
        - createdAt
        - updatedAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: Cash-in ID (`ci_` prefix).
        object:
          type: string
          enum:
            - cashIn
          description: Resource type discriminator. Always "cashIn".
        type:
          allOf:
            - $ref: '#/components/schemas/TransferType'
          description: Cash-in flavor.
        status:
          allOf:
            - $ref: '#/components/schemas/CashInStatus'
          description: Current lifecycle status of the cash-in.
        subStatus:
          allOf:
            - $ref: '#/components/schemas/CashInSubStatus'
          description: Granular sub-status adding detail behind `status`.
        customerId:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: The OMS customer that owns this record (`cst_` prefix).
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerSummary'
          description: >-
            Display-safe summary of the owning customer (`customer.id` equals
            `customerId`). Omitted when the customer cannot be resolved.
        fixedAmountSide:
          type: string
          enum:
            - source
            - destination
          description: >-
            The side the amount was fixed on when creating the cash-in. OMS
            calculated the other side.
        source:
          allOf:
            - $ref: '#/components/schemas/CashInSource'
          description: 'Where the customer deposits cash: the provider and location.'
        destination:
          allOf:
            - $ref: '#/components/schemas/CashInDestination'
          description: Crypto instrument the converted funds are delivered to.
        cash:
          allOf:
            - $ref: '#/components/schemas/CashInfo'
          description: The cash amount to be deposited.
        location:
          allOf:
            - $ref: '#/components/schemas/CashInLocation'
          description: Resolved detail of the chosen cash location.
        depositInstructions:
          allOf:
            - $ref: '#/components/schemas/CashInDepositInstructions'
          description: >-
            The deposit code and instructions the customer presents at the
            retail location.
        rates:
          allOf:
            - $ref: '#/components/schemas/Rates'
          description: Exchange and effective rates applied to this cash-in.
        sponsorGasCost:
          type: string
          description: >-
            On-chain gas cost for the destination delivery charged to you, as a
            decimal string. Always `"0"` today — OMS absorbs the destination
            gas, and every response reports `sponsorGas: true`.
        omsFeeSchedule:
          allOf:
            - $ref: '#/components/schemas/OmsFeeSchedule'
          description: OMS fee schedule applied to this cash-in.
        transactionId:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: >-
            The Transaction produced once the cash-in completes. Null while
            pending.
        sponsorGas:
          type: boolean
          description: >-
            When `true`, OMS absorbs the on-chain gas cost for the destination
            delivery. Only `true` is currently supported.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Free-form key-value pairs supplied at creation or update.
        developerFees:
          type: array
          items:
            $ref: '#/components/schemas/FeeEntry'
          description: >-
            Echo of the developer fee entries from the originating request.
            `POST /cash-ins` has no `developerFees` field, so this is always
            absent; a `developerFees` key sent on the create request is ignored
            rather than rejected.
        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 reached a terminal state. Null while in progress.
        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
        object: cashIn
        type: fiatToCrypto
        status: pending
        subStatus: order_reserved
        customerId: cst_vfa0nxw6zvyws9g237jrxn4y7k
        customer:
          id: cst_vfa0nxw6zvyws9g237jrxn4y7k
          name: Jane Smith
        source:
          asset: usd
          indicatedAmount: '200.00'
          amountGross: '200.00'
          amountNet: '200.00'
          feesDeducted:
            total: '0.00'
            developer: '0.00'
            oms: '0.00'
            gas: '0.00'
        destination:
          asset: usdc
          network: polygon
          amountGross: '200.00'
          amountNet: '200.00'
          feesDeducted:
            total: '0.00'
            developer: '0.00'
            oms: '0.00'
            gas: '0.00'
          wallet:
            id: wlt_5h4jzzpr9xre3bamd9ca7qyghn
            blockchainAddress: '0x7B3A9F2C4D1eA8bf6390cE5D2b7fA104c8e3D9B1'
        cash:
          locationId: loc_01H9Xd
          locationReference: R1JFRU5ET1QtMjQzNA==
        location:
          name: 'CVS Pharmacy #4521'
          address: 123 Main St, San Francisco, CA 94105
        rates:
          pair: usd/usdc
          exchangeRate: '1.0000'
          effectiveRate: '1.0000'
        depositInstructions:
          cashInCode: 483 291
          locationName: 'CVS Pharmacy #4521'
          locationAddress: 123 Main St, San Francisco, CA 94105
        fixedAmountSide: source
        sponsorGas: true
        sponsorGasCost: '0'
        expiresAt: '2026-05-15T18:32:48Z'
        createdAt: '2026-05-15T17:32:48Z'
        updatedAt: '2026-05-15T17:32:48Z'
    InvalidStatusErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - InvalidStatus
        code:
          type: number
          enum:
            - 10114
        msg:
          type: string
          enum:
            - invalid status value
        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
    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
    RefreshExpiredErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - RefreshExpired
        code:
          type: number
          enum:
            - 10115
        msg:
          type: string
          enum:
            - refresh window has expired; original 24-hour TTL has passed
        cause:
          type: string
    RefreshLimitReachedErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - RefreshLimitReached
        code:
          type: number
          enum:
            - 10117
        msg:
          type: string
          enum:
            - cash-in has already been refreshed the maximum number of times
        cause:
          type: string
    RefreshTooFrequentErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - RefreshTooFrequent
        code:
          type: number
          enum:
            - 10118
        msg:
          type: string
          enum:
            - minimum interval between refreshes has not yet elapsed
        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
    ProviderRefreshFailedErrorResponse:
      type: object
      required:
        - error
        - code
        - msg
      properties:
        error:
          type: string
          enum:
            - ProviderRefreshFailed
        code:
          type: number
          enum:
            - 10116
        msg:
          type: string
          enum:
            - failed to refresh deposit code; old code remains valid
        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
    TransferType:
      type: string
      enum:
        - cryptoToCrypto
        - fiatToCrypto
        - cryptoToFiat
      description: >-
        Direction of value across rails: cryptoToCrypto, fiatToCrypto, or
        cryptoToFiat. Retained for resources not yet on the
        `SourceToDestination` shape (onramp/cash-in, customer filters).
    CashInStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
        - expired
      description: >-
        Lifecycle of a cash-in. pending: code issued, awaiting deposit.
        processing: cash deposited, conversion underway. completed: converted
        and delivered. failed: the deposit or conversion did not succeed.
        expired: the code expired before any deposit.
    CashInSubStatus:
      type: string
      enum:
        - order_reserved
        - settled
        - cash_deposit_expired
        - cash_deposit_failed
        - provider_order_failed
        - provider_order_template_error
      description: >-
        Granular sub-status for a cash-in. Adds detail behind the coarse status
        field.
    CustomerSummary:
      type: object
      required:
        - id
        - name
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: The OMS customer id (`cst_` prefix).
        name:
          type: string
          description: Customer display name.
      description: >-
        Display-safe summary of a customer — ID plus display name only. Enables
        one-request list rendering: a page of rows needs no per-row detail
        queries. Always the record's owning customer, not whichever side a party
        sits on.
    CashInSource:
      type: object
      required:
        - asset
      properties:
        asset:
          type: string
          description: Canonical asset identifier.
        network:
          type: string
          description: Network identifier.
        email:
          type: string
          description: Email address.
        indicatedAmount:
          type: string
          description: The cash amount the customer indicated they will deposit.
        amount:
          type: string
          description: Amount as a decimal string.
        amountGross:
          type: string
          description: Amount on this side before fees are applied.
        amountNet:
          type: string
          description: >-
            Amount after fees - what is actually pulled from a source, or
            delivered to a destination.
        feesDeducted:
          $ref: '#/components/schemas/FeesDeducted'
      description: 'Cash side of a cash-in: the fiat asset and amounts.'
    CashInDestination:
      type: object
      properties:
        wallet:
          $ref: '#/components/schemas/CashInDestinationWallet'
        asset:
          type: string
          description: Canonical asset identifier.
        network:
          type: string
          description: Network identifier.
        amountGross:
          type: string
          description: Amount on this side before fees are applied.
        amountNet:
          type: string
          description: >-
            Amount after fees - what is actually pulled from a source, or
            delivered to a destination.
        feesDeducted:
          $ref: '#/components/schemas/FeesDeducted'
      description: The crypto destination a cash-in is converted to and delivered to.
    CashInfo:
      type: object
      required:
        - locationId
        - locationReference
      properties:
        locationId:
          type: string
          description: Cash location ID from `GET /cash-locations`.
        locationReference:
          type: string
          description: Provider reference for the location, from `GET /cash-locations`.
      description: >-
        The retail location chosen for the deposit, by ID and provider
        reference.
    CashInLocation:
      type: object
      properties:
        name:
          type: string
          description: Display name.
        address:
          type: string
          description: Postal address.
      description: Resolved retail location detail.
    CashInDepositInstructions:
      type: object
      required:
        - cashInCode
      properties:
        cashInCode:
          type: string
          description: Machine-readable code the customer presents at the register.
        locationName:
          type: string
          description: Display name of the retail location.
        locationAddress:
          type: string
          description: Street address of the retail location.
      description: >-
        The deposit code and retail location a customer uses to complete a
        cash-in.
    Rates:
      type: object
      required:
        - pair
        - exchangeRate
        - effectiveRate
      properties:
        pair:
          type: string
          description: Asset pair string, e.g. "usdc/usd".
        exchangeRate:
          type: string
          description: Units of destination asset per 1 unit of source asset.
        effectiveRate:
          type: string
          description: All-in rate inclusive of all fees on both sides.
      description: Exchange and effective rates.
    OmsFeeSchedule:
      type: object
      required:
        - feeCurrency
        - entries
      properties:
        feeCurrency:
          type: string
          description: Currency the fee lines are denominated in.
        entries:
          type: array
          items:
            $ref: '#/components/schemas/OmsFeeEntry'
          description: Individual fee lines.
      description: The OMS fee lines applied, denominated in `feeCurrency`.
    FeeEntry:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier assigned by OMS. Present on responses only.
        percentage:
          type: string
          description: Percentage fee as a decimal rate. "0.02" = 2%.
        flatFee:
          type: string
          description: Fixed fee in USD. Converted to fee-side asset at the exchange rate.
        amount:
          type: string
          description: Computed fee amount for this entry. Present on responses only.
        payoutAsset:
          type: string
          enum:
            - usdc
            - usdt
          description: Crypto asset for fee payout. Defaults to "usdc".
        wallet:
          type: string
          description: OMS wallet to receive this fee.
      description: >-
        A single developer fee entry. At least one of percentage or flatFee is
        required.
    FeesDeducted:
      type: object
      required:
        - total
        - developer
        - oms
        - gas
      properties:
        total:
          type: string
        developer:
          type: string
          description: >-
            Per-side aggregated developer fee total in this side's asset. Always
            "0" in alpha - alpha invariant, mirrors the gas line.
        oms:
          type: string
        gas:
          type: string
      description: >-
        Per-side breakdown of fees deducted in-line from the transaction.
        End-of-month billable fees will be reported separately in the future
        (planned `feesInvoice` sibling). Denominated in that side's asset.
    CashInDestinationWallet:
      type: object
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/typeId'
          description: Unique identifier.
        externalAccount:
          type: string
          description: Registered External Account receiving the funds, when applicable.
        blockchainAddress:
          type: string
          description: >-
            On-chain address. For an EVM network the address must be
            all-lowercase, all-uppercase, or a valid EIP-55 checksummed form; an
            inconsistent mixed-case address is rejected as a likely casing typo,
            and the zero address is rejected. Solana/SUI are validated per their
            own network rules.
      description: The wallet receiving the converted funds.
    OmsFeeEntry:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: Type discriminator.
        rate:
          type: string
          description: Fee rate as a decimal.
        amount:
          type: string
          description: Amount as a decimal string.
      description: A single OMS fee line.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token from POST /auth/token

````