323 lines
9.2 KiB
TypeScript
323 lines
9.2 KiB
TypeScript
import { NullablePartial } from "#shared/NullablePartail.js"
|
|
|
|
export declare namespace Shopify {
|
|
export type DeliveryMethod = {
|
|
id: number,
|
|
method_type: "local" | "delivery" | string,
|
|
min_delivery_date_time: string,
|
|
max_delivery_date_time: string,
|
|
additional_information: {
|
|
|
|
},
|
|
service_code: "Economy" | string,
|
|
source_reference: "Shopify" | string,
|
|
branded_promise: {
|
|
name: string,
|
|
handle: string
|
|
},
|
|
presented_name: "Economy" | string,
|
|
f
|
|
}
|
|
|
|
export type FulfillmentOrder = {
|
|
id: string,
|
|
order_id: number,
|
|
shop_id: number,
|
|
status: "open" | "close" | "hold",
|
|
assigned_location_id: number,
|
|
destienation: Address,
|
|
delivery_method: DeliveryMethod,
|
|
fulfill_at: string, // solo fecha, sin hora
|
|
fulfill_by: string, // solo fecha, sin hora
|
|
fulfillment_holds: {
|
|
reason: string, // hay una lista de codigos de fulfillment_holds
|
|
reason_notes: string
|
|
}[],
|
|
international_duties: {
|
|
// Lista de aranceles
|
|
},
|
|
line_items: LineItem[],
|
|
request_status: "submitted" | "unsubmitted" | string,
|
|
supported_actions: string[],
|
|
merchant_request: {
|
|
message: string,
|
|
request_options: {
|
|
shipping_method: string,
|
|
note: string,
|
|
date: string, // ISO date
|
|
},
|
|
kind: string,
|
|
}[],
|
|
assigned_location: Address,
|
|
created_at: string, // ISO date
|
|
updated_at: string, // ISO date
|
|
}
|
|
|
|
export type Fulfillment = {
|
|
|
|
}
|
|
|
|
export type ShippingLine = {
|
|
id: number,
|
|
carrier_identifier: string,
|
|
code: string,
|
|
current_discounted_price_set: PriceSet,
|
|
discounted_price: string,
|
|
discounted_price_set: PriceSet,
|
|
is_removed: boolean,
|
|
phone: string,
|
|
price: string,
|
|
price_set: PriceSet,
|
|
requested_fulfillment_service_id: number,
|
|
source: string,
|
|
title: string,
|
|
tax_lines: TaxLine[],
|
|
discount_allocations: unknown[]
|
|
}
|
|
|
|
type LineItem = NullablePartial<{
|
|
id: number,
|
|
admin_graphql_api_id: string,
|
|
attributed_staffs: unknown[],
|
|
current_quantity: number,
|
|
fulfillable_quantity: number,
|
|
fulfillment_service: string,
|
|
fulfillment_status: string,
|
|
gift_card: boolean,
|
|
grams: number,
|
|
name: string,
|
|
price: string,
|
|
price_set: PriceSet,
|
|
product_exists: boolean,
|
|
product_id: number,
|
|
properties: { name: string, value: string }[],
|
|
quantity: number,
|
|
requires_shipping: boolean,
|
|
sku: string,
|
|
taxable: boolean,
|
|
title: string,
|
|
total_discount: string,
|
|
total_discount_set: PriceSet,
|
|
variant_id: number,
|
|
variant_inventory_management: unknown,
|
|
variant_title: string,
|
|
vendor: string,
|
|
tax_lines: TaxLine[],
|
|
duties: unknown[],
|
|
discount_allocations: unknown[]
|
|
}>
|
|
|
|
type DiscountAplication = {
|
|
target_type: string,
|
|
type: string,
|
|
value: string,
|
|
value_type: string,
|
|
allocation_method: string,
|
|
target_selection: string,
|
|
title: string,
|
|
}
|
|
|
|
export type Address = NullablePartial<{
|
|
id: number,
|
|
customer_id: number,
|
|
first_name: string,
|
|
last_name: string,
|
|
company: string,
|
|
address1: string,
|
|
address2: string,
|
|
city: string,
|
|
province: string,
|
|
country: string,
|
|
zip: string,
|
|
phone: string,
|
|
name: string,
|
|
province_code: string,
|
|
country_code: string,
|
|
country_name: string,
|
|
default: boolean
|
|
}>
|
|
|
|
export type CustomerData = NullablePartial<{
|
|
id: number,
|
|
created_at: string,
|
|
updated_at: string,
|
|
first_name: string,
|
|
last_name: string,
|
|
state: string,
|
|
note: string,
|
|
verified_email: boolean,
|
|
multipass_identifier: string,
|
|
tax_exempt: boolean,
|
|
email_marketing_consent: {
|
|
state: string,
|
|
opt_in_level: string,
|
|
consent_updated_at: string,
|
|
},
|
|
sms_marketing_consent: boolean,
|
|
tags: string,
|
|
email: string,
|
|
phone: string,
|
|
currency: string,
|
|
tax_exemptions: unknown[],
|
|
admin_graphql_api_id: string,
|
|
default_address: Address
|
|
}>
|
|
|
|
export type BillingData = {
|
|
first_name: string,
|
|
address1: string,
|
|
phone: string,
|
|
city: string,
|
|
zip: string,
|
|
province: string,
|
|
country: string,
|
|
last_name: string,
|
|
address2: string,
|
|
company: string,
|
|
latitude: number,
|
|
longitude: number,
|
|
name: string,
|
|
country_code: string,
|
|
province_code: string,
|
|
}
|
|
|
|
export type TaxLine = NullablePartial<{
|
|
price: string,
|
|
rate: 0.21,
|
|
title: string,
|
|
price_set: PriceSet,
|
|
channel_liable: boolean
|
|
}>
|
|
|
|
export type NoteAtributte = {
|
|
name: string,
|
|
value: string
|
|
}
|
|
|
|
export type ClientDetails = NullablePartial<{
|
|
accept_language: string,
|
|
browser_height: number,
|
|
browser_width: number,
|
|
browser_ip: string,
|
|
session_hash: string,
|
|
user_agent: string,
|
|
}>
|
|
|
|
/**
|
|
* https://shopify.dev/docs/api/admin-graphql/2026-01/objects/MoneyBag
|
|
*/
|
|
export type PriceSet = NullablePartial<{
|
|
shop_money: {
|
|
amount: string,
|
|
currency_code: string
|
|
},
|
|
presentment_money: {
|
|
amount: string
|
|
currency_code: string
|
|
}
|
|
|
|
}>
|
|
export type MoneyBag = PriceSet
|
|
|
|
// Webhook orders/create
|
|
export type OrderCreate = Order
|
|
export type OrderUpdate = Order
|
|
export type OrderDelete = Order
|
|
|
|
export type Order = NullablePartial<{
|
|
id: number,
|
|
admin_graphql_api_id: string,
|
|
app_id: number,
|
|
browser_ip: string,
|
|
buyer_accepts_marketing: boolean,
|
|
cancel_reason: unknown,
|
|
cancelled_at: string,
|
|
cart_token: string,
|
|
checkout_id: number,
|
|
checkout_token: string,
|
|
client_details: NullablePartial<ClientDetails>,
|
|
closed_at: string,
|
|
company: string,
|
|
confirmation_number: string,
|
|
confirmed: boolean,
|
|
contact_email: string,
|
|
created_at: string,
|
|
currency: string,
|
|
current_subtotal_price: string,
|
|
current_subtotal_price_set: NullablePartial<PriceSet>,
|
|
current_total_additional_fees_set: string,
|
|
current_total_discounts: string,
|
|
current_total_discounts_set: NullablePartial<PriceSet>
|
|
current_total_duties_set: unknown,
|
|
current_total_price: string,
|
|
current_total_price_set: NullablePartial<PriceSet>
|
|
current_total_tax: string,
|
|
current_total_tax_set: NullablePartial<PriceSet>
|
|
customer_locale: string,
|
|
device_id: unknown,
|
|
discount_codes: unknown[],
|
|
duties_included: boolean,
|
|
email: string,
|
|
estimated_taxes: boolean,
|
|
financial_status: string,
|
|
fulfillment_status: unknown,
|
|
landing_site: string,
|
|
landing_site_ref: string,
|
|
location_id: unknown,
|
|
merchant_business_entity_id: string,
|
|
merchant_of_record_app_id: unknown,
|
|
name: string,
|
|
note: unknown,
|
|
note_attributes: NoteAtributte[]
|
|
number: number,
|
|
order_number: number,
|
|
order_status_url: string,
|
|
original_total_additional_fees_set: PriceSet,
|
|
original_total_duties_set: PriceSet,
|
|
payment_gateway_names: string[],
|
|
phone: string,
|
|
po_number: string,
|
|
presentment_currency: string,
|
|
processed_at: string,
|
|
reference: string,
|
|
referring_site: string,
|
|
source_identifier: string,
|
|
source_name: string,
|
|
source_url: string,
|
|
subtotal_price: string,
|
|
subtotal_price_set: PriceSet
|
|
tags: string,
|
|
tax_exempt: boolean,
|
|
tax_lines: TaxLine[],
|
|
taxes_included: boolean,
|
|
test: boolean,
|
|
token: string,
|
|
total_cash_rounding_payment_adjustment_set: PriceSet,
|
|
total_cash_rounding_refund_adjustment_set: PriceSet,
|
|
total_discounts: string,
|
|
total_discounts_set: PriceSet,
|
|
total_line_items_price: string,
|
|
total_line_items_price_set: PriceSet
|
|
total_outstanding: string,
|
|
total_price: string,
|
|
total_price_set: PriceSet,
|
|
total_shipping_price_set: PriceSet,
|
|
total_tax: string,
|
|
total_tax_set: PriceSet,
|
|
total_tip_received: string,
|
|
total_weight: number,
|
|
updated_at: string,
|
|
user_id: string,
|
|
billing_address: NullablePartial<BillingData>,
|
|
customer: CustomerData,
|
|
discount_applications: NullablePartial<DiscountAplication>[],
|
|
fulfillments: unknown[],
|
|
line_items: LineItem[],
|
|
payment_terms: unknown,
|
|
refunds: unknown,
|
|
shipping_address: Address,
|
|
shipping_lines: NullablePartial<ShippingLine>[],
|
|
returns: unknown[]
|
|
}>
|
|
}
|