Shipments
Refund Shipments
This endpoint allows you to request a refund for a previously purchased shipment. When a refund is processed, the shipment status is updated to canceled and refund status is set to refunded
POST
`/v1/shipments/:shipment/refund`
The endpoint requires only the shipment ID as a URL parameter. No request body is needed.
Request Example
Provider Support
Not all shipping providers support refunds. The system automatically checks provider capabilities before processing the refund request. If a provider doesn't support refunds, the request will be rejected with an appropriate error message.
Refund Process
The refund process involves several automated steps:
Validation
- Verifies the shipment exists and has been purchased.
- Confirms the shipping provider supports refunds.
- Checks if the shipment is eligible for refund.
Provider Integration
- Processes the refund with the shipping provider.
- Updates tracking information accordingly.
- Cancels any pending pickup or delivery requests.
Status Updates
- Updates shipment status to
canceled
- Sets refund status to
refunded
- Creates tracking update records.
- Updates shipment status to
Status Changes
When a refund is processed, the following status changes occur:
- Shipment status: Changed to
canceled
- Refund status: Set to
refunded
- Tracking updates: New update created with
canceled
status
Error Scenarios
The endpoint may return the following errors: