Order Management

Order completion, cancellation, and modification endpoints

Get Completed Order Details (Authenticated)

get

Retrieves the details of a completed order for the authenticated user.

Business Logic:

  • Requires authentication. The order must belong to the logged-in user.

  • Validates the signed order number.

  • The signature is time-limited for security.

Response Format:

  • Default: HTML page rendering order confirmation.

  • JSON: Add ?format=json query parameter.

Authorizations
sessionidstringRequired
Path parameters
order_numberstringRequired

Signed order number (time-limited signature for security).

Query parameters
formatstring · enumOptional

Response format. Use json for JSON response.

Possible values:
Header parameters
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Responses
200

Order details

Responsestring

HTML page with order confirmation.

get
/orders/completed/{order_number}/

Cancel Order Items Directly

post

Directly cancels selected order items and sends the cancellation to the order management system (Omnitron).

How It Works:

This endpoint attempts direct cancellation without creating CancellationRequest records. The selected order items are immediately cancelled and reported to Omnitron.

  1. Validates that the order belongs to the authenticated user.

  2. Checks all cancellation rules (status, time limits, invoice status, etc.).

  3. Retrieves the order details from Omnitron.

  4. Sends the cancellation request directly to Omnitron API.

  5. Updates the order item statuses to cancellation_waiting.

Fallback Behavior:

If direct cancellation fails for any reason (validation error, Omnitron API error, etc.), the system automatically creates CancellationRequest records instead. In this case, the response will be 200 OK with the created CancellationRequest list.

Cancellation Validation Rules:

The following conditions are checked before allowing cancellation:

Validation
Error

Order is already cancelled

"Order already cancelled!"

Cancellation already in progress

"Order cancellation already in progress."

Order status doesn't allow cancellation

"Order can't be cancelled in this status."

Order has invoice (if configured)

"Invoiced orders can not cancel"

Time limit exceeded (if configured)

"Order cancellation expired."

Item status doesn't allow cancellation

"Order Item ({name}) can't be cancelled in this status."

Cancellable Order Statuses (Default):

  • payment_waiting

  • confirmation_waiting

  • approved

Additional statuses can be configured via EXTRA_CANCEL_RULES setting.

Configuration (Dynamic Settings):

Setting
Description

EXTRA_CANCEL_RULES.extra_direct_cancellable_statuses

Additional order statuses that allow direct cancellation

EXTRA_CANCEL_RULES.has_invoice

If true, orders with invoice cannot be cancelled

EXTRA_CANCEL_RULES.hour_gap.is_active

If true, enables time-based cancellation limit

EXTRA_CANCEL_RULES.hour_gap.time

Time limit in minutes after order creation (default: 60)

Response:

  • 204: Direct cancellation successful - order items cancelled and sent to Omnitron.

  • 200: Direct cancellation failed - CancellationRequest records created as fallback.

  • 400: Validation error - cancellation not allowed.

Authorizations
sessionidstringRequired
Path parameters
order_numberstringRequired

The order number to cancel.

Example: ORD-2024-001234
Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Body

Request payload for cancelling order items. Contains a list of items to cancel with their individual cancellation details.

pickup_addressinteger | nullOptional

Address ID for product pickup (for easy return / refund requests). Must be a valid address belonging to the authenticated user. Only required for refund-type cancellations with easy return enabled.

fully_refund_as_loyalty_moneybooleanOptional

If true, the refund amount will be credited as loyalty points instead of being refunded to the original payment method.

Default: false
Responses
200

Direct cancellation failed - CancellationRequest records created as fallback. Returns the list of created CancellationRequest records that will be processed by the back-office.

application/json
post
/orders/{order_number}/cancel/

Request Order Address Change

post

Submits a request to change the delivery address for an existing order.

Business Logic:

  • Validates that the order and address belong to the authenticated user.

  • Sends the address change request to the order management system (Omnitron).

  • The request may be subject to approval based on order status.

Restrictions:

  • Cannot change address for orders that have already been shipped.

  • The new address must be a valid address from the user's address book.

Error Code: order_100_3 - Old order address cannot be changed (order already shipped).

Authorizations
sessionidstringRequired
Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Body
orderintegerRequired

The ID of the order to update.

addressintegerRequired

The ID of the new address from the user's address book.

channel_idinteger | nullOptional

Channel ID (optional, populated automatically).

Responses
200

Address change request submitted successfully to Omnitron.

application/json
post
/orders/address_change/

Last updated

Was this helpful?