Adding and displaying products
Ordering and payments
Post-purchase
Monetization
Testing
- Apple Pay
- 3D-S (3D-Secure) Challenge
- Handling GraphQL Input Validation Errors
- Sell Anything API
- Tokenize a payment method
- JWT Authentication
- FAQs
Start an integration
Solutions & Guides
Appendix
Events
This page documents all webhooks sent by Rye.
Webhook taxonomy
Payment related webhooks
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:00Z",
"type": "PAYMENT_SUCCEEDED",
"data": {
"marketplace": "shopify",
"amount": 100
}
}
Product related webhooks
Note: You should interpret the PRODUCT_UPDATED
webhook as an upsert, as Rye currently does not send a separate event for when products are first created inside our system. This behavior is likely to change in future, as firing a separate PRODUCT_CREATED
event is on our roadmap.
Product related webhooks are fired when our product catalog is updated. Subscriptions are created for your account when you request a product or store to be tracked by the Sell Anything API.
The product
field in the webhook payload comes in a similar format to the response of the productByID
query.
{
"id": "ffd4ee63-b911-48a2-84fe-8ba445746b0b",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2024-03-22T23:57:48.009Z",
"type": "PRODUCT_UPDATED",
"marketplace": "amazon",
"data": {
"product": {
"id": "B00A2KD8NY",
"title": "OXO Good Grips 3-in-1 Egg Separator, White/Yellow 1 Count (Pack of 1)",
"url": "https://www.amazon.com/OXO-Good-Grips-Separator-White/dp/B00A2KD8NY",
"vendor": "OXO",
// ...
}
}
}
Order submission related webhooks
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:03Z",
"type": "ORDER_SUBMISSION_STARTED",
"data": {
"marketplace": "shopify"
}
}
Order cancellation related webhooks (Amazon)
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:03Z",
"type": "ORDER_CANCEL_STARTED",
"data": {
"marketplace": "amazon",
"startedAt": "2023-09-07T17:49:07.267Z"
}
}
Order placed and failure related webhooks
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:06Z",
"type": "ORDER_PLACED",
"data": {
"marketplace": "shopify",
"order": {
"currency": "USD",
"shippingCents": 500,
"subtotalCents": 2000,
"taxCents": 200,
"totalCents": 2700,
"orderEmailOverride": "[[email protected]](/cdn-cgi/l/email-protection)"
}
}
}
Tracking related webhooks
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:09Z",
"type": "TRACKING_OBTAINED",
"data": {
"marketplace": "shopify",
"order": {
"fulfillments": [
{
"products": [
{
"quantity": 1,
"variantId": "41160207204557"
}
],
"trackingDetails": [
{
"trackingNumber": "1Z87F765679738",
"courierUrl": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z87F765679738",
"courierName": "UPS"
}
]
}
]
}
}
}
Returns related webhooks (Shopify Sync API)
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:09Z",
"type": "RETURN_REQUESTED",
"data": {
"marketplace": "shopify",
"returnId": "123456",
"requestedAt": "2023-06-27T12:00:09Z",
"requestedLineItems": [
{
"variantId": "123456"
}
]
}
}
Returns related webhooks (Amazon)
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:09Z",
"type": "RETURN_REQUESTED",
"data": {
"marketplace": "amazon",
"returnId": "123456",
"requestedAt": "2023-06-27T12:00:09Z",
"requestedLineItems": [
{
"productId": "123456",
"status": "RETURN_REQUESTED",
}
]
}
}
Developer related webhooks
{
"id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
"developerId": "xDasf23Jk4LKlxOq",
"createdAt": "2023-06-27T12:00:09Z",
"type": "SHOPIFY_APP_CONNECTED",
"data": {
"shopDomain": "rye.myshopify.com",
}
}
Webhook types
The webhook body is JSON formatted. If your project is Typescript based you can use these types.
/**
* How public events are represented on data transfer
*/
export type RyeWebhook = PaymentSucceededWebhook | PaymentFailedWebhook | PaymentRefundedWebhook | OrderSubmissionStartedWebhook | OrderSubmissionSucceededWebhook | OrderPlacedWebhook | OrderFailedWebhook | PublicOrderCancelledWebhook | PublicOrderCancelFailedWebhook | PublicOrderCancelStartedWebhook | PublicOrderCancelRequestedWebhook | ReturnApprovedWebhook | ReturnDeniedWebhook | ReturnCancelledWebhook | ReturnRequestedWebhook | ReturnRequestAcceptedWebhook | ReturnClosedWebhook | TrackingObtainedWebhook;
export type PaymentSucceededWebhook = BaseWebhook & {
type: WebhookType.PaymentSucceeded;
data: {
marketplace: Marketplace;
amount: number;
};
};
export type BaseWebhook = {
// Unique identifier for the event
id: string;
// Unique ID of the request. This is used to group events together.
requestId: string;
// ID of developer who initiated the request
developerId: string;
// Creation time of the event
createdAt: string;
};
export type Marketplace = AmazonMarketplace | ShopifyMarketplace;
export enum WebhookType {
PaymentSucceeded = 'PAYMENT_SUCCEEDED',
PaymentFailed = 'PAYMENT_FAILED',
PaymentRefunded = 'PAYMENT_REFUNDED',
OrderSubmissionStarted = 'ORDER_SUBMISSION_STARTED',
OrderSubmissionSucceeded = 'ORDER_SUBMISSION_SUCCEEDED',
OrderPlaced = 'ORDER_PLACED',
OrderFailed = 'ORDER_FAILED',
OrderCancelFailed = 'ORDER_CANCEL_FAILED',
OrderCancelStarted = 'ORDER_CANCEL_STARTED',
OrderCancelRequested = 'ORDER_CANCEL_REQUESTED',
OrderCancelSucceeded = 'ORDER_CANCEL_SUCCEEDED',
TrackingObtained = 'TRACKING_OBTAINED',
ReturnRequested = 'RETURN_REQUESTED',
ReturnRequestAccepted = 'RETURN_REQUEST_ACCEPTED',
ReturnApproved = 'RETURN_APPROVED',
ReturnClosed = 'RETURN_CLOSED',
ReturnDenied = 'RETURN_DENIED',
ReturnCancelled = 'RETURN_CANCELLED'
}
export type PaymentFailedWebhook = BaseWebhook & {
type: WebhookType.PaymentFailed;
data: {
marketplace: Marketplace;
};
};
export type PaymentRefundedWebhook = BaseWebhook & {
type: WebhookType.PaymentRefunded;
data: Record<string, never>;
};
export type OrderSubmissionStartedWebhook = BaseWebhook & {
type: WebhookType.OrderSubmissionStarted;
data: {
marketplace: Marketplace;
};
};
export type OrderSubmissionSucceededWebhook = BaseWebhook & {
type: WebhookType.OrderSubmissionSucceeded;
data: {
marketplace: Marketplace;
};
};
export type OrderPlacedWebhook = BaseWebhook & {
type: WebhookType.OrderPlaced;
data: AmazonOrderPlacedData | ShopifyOrderPlacedData;
};
type AmazonOrderPlacedData = {
marketplace: AmazonMarketplace;
order: BasePlacedOrderDetails & {
amazonOrders: Pick<BaseAmazonOrder, 'amazonOrderId' | 'products'>[];
};
};
export type AmazonMarketplace = 'amazon';
export type BasePlacedOrderDetails = {
currency: string;
shippingCents: number;
subtotalCents: number;
taxCents: number;
totalCents: number;
discountCents: number;
};
export type BaseAmazonOrder = {
amazonOrderId: string;
// returnDetails?: {
// status:
// | EventType.ReturnRequested
// | EventType.ReturnRequestAccepted
// | EventType.ReturnApproved
// | EventType.ReturnDenied
// | EventType.ReturnClosed;
// date: Timestamp;
// reason?: string; //use this for failed status
// requestedLineItems?: AmazonReturnLineItem[];
// refundedLineItems?: AmazonReturnLineItem[];
// };
cancellation?: {
status: WebhookType.OrderCancelFailed | WebhookType.OrderCancelSucceeded | WebhookType.OrderCancelStarted | WebhookType.OrderCancelRequested;
isManuallyCancelled?: boolean;
isOrderFailure?: boolean;
date: string;
reason?: string; //use this for failed status
};
products: AmazonOrderRequestProduct[];
};
export type AmazonOrderRequestProduct = {
quantity: number;
productId: string;
price?: AmazonProductPrice;
amazonBusinessPrice?: AmazonProductPrice | null;
};
export type AmazonProductPrice = {
value: number;
currencyCode: string;
};
type ShopifyOrderPlacedData = {
marketplace: ShopifyMarketplace;
order: BasePlacedOrderDetails & {
};
orderEmailOverride?: string;
};
export type ShopifyMarketplace = 'shopify';
export type OrderFailedWebhook = BaseWebhook & {
type: WebhookType.OrderFailed;
data: {
marketplace: Marketplace;
refund?: StripeRefund;
reasonCode?: OrderFailedReasonCode;
reason?: string;
};
};
type StripeRefund = {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'refund';
/**
* Amount, in %s.
*/
amount: number;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)
*/
description?: string;
/**
* This is the transaction number that appears on email receipts sent for this refund.
*/
receipt_number: string | null;
/**
* Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details.
*/
status: string | null;
};
export type OrderFailedReasonCode = 'INTERNAL_ERROR' | 'OUT_OF_STOCK' | 'INVALID_REQUEST' | 'UNAUTHENTICATED' | 'PERMISSION_DENIED' | 'USER_REQUESTED' | 'DENIED_BY_MARKETPLACE' | 'CANCELED' | 'SHIPPING_ADDRESS_BLACKLISTED' | 'SHIPPING_ADDRESS_UNAVAILABLE' | 'EXPIRED_PRODUCT_ID' | 'INSUFFICIENT_VARIANTS' | 'INVALID_QUANTITY' | 'INVALID_SHIPPING_METHOD' | 'INVALID_VARIANT' | 'PRODUCT_UNAVAILABLE' | 'SHIPPING_ADDRESS_REFUSED' | 'SHIPPING_METHOD_UNAVAILABLE' | 'UNSUPPORTED_PRODUCT_ID' | 'PAYMENT_FAILED';
export type PublicOrderCancelledWebhook = BaseWebhook & {
type: WebhookType.OrderCancelSucceeded;
data: {
marketplace: Marketplace;
cancelledAt: string;
refund?: StripeRefund;
};
};
export type PublicOrderCancelFailedWebhook = BaseWebhook & {
type: WebhookType.OrderCancelFailed;
data: {
marketplace: Marketplace;
reason: string;
};
};
export type PublicOrderCancelStartedWebhook = BaseWebhook & {
type: WebhookType.OrderCancelStarted;
data: {
marketplace: Marketplace;
startedAt: string;
};
};
export type PublicOrderCancelRequestedWebhook = BaseWebhook & {
type: WebhookType.OrderCancelRequested;
data: {
marketplace: Marketplace;
requestedAt: string;
marketplaceOrderId: string;
};
};
export type ReturnApprovedWebhook = BaseWebhook & {
type: WebhookType.ReturnApproved;
data: AmazonReturnApprovedWebhookData | ShopifyReturnApprovedWebhookData;
};
export type AmazonReturnApprovedWebhookData = BaseReturnApprovedWebhookData & {
marketplace: AmazonMarketplace;
requestedLineItems: AmazonReturnLineItem[];
returnId: string;
shippingLabelUrl: string;
refund: RefundBreakdown;
};
export type BaseReturnApprovedWebhookData = {
approvedAt: string;
returnId: string;
shippingLabelUrl: string;
};
export type AmazonReturnLineItem = BaseReturnLineItem & {
productId: string;
status: LineItemReturnStatus;
price?: AmazonProductPrice;
};
export type BaseReturnLineItem = {
quantity: number;
reason?: string;
productName?: string;
productImageUrl?: string;
refundAmount?: number;
};
export type LineItemReturnStatus = WebhookType.ReturnRequested | WebhookType.ReturnRequestAccepted | WebhookType.ReturnApproved | WebhookType.ReturnClosed | WebhookType.ReturnDenied | WebhookType.ReturnCancelled;
export type RefundBreakdown = {
subtotalCents: number;
taxCents: number;
totalCents: number;
currencyCode: string;
};
export type ShopifyReturnApprovedWebhookData = BaseReturnApprovedWebhookData & {
marketplace: ShopifyMarketplace;
requestedLineItems: ShopifyReturnLineItem[];
returnId: string;
shippingLabelUrl: string;
refundAmount: number;
};
export type ShopifyReturnLineItem = BaseReturnLineItem & {
variantId: string;
price: string;
currencyCode: string;
status: LineItemReturnStatus;
};
export type ReturnDeniedWebhook = BaseWebhook & {
type: WebhookType.ReturnDenied;
data: AmazonReturnDeniedWebhookData | ShopifyReturnDeniedWebhookData;
};
export type AmazonReturnDeniedWebhookData = BaseReturnDeniedWebhookData & {
marketplace: AmazonMarketplace;
requestedLineItems: AmazonReturnLineItem[];
returnId: string;
};
export type BaseReturnDeniedWebhookData = {
deniedAt: string;
returnId: string;
};
export type ShopifyReturnDeniedWebhookData = BaseReturnDeniedWebhookData & {
marketplace: ShopifyMarketplace;
requestedLineItems: ShopifyReturnLineItem[];
returnId: string;
};
export type ReturnCancelledWebhook = BaseWebhook & {
type: WebhookType.ReturnCancelled;
data: {
marketplace: Marketplace;
returnId: string;
cancelledAt: string;
};
};
export type ReturnRequestedWebhook = BaseWebhook & {
type: WebhookType.ReturnRequested;
data: AmazonReturnRequestedWebhookData | ShopifyReturnRequestedWebhookData;
};
export type AmazonReturnRequestedWebhookData = BaseReturnRequestedWebhookData & {
marketplace: AmazonMarketplace;
requestedLineItems: AmazonReturnLineItem[];
returnId: string;
};
export type BaseReturnRequestedWebhookData = {
requestedAt: string;
returnId: string;
};
export type ShopifyReturnRequestedWebhookData = BaseReturnRequestedWebhookData & {
marketplace: ShopifyMarketplace;
requestedLineItems: ShopifyReturnLineItem[];
returnId: string;
};
export type ReturnRequestAcceptedWebhook = BaseWebhook & {
type: WebhookType.ReturnRequestAccepted;
data: AmazonReturnRequestAcceptedWebhookData | ShopifyReturnRequestAcceptedWebhookData;
};
export type AmazonReturnRequestAcceptedWebhookData = BaseReturnRequestAcceptedWebhookData & {
marketplace: AmazonMarketplace;
acceptedAt: string;
returnId: string;
};
export type BaseReturnRequestAcceptedWebhookData = {
acceptedAt: string;
returnId: string;
};
export type ShopifyReturnRequestAcceptedWebhookData = BaseReturnRequestAcceptedWebhookData & {
marketplace: ShopifyMarketplace;
acceptedAt: string;
};
export type ReturnClosedWebhook = BaseWebhook & {
type: WebhookType.ReturnClosed;
data: AmazonReturnClosedWebhookData | ShopifyReturnClosedWebhookData;
};
export type AmazonReturnClosedWebhookData = BaseReturnClosedWebhookData & {
marketplace: AmazonMarketplace;
refundedLineItems: AmazonReturnLineItem[];
returnId: string;
};
export type BaseReturnClosedWebhookData = {
closedAt: string;
returnId: string;
};
export type ShopifyReturnClosedWebhookData = BaseReturnClosedWebhookData & {
marketplace: ShopifyMarketplace;
refundedLineItems: ShopifyReturnLineItem[];
returnId: string;
};
export type TrackingObtainedWebhook = BaseWebhook & {
type: WebhookType.TrackingObtained;
data: AmazonTrackingObtainedData | ShopifyTrackingObtainedData;
};
type AmazonTrackingObtainedData = {
marketplace: AmazonMarketplace;
order: BasePlacedOrderDetails & {
amazonOrders: AmazonOrderWithTrackingObtained[];
};
};
type AmazonOrderWithTrackingObtained = Pick<BaseAmazonOrder, 'amazonOrderId' | 'products'> & {
shipments?: AmazonShipment[];
};
/** The shipment sent to the customer. */
export type AmazonShipment = {
/**
* Date when the item was shipped.
* @format Firestore Timestamp
*/
shipmentDate: string;
/** The current status of the shipment. */
shipmentStatus: 'SHIPPED' | null;
/** The tracking number from the shipment carrier. */
carrierTracking: string | null;
/** The delivery status and estimated delivery date. */
deliveryInformation: DeliveryInformation;
/** The total number of items for shipping. */
shipmentQuantity: number;
/** The name of the shipment carrier. */
carrierName: string;
/** Tracking url for the shipment carrier */
carrierTrackingUrl: string;
};
/** The delivery status and estimated delivery date. */
export type DeliveryInformation = {
/**
* The expected delivery date of the shipment.
* @format Firestore Timestamp
*/
expectedDeliveryDate: string;
/** The current delivery status of the shipment. */
deliveryStatus: 'DELIVERED' | 'NOT_DELIVERED' | 'NOT_AVAILABLE';
};
export type ShopifyTrackingObtainedData = {
marketplace?: ShopifyMarketplace;
order: {
fulfillments: BaseShopifyOrderFulfillment[];
};
};
export type BaseShopifyOrderFulfillment = {
products: ShopifyOrderRequestProduct[];
trackingDetails: TrackedOrderDetails[];
};
export type ShopifyOrderRequestProduct = {
quantity: number;
variantId: string;
};
export type TrackedOrderDetails = {
trackingNumber: string;
courierUrl: string;
courierName: string;
};
export type PublicProductWebhook = AmazonProductUpdatedWebhook | ShopifyProductUpdatedWebhook | ShopifyProductDeletedWebhook | LegacyShopifyProductUpdatedWebhook;
export type AmazonProductUpdatedWebhook = BaseProductWebhook & {
type: ProductEventType.ProductUpdated;
marketplace: AmazonMarketplace;
data: {
product: TypedGqlAmazonProduct;
};
};
export type BaseProductWebhook = {
/** Unique identifier for the event */
id: string;
/** ID of developer to be notified */
developerId: string;
/** Creation time of the event */
createdAt: string;
};
export type TypedGqlAmazonProduct = AmazonProduct & {
__typename: 'AmazonProduct';
};
export type ShopifyProductUpdatedWebhook = BaseProductWebhook & {
type: ProductEventType.ProductUpdated;
marketplace: ShopifyMarketplace;
data: {
product: TypedGqlShopifyProduct;
};
};
export type TypedGqlShopifyProduct = ShopifyProduct & {
__typename: 'ShopifyProduct';
};
export type ShopifyProductDeletedWebhook = BaseProductWebhook & {
type: ShopifyProductWebhookType.ShopifyProductDeleted;
data: {
marketplace: ShopifyMarketplace;
productId: string;
};
};
// Represents the types of events related to a Shopify app.
export enum ShopifyProductWebhookType {
ShopifyProductUpdated = 'SHOPIFY_PRODUCT_UPDATED',
ShopifyProductDeleted = 'SHOPIFY_PRODUCT_DELETED'
}
/**
* @deprecated Prefer using the API-specific events instead.
*/
export type LegacyShopifyProductUpdatedWebhook = BaseProductWebhook & {
type: ShopifyProductWebhookType.ShopifyProductUpdated;
/**
* Canonical store domain event comes from
* @example 'my-cool-store.myshopify.com'
*/
storeDomain: string;
data: {
marketplace: ShopifyMarketplace;
product: ShopifyProductData;
};
};
export type ShopifyProductData = SnakeToCamelCaseObject<Omit<LegacyShopifyProduct, '_id'>>;
export type LegacyShopifyProduct = {
_id: string;
store_canonical_url: string;
request_domain: string;
currencyCode?: string;
date_updated?: string;
id: number;
title: string;
handle: string;
description: string;
description_text?: string;
published_at: string;
created_at: string;
vendor: string;
type: string;
tags: string[];
price: number;
price_min: number;
price_max: number;
available: boolean;
price_varies: boolean;
compare_at_price?: number;
compare_at_price_min?: number;
compare_at_price_max?: number;
compare_at_price_varies: boolean;
variants: Variant[];
images: string[];
featured_image: string;
options: Option[];
url: string;
media: Media[];
requires_selling_plan: boolean;
selling_plan_groups: SellingPlanGroup[];
};
export type Variant = {
id: number;
title: string;
option1?: string | null;
option2?: string | null;
option3?: string | null;
sku: string;
requires_shipping: boolean;
taxable: boolean;
featured_image?: VariantFeaturedImage;
featured_media?: Media;
available: boolean;
name: string;
public_title: string;
options: string[];
price: number;
weight: number;
compare_at_price?: number;
inventory_quantity: number;
inventory_management: string;
inventory_policy: string;
barcode: string;
requires_selling_plan: boolean;
selling_plan_allocations: SellingPlanAllocation[];
};
type VariantFeaturedImage = {
id: number;
product_id: number;
position: number;
created_at: string;
updated_at: string;
alt?: string;
width: number;
height: number;
src: string;
variant_ids: number[];
};
type Media = {
alt?: string;
id: number;
position: number;
preview_image: Previewimage;
aspect_ratio: number | null;
height: number;
media_type: string;
src: string;
width: number;
};
type Previewimage = {
aspect_ratio: number | null;
height: number;
width: number;
src: string;
};
type SellingPlanAllocation = {
price_adjustments: PriceAdjustment[];
price: number;
compare_at_price: number;
per_delivery_price: number;
selling_plan_id: number;
selling_plan_group_id: string;
};
type PriceAdjustment = {
position: number;
price: number;
};
type Option = {
name: string;
position: number;
values: string[];
};
type SellingPlanGroup = {
id: string;
name: string;
options: SellingPlanGroupOption[];
selling_plans: SellingPlan[];
app_id: string;
};
type SellingPlanGroupOption = {
name: string;
position: number;
values: string[];
};
type SellingPlan = {
id: number;
name: string;
description?: string;
options: SellingPlanOption[];
recurring_deliveries: boolean;
price_adjustments: SellingPlanPriceaAjustment[];
};
type SellingPlanOption = {
name: string;
position: number;
value: string;
};
type SellingPlanPriceaAjustment = {
order_count?: number;
position: number;
value_type: string;
value: number;
};
export enum ProductEventType {
ProductUpdated = 'PRODUCT_UPDATED'
}
export type SnakeToCamelCase<S extends string> = S extends `${infer Head}_${infer Tail}` ? `${Lowercase<Head>}${Capitalize<SnakeToCamelCase<Tail>>}` : S;
export type SnakeToCamelCaseObject<T> = {
[K in keyof T as SnakeToCamelCase<K & string>]: T[K] extends object ? SnakeToCamelCaseObject<T[K]> : T[K];
};
export type PublicUserWebhook = ShopifyAppConnectedWebhook | ShopifyAppDisconnectedWebhook;
export type ShopifyAppConnectedWebhook = BaseUserWebhook & {
type: ShopifyAppEventType.ShopifyAppConnected;
data: {
shopDomain: string;
};
};
export type BaseUserWebhook = {
// Unique identifier for the event
id: string;
// ID of developer to be notified
developerId: string;
// Creation time of the event
createdAt: string;
};
// Represents the types of events related to a Shopify app.
export enum ShopifyAppEventType {
ShopifyAppConnected = 'SHOPIFY_APP_CONNECTED',
ShopifyAppDisconnected = 'SHOPIFY_APP_DISCONNECTED'
}
export type ShopifyAppDisconnectedWebhook = BaseUserWebhook & {
type: ShopifyAppEventType.ShopifyAppDisconnected;
data: {
shopDomain: string;
};
};
export interface AmazonProduct {
id: string;
marketplace: 'AMAZON' | 'SHOPIFY';
title: string;
description: string;
vendor: string;
url: any;
price?: { value: any; currency: any; displayValue: any; };
amazonBusinessPrice?: { value: any; currency: any; displayValue: any; };
isAvailable: boolean;
tags: string[];
images: Array<{ url: any; }>;
variants: Array<{ title: any; image: any; }>;
ASIN: string;
titleExcludingVariantName: string;
featureBullets: string[];
parentID?: string;
protectionPlans: Array<{ id: any; title: any; price: any; }>;
categories: Array<{ name: any; url: any; categoryID: any; }>;
ratingsTotal: number;
reviewsTotal: number;
subtitle?: { text: any; url: any; };
videos: Array<{ durationSeconds: any; width: any; height: any; url: any; thumbnailURL: any; title: any; }>;
specifications: Array<{ name: any; value: any; }>;
color?: string;
manufacturer?: string;
weight?: string;
firstAvailable?: any;
dimensions?: string;
modelNumber?: string;
}
export interface ShopifyProduct {
id: string;
marketplace: 'AMAZON' | 'SHOPIFY';
title: string;
description: string;
vendor: string;
url: any;
price?: { value: any; currency: any; displayValue: any; };
isAvailable: boolean;
tags: string[];
images: Array<{ url: any; }>;
variants: Array<{ title: any; image: any; }>;
descriptionHTML: string;
collectionHandle: string;
handle: string;
maxPrice: number;
minPrice: number;
productType: string;
createdAt: any;
publishedAt: any;
storeCanonicalURL: any;
storeDomain: string;
options?: Array<{ name: any; position: any; values?: any; }>;
}
Was this page helpful?
- Webhook taxonomy
- Payment related webhooks
- Product related webhooks
- Order submission related webhooks
- Order cancellation related webhooks (Amazon)
- Order placed and failure related webhooks
- Tracking related webhooks
- Returns related webhooks (Shopify Sync API)
- Returns related webhooks (Amazon)
- Developer related webhooks
- Webhook types