How to submit refunds/returns using the Events API.
This guide explains how to submit return and refund data to LoudCrowd so commissions are correctly adjusted when items are returned. These requests use the same single endpoint as order events and are selected by header.
- Endpoint:
POST https://api.loudcrowd.com/event/ecomm - Topic header:
X-LC-TOPIC: ORDER_UPDATE - Authentication and base payload: see Submit Order Event
Important Notes
Refund Line Item ID Management
The refund_line_item_id is critical for proper commission tracking:
- One stable ID per line item: Assign a
refund_line_item_idthat is unique within the ecommerce integration to each originalline_item_id. - Cumulative updates: Reuse that ID on later updates and send the current cumulative
amount,tax, andquantityrefunded for the line item. - Different original line items: Use different refund IDs for different original line items. Do not issue a second refund ID for the same original line item.
Commission Adjustment Logic
When processing returns:
- Full Refund: If the refund amount equals the line item amount, the entire line item is disqualified for commissions.
- Partial Refund: If the refund amount is less than the line item amount, commissions are adjusted proportionally.
- Multiple Refunds: Update the stable refund record for an original line item with cumulative values; use separate IDs only for different original line items.
Order Amount Updates
When submitting return events:
- Keep
amount,tax, andshippingas the order's gross values before refunds. LoudCrowd subtracts the supplied refund amounts separately. - Update
platform_updated_atto the current timestamp. - Include all original
line_itemsplus the newrefund_line_items.
Common Scenarios
The following examples are independent scenarios. For later updates to the same original line item, reuse its refund ID and send cumulative values.
Full Item Return
{
"refund_line_item_id": "REFUND_001",
"line_item_id": "1",
"platform_refunded_at": "2021-01-03T10:00:00Z",
"sku": "SKU1",
"variant_sku": "VARIANT1",
"amount": "100.00",
"tax": "6.00",
"quantity": "2"
}Partial Item Return
{
"refund_line_item_id": "REFUND_002",
"line_item_id": "1",
"platform_refunded_at": "2021-01-03T10:00:00Z",
"sku": "SKU1",
"variant_sku": "VARIANT1",
"amount": "50.00",
"tax": "3.00",
"quantity": "1"
}