# OfferCancel [[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/CancelOffer.cpp) Cancel an [offer](/docs/concepts/tokens/decentralized-exchange/offers) to trade in the decentralized exchange. ## Example JSON ```json { "TransactionType": "OfferCancel", "Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Fee": "12", "Flags": 0, "LastLedgerSequence": 7108629, "OfferSequence": 6, "Sequence": 7 } ``` ## Fields In addition to the [common fields](/docs/references/protocol/transactions/common-fields), transactions use the following fields: | Field | JSON Type | [Internal Type](/docs/references/protocol/binary-format) | Description | | --- | --- | --- | --- | | `OfferSequence` | Number | UInt32 | The sequence number (or [Ticket](/docs/concepts/accounts/tickets) number) of a previous OfferCreate transaction. If specified, cancel any offer object in the ledger that was created by that transaction. It is not considered an error if the offer specified does not exist. | To remove an old offer and replace it with a new one, you can use an [OfferCreate transaction](/docs/references/protocol/transactions/types/offercreate) with an `OfferSequence` parameter, instead of using OfferCancel and another OfferCreate. The OfferCancel method returns [`tesSUCCESS`](/docs/references/protocol/transactions/transaction-results/tes-success) even if it did not find an offer with the matching sequence number. ## See Also - [Offer entry](/docs/references/protocol/ledger-data/ledger-entry-types/offer)