Webhook updates

After an order is created, real-time updates about order state changes are sent to your configured webhook.

Webhook configuration

To configure your webhook:

  1. Head over to https://console.rye.com/account
  2. Enter a valid callback endpoint for your backend under the "Webhook section", and click save

That's it! On every order update, a webhook will be fired at your designated endpoint. Currently, webhooks are not retried on failure so please ensure they succeed on the first try.


Webhook payload examples

📘

The requestId field present in the webhook payload is what will be returned by the submitCart mutation. This can interpreted as the "order ID".

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
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_890",
  "createdAt": "2023-06-27T12:00:01Z",
  "type": "PAYMENT_FAILED",
  "data": {
    "marketplace": "shopify"
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_901",
  "createdAt": "2023-06-27T12:00:02Z",
  "type": "PAYMENT_REFUNDED",
  "data": {}
}

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"
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_123",
  "createdAt": "2023-06-27T12:00:04Z",
  "type": "ORDER_SUBMISSION_SUCCEEDED",
  "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"
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_123",
  "createdAt": "2023-06-27T12:00:04Z",
  "type": "ORDER_CANCEL_SUCCEEDED",
  "data": {
    "marketplace": "amazon",
    "cancelledAt": "2023-09-07T17:49:07.267Z"
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_123",
  "createdAt": "2023-06-27T12:00:04Z",
  "type": "ORDER_CANCEL_FAILED",
  "data": {
    "marketplace": "amazon",
    "reason": "Order already shipped"
  }
}

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]"
    }
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "xDasf23Jk4LKlxOq",
  "createdAt": "2023-06-27T12:00:05Z",
  "type": "ORDER_PLACED",
  "data": {
    "marketplace": "amazon",
    "order": {
      "currency": "USD",
      "shippingCents": 500,
      "subtotalCents": 2000,
      "taxCents": 200,
      "totalCents": 2700,
      "amazonOrders": [
        {
          "amazonOrderId": "113-7953074923-1301",
          "products": [
            {
              "quantity": 2,
              "productId": "B09X7FXHVJ"
            },
            {
              "quantity": 1,
              "productId": "B09X7CFXSX"
            }
          ]
        }
      ]
    }
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "xDasf23Jk4LKlxOq",
  "createdAt": "2023-06-27T12:00:07Z",
  "type": "ORDER_FAILED",
  "data": {
    "marketplace": "amazon",
    "refund": {
      "amount": 1000,
      "created": 1675936800,
      "currency": "USD",
      "receipt_number": "refund_593203912",
      "status": "succeeded"
    },
    "reasonCode": "INTERNAL_ERROR",
    "reason": "An internal error occurred."
  }
}

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"
            }
          ]
        }
      ]
    }
  }
}

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "requestId": "d222c412-fbc8-4e59-8cef-b57696bxyz11",
  "developerId": "developer_567",
  "createdAt": "2023-06-27T12:00:08Z",
  "type": "TRACKING_OBTAINED",
  "data": {
    "marketplace": "amazon",
    "order": {
      "amazonOrders": [
        {
          "amazonOrderId": "113-7953074923-1301",
          "products": [
            {
              "quantity": 1,
              "productId": "B09X7FXHVJ"
            }
          ],
          "trackingNumber": "1Z87F765679738",
          "retailTrackingNumber": "TBA307720391618",
          "courierUrl": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z87F765679738",
          "courierName": "UPS"
        }
      ]
    }
  }
}


Webhook types

The webhook body is JSON formatted. If your project is Typescript based you can use these types.

export type Marketplace = AmazonMarketplace | ShopifyMarketplace;
export type AmazonMarketplace = 'amazon';
export type ShopifyMarketplace = 'shopify';

export type RyeWebhook =
  | PaymentSucceededWebhook
  | PaymentFailedWebhook
  | PaymentRefundedWebhook
  | OrderSubmissionStartedWebhook
  | OrderSubmissionSucceededWebhook
  | OrderPlacedWebhook
  | OrderFailedWebhook
  | OrderCancelFailedWebhook
  | OrderCancelStartedWebhook
  | OrderCancelSucceededWebhoook
  | TrackingObtainedWebhook;

type BaseWebhook = {
  // Unique identifier for the webhook
  id: string;
  // Unique ID of the checkout request
  requestId: string;
  // ID of developer who initiated the checkout request
  developerId: string;
  // Creation time of the webhook
  createdAt: string;
};

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',
  TrackingObtained = 'TRACKING_OBTAINED',
  OrderCancelFailed = 'ORDER_CANCEL_FAILED',
  OrderCancelStarted = 'ORDER_CANCEL_STARTED',
  OrderCancelSucceeded = 'ORDER_CANCEL_SUCCEEDED',
}

export type PaymentSucceededWebhook = BaseWebhook & {
  type: WebhookType.PaymentSucceeded;
  data: { marketplace: Marketplace; amount: number };
};

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: AmazonOrderPlacedWebhook | ShopifyOrderPlacedData;
};

export type AmazonOrderPlacedWebhook = {
  marketplace: AmazonMarketplace;
  order: BasePlacedOrderDetails & {
    amazonOrders: BaseAmazonOrder[];
  };
};

export type OrderCancelledWebhook = BaseWebhook & {
  type: WebhookType.OrderCancelSucceeded;
  data: {
    marketplace: Marketplace;
    cancelledAt: string;
  };
};

export type OrderCancelStartedWebhook = BaseWebhook & {
  type: WebhookType.OrderCancelStarted;
  data: {
    marketplace: Marketplace;
    startedAt: string;
  };
};

export type OrderCancelFailedWebhook = BaseWebhook & {
  type: WebhookType.OrderCancelFailed;
  data: {
    marketplace: Marketplace;
    reason: string;
  };
};

export type BasePlacedOrderDetails = {
  currency: string;
  shippingCents: number;
  subtotalCents: number;
  taxCents: number;
  totalCents: number;
};

export type AmazonOrder = BaseAmazonOrder & AllOrNothing<AmazonTrackedOrderDetails>;
export type BaseAmazonOrder = {
  amazonOrderId: string;
  products: AmazonOrderRequestProduct[];
};

export type AmazonTrackedOrderDetails = TrackedOrderDetails & {
  retailTrackingNumber?: string;
};

export type AmazonOrderRequestProduct = {
  quantity: number;
  productId: string;
};

export type ShopifyOrderPlacedData = {
  marketplace: ShopifyMarketplace;
  order: BasePlacedOrderDetails
  orderEmailOverride?: string;
};

export type OrderFailedWebhook = BaseWebhook & {
  type: WebhookType.OrderFailed;
  data: {
    marketplace: Marketplace;
    // Only for stripe
    refund?: StripeRefund;
    reasonCode?: OrderFailedReasonCode;
    reason?: string;
  };
};
export type OrderFailedReasonCode =
  | 'INTERNAL_ERROR'
  | 'OUT_OF_STOCK'
  | 'INVALID_REQUEST'
  | 'UNAUTHENTICATED'
  | 'PERMISSION_DENIED'
  | 'USER_REQUESTED'
  | 'CANCELED'
  | 'SHIPPING_ADDRESS_UNAVAILABLE'
  | 'SHIPPING_ADDRESS_BLACKLISTED';

export type TrackingObtainedWebhook = BaseWebhook & {
  type: WebhookType.TrackingObtained;
  data: AmazonTrackingObtainedData | ShopifyTrackingObtainedData;
};
export type AmazonTrackingObtainedData = {
  marketplace: AmazonMarketplace;
  order: {
    amazonOrders: AmazonOrder[];
  };
};
export type TrackedOrderDetails = {
  trackingNumber: string;
  courierUrl: string;
  courierName: string;
};

export type AllOrNothing<T> = NeverFields<T> | T;
export type NeverFields<T> = {
  [K in keyof T]?: never;
};

export type ShopifyTrackingObtainedData = {
  marketplace: ShopifyMarketplace;
  order: {
    fulfillments: BaseShopifyOrderFulfillment[];
  };
};

export type BaseShopifyOrderFulfillment = {
  products: ShopifyOrderRequestProduct[];
  trackingDetails: TrackedOrderDetails[];
};
export type ShopifyOrderRequestProduct = {
  quantity: number;
  variantId: string;
};

export type StripeRefund = {
  /**
   * 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;
};
{
  "$ref": "#/definitions/RyeWebhook",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "AmazonMarketplace": {
      "const": "amazon",
      "type": "string"
    },
    "AmazonOrderPlacedWebhook": {
      "additionalProperties": false,
      "properties": {
        "marketplace": {
          "$ref": "#/definitions/AmazonMarketplace"
        },
        "order": {
          "additionalProperties": false,
          "properties": {
            "amazonOrders": {
              "items": {
                "$ref": "#/definitions/BaseAmazonOrder"
              },
              "type": "array"
            },
            "currency": {
              "type": "string"
            },
            "shippingCents": {
              "type": "number"
            },
            "subtotalCents": {
              "type": "number"
            },
            "taxCents": {
              "type": "number"
            },
            "totalCents": {
              "type": "number"
            }
          },
          "required": [
            "amazonOrders",
            "currency",
            "shippingCents",
            "subtotalCents",
            "taxCents",
            "totalCents"
          ],
          "type": "object"
        }
      },
      "required": [
        "marketplace",
        "order"
      ],
      "type": "object"
    },
    "AmazonOrderRequestProduct": {
      "additionalProperties": false,
      "properties": {
        "productId": {
          "type": "string"
        },
        "quantity": {
          "type": "number"
        }
      },
      "required": [
        "quantity",
        "productId"
      ],
      "type": "object"
    },
    "AmazonTrackingObtainedData": {
      "additionalProperties": false,
      "properties": {
        "marketplace": {
          "$ref": "#/definitions/AmazonMarketplace"
        },
        "order": {
          "additionalProperties": false,
          "properties": {
            "amazonOrders": {
              "items": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "amazonOrderId": {
                        "type": "string"
                      },
                      "products": {
                        "items": {
                          "$ref": "#/definitions/AmazonOrderRequestProduct"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "amazonOrderId",
                      "products"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "retailTrackingNumber": {
                      	"type": "string"
                      }
                    }
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "amazonOrderId": {
                        "type": "string"
                      },
                      "courierName": {
                        "type": "string"
                      },
                      "courierUrl": {
                        "type": "string"
                      },
                      "products": {
                        "items": {
                          "$ref": "#/definitions/AmazonOrderRequestProduct"
                        },
                        "type": "array"
                      },
                      "trackingNumber": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "amazonOrderId",
                      "courierName",
                      "courierUrl",
                      "products",
                      "trackingNumber"
                    ],
                    "type": "object"
                  }
                ]
              },
              "type": "array"
            }
          },
          "required": [
            "amazonOrders"
          ],
          "type": "object"
        }
      },
      "required": [
        "marketplace",
        "order"
      ],
      "type": "object"
    },
    "BaseAmazonOrder": {
      "additionalProperties": false,
      "properties": {
        "amazonOrderId": {
          "type": "string"
        },
        "products": {
          "items": {
            "$ref": "#/definitions/AmazonOrderRequestProduct"
          },
          "type": "array"
        }
      },
      "required": [
        "amazonOrderId",
        "products"
      ],
      "type": "object"
    },
    "BasePlacedOrderDetails": {
      "additionalProperties": false,
      "properties": {
        "currency": {
          "type": "string"
        },
        "shippingCents": {
          "type": "number"
        },
        "subtotalCents": {
          "type": "number"
        },
        "taxCents": {
          "type": "number"
        },
        "totalCents": {
          "type": "number"
        }
      },
      "required": [
        "currency",
        "shippingCents",
        "subtotalCents",
        "taxCents",
        "totalCents"
      ],
      "type": "object"
    },
    "BaseShopifyOrderFulfillment": {
      "additionalProperties": false,
      "properties": {
        "products": {
          "items": {
            "$ref": "#/definitions/ShopifyOrderRequestProduct"
          },
          "type": "array"
        },
        "trackingDetails": {
          "items": {
            "$ref": "#/definitions/TrackedOrderDetails"
          },
          "type": "array"
        }
      },
      "required": [
        "products",
        "trackingDetails"
      ],
      "type": "object"
    },
    "Marketplace": {
      "anyOf": [
        {
          "$ref": "#/definitions/AmazonMarketplace"
        },
        {
          "$ref": "#/definitions/ShopifyMarketplace"
        }
      ]
    },
    "OrderFailedReasonCode": {
      "enum": [
        "INTERNAL_ERROR",
        "OUT_OF_STOCK",
        "INVALID_REQUEST",
        "UNAUTHENTICATED",
        "PERMISSION_DENIED",
        "USER_REQUESTED",
        "CANCELED",
        "SHIPPING_ADDRESS_BLACKLISTED",
        "SHIPPING_ADDRESS_UNAVAILABLE"
      ],
      "type": "string"
    },
    "OrderFailedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            },
            "reason": {
              "type": "string"
            },
            "reasonCode": {
              "$ref": "#/definitions/OrderFailedReasonCode"
            },
            "refund": {
              "$ref": "#/definitions/StripeRefund"
            }
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderFailed"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderPlacedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "anyOf": [
            {
              "$ref": "#/definitions/AmazonOrderPlacedWebhook"
            },
            {
              "$ref": "#/definitions/ShopifyOrderPlacedData"
            }
          ]
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderPlaced"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderSubmissionStartedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            }
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderSubmissionStarted"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderSubmissionSucceededWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            }
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderSubmissionSucceeded"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderCancelFailedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            },
            "reason": {
              "type": "string"
            },
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderCancelFailed"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderCancelStartedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            },
            "startedAt": {
              "type": "string"
            }
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderCancelStarted"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "OrderCancelSucceededWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            },
            "cancelledAt": {
              "type": "string"
            },
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.OrderCancelSucceede"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "PaymentFailedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            }
          },
          "required": [
            "marketplace"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.PaymentFailed"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "PaymentRefundedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "$ref": "#/definitions/Record%3Cstring%2Cnever%3E"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.PaymentRefunded"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "PaymentSucceededWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number"
            },
            "marketplace": {
              "$ref": "#/definitions/Marketplace"
            }
          },
          "required": [
            "marketplace",
            "amount"
          ],
          "type": "object"
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.PaymentSucceeded"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "Record<string,never>": {
      "additionalProperties": {
        "not": {
          
        }
      },
      "type": "object"
    },
    "RyeWebhook": {
      "anyOf": [
        {
          "$ref": "#/definitions/PaymentSucceededWebhook"
        },
        {
          "$ref": "#/definitions/PaymentFailedWebhook"
        },
        {
          "$ref": "#/definitions/PaymentRefundedWebhook"
        },
        {
          "$ref": "#/definitions/OrderSubmissionStartedWebhook"
        },
        {
          "$ref": "#/definitions/OrderSubmissionSucceededWebhook"
        },
        {
          "$ref": "#/definitions/OrderPlacedWebhook"
        },
        {
          "$ref": "#/definitions/OrderFailedWebhook"
        },
        {
          "$ref": "#/definitions/OrderCancelFailedWebhook"
        },
        {
          "$ref": "#/definitions/OrderCancelStartedWebhook"
        },
        {
          "$ref": "#/definitions/OrderCancelSucceededWebhook"
        },
        {
          "$ref": "#/definitions/TrackingObtainedWebhook"
        }
      ]
    },
    "ShopifyMarketplace": {
      "const": "shopify",
      "type": "string"
    },
    "ShopifyOrderPlacedData": {
      "additionalProperties": false,
      "properties": {
        "marketplace": {
          "$ref": "#/definitions/ShopifyMarketplace"
        },
        "order": {
          "$ref": "#/definitions/BasePlacedOrderDetails"
        },
        "orderEmailOverride": {
          "type": "string"
        }
      },
      "required": [
        "marketplace",
        "order"
      ],
      "type": "object"
    },
    "ShopifyOrderRequestProduct": {
      "additionalProperties": false,
      "properties": {
        "quantity": {
          "type": "number"
        },
        "variantId": {
          "type": "string"
        }
      },
      "required": [
        "quantity",
        "variantId"
      ],
      "type": "object"
    },
    "ShopifyTrackingObtainedData": {
      "additionalProperties": false,
      "properties": {
        "marketplace": {
          "$ref": "#/definitions/ShopifyMarketplace"
        },
        "order": {
          "additionalProperties": false,
          "properties": {
            "fulfillments": {
              "items": {
                "$ref": "#/definitions/BaseShopifyOrderFulfillment"
              },
              "type": "array"
            }
          },
          "required": [
            "fulfillments"
          ],
          "type": "object"
        }
      },
      "required": [
        "marketplace",
        "order"
      ],
      "type": "object"
    },
    "StripeRefund": {
      "additionalProperties": false,
      "properties": {
        "amount": {
          "description": "Amount, in %s.",
          "type": "number"
        },
        "created": {
          "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
          "type": "number"
        },
        "currency": {
          "description": "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).",
          "type": "string"
        },
        "description": {
          "description": "An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)",
          "type": "string"
        },
        "receipt_number": {
          "description": "This is the transaction number that appears on email receipts sent for this refund.",
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "description": "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.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "amount",
        "created",
        "currency",
        "receipt_number",
        "status"
      ],
      "type": "object"
    },
    "AmazonTrackedOrderDetails": {
      "additionalProperties": false,
      "properties": {
        "retailTrackingNumber": {
          "type": "string"
        }
      }
    },
    "TrackedOrderDetails": {
      "additionalProperties": false,
      "properties": {
        "courierName": {
          "type": "string"
        },
        "courierUrl": {
          "type": "string"
        },
        "trackingNumber": {
          "type": "string"
        }
      },
      "required": [
        "trackingNumber",
        "courierUrl",
        "courierName"
      ],
      "type": "object"
    },
    "TrackingObtainedWebhook": {
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "data": {
          "anyOf": [
            {
              "$ref": "#/definitions/AmazonTrackingObtainedData"
            },
            {
              "$ref": "#/definitions/ShopifyTrackingObtainedData"
            }
          ]
        },
        "developerId": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/WebhookType.TrackingObtained"
        }
      },
      "required": [
        "createdAt",
        "data",
        "developerId",
        "id",
        "requestId",
        "type"
      ],
      "type": "object"
    },
    "WebhookType.OrderFailed": {
      "const": "ORDER_FAILED",
      "type": "string"
    },
    "WebhookType.OrderPlaced": {
      "const": "ORDER_PLACED",
      "type": "string"
    },
    "WebhookType.OrderSubmissionStarted": {
      "const": "ORDER_SUBMISSION_STARTED",
      "type": "string"
    },
    "WebhookType.OrderSubmissionSucceeded": {
      "const": "ORDER_SUBMISSION_SUCCEEDED",
      "type": "string"
    },
    "WebhookType.PaymentFailed": {
      "const": "PAYMENT_FAILED",
      "type": "string"
    },
    "WebhookType.PaymentRefunded": {
      "const": "PAYMENT_REFUNDED",
      "type": "string"
    },
    "WebhookType.PaymentSucceeded": {
      "const": "PAYMENT_SUCCEEDED",
      "type": "string"
    },
    "WebhookType.TrackingObtained": {
      "const": "TRACKING_OBTAINED",
      "type": "string"
    },
     "WebhookType.OrderCancelFailed": {
      "const": "ORDER_CANCEL_FAILED",
      "type": "string"
    },
     "WebhookType.OrderCancelStarted": {
      "const": "ORDER_CANCEL_STARTED",
      "type": "string"
    },
     "WebhookType.OrderCancelSucceeded": {
      "const": "ORDER_CANCEL_SUCCEEDED",
      "type": "string"
    }
  }
}