UNPKG

@redotech/redo-api-schema

Version:

Common definitions for Redo API

1,822 lines (1,812 loc) 45.2 kB
/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ /** OneOf type helpers */ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }; type XOR<T, U> = (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U; type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never; export interface paths { "/invoices/{invoiceId}/items.csv": { /** * Get invoice * @description Get an invoice as a CSV. */ get: operations["Invoice csv get"]; }; "/invoices/pending/items.csv": { /** * Get pending invoice * @description Get an invoice as a CSV. */ get: operations["Invoice pending csv get"]; }; "/returns/{returnId}": { /** * Get return * @description Get return. */ get: operations["Return get"]; parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; }; "/returns/{returnId}/comments": { /** * List return comments * @description List return comments. */ get: operations["Return comments get"]; /** * Create return comment * @description Create return comment. */ post: operations["Return comment create"]; parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; }; "/returns/{returnId}/status": { /** * Get return status * @description Get return status. */ get: operations["Return status get"]; /** * Update return status * @description Update return status. */ put: operations["Return status update"]; }; "/stores/{storeId}/admin": { /** * Navigate to merchant admin * @description Navigate to the merchant admin page. */ get: operations["Merchant admin navigate"]; }; "/stores/{storeId}/checkout-buttons-ui": { /** * Retrieve some rendered HTML and CSS for checkout buttons options for enabling and disabling coverage * @description Generate HTML and CSS for checkout buttons */ get: operations["Checkout buttons UI"]; }; "/stores/{storeId}/coverage-info": { /** * Navigate to coverage info * @description Navigate to the coverage info page. */ get: operations["Coverage info navigate"]; }; "/stores/{storeId}/coverage-products": { /** * Get coverage products * @description Get available coverage products. */ post: operations["Coverage products"]; }; "/stores/{storeId}/customer-portal": { /** * Navigate to customer portal * @description Navigate to the customer portal. */ get: operations["Customer portal navigate"]; }; "/stores/{storeId}/invoices": { /** * Get invoice * @description Get a list of invoices. */ get: operations["Invoice list"]; }; "/stores/{storeId}/returns": { /** * List returns * @description List returns, sorted by most recent to least recent. */ get: operations["Returns list"]; parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; }; "/stores/{storeId}/shipments/{shipmentId}/documents/{documentType}": { /** * Download shipment document * @description Get a shipment document (label, commercial invoice, etc). */ get: operations["Shipment document download"]; parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; }; "/stores/{storeId}/shipments/buy": { /** * Purchase shipping label * @description Purchase a shipping label based on origin, destination, carrier, service, and parcel information. */ post: operations["Shipment buy"]; parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; }; "/stores/{storeId}/shipments/rates": { /** * Get shipping rates * @description Get available shipping rates based on origin, destination, and parcel information. */ post: operations["Shipment rates"]; parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; }; "/stores/{storeId}/webhooks": { /** * List webhooks * @description List webhooks for store. */ get: operations["Webhooks list"]; /** * Create or update webhook * @description Create webhook for store. Or if webhook already exists with `externalId`, update it. */ post: operations["Webhook create"]; parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; }; "/webhooks/{webhookId}": { /** * Get webhook * @description Get a webhook. */ get: operations["Webhook get"]; /** * Update webhook * @description Update a webhook. */ put: operations["Webhook update"]; /** * Delete webhook * @description Delete a webhook. */ delete: operations["Webhook delete"]; }; "/webhooks/{webhookId}/replay": { /** * Replay webhook * @description Replay a webhook. */ post: operations["Webhook replay"]; parameters: { path: { webhookId: components["parameters"]["webhook-id.param"]; }; }; }; } export interface webhooks { "return": { /** Return event */ post: operations["Webhook return event"]; }; } export interface components { schemas: { /** * Address * @description Address. */ "address.schema": { /** * City * @description City name */ city: string; /** * Country * @description Country code */ country: string; /** * Line 1 * @description Line 1 */ line1: string; /** * Line 2 * @description Line 2 * @default */ line2?: string; /** * Postal code * @description Postal or ZIP code */ postalCode: string; /** * State * @description State or province */ state: string; }; /** * Comment * @description Comment with either message or image. */ "comment.schema": OneOf<[{ /** * Image * @description Base64-encoded image */ image?: string; }, { /** * Message * @description Message. */ message?: string; }]>; /** * Coverage product * @description Coverage product. */ "coverage-product.schema": { /** @description Coverage. */ coverages?: ({ lineItems: { /** * ID * @description Line item ID. */ id?: string; }[]; /** * Coverage * @enum {unknown} */ type: "shipping_failure" | "return_shipping"; })[]; /** * ID * @description Coverage ID. */ id: string; /** * Price * @description Price. */ price: components["schemas"]["money.schema"]; }; /** * Problem details * @description Problem details. See [RFC 7807 Section 3](https://datatracker.ietf.org/doc/html/rfc7807#section-3). */ "error.schema": { /** * Detail * @description Human-readable description of the problem. */ detail?: string; /** * Format: uri-reference * @description A URI reference that identifies this problem. */ instance?: string; /** * Title * @description Human-readable summary of the problem type. */ title?: string; /** * Format: uri-reference * @description A URI reference that identifies the problem type. * @default about:blank */ type?: string; }; /** * Exchang provision * @example deferred * @enum {string} */ "exchange-provision.schema": "instant" | "deferred"; /** * HTTPS callback * @description HTTPS callback */ "https-callback.schema": { /** * Authorization * @description Authorization. */ auth: OneOf<[{ /** * Bearer * @description Bearer */ bearer?: { /** * Token * Format: password * @description Token for Bearer authorization. * @example abc123 */ token?: string; }; }, null]>; /** * URL * Format: uri * @description HTTPS callback URL. * @example https://subscriber.example.org/events */ url: string; }; /** @description Schema for an invoice. */ "invoice.schema": { /** @description The charge that the invoice is for. */ charge: components["schemas"]["money.schema"]; /** * Format: date-time * @description The time the invoice was created. */ createdAt: string; /** @description The ID of the charge. */ id?: string; /** @description The status of the invoice. */ status: string; store?: { /** @description The ID of the store. */ id: string; }; /** * Format: date-time * @description The time the invoice was last updated. */ updatedAt: string; }; /** * Item quantity * @description Item quantity. * @example 1 */ "item-quantity.schema": number; /** * Length * @description Length measurement with unit. */ "length.schema": { /** * Unit * @description Length unit * @enum {string} */ unit: "in" | "cm"; /** * Value * @description Numeric length value */ value: number; }; /** * Money * @description Currency amount */ "money.schema": { /** Amount */ amount?: string; /** Currency */ currency?: string; }; /** * Order * @description Order. */ "order-read.schema": { customer: { /** * Email address * Format: email * @description Email address of customer. */ emailAddress?: string; /** * Name * @description Name of customer. */ name: components["schemas"]["person-name.schema"]; /** * Phone number * @description Phone number of customer. */ phoneNumber?: components["schemas"]["phone-number.schema"]; }; /** * External ID * @description Shopify ID */ externalId?: string; /** * ID * @description Order ID * @example 64e4da943dd822979a70bd12 */ id: string; /** Line items */ items: ({ /** @example 123 */ externalId?: string; /** * @description ID of the location where the item was be fulfilled. * @example 123 */ fulfillmentLocationId: string | null; /** * ID * @description Line item ID */ id: string; /** Price */ price: components["schemas"]["money.schema"]; /** Product */ product: components["schemas"]["product.schema"]; /** Quantity */ quantity: components["schemas"]["item-quantity.schema"]; /** Variant */ variant: components["schemas"]["product-variant.schema"]; })[]; /** * Name * @description Shopify name. */ name: string; }; /** * Parcel Type * @description Parcel type enum. * @enum {string} */ "parcel-type.schema": "box" | "envelope" | "soft_pack"; /** * Parcel * @description Parcel information for shipping. */ "parcel.schema": { height: components["schemas"]["length.schema"]; length: components["schemas"]["length.schema"]; type: components["schemas"]["parcel-type.schema"]; weight: components["schemas"]["shipping-weight.schema"]; width: components["schemas"]["length.schema"]; }; /** * Person name * @description Person name. */ "person-name.schema": { /** @description Given name */ given: string; /** @description Surname */ surname: string; }; /** * Phone number * @description Phone number, in E.164 format */ "phone-number.schema": string; /** Product variant */ "product-variant.schema": { /** External ID */ externalId?: string; /** Title */ name: string; /** SKU */ sku?: string; /** Weight */ weight?: components["schemas"]["weight.schema"]; }; /** * Product * @description Product. */ "product.schema": { /** * External ID * @description Product ID in external system (e.g. shopify). */ externalId?: string; /** * Name * @description Product title */ name: string; }; /** * Return * @description Return read. */ "return-read.schema": { /** * Created at * Format: date-time * @description Time of creation. */ createdAt: string; destination: { /** * Mailing address * @description Mailing address to send the returned items. */ mailingAddress?: components["schemas"]["address.schema"]; /** * Phone number * @description Phone number of the destination. */ phoneNumber?: components["schemas"]["phone-number.schema"]; }; /** * Exchange * @description Exchange order */ exchange?: { /** Line items */ items: { /** ID */ id: string; /** Product */ product: components["schemas"]["product.schema"]; /** Quantity */ quantity: components["schemas"]["item-quantity.schema"]; variant: components["schemas"]["product-variant.schema"]; }[]; order?: { /** * External ID * @description ID of external order */ externalId?: string; id?: string; }; /** Provision */ provision: components["schemas"]["exchange-provision.schema"]; }; /** * Gift cards * @description Gift card(s) created for return */ giftCards: { /** Amount */ amount: components["schemas"]["money.schema"]; /** * Code * @description Gift card 16 digit code. */ code: string; /** * ID * @description Gift card ID. */ externalId: string; }[]; /** * Identifier * @description Return identifier. */ id: string; /** @description Return items */ items: ({ /** Exchange item */ exchangeItem?: { /** * ID * @description ID of exchange line item */ id?: string; }; /** * ID * @description Return item ID. */ id?: string; /** * Order item * @description Order line item */ orderItem?: { /** * ID * @description Line item ID in original order. Note: There can be more than return item for an original line item, with different quantity, return reasons, etc. */ id?: string; }; /** Quantity */ quantity: components["schemas"]["item-quantity.schema"]; /** @description Return reason */ reason: string; /** @description Refund */ refund?: { /** Amount */ amount: components["schemas"]["money.schema"]; /** Planned amount */ pendingAmount: components["schemas"]["money.schema"]; /** * Taxes * @description Taxes. */ pendingTaxAmount: components["schemas"]["money.schema"]; /** * Taxes * @description Taxes. */ taxAmount: components["schemas"]["money.schema"]; /** * @description Refund method * @enum {string} */ type: "credit" | "refund"; }; })[]; /** * Order * @description Original order. */ order: { /** * ID * @description Order ID. * @example abc123 */ id: string; }; /** * Shipment * @description Shipment, if has been made */ shipment?: { /** * Carrier * @description Carrier code */ carrier?: string; /** * Status * @description Status of shipment * @enum {string} */ status?: "pre_transit" | "transit" | "delivered" | "cancelled" | "flagged"; /** * Tracker * @description Tracking number */ tracker?: string; }; source: { /** * Email address * Format: email * @description Email address. */ emailAddress: string; /** * Mailing address * @description Mailing address returned items are sent from. */ mailingAddress: components["schemas"]["address.schema"]; /** * Name * @description Name of returner. */ name: components["schemas"]["person-name.schema"]; /** * Phone number * @description Phone number of returner. */ phoneNumber: components["schemas"]["phone-number.schema"]; }; /** * Status * @description Return status. */ status: components["schemas"]["return-status.schema"]; /** * Type * @description Return type. */ type?: components["schemas"]["return-type.schema"]; /** * Updated at * Format: date-time * @description Time of last update. */ updatedAt: string; }; /** * Return status * @description Return status. * * * complete: The return has been completed successfully. * * open: Return has been approved and is awaiting shipment. * * flagged: A problem with return processing requires merchant action. * * rejected: The return has been rejected. * * deleted: The return has been reset. * * @example open * @enum {string} */ "return-status-update.schema": "complete" | "open" | "flagged" | "rejected" | "deleted"; /** * Return status * @description Return status. * * * open: Return has been approved and is awaiting shipment. * * in_transit: Return shipment is in transit. * * delivered: Return shipment has been delivered and awaiting processing. * * needs_review: Return requires review before further action. * * in_review: Return is currently being reviewed. * * complete: The return has been completed successfully. * * rejected: The return has been rejected. * * flagged: A problem with return processing requires merchant action. * * pre_shipment: Return requires pre-shipment merchant authorization. * * deleted: The return has been deleted (Reset). * * @example open * @enum {string} */ "return-status.schema": "open" | "in_transit" | "delivered" | "needs_review" | "in_review" | "complete" | "rejected" | "flagged" | "pre_shipment" | "deleted"; /** * Return type * @description Return type. * * @example return * @enum {string} */ "return-type.schema": "claim" | "return" | "warranty"; /** * Shipment Document Type * @description Type of shipping document. * @enum {string} */ "shipment-document-type.schema": "label" | "commercialInvoice"; /** * Shipment Document * @description Shipping document information. */ "shipment-document.schema": { type: components["schemas"]["shipment-document-type.schema"]; }; /** * Shipment Rate * @description Shipping rate information. */ "shipment-rate.schema": { carrier: { /** * Carrier Account ID * @description ID for the carrier account that provides the shipping rate. */ id: string; /** * Carrier Name * @description Carrier display name */ name: string; }; price: components["schemas"]["money.schema"]; service: { /** * Service Name * @description Service level name */ name: string; }; }; /** * Shipment Tracker * @description Shipment tracking information. */ "shipment-tracker.schema": { /** * Tracking Code * @description Carrier tracking code */ code: string; }; /** * Shipment * @description Shipment information. */ "shipment.schema": { /** * Documents * @description Available shipping documents. You can access these documents using the GET Shipment document endpoint. */ documents: components["schemas"]["shipment-document.schema"][]; /** * Shipment ID * @description Shipment identifier */ id: string; price: components["schemas"]["money.schema"]; tracker: components["schemas"]["shipment-tracker.schema"]; }; /** * Shipping Contact * @description Contact information for shipping. */ "shipping-contact.schema": { address: components["schemas"]["address.schema"]; /** * Name * @description Contact name */ name: string; /** * Phone Number * @description Contact phone number */ phoneNumber: string; }; /** * Shipping Weight * @description Weight measurement with unit for shipping. */ "shipping-weight.schema": { /** * Unit * @description Weight unit * @enum {string} */ unit: "g" | "kg" | "oz" | "lb"; /** * Value * @description Numeric weight value */ value: number; }; /** * Storefront Cart * @description Storefront cart. */ "storefront-cart.schema": { /** * Line items * @description Line items. */ lineItems: { coupons?: { code: string; /** @description The amount this coupon discounts in dollars for this line item. */ discountAmount: components["schemas"]["money.schema"]; id: string; }[]; /** * ID * @description Line item ID. */ id: string; /** * Original Price * @description Original price. */ originalPrice?: components["schemas"]["money.schema"]; /** * Price * @description Total price. */ priceTotal: components["schemas"]["money.schema"]; /** @description Product. */ product: { /** ID */ id: string; }; /** * Quantity * @description Quantity. */ quantity: number; /** @description Variant. */ variant: { /** ID */ id: string; }; }[]; /** * Price * @description Total price. */ priceTotal?: components["schemas"]["money.schema"]; }; /** * Storefront Customer * @description Storefront customer. */ "storefront-customer.schema": { /** * ID * @description Customer ID. */ id: string; }; /** * Webhook create * @description Webhook create. */ "webhook-create.schema": { /** * Backfill * @description Create events for already-existing items * @default false */ backfill?: boolean; /** * HTTPS callback * @description HTTPS callback to POST events. */ callback: components["schemas"]["https-callback.schema"]; /** * External ID * @description Optional external identifier. * @default null */ externalId?: string | null; /** * Kind * @description Kind. */ kind?: components["schemas"]["webhook-kind.schema"]; /** * Topic * @description Topic. */ topic: components["schemas"]["webhook-topic.schema"]; }; /** * Webhook kind * @description Webhook kind. * @enum {string} */ "webhook-kind.schema": "redo" | "loop"; /** * Webhook read * @description Webhook read. */ "webhook-read.schema": { /** * Callback * @description HTTPS callback URL to POST events. */ callback: components["schemas"]["https-callback.schema"]; /** * Created at. * Format: date-time * @description Time created. */ createdAt: string; /** * External ID * @description Optional external identifier. * @default null */ externalId?: string | null; /** * ID * @description Webhook ID. */ id?: string; /** * Kind * @description Kind. */ kind?: components["schemas"]["webhook-kind.schema"]; /** * Topic * @description Topic. */ topic: components["schemas"]["webhook-topic.schema"]; /** * Updated at. * Format: date-time * @description Last time updated. */ updatedAt: string; }; /** * Webhook topic * @description Webhook topic. * @enum {string} */ "webhook-topic.schema": "return"; /** * Webhook update * @description Webhook update. */ "webhook-update.schema": { /** * HTTPS callback * @description HTTPS callback to POST events. */ callback: components["schemas"]["https-callback.schema"]; /** * External ID * @description Optional external identifier. * @default null */ externalId?: string | null; }; /** * Weight * @description Weight. */ "weight.schema": { /** * Kilograms * @description Weight in kilograms */ kg?: number; }; }; responses: never; parameters: { /** @description Type of document to download */ "document-type.param": components["schemas"]["shipment-document-type.schema"]; /** @description Invoice ID */ "invoice-id.param": string; /** * @description Page marker, from X-Page-Next header * @example 64df700931a04885276c3364 */ "page-continue.param"?: string; /** * @description Page size, defaults to 20 * @example 20 */ "page-size.param"?: number; /** @description Return ID */ "return-id.param": string; /** @description Shipment ID */ "shipment-id.param": string; /** @description Store ID */ "store-id.param": string; /** * @description Maximum updated time, exclusive * @example 2000-02-01T00:00:00Z */ "updated-at-max.param"?: string; /** * @description Minimum updated time, inclusive * @example 2000-01-01T00:00:00Z */ "updated-at-min.param"?: string; /** @description Webhook ID */ "webhook-id.param": string; }; requestBodies: never; headers: { /** @description Next value for X-Page-Continue, for more results */ "page-next.header": string; }; pathItems: never; } export type $defs = Record<string, never>; export type external = Record<string, never>; export interface operations { /** * Get invoice * @description Get an invoice as a CSV. */ "Invoice csv get": { parameters: { path: { invoiceId: components["parameters"]["invoice-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "text/csv": string; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Get pending invoice * @description Get an invoice as a CSV. */ "Invoice pending csv get": { responses: { /** @description Success */ 200: { content: { "text/csv": string; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Get return * @description Get return. */ "Return get": { parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { order: components["schemas"]["order-read.schema"]; return: components["schemas"]["return-read.schema"]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * List return comments * @description List return comments. */ "Return comments get": { parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { /** * Comments * @description Return comments. */ comments: components["schemas"]["comment.schema"][]; }; }; }; }; }; /** * Create return comment * @description Create return comment. */ "Return comment create": { parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; requestBody: { content: { "application/json": { comment: components["schemas"]["comment.schema"]; }; }; }; responses: { /** @description Created */ 201: { content: { "application/json": { comment: components["schemas"]["comment.schema"]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Get return status * @description Get return status. */ "Return status get": { parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { status: components["schemas"]["return-status.schema"]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Update return status * @description Update return status. */ "Return status update": { parameters: { path: { returnId: components["parameters"]["return-id.param"]; }; }; requestBody: { content: { "application/json": { status: components["schemas"]["return-status-update.schema"]; }; }; }; responses: { /** @description Updated */ 204: { content: never; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Navigate to merchant admin * @description Navigate to the merchant admin page. */ "Merchant admin navigate": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Redirect */ 302: { content: never; }; }; }; /** * Retrieve some rendered HTML and CSS for checkout buttons options for enabling and disabling coverage * @description Generate HTML and CSS for checkout buttons */ "Checkout buttons UI": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { 200: { content: { "application/json": { /** * Checkout buttons CSS * @description Boilerplate checkout button CSS, plus any merchant configured styles or A/B tests. */ css?: string; /** * Checkout buttons HTML * @description Boilerplate checkout button HTML */ html?: string; }; }; }; }; }; /** * Navigate to coverage info * @description Navigate to the coverage info page. */ "Coverage info navigate": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Redirect */ 302: { content: never; }; }; }; /** * Get coverage products * @description Get available coverage products. */ "Coverage products": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; requestBody: { content: { "application/json": { cart: components["schemas"]["storefront-cart.schema"]; customer?: components["schemas"]["storefront-customer.schema"]; }; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { /** * Coverage Products * @description Coverage products. */ coverageProducts: components["schemas"]["coverage-product.schema"][]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Navigate to customer portal * @description Navigate to the customer portal. */ "Customer portal navigate": { parameters: { query?: { /** @description HMAC-SHA256 JWT of {"iss":"<partnerId>","sub":"<storeId>/<customerId>"} */ token?: string; /** @description Order ID */ order_id?: string; }; path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Redirect */ 302: { content: never; }; }; }; /** * Get invoice * @description Get a list of invoices. */ "Invoice list": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { invoices: components["schemas"]["invoice.schema"][]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * List returns * @description List returns, sorted by most recent to least recent. */ "Returns list": { parameters: { query?: { updated_at_max?: components["parameters"]["updated-at-max.param"]; updated_at_min?: components["parameters"]["updated-at-min.param"]; }; header?: { "X-Page-Continue"?: components["parameters"]["page-continue.param"]; "X-Page-Size"?: components["parameters"]["page-size.param"]; }; path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Success */ 200: { headers: { "X-Page-Next": components["headers"]["page-next.header"]; }; content: { "application/json": { orders: components["schemas"]["order-read.schema"][]; returns: components["schemas"]["return-read.schema"][]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Download shipment document * @description Get a shipment document (label, commercial invoice, etc). */ "Shipment document download": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; shipmentId: components["parameters"]["shipment-id.param"]; documentType: components["parameters"]["document-type.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/pdf": string; "image/png": string; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Purchase shipping label * @description Purchase a shipping label based on origin, destination, carrier, service, and parcel information. */ "Shipment buy": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; requestBody: { content: { "application/json": { carrier: { /** * Carrier Account ID * @description ID for the carrier account that provides the shipping rate. */ id: string; }; destination: components["schemas"]["shipping-contact.schema"]; origin: components["schemas"]["shipping-contact.schema"]; parcel: components["schemas"]["parcel.schema"]; service: { /** @description Service level name */ name: string; }; }; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { shipment: components["schemas"]["shipment.schema"]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Get shipping rates * @description Get available shipping rates based on origin, destination, and parcel information. */ "Shipment rates": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; requestBody: { content: { "application/json": { destination: { address: components["schemas"]["address.schema"]; }; origin: { address: components["schemas"]["address.schema"]; }; parcel: components["schemas"]["parcel.schema"]; }; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { /** @description Available shipping rates */ rates: components["schemas"]["shipment-rate.schema"][]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * List webhooks * @description List webhooks for store. */ "Webhooks list": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { webhooks: components["schemas"]["webhook-read.schema"][]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Create or update webhook * @description Create webhook for store. Or if webhook already exists with `externalId`, update it. */ "Webhook create": { parameters: { path: { storeId: components["parameters"]["store-id.param"]; }; }; requestBody: { content: { "application/json": { webhook?: components["schemas"]["webhook-create.schema"]; }; }; }; responses: { /** @description Updated */ 200: { content: { "application/json": { webhook?: components["schemas"]["webhook-read.schema"]; }; }; }; /** @description Created */ 201: { content: { "application/json": { webhook?: components["schemas"]["webhook-read.schema"]; }; }; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Get webhook * @description Get a webhook. */ "Webhook get": { parameters: { path: { webhookId: components["parameters"]["webhook-id.param"]; }; }; responses: { /** @description Success */ 200: { content: { "application/json": { webhook: components["schemas"]["webhook-read.schema"]; }; }; }; }; }; /** * Update webhook * @description Update a webhook. */ "Webhook update": { parameters: { path: { webhookId: components["parameters"]["webhook-id.param"]; }; }; requestBody: { content: { "application/json": { webhook: components["schemas"]["webhook-update.schema"]; }; }; }; responses: { /** @description Success */ 204: { content: never; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** * Delete webhook * @description Delete a webhook. */ "Webhook delete": { parameters: { path: { webhookId: components["parameters"]["webhook-id.param"]; }; }; responses: { /** @description Deleted */ 204: { content: never; }; }; }; /** * Replay webhook * @description Replay a webhook. */ "Webhook replay": { parameters: { path: { webhookId: components["parameters"]["webhook-id.param"]; }; }; requestBody: { content: { "application/json": { /** Format: date-time */ start: string; }; }; }; responses: { /** @description Success */ 202: { content: never; }; /** @description Error */ default: { content: { "application/problem+json": components["schemas"]["error.schema"]; }; }; }; }; /** Return event */ "Webhook return event": { /** @description Return event webhook. */ requestBody: { content: { "application/json": { /** * At * Format: date-time * @description Event time */ at?: string; /** * Order * @description Order for return. */ order?: components["schemas"]["order-read.schema"]; /** * Return * @description Return. */ return?: components["schemas"]["return-read.schema"]; /** * @description Event type * @enum {string} */ type?: "backfill" | "created" | "updated"; }; }; }; responses: { /** @description Success. Return a 2xx status code to indicate success. */ "2xx": { content: never; }; /** @description Error. The event will be retried multiple times and then discarded. */ default: { content: never; }; }; }; }