@redotech/redo-api-schema
Version:
Common definitions for Redo API
1,795 lines (1,785 loc) • 67.7 kB
TypeScript
/**
* 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": {
/**
* Invoice (CSV)
* @description Get an invoice as a CSV.
*/
get: operations["Invoice csv get"];
};
"/invoices/pending/items.csv": {
/**
* Pending Invoice (CSV)
* @description Get an invoice as a CSV.
*/
get: operations["Invoice pending csv get"];
};
"/returns/{returnId}": {
/**
* 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}/process": {
/**
* Process Return
* @description **BETA**: This endpoint is in beta and subject to change.
*
* Trigger processing of a return with specified products.
*/
post: operations["Return process"];
parameters: {
path: {
returnId: components["parameters"]["return-id.param"];
};
};
};
"/returns/{returnId}/status": {
/**
* 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": {
/**
* Checkout Buttons UI
* @description Generate rendered 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": {
/**
* 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}/customer-subscriptions": {
/**
* Update Customer Subscriptions
* @description Update customer subscription status for SMS and email marketing and transactional messages. If the customer with that phone number or email does not exist, it will be created.
*/
post: operations["Customer subscriptions update"];
};
"/stores/{storeId}/events": {
/**
* Create custom event
* @description Create a custom event to trigger flows with merchant-defined event names and properties.
*
* Custom events allow merchants to trigger flows based on events from their own systems.
* Events can include custom properties that are accessible in email and SMS templates.
*
* ## Customer Matching
* The API matches customers by email or phone number. At least one must be provided.
*
* If no matching customer is found, the request will fail with a 404 error.
*
* ## Rate Limiting
* This endpoint is rate-limited to 100 requests per second per store.
*/
post: operations["Custom event create"];
};
"/stores/{storeId}/invoices": {
/**
* List Invoices
* @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": {
/**
* 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}/storefront/events": {
/**
* Receive Storefront Events
* @description Processes events from storefronts using Shopify pixel event schema
*/
post: operations["Storefront Event"];
};
"/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}": {
/**
* 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"];
};
/**
* Custom Event Request
* @description Custom event to trigger flows with merchant-defined event names and properties.
*/
"custom-event-request.schema": {
/** @description Customer email address (one of email or phone is required). */
email?: string;
/** @description The name of the custom event (e.g., 'user_registered', 'purchase_completed'). */
event_name: string;
/**
* Format: date-time
* @description ISO 8601 timestamp when the event occurred. Defaults to current time if not provided.
*/
event_timestamp?: string;
/** @description Customer phone number (one of email or phone is required). */
phone?: string;
/** @description Custom properties for this event. Access in templates using dot notation (e.g., {{ properties.product_name }}). */
properties?: {
[key: string]: unknown;
};
};
/**
* Custom Event Response
* @description Response after successfully creating a custom event.
*/
"custom-event-response.schema": {
/** @description The unique identifier for the created event. */
event_id: string;
/** @description The name of the custom event that was created. */
event_name: string;
/**
* @description Status of the event processing.
* @enum {string}
*/
status: "processed";
};
/** @description Email subscription updates */
"customer-subscription-email.schema": {
/**
* Format: email
* @description Email address
*/
email: string;
subscriptions: {
marketing?: components["schemas"]["subscription-status-marketing.schema"];
};
};
/** @description SMS subscription updates */
"customer-subscription-sms.schema": {
/** @description Phone number in E.164 format (e.g., +12345678900) */
phoneNumber: string;
subscriptions: {
marketing?: components["schemas"]["subscription-status-marketing.schema"];
transactional?: components["schemas"]["subscription-status-transactional.schema"];
};
};
/** @description Customer subscription update response */
"customer-subscription-update-response.schema": {
/** @description Human-readable success message */
message: string;
/** @description Whether the operation was successful */
success: boolean;
/** @description Details of which subscriptions were updated */
updatedSubscriptions: {
email?: {
/** @description Whether email marketing was updated */
marketing?: boolean;
};
sms?: {
/** @description Whether SMS marketing was updated */
marketing?: boolean;
/** @description Whether SMS transactional was updated */
transactional?: boolean;
};
};
};
/**
* 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"];
};
/**
* Discounts
* @description The total amount discounted on the order before returns. This includes both order and line level discounts.
*/
discounts: components["schemas"]["money.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"];
})[];
/**
* Line Items Total
* @description Total price of all line items before discounts, shipping, and taxes.
*/
lineItemsTotal: components["schemas"]["money.schema"];
/**
* Name
* @description Shopify name.
*/
name: string;
/**
* Shipping Cost
* @description The total shipping cost for the order. This includes fees and any related discounts that were refunded.
*/
shippingCost: components["schemas"]["money.schema"];
/**
* Taxes
* @description Total taxes applied to the order.
*/
taxes: components["schemas"]["money.schema"];
/**
* Total
* @description The total price of the order, before returns. This includes taxes, discounts, and shipping costs.
*/
total: components["schemas"]["money.schema"];
};
/**
* 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": {
/**
* Compensation Methods
* @description Array of compensation methods available for this return
*/
compensationMethods?: ("refund" | "store_credit" | "exchange")[];
/**
* 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?: {
/** @description Total quantity of all exchange items */
itemCount?: number;
/** Line items */
items: {
/** ID */
id: string;
/** @description Original price for the exchange item without discounts and taxes */
originalPrice?: {
amount?: string;
currency?: string;
};
/** @description Subtotal price for the exchange item including discounts */
price?: {
amount?: string;
currency?: string;
tax?: 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;
};
/** Provision */
provision: components["schemas"]["exchange-provision.schema"];
/** @description Total tax for exchange items */
totalTax?: {
amount?: string;
currency?: string;
};
};
/**
* External Order IDs
* @description Array of external order IDs associated with this return
*/
externalOrderIds?: string[];
/**
* 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;
/**
* Internal Created By Name
* @description Name of the internal team member who created this return
*/
internalCreatedByName?: string;
/** @description Return items */
items: ({
/** @description Assessment records for this return item. Only applicable for warranties. */
assessments?: ({
/** @description User assigned to this assessment */
assignedUser: {
email: string;
firstName: string;
id: string;
lastName: string;
name: string;
};
/** @description Assessment responses */
responses: ({
/** @constant */
type: "short_text";
/** @description Short text response value */
value: string;
} | {
/** @constant */
type: "long_text";
/** @description Long text response value */
value: string;
} | {
/** @constant */
type: "select";
/** @description Select response values (array of selected options) */
value: string[];
} | {
/** @constant */
type: "number";
/** @description Number response value */
value: number;
} | {
/** @constant */
type: "boolean";
/** @description Boolean response value */
value: boolean;
} | {
/** @constant */
type: "file_upload";
/** @description File upload response values (array of file URLs or identifiers) */
value: string[];
} | {
/** @constant */
type: "date";
/**
* Format: date-time
* @description Date response value
*/
value: string;
})[];
})[];
/** @description Customer's comment about the return */
customerComment?: string;
/**
* Exchange item
* @description Exchange item details if this return item is being exchanged
*/
exchangeItem?: {
product?: {
externalId?: string;
name?: string;
};
quantity?: number;
variant?: {
externalId?: string;
name?: string;
};
};
/** @description Whether this is a green return (no physical return required) */
greenReturn?: boolean;
/**
* ID
* @description Return item ID.
*/
id: string;
/** @description Multiple choice questions and answers for this return item */
multipleChoiceQuestions?: {
/** @description The selected answer */
answer: string;
/** @description The question text */
question: string;
}[];
/**
* Order item
* @description Order line item
*/
orderItem: {
/**
* ID
* @description Line item reference ID in format: {orderId}/{lineItemIndex}
*/
id: string;
/**
* Line Item ID
* @description Original Shopify line item ID
*/
line_item_id?: string;
};
/** @description Product adjustment details */
productAdjustment?: string;
/** @description Product ID */
productId?: string;
/** @description Quantity of items being returned */
quantity: number;
/** @description Primary return reason */
reason: string;
/** @description Return reason code */
reasonCode?: string;
/** @description Array of return reason codes */
reasonCodes?: string[];
/** @description Array of return reasons */
reasons?: string[];
/** @description Refund details */
refund?: {
/** Amount */
amount: components["schemas"]["money.schema"];
/** @description Refund strategy */
type?: string;
};
/** @description Product SKU */
sku?: string;
/** @description Return item status */
status?: string;
/** @description Product variant ID */
variantId?: string;
})[];
/**
* Notes
* @description Teammembers generated notes and comments on the return
*/
notes?: {
/**
* Image URL
* @description Optional image URL attached to the note
*/
image?: string;
/**
* Message
* @description The note text
*/
message: string;
}[];
/**
* Order
* @description Original order.
*/
order: {
/**
* ID
* @description Order ID.
* @example abc123
*/
id: string;
};
/**
* Shipment
* @description Shipment, if has been made
*/
shipment?: components["schemas"]["return-shipment.schema"];
/**
* Shipments
* @description Array of all shipments associated with this return
*/
shipments?: components["schemas"]["return-shipment.schema"][];
/**
* Shopify Order IDs
* @description Array of Shopify order IDs (deprecated, use externalOrderIds)
*/
shopifyOrderIds?: 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"];
/**
* Totals
* @description Calculated totals for the return
*/
totals?: {
/** @description The upsell amount for the exchange order */
charge: {
amount: components["schemas"]["money.schema"];
};
/** @description Total value of new items in exchange */
exchange: {
amount: components["schemas"]["money.schema"];
};
/** @description Total refund amount excluding shipping */
refund: {
amount: components["schemas"]["money.schema"];
};
/** @description Total store credit amount */
storeCredit: {
amount: components["schemas"]["money.schema"];
};
};
/**
* Type
* @description Return type.
*/
type?: components["schemas"]["return-type.schema"];
/**
* Updated at
* Format: date-time
* @description Time of last update.
*/
updatedAt: string;
};
/**
* Return Shipment
* @description Return shipment tracking information
*/
"return-shipment.schema": {
/**
* Carrier
* @description Carrier code
*/
carrier?: string;
/**
* Postage Label
* @description Postage label URL
*/
postageLabel?: string;
/**
* Status
* @description Status of shipment
* @enum {string}
*/
status?: "unknown" | "pre_transit" | "in_transit" | "out_for_delivery" | "available_for_pickup" | "cancelled" | "delivered" | "error" | "failure" | "return_to_sender" | "expired";
/**
* Tracker
* @description Tracking number
*/
tracker?: string;
/**
* Tracking URL
* @description Tracking URL
*/
trackingUrl?: 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
* @description Identifier of the product.
*/
id: string;
};
/**
* Quantity
* @description Quantity.
*/
quantity: number;
/** @description Variant. */
variant: {
/**
* ID
* @description Identifier of the variant.
*/
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;
};
/**
* Storefront Event
* @description Shopify pixel event for storefront tracking.
*/
"storefront-event.schema": {
/** @description Anonymous identifier for users without account. */
anonymousId?: string;
/** @description Cart information. */
cart?: Record<string, never> | null;
/** @description Information about specific cart line item. */
cartLine?: Record<string, never>;
/** @description Checkout information. */
checkout?: Record<string, never>;
/** @description Collection information. */
collection?: Record<string, never>;
/** @description Customer information if available. */
customer?: Record<string, never> | null;
/**
* Format: email
* @description Customer email if available.
*/
customerEmail?: string;
/** @description Customer phone if available. */
customerPhone?: string;
/** @description Unique identifier for the event. */
eventId: string;
/**
* @description Name of the Shopify pixel event.
* @enum {string}
*/
eventName: "product_added_to_cart" | "product_removed_from_cart" | "product_viewed" | "checkout_started" | "checkout_completed" | "checkout_contact_info_submitted" | "page_viewed" | "collection_viewed";
/** @description Product variant information. */
productVariant?: Record<string, never>;
/**
* @description Source of the event.
* @enum {string}
*/
source: "AIMERCE";
/**
* Format: date-time
* @description ISO 8601 timestamp when the event occurred.
*/
timestamp: string;
/** @description Page URL without query parameters. */
urlWithoutParams?: string;
/** @description Complete page URL with query parameters. */
urlWithParams?: string;
[key: string]: unknown;
};
/** @description Marketing subscription status */
"subscription-status-marketing.schema": {
/**
* @description Subscription status
* @enum {string}
*/
subscriptionStatus: "subscribed" | "confirmed" | "unsubscribed";
/**
* @description Whether to trigger automations for this subscription change. Defaults to false.
* @default false
*/
triggerAutomations?: boolean;
/**
* Format: date-time
* @description ISO 8601 timestamp. If not provided, defaults to now.
*/
updatedAt?: string;
};
/** @description Transactional subscription status (order tracking) */
"subscription-status-transactional.schema": {
/**
* @description Subscription status. Only subscribed and unsubscribed are supported for transactional.
* @enum {string}
*/
subscriptionStatus: "subscribed" | "unsubscribed";
/**
* Format: date-time
* @description ISO 8601 timestamp. If not provided, defaults to now.
*/
updatedAt?: 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 Provider specific order name */
"provider-order-name"?: string;
/** @description Return ID */
"return-id.param": string;
/** @description Shipment ID */
"shipment-id.param": string;
/** @description Shopify specific order name */
"shopify-order-name"?: 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 {
/**
* Invoice (CSV)
* @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"];
};
};
};
};
/**
* Pending Invoice (CSV)
* @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"];
};
};
};
};
/**
* 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"];
};
};
};
};
/**
* Process Return
* @description **BETA**: This endpoint is in beta and subject to change.
*
* Trigger processing of a return with specified products.
*/
"Return process": {
parameters: {
path: {
returnId: components["parameters"]["return-id.param"];
};
};
requestBody: {
content: {
"application/json": {
/** @description Notes to send to customer. These can be rejection notes or processing notes. */
customerNotes?: string;
/** @description Array of products to process or reject */
products: ({
/**
* @description Product ID found on the return
* @example 64e4d5e837572a4813b73e41
*/
_id: string;
/** @description Processing details. You may only have one of reject or processInput. */
processInput?: ({
/** @description Adjustment amount. This will be the amount that is credited to the customer, overriding the original product value. */
newMerchantAdjustment?: number | null;
/** @description Whether to restock the item */
restock?: boolean;
}) | null;
/**
* @description Reject this product. You may only have one of reject or processInput.
* @default false
*/
reject?: boolean;
})[];
};
};
};
responses: {
/** @description Processing request completed */
200: {
content: {
"application/json": {
/** @description Status message */
message?: string;
};
};
};
/** @description Bad request (e.g., missing products array) */
400: {
content: {
"application/problem+json": components["schemas"]["error.schema"];
};
};
/** @description Error */
default: {
content: {
"application/problem+json": components["schemas"]["error.schema"];
};
};
};
};
/**
* 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;
};
};
};
/**
* Checkout Buttons UI