@pfantato/printful-ts
Version:
Typescript SDK to integrate with Printful
772 lines (771 loc) • 27 kB
TypeScript
import { z } from 'zod';
export declare const CreateOrderEstimationTaskBody: z.ZodObject<z.objectUtil.extendShape<{
recipient: z.ZodObject<{
name: z.ZodString;
company: z.ZodString;
address1: z.ZodString;
address2: z.ZodString;
city: z.ZodString;
state_code: z.ZodString;
state_name: z.ZodString;
country_code: z.ZodString;
country_name: z.ZodString;
zip: z.ZodString;
phone: z.ZodString;
email: z.ZodString;
tax_number: z.ZodString;
}, "strip", z.ZodTypeAny, {
email?: string;
name?: string;
company?: string;
address1?: string;
address2?: string;
city?: string;
state_code?: string;
state_name?: string;
country_code?: string;
country_name?: string;
zip?: string;
phone?: string;
tax_number?: string;
}, {
email?: string;
name?: string;
company?: string;
address1?: string;
address2?: string;
city?: string;
state_code?: string;
state_name?: string;
country_code?: string;
country_name?: string;
zip?: string;
phone?: string;
tax_number?: string;
}>;
order_items: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<z.objectUtil.extendShape<{
id: z.ZodNumber;
source: z.ZodEnum<["catalog", "product_template", "warehouse"]>;
external_id: z.ZodNullable<z.ZodString>;
quantity: z.ZodNumber;
retail_price: z.ZodString;
name: z.ZodString;
_links: z.ZodObject<{
self: z.ZodObject<{
href: z.ZodString;
}, "strip", z.ZodTypeAny, {
href?: string;
}, {
href?: string;
}>;
}, "strip", z.ZodTypeAny, {
self?: {
href?: string;
};
}, {
self?: {
href?: string;
};
}>;
}, {
source: z.ZodLiteral<"warehouse">;
warehouse_product_variant_id: z.ZodNumber;
}>, "strip", z.ZodTypeAny, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "warehouse";
external_id?: string;
quantity?: number;
retail_price?: string;
warehouse_product_variant_id?: number;
}, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "warehouse";
external_id?: string;
quantity?: number;
retail_price?: string;
warehouse_product_variant_id?: number;
}>, z.ZodObject<z.objectUtil.extendShape<{
id: z.ZodNumber;
source: z.ZodEnum<["catalog", "product_template", "warehouse"]>;
external_id: z.ZodNullable<z.ZodString>;
quantity: z.ZodNumber;
retail_price: z.ZodString;
name: z.ZodString;
_links: z.ZodObject<{
self: z.ZodObject<{
href: z.ZodString;
}, "strip", z.ZodTypeAny, {
href?: string;
}, {
href?: string;
}>;
}, "strip", z.ZodTypeAny, {
self?: {
href?: string;
};
}, {
self?: {
href?: string;
};
}>;
}, {
source: z.ZodLiteral<"catalog">;
catalog_variant_id: z.ZodNumber;
placements: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<Pick<{
placement: z.ZodString;
technique: z.ZodEnum<["dtg", "digital", "cut-sew", "uv", "embroidery", "sublimation", "dtfilm"]>;
print_area_width: z.ZodNumber;
print_area_height: z.ZodNumber;
layers: z.ZodArray<z.ZodObject<{
type: z.ZodString;
layer_options: z.ZodArray<z.ZodObject<{
name: z.ZodString;
techniques: z.ZodArray<z.ZodEnum<["dtg", "digital", "cut-sew", "uv", "embroidery", "sublimation", "dtfilm"]>, "many">;
type: z.ZodString;
values: z.ZodArray<z.ZodUnknown, "many">;
}, "strip", z.ZodTypeAny, {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}, {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}>, "many">;
}, "strip", z.ZodTypeAny, {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}, {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}>, "many">;
placement_options: z.ZodArray<z.ZodObject<{
name: z.ZodString;
techniques: z.ZodArray<z.ZodEnum<["dtg", "digital", "cut-sew", "uv", "embroidery", "sublimation", "dtfilm"]>, "many">;
type: z.ZodString;
values: z.ZodArray<z.ZodUnknown, "many">;
}, "strip", z.ZodTypeAny, {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}, {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}>, "many">;
conflicting_placements: z.ZodArray<z.ZodString, "many">;
}, "placement_options" | "layers" | "placement" | "technique">, {
status: z.ZodEnum<["ok", "failed"]>;
status_explanation: z.ZodString;
}>, "strip", z.ZodTypeAny, {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}, {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}>, "many">;
product_options: z.ZodArray<z.ZodObject<{
name: z.ZodEnum<["inside_pocket", "stitch_color", "notes", "lifelike", "custom_border_color", "base_color", "trim_color", "color_reduction_mode"]>;
value: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}, {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}>, "many">;
}>, "strip", z.ZodTypeAny, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
placements?: {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}[];
source?: "catalog";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_options?: {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}[];
}, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
placements?: {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}[];
source?: "catalog";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_options?: {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}[];
}>, z.ZodObject<z.objectUtil.extendShape<{
id: z.ZodNumber;
source: z.ZodEnum<["catalog", "product_template", "warehouse"]>;
external_id: z.ZodNullable<z.ZodString>;
quantity: z.ZodNumber;
retail_price: z.ZodString;
name: z.ZodString;
_links: z.ZodObject<{
self: z.ZodObject<{
href: z.ZodString;
}, "strip", z.ZodTypeAny, {
href?: string;
}, {
href?: string;
}>;
}, "strip", z.ZodTypeAny, {
self?: {
href?: string;
};
}, {
self?: {
href?: string;
};
}>;
}, {
source: z.ZodLiteral<"product_template">;
product_template_id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
catalog_variant_id: z.ZodNumber;
}>, "strip", z.ZodTypeAny, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "product_template";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_template_id?: string | number;
}, {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "product_template";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_template_id?: string | number;
}>]>, "many">;
retail_costs: z.ZodObject<Pick<{
calculation_status: z.ZodEnum<["done", "calculating", "failed"]>;
currency: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
subtotal: z.ZodNullable<z.ZodString>;
discount: z.ZodNullable<z.ZodString>;
shipping: z.ZodNullable<z.ZodString>;
digitization: z.ZodNullable<z.ZodString>;
additional_fee: z.ZodNullable<z.ZodString>;
fulfillment_fee: z.ZodNullable<z.ZodString>;
total: z.ZodNullable<z.ZodString>;
retail_delivery_fee: z.ZodNullable<z.ZodString>;
vat: z.ZodNullable<z.ZodString>;
tax: z.ZodNullable<z.ZodString>;
}, "currency" | "discount" | "shipping" | "tax">, "strip", z.ZodTypeAny, {
currency?: string;
discount?: string;
shipping?: string;
tax?: string;
}, {
currency?: string;
discount?: string;
shipping?: string;
tax?: string;
}>;
}, {
store_id: z.ZodOptional<z.ZodNumber>;
}>, z.UnknownKeysParam, z.ZodTypeAny, {
store_id?: number;
retail_costs?: {
currency?: string;
discount?: string;
shipping?: string;
tax?: string;
};
recipient?: {
email?: string;
name?: string;
company?: string;
address1?: string;
address2?: string;
city?: string;
state_code?: string;
state_name?: string;
country_code?: string;
country_name?: string;
zip?: string;
phone?: string;
tax_number?: string;
};
order_items?: ({
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "warehouse";
external_id?: string;
quantity?: number;
retail_price?: string;
warehouse_product_variant_id?: number;
} | {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
placements?: {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}[];
source?: "catalog";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_options?: {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}[];
} | {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "product_template";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_template_id?: string | number;
})[];
}, {
store_id?: number;
retail_costs?: {
currency?: string;
discount?: string;
shipping?: string;
tax?: string;
};
recipient?: {
email?: string;
name?: string;
company?: string;
address1?: string;
address2?: string;
city?: string;
state_code?: string;
state_name?: string;
country_code?: string;
country_name?: string;
zip?: string;
phone?: string;
tax_number?: string;
};
order_items?: ({
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "warehouse";
external_id?: string;
quantity?: number;
retail_price?: string;
warehouse_product_variant_id?: number;
} | {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
placements?: {
status?: "failed" | "ok";
placement_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
layers?: {
type?: string;
layer_options?: {
values?: unknown[];
type?: string;
name?: string;
techniques?: ("dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm")[];
}[];
}[];
placement?: string;
technique?: "dtg" | "digital" | "cut-sew" | "uv" | "embroidery" | "sublimation" | "dtfilm";
status_explanation?: string;
}[];
source?: "catalog";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_options?: {
value?: boolean;
name?: "inside_pocket" | "stitch_color" | "notes" | "lifelike" | "custom_border_color" | "base_color" | "trim_color" | "color_reduction_mode";
}[];
} | {
name?: string;
id?: number;
_links?: {
self?: {
href?: string;
};
};
source?: "product_template";
external_id?: string;
quantity?: number;
retail_price?: string;
catalog_variant_id?: number;
product_template_id?: string | number;
})[];
}>;
export type CreateOrderEstimationTaskBody = z.infer<typeof CreateOrderEstimationTaskBody>;
export declare const CreateOrderEstimationTaskResponse: z.ZodObject<{
data: z.ZodObject<{
id: z.ZodNumber;
status: z.ZodEnum<["pending", "failed", "completed"]>;
costs: z.ZodNullable<z.ZodObject<{
calculation_status: z.ZodEnum<["done", "calculating", "failed"]>;
currency: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
subtotal: z.ZodNullable<z.ZodString>;
discount: z.ZodNullable<z.ZodString>;
shipping: z.ZodNullable<z.ZodString>;
digitization: z.ZodNullable<z.ZodString>;
additional_fee: z.ZodNullable<z.ZodString>;
fulfillment_fee: z.ZodNullable<z.ZodString>;
total: z.ZodNullable<z.ZodString>;
retail_delivery_fee: z.ZodNullable<z.ZodString>;
vat: z.ZodNullable<z.ZodString>;
tax: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
}, {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
}>>;
retail_costs: z.ZodNullable<z.ZodObject<Pick<{
calculation_status: z.ZodEnum<["done", "calculating", "failed"]>;
currency: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
subtotal: z.ZodNullable<z.ZodString>;
discount: z.ZodNullable<z.ZodString>;
shipping: z.ZodNullable<z.ZodString>;
digitization: z.ZodNullable<z.ZodString>;
additional_fee: z.ZodNullable<z.ZodString>;
fulfillment_fee: z.ZodNullable<z.ZodString>;
total: z.ZodNullable<z.ZodString>;
retail_delivery_fee: z.ZodNullable<z.ZodString>;
vat: z.ZodNullable<z.ZodString>;
tax: z.ZodNullable<z.ZodString>;
}, "total" | "currency" | "calculation_status" | "subtotal" | "discount" | "shipping" | "vat" | "tax">, "strip", z.ZodTypeAny, {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
}, {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
}>>;
failure_reasons: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "failed" | "pending" | "completed";
id?: number;
costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
};
retail_costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
};
failure_reasons?: string[];
}, {
status?: "failed" | "pending" | "completed";
id?: number;
costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
};
retail_costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
};
failure_reasons?: string[];
}>;
}, "strip", z.ZodTypeAny, {
data?: {
status?: "failed" | "pending" | "completed";
id?: number;
costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
};
retail_costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
};
failure_reasons?: string[];
};
}, {
data?: {
status?: "failed" | "pending" | "completed";
id?: number;
costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
digitization?: string;
additional_fee?: string;
fulfillment_fee?: string;
retail_delivery_fee?: string;
vat?: string;
tax?: string;
};
retail_costs?: {
total?: string;
currency?: string;
calculation_status?: "done" | "calculating" | "failed";
subtotal?: string;
discount?: string;
shipping?: string;
vat?: string;
tax?: string;
};
failure_reasons?: string[];
};
}>;
export type CreateOrderEstimationTaskResponse = z.infer<typeof CreateOrderEstimationTaskResponse>;