tys.returns.create()
Record a return of an order line (idempotent by return id and line).
def create(ret: OutcomeReturnInput, *, idempotency_key: Optional[str] = None) -> OutcomeReturnResultParameters
Section titled “Parameters”retOutcomeReturnInputRequiredProperties
idstringRequiredYour return (or RMA) ID.
order_idstringRequiredline_idstringRequiredquantityintegerRequiredreasonstringOptionalsize_too_small, size_too_large, fit_other, style, quality, damaged_or_wrong, changed_mind, other; Shopify's ReturnReason codes (SIZE_TOO_SMALL…) and common returns-platform words are mapped. Empty: unspecified.
exchangebooleanOptionalThe item was exchanged rather than refunded.
exchange_sizestringOptionalThe size sent in exchange (implies exchange).
returned_atstringRequiredidempotency_keyOptional[str]Optional= NoneReturns
Section titled “Returns”OutcomeReturnResult: What was recorded.
Example
Section titled “Example”tys.returns.create({ "id": "RMA-7", "order_id": "1001", "line_id": "1", "quantity": 1, "reason": "size_too_small", "returned_at": datetime.now(timezone.utc).isoformat(),})await tys.returns.create({ id: "RMA-7", order_id: "1001", line_id: "1", quantity: 1, reason: "size_too_small", returned_at: new Date().toISOString(),});curl -X POST https://api.tryyoursize.com/v1/returns \ -H "Authorization: Bearer $TRYYOURSIZE_SECRET_KEY" \ -H "TYS-Version: 2026-10-25" \ -H "Content-Type: application/json" \ -d '{"id":"RMA-7","order_id":"1001","line_id":"1","quantity":1,"reason":"size_too_small","returned_at":"2026-11-02T09:00:00Z"}'See also
Section titled “See also”Was this page helpful?
Thank you. We read every answer.