Skip to content

tys.returns.create()

Methodtryyoursize

Record a return of an order line (idempotent by return id and line).

def create(ret: OutcomeReturnInput, *, idempotency_key: Optional[str] = None) -> OutcomeReturnResult
retOutcomeReturnInputRequired
Properties
idstringRequired

Your return (or RMA) ID.

order_idstringRequired
line_idstringRequired
quantityintegerRequired
reasonstringOptional

size_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.

exchangebooleanOptional

The item was exchanged rather than refunded.

exchange_sizestringOptional

The size sent in exchange (implies exchange).

returned_atstringRequired
idempotency_keyOptional[str]Optional= None

OutcomeReturnResult: What was recorded.

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(),
})

Was this page helpful?