> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/intents/cancel-intent/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Cancel an Intent POST https://api.sandbox.mangopay.com/v3.0/{ClientId}/payins/intents/{IntentId}/cancel Content-Type: application/json Cancel all or part of an authorized Intent You can use this endpoint to cancel all or part of an Intent **before** it has been captured. You can only call this endpoint if the Intent has the `Status` of `AUTHORIZED`. You cannot cancel an Intent if it has been captured in part (`PARTIALLY_CAPTURED`) or full (`CAPTURED`). Reference: https://docs.mangopay.com/api-reference/intents/cancel-intent ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL. ## Servers - `https://api.sandbox.mangopay.com` (Sandbox, default) - `https://api.mangopay.com` (Production) - `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox) - `https://api-mtls.mangopay.com` (mTLS Production) ## Request ### Path parameters - `ClientId` (string, required) — Platform's API account identifier, associated with the API key. - `IntentId` (string, required) — The unique identifier of the Intent. ### Body (application/json) This endpoint expects a CancelAnIntentRequest. - `Amount` (integer, optional) — The amount of the cancellation, required for a partial cancellation. The cancellation `Amount` must equal the sum of its line items. - `Currency` (string, optional) — The currency of the intent. - `PlatformFeesAmount` (integer, optional) — The amount of fees to be diverted to the platform's Fees Wallet when the Intent is split. This value can be overridden when the Split is created. The `PlatformFeesAmount` value must the sum of all line item `Seller.FeesAmount` values. - `ExternalData` (CancelAnIntentRequestExternalData, optional) — Information about the cancellation processed by the third-party PSP. - `LineItems` (list of CancelAnIntentRequestLineItemsItems, optional) — Information about the items canceled, required for a partial cancellation. ## Response ### 200 Success - `Id` (string, optional) — The unique identifier of the intent. - `Amount` (integer, optional) — The full amount authorized in the Intent, which must equal the sum of the total amounts of all `LineItems`. - `AvailableAmountToSplit` (integer, optional) — The remaining amount of the Intent that can be split and transferred to the sellers' wallets. - `UnfundedAmount` (integer, optional) — The amount needing to be settled to the Platform's technical wallet before the Intent Splits can be executed. - `Currency` (string, optional) — The currency of the intent. - `PlatformFeesAmount` (integer, optional) — The amount of fees to be diverted to the platform's Fees Wallet when the Intent is split. This value can be overridden when the Split is created. The `PlatformFeesAmount` value must the sum of all line item `Seller.FeesAmount` values. - `Status` (string, optional) — The status of the Intent, as declared by the platform through Intent Captures, Refunds (and reversals), or Disputes (and decisions). Where partial actions occur, the top-level Intent `Status` may differ from the `Status` of Intent `LineItems`. Intent `Status` values: - `AUTHORIZED` – The Intent `Amount` was authorized for acquisition by the PSP and can be captured or canceled. - `PARTIALLY_CAPTURED` – Part of the Intent `Amount` from one or more `LineItems` was captured. The other parts are either still available for capture or cancel. - `CAPTURED` – All of the Intent `Amount` was captured. Part of it may have been subsequently refunded or disputed. - `CANCELLED` – All of the Intent `Amount` was canceled. - `REFUNDED` – All of the `CapturedAmount` of all `LineItems` was refunded. - `REFUND_REVERSED` – The refund could not be completed and the funds were returned to the platform. - `DISPUTED` – All of the `CapturedAmount` of all `LineItems` was disputed. - `DEFENDED` – The dispute is being defended by the platform. - `DISPUTED_WON` – The dispute was resolved in favor of the platform. - `DISPUTED_LOST` – The dispute was resolved against the platform. - `ExternalData` (ExternalProcessingDateExternalProviderReferenceExternalMerchantReference, optional) — Information about the transaction authorization processed by the third-party PSP. - `Buyer` (BuyerId, optional) — Information about the buyer. - `LineItems` (list of LineItems_Intent, optional) — Information about the items purchased in the transaction. A maximum of 100 line items can be created per Intent. The sum of all line item amounts must equal the Intent `Amount` value. The total for each line items is calculated as ((`UnitAmount` x `Quantity`) - `DiscountAmount`), which is shown in the `TotalLineItemAmount` returned. The `TaxAmount` is indicative and included in the `UnitAmount`. The sum of all line item `Seller.FeesAmount` values must equal the Intent `PlatformFeesAmount` value. - `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created. - `ExecutionDate` (integer, optional) — Unix timestamp (UTC) of the date and time the Intent moved to `AUTHORIZED`. - `Cancel` (Id_IntentCancel, optional) — Information about the Cancel. ## Errors ### 400 Bad Request Error Bad Request - `Message` (string, optional) — Description of the error. - `Type` (string, optional) — The category of the error. - `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support. - `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered. - `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors. ## Types ### CancelAnIntentRequestExternalData Information about the cancellation processed by the third-party PSP. - `ExternalProcessingDate` (integer, required) — The date at which the cancellation was created. - `ExternalProviderReference` (string, optional) — The unique identifier of the cancellation at the provider level - `ExternalMerchantReference` (string, optional) — The unique identifier of the cancellation at the merchant level - `ExternalProviderName` (string, optional) — The [supported third-party PSP](/api-reference/echo/supported-providers) processing the transaction. - `ExternalProviderPaymentMethod` (string, optional) — One of the [supported payment methods](/api-reference/echo/supported-payment-methods) used to process the cancellation. ### CancelAnIntentRequestLineItemsItems - `Id` (string, required) — The unique identifier of the line item in Mangopay ecosystem. - `Amount` (integer, required) — The amount of the cancellation. The sum of the cancellation's `LineItems.Amount` values must equal the `Amount` of the cancellation. ### ExternalProcessingDateExternalProviderReferenceExternalMerchantReference Information about the transaction authorization processed by the third-party PSP. - `ExternalProcessingDate` (integer, optional) — The date at which the transaction authorization was created. - `ExternalProviderReference` (string, optional) — The unique identifier of the transaction at the provider level. - `ExternalMerchantReference` (string, optional) — The unique identifier of the transaction at the merchant level. - `ExternalProviderName` (string, optional) — The [supported third-party PSP](/api-reference/echo/supported-providers) processing the transaction. **Note:** The uppercase value is expected. The API returns the sentence-case value. - `ExternalProviderPaymentMethod` (string, optional) — One of the [supported payment methods](/api-reference/echo/supported-payment-methods) used to process the transaction. ### BuyerId Information about the buyer. - `Id` (string, optional) — If it exists, the unique identifier of the Mangopay user making the payment via the third-party PSP. Must be a valid Mangopay `UserId`. ### LineItems_Intent - `Seller` (AuthorIdWalletIdFeesAmount, optional) — Information about the seller of the line item. - `Id` (string, optional) — The unique identifier of the line item in Mangopay's ecosystem. - `Sku` (string, optional) — The stock keeping unit (SKU) or other unique identifier of the item. - `Name` (string, optional) — The name of the item. - `Description` (string, optional) — The description of the item. - `Quantity` (integer, optional) — The number of units in the line item. - `UnitAmount` (integer, optional) — The cost of each unit, including `TaxAmount` and excluding `DiscountAmount`. - `TaxAmount` (integer, optional) — The amount of the `UnitAmount` which is tax. - `DiscountAmount` (integer, optional) — The amount of discount applied to the line item. - `Category` (string, optional) — The category of the item, as defined by the platform. - `ShippingAddress` (LineItemsIntentShippingAddress, optional) — The shipping address. - `CapturedAmount` (integer, optional) — The item total `CAPTURED` amount - `RefundedAmount` (integer, optional) — The item total `REFUNDED` amount - `DisputedAmount` (integer, optional) — The item total `DISPUTED` amount. - `SplitAmount` (integer, optional) — The item total `COMPLETED` amount. - `CancelledAmount` (integer, optional) — The item total `CANCELLED` amount. - `TotalLineItemAmount` (integer, optional) — The total amount of the line item calculated as ((`UnitAmount` x `Quantity`) - `DiscountAmount`). - `UnfundedSellerAmount` (integer, optional) — The amount needing to be settled to the Platform's technical wallet before the Intent Splits can be executed for this seller. - `SplitOriginWalletId` (string, optional) — The unique identifier of the wallet from which the split will be debited. This parameter is required for Intents where `ExternalProviderName` is `Mangopay`. If it is not defined in the Intent it must be defined at Split creation. ### Id_IntentCancel Information about the Cancel. - `Id` (string, optional) — The unique identifier of the Cancel. ### AuthorIdWalletIdFeesAmount Information about the seller of the line item. - `AuthorId` (string, optional) — The unique identifier of the seller of the line item. Required if `WalletId` not sent. - `WalletId` (string, optional) — The unique identifier of the wallet to credit the seller's funds. Required if `AuthorId` not sent. - `FeesAmount` (integer, optional) — The amount of fees that will be diverted to the platform's Fees Wallet when the Intent is split. This value can be overridden when the Split is created. - `TransferDate` (integer, optional) — The future date when the funds are to be automatically transferred to the seller's wallet. ### LineItemsIntentShippingAddress The shipping address. - `AddressLine1` (string, optional) — The first line of the address. - `AddressLine2` (string, optional) — The second line of the address. - `City` (string, optional) — The city of the address. - `Region` (string, optional) — The region of the address. - `PostalCode` (string, optional) — The postal code of the address. - `Country` (string, optional) — Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats)) The country of the address. ## Examples ### Full cancel **Request** ```json { "body": { "ExternalData": { "ExternalMerchantReference": "cancel-order-e76ec48d-9285-42fc-bd83-3e43d91352a0", "ExternalProcessingDate": 1769794421, "ExternalProviderName": "Stripe", "ExternalProviderPaymentMethod": "MASTERCARD", "ExternalProviderReference": "cancel-stripe-01f82162-1fe2-4921-a322-1de2680ec995" } } } ``` **Response** ```json { "Id": "int_019c0ff6-7334-7217-9a1d-3f029defb965", "Amount": 20000, "AvailableAmountToSplit": 0, "UnfundedAmount": 0, "Currency": "EUR", "PlatformFeesAmount": 0, "Status": "CANCELLED", "ExternalData": { "ExternalProcessingDate": 1769794335, "ExternalProviderReference": "auth-stripe-07d87474-61ab-4054-8f9c-99d9b6478b00", "ExternalMerchantReference": "order-27cd989a-220f-486a-8714-b3120913dac4", "ExternalProviderName": "Stripe", "ExternalProviderPaymentMethod": "MASTERCARD" }, "Buyer": { "Id": "user_m_01KF3087EDXEAK8VPD9DTMZW8N" }, "LineItems": [ { "Id": "int_li_019c0ff6-7339-73b9-aa3f-4b657d8629c0", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 10000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff6-7339-73b9-aa3f-4b657d8629c1", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 10000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff6-7339-73b9-aa3f-4b657d8629c0", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 10000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff6-7339-73b9-aa3f-4b657d8629c1", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 10000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 } ], "CreationDate": 1769794335, "ExecutionDate": 1769794339, "Cancel": { "Id": "int_cancel_019c0ff6-8493-7efd-a303-40ec83b1b7a8" } } ``` ### Partial cancel **Request** ```json { "body": { "Amount": 5000, "Currency": "EUR", "ExternalData": { "ExternalMerchantReference": "cancel-order-608db682-4b52-4f55-8c8c-f8d93315f726", "ExternalProcessingDate": 1769794487, "ExternalProviderName": "Stripe", "ExternalProviderPaymentMethod": "MASTERCARD", "ExternalProviderReference": "cancel-stripe-d2ee9b52-0eed-48a2-9b36-36032b8c6be4" }, "LineItems": [ { "Amount": 5000, "Id": "int_li_019c0ff8-b377-7130-bc58-e1270e6e11b3" } ], "PlatformFeesAmount": 0 } } ``` **Response** ```json { "Id": "int_019c0ff8-b375-7c3a-858c-8422007b8b23", "Amount": 20000, "AvailableAmountToSplit": 0, "UnfundedAmount": 0, "Currency": "EUR", "PlatformFeesAmount": 0, "Status": "AUTHORIZED", "ExternalData": { "ExternalProcessingDate": 1769794487, "ExternalProviderReference": "cancel-stripe-d2ee9b52-0eed-48a2-9b36-36032b8c6be4", "ExternalMerchantReference": "cancel-order-608db682-4b52-4f55-8c8c-f8d93315f726", "ExternalProviderName": "Stripe", "ExternalProviderPaymentMethod": "MASTERCARD" }, "Buyer": { "Id": "user_m_01KF3087EDXEAK8VPD9DTMZW8N" }, "LineItems": [ { "Id": "int_li_019c0ff8-b377-7130-bc58-e1270e6e11b3", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 5000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff8-b377-7130-bc58-e1270e6e11b4", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 0, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff8-b377-7130-bc58-e1270e6e11b3", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 5000, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 }, { "Id": "int_li_019c0ff8-b377-7130-bc58-e1270e6e11b4", "CapturedAmount": 0, "RefundedAmount": 0, "DisputedAmount": 0, "SplitAmount": 0, "CancelledAmount": 0, "TotalLineItemAmount": 10000, "UnfundedSellerAmount": 0 } ], "CreationDate": 1769794483, "ExecutionDate": 1769794487, "Cancel": { "Id": "int_cancel_019c0ff8-c4a1-717d-ba09-c8e187d6f31b" }, "NextActions": "CAPTURE, PARTIALLY_CAPTURE, CANCEL" } ```