Create cancellation request

POST /Orders/CreateOrderItemLineCancelRequest — OMS API · Cancellation & Return

Opens a cancellation request for order lines. The request appears on the seller's cancellation requests screen; the seller approves or rejects it and the result is notified to you via the CancelShipmentRequestApprovedEvent / CancelShipmentRequestRejectedEvent webhook. The body is an array; you can send multiple records in a single request.

When to call: When the customer wants to cancel a product that the seller has not yet shipped.

  • Use GetStatusReasonByType (statusType=Cancelled) for reasonId.
  • If the line status is not suitable for cancellation request, quantity is insufficient, or reasonId is incorrect, HTTP 200 with isSuccess: false is returned.
  • If there is already a pending request for the line, the request is considered successful (retries are safe).
  • If refund is enabled in the tenant, refund information generated is returned in data.

İstek gövdesi

  • quantity (integer<int32>, zorunlu): Cancellation quantity (usually 1 per line).
  • reasonId (integer<int64>, zorunlu): Cancellation reason ID; id from the GetStatusReasonByType (statusType=Cancelled) response.
  • reasonDesc (string): Cancellation description.
  • refundAction (string): Refund method: refund (money refund, default) or credit (return voucher).
  • sourceOrderItemLineId (string, zorunlu): sourceOrderItemLineId value of the line to be cancelled.

Yanıtlar

  • 200: Successful. Always check the isSuccess field in the body.
  • 400: Body could not be validated (missing required field, type mismatch, or malformed JSON). The response is in ASP.NET Core ValidationProblemDetails format; the errors field indicates which field is invalid.
  • 401: Authorization header missing, token invalid or expired. Body returns empty; get a new token via /Auth/login.
  • 500: Unexpected server error. This response returns with PascalCase field names (unlike other responses) and includes null fields.

200 yanıt alanları

  • data (object[]): Generated payment refunds. Empty list if payment refund is disabled.
    • data.total (number<double>): Payment amount.
    • data.status (integer<int32>): Return status code.
    • data.authCode (string): Provision code. Returned only if populated.
    • data.interest (number<double>): Due difference.
    • data.paidDate (string<date-time>): Payment time. Returned only if populated.
    • data.posPoint (number<double>): POS points. Returned only if populated.
    • data.refundId (string): Return record ID.
    • data.createdOn (string<date-time>): Creation time. Returned only if populated.
    • data.statusName (string): Return status name.
    • data.paymentType (string): Payment type.
    • data.refundTotal (number<double>): Amount to be refunded.
    • data.transactionId (string): Transaction ID. Returned only if populated.
    • data.paymentMethodId (string): Payment method ID.
    • data.transactionCode (string): Transaction code. Returned only if populated.
    • data.captureTransactionId (string): Collection transaction ID. Returned only if populated.
  • isSuccess (boolean, zorunlu): true if the operation is successful.
  • statusCode (string): Not used; usually null.
  • errorMesssage (string): Error message. Returned only if there is an error.