---
title: "Partially cancel an order"
method: POST
path: "/v1/pvt/Order/{orderId}/partialcancel"
tags: ["Order"]
---

# Partially cancel an order

`POST /v1/pvt/Order/{orderId}/partialcancel`

If your customer returns or ask for refund for some part of their purchase you can you this endpoint to 
cancel the corresponding points/cashback for that purchase

## orderID
This is the exact same ID used when sending the order to BonifiQ. Usually is the ID from the origin plataform.
            
## ValueToRefund
The purchase value being refunded. It should be less than the order total value. 

## CancelKey
This field allows to create idempotency. It can be any unique string such an ID for the cancellation.
If you try to cancel the same order using the same CancelKey the cancellation will fail.

## Path parameters

- `orderId` string, required

## Request body

- PartialCancelOrderRequest
  - `ValueToRefund` number — Value to be refunded from the order total. This value must be greater than 0 and less or equal than the OrderTotal value sent when the order was created or updated.
  - `CancelKey` string — This key is used to avoid duplicated partial cancel on the same order. Use a unique value (such as an ID) for each partial cancel request.
  - `Products` object[], nullable — Optional list of products being refunded. When provided, BonifiQ will reverse points using the product point history saved on the original purchase. The sum of all product ValueToRefund values must match ValueToRefund after currency rounding.
    - `OriginalId` string — Product OriginalId sent when the order was created.
    - `ValueToRefund` number — Refunded value for this product.
  - `ShouldRefundRedeem` boolean, nullable — Controls whether BonifiQ should refund points/cashback redeemed on this order. True forces redeem refund, false skips redeem refund, null follows the tenant feature flag.

## Response `200`

- BaseExternalApiResponseOfCancelOrderResponse — Standard response envelope used by the External API.
  - `ErrorMessage` string, nullable — Error message returned when the request fails validation or processing. For warnings and successful responses, consumers should usually inspect `Result`, `Code` and `Severity` first.
  - `ErrorCode` integer, nullable — Legacy numeric error code derived from internal API errors when available. This field is relevant only for error flows that use `ApiResponseErrorDescription`.
  - `Result` CancelOrderResponse
    - `isCanceled` boolean — If true the order was found and Cancelled
    - `UpdatedAt` string, date-time — The time the order was canceled
    - `Status` 0 | 1 | 2 | 3 | 4 — Order Status model 0 = Accepted 1 = Refuse 2 = Error 3 = Completed 4 = Cancel
    - `RefundErrorDetails` RefundErrorDetailsResponse
      - `Code` string — Stable code that integrations can use to handle the refund error.
      - `Message` string — Human-readable explanation of what must be fixed.
      - `Field` string, nullable — Request field related to the error, when applicable.
      - `ProductOriginalId` string, nullable — Product OriginalId related to the error, when applicable.
      - `ExpectedValue` number, nullable — Expected numeric value, when the error is caused by a mismatch.
      - `ActualValue` number, nullable — Actual numeric value received or calculated, when the error is caused by a mismatch.
  - `Code` string, nullable — Endpoint-specific business code formatted as a two-digit string, such as `03` or `07`. This field is available for success, warning and error outcomes.
  - `CodeName` string, nullable — Symbolic enum name associated with `Code`, such as `CheckoutNotFound`.
  - `Severity` 0 | 1 | 2 — 0 = Success 1 = Warning 2 = Error
  - `HasWarning` boolean — Convenience flag that is `true` when `Severity` is `Warning`. Warnings are valid `200 OK` business outcomes and should not be handled as transport or validation errors.
  - `HasError` boolean — Indicates whether the request failed and should be handled as an error response. This flag is reserved for real API errors; warnings must keep this property as `false`.

---

[API](https://skmtc.net/bonifiq/apis/bonifiq-private-apis.md) · [All operations](https://skmtc.net/bonifiq/apis/bonifiq-private-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bonifiq/bonifiq-private-apis/revisions/1c29e55baf55/schema)
