import { APIResource } from "../../core/resource.mjs"; import * as ReturnsAPI from "../returns.mjs"; import { APIPromise } from "../../core/api-promise.mjs"; import { RequestOptions } from "../../internal/request-options.mjs"; export declare class Returns extends APIResource { /** * Create a simulated return for an order, then drive it through its lifecycle with * the approve/deny/refund/fail helpers below. */ create(body: ReturnCreateParams, options?: RequestOptions): APIPromise; /** * Approve a simulated return. */ approve(returnID: string, body: ReturnApproveParams, options?: RequestOptions): APIPromise; /** * Deny a simulated return. */ deny(returnID: string, body: ReturnDenyParams, options?: RequestOptions): APIPromise; /** * Mark a simulated return as failed. */ fail(returnID: string, body: ReturnFailParams, options?: RequestOptions): APIPromise; /** * Refund a simulated return using the order total as the simulated refund amount. */ refund(returnID: string, body: ReturnRefundParams, options?: RequestOptions): APIPromise; } export interface ReturnCreateParams { /** * Rye order id (`oi_` / `order_`) to open the simulated return against. */ orderId: string; /** * Subset of order line items to return. Defaults to every order item at full * quantity. */ lineItems?: Array; /** * Defaults to `other` when omitted. */ reason?: ReturnsAPI.ReturnReason; } export declare namespace ReturnCreateParams { interface LineItem { /** * Order line item id (`oi_`) to return. */ orderLineItemId: string; /** * Units of this line item to return. */ quantity: number; } } export interface ReturnApproveParams { /** * `ship_items_to_merchant` lands the return in `requires_action` with a stub * shipping label; `no_action_required` lands it directly in `processing`. Defaults * to `ship_items_to_merchant`. */ nextAction?: 'ship_items_to_merchant' | 'no_action_required'; } export interface ReturnDenyParams { note?: string; /** * Defaults to `other`. */ reason?: 'final_sale' | 'return_period_ended' | 'other'; } export interface ReturnFailParams { note?: string; } export interface ReturnRefundParams { /** * Defaults to `shopper`. */ costBearer?: 'shopper' | 'developer' | 'rye'; } export declare namespace Returns { export { type ReturnCreateParams as ReturnCreateParams, type ReturnApproveParams as ReturnApproveParams, type ReturnDenyParams as ReturnDenyParams, type ReturnFailParams as ReturnFailParams, type ReturnRefundParams as ReturnRefundParams, }; } //# sourceMappingURL=returns.d.mts.map