Calculate return shipping cost API
Apply one matching caller-supplied rate to a return. A missing rate is not estimated, currencies are not converted, and the result is not a refund.
The Calculate return shipping cost operation is part of the Returns & Delivery Intelligence API on BRAINIAC.software. Apply one matching caller-supplied rate to a return. A missing rate is not estimated, currencies are not converted, and the result is not a refund. It is exposed as POST /api/v1/returns-delivery/return-shipping-cost-calculate and priced at $0.04 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: Orders, addresses, events, and rates supplied in the request. Limitations: Records are copied only from labeled fields in the request. No carrier tracking event is added. An address check does not confirm that a carrier can deliver. A return cost and a return window come only from supplied rates and day counts. No carrier account is contacted and no return is initiated. Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Classify delivery exceptions, Detect failed-delivery patterns, Validate shipping-address structure, Analyze return reasons. Open the group documentation for the full request schema, field notes, and response examples before integrating.
/api/v1/returns-delivery/return-shipping-cost-calculateExample request
curl -i -X POST "https://www.brainiac.software/api/v1/returns-delivery/return-shipping-cost-calculate" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"orders": [
{
"id": "O-1",
"carrier": "Example Carrier",
"country": "GB"
},
{
"id": "O-2",
"carrier": "Example Carrier",
"country": "FR"
}
],
"rates": [
{
"carrier": "Example Carrier",
"country": "GB",
"amount": 4.5,
"currency": "USD",
"basis": "flat"
}
],
"returns": [
{
"id": "R-1",
"orderId": "O-1",
"reason": "size"
},
{
"id": "R-2",
"orderId": "O-2",
"reason": "size"
}
]
}
JSONAn unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.
FAQ
- Do I need an API key? No. Pay the listed USDC amount with x402.
- What network? Base (eip155:8453), USDC.
- Is this an official determination? No. Results are for human review against the cited sources.
Related operations
- Classify delivery exceptions — $0.04 USDC
- Detect failed-delivery patterns — $0.05 USDC
- Validate shipping-address structure — $0.04 USDC
- Analyze return reasons — $0.04 USDC