Rye

Rye Events API

The Events API from Rye — 3 operation(s) for events.

OpenAPI Specification

rye-events-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Universal Checkout Betas Events API
  version: 1.0.5
  description: 'Turn any product URL into a completed checkout. Instantly retrieve price, tax, and shipping for any product, and let users buy without ever leaving your native AI experience.


    View the [Rye API docs](https://docs.rye.com).'
  termsOfService: https://rye.com/terms-of-service
  license:
    name: UNLICENSED
  contact:
    name: Rye
    email: dev@rye.com
    url: https://docs.rye.com
servers:
- url: https://staging.api.rye.com
tags:
- name: Events
paths:
  /api/v1/events:
    get:
      operationId: List
      responses:
        '200':
          description: Events list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventListResponse'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateError'
      description: Retrieve a paginated list of events.
      summary: List events
      tags:
      - Events
      security:
      - bearerAuth:
        - events:read
      parameters:
      - description: Maximum number of results to return (default 100)
        in: query
        name: limit
        required: false
        schema:
          format: int32
          type: integer
          minimum: 1
          maximum: 100
        example: 20
      - in: query
        name: after
        required: false
        schema:
          type: string
      - in: query
        name: before
        required: false
        schema:
          type: string
      x-codeSamples:
      - lang: JavaScript
        source: "import CheckoutIntents from 'checkout-intents';\n\nconst client = new CheckoutIntents({\n  apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const event of client.events.list()) {\n  console.log(event.id);\n}"
      - lang: Python
        source: "import os\nfrom checkout_intents import CheckoutIntents\n\nclient = CheckoutIntents(\n    api_key=os.environ.get(\"CHECKOUT_INTENTS_API_KEY\"),  # This is the default and can be omitted\n)\npage = client.events.list()\npage = page.data[0]\nprint(page.id)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.events.EventListPage;\nimport com.rye.models.events.EventListParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        EventListPage page = client.events().list();\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/events \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
  /api/v1/events/{id}:
    get:
      operationId: Get
      responses:
        '200':
          description: The event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeError'
      description: Retrieves an event by ID.
      summary: Retrieve event
      tags:
      - Events
      security:
      - bearerAuth:
        - events:read
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      x-codeSamples:
      - lang: JavaScript
        source: "import CheckoutIntents from 'checkout-intents';\n\nconst client = new CheckoutIntents({\n  apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst event = await client.events.retrieve('id');\n\nconsole.log(event.id);"
      - lang: Python
        source: "import os\nfrom checkout_intents import CheckoutIntents\n\nclient = CheckoutIntents(\n    api_key=os.environ.get(\"CHECKOUT_INTENTS_API_KEY\"),  # This is the default and can be omitted\n)\nevent = client.events.retrieve(\n    \"id\",\n)\nprint(event.id)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.events.Event;\nimport com.rye.models.events.EventRetrieveParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        Event event = client.events().retrieve(\"id\");\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/events/$ID \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
  /api/v1/events/trigger:
    post:
      operationId: Trigger
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeError'
      description: 'Trigger a webhook event for a product on demand, in the shape your

        registered destinations would normally receive. Use during integration

        testing to exercise your handlers without waiting for an upstream update.


        The event is targeted at the calling developer only. Pass an

        `Idempotency-Key` header so retried calls produce the same event ID and

        the delivery layer dedups.'
      summary: Trigger event
      tags:
      - Events
      security:
      - bearerAuth:
        - events:read
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTriggerRequest'
components:
  schemas:
    EventType:
      anyOf:
      - $ref: '#/components/schemas/CheckoutIntentEventType'
      - $ref: '#/components/schemas/ShipmentEventType'
      - $ref: '#/components/schemas/ProductEventType'
      - $ref: '#/components/schemas/WebhookEndpointEventType'
    EventData:
      properties: {}
      additionalProperties: {}
      type: object
      description: 'The event data payload. The concrete shape depends on `source.type`.


        Refer to [webhook event types](https://docs.rye.com/api-v2/webhooks/types)

        for the payload shape associated with each `source.type`.'
    CheckoutIntentEventType:
      type: string
      enum:
      - checkout_intent.offer_retrieved
      - checkout_intent.offer_failed
      - checkout_intent.completed
      - checkout_intent.order_failed
    AuthenticationError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
    ValidateError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
        status:
          type: number
          format: double
        fields:
          $ref: '#/components/schemas/FieldErrors'
      required:
      - name
      - message
      - status
      - fields
      type: object
      additionalProperties: false
    ProductEventType:
      type: string
      enum:
      - product.updated
      - product.removed
    RuntimeError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
    EventSourceType:
      type: string
      enum:
      - checkout_intent
      - shipment
      - product
      - webhook_endpoint
    EventListResponse:
      properties:
        pageInfo:
          properties:
            endCursor:
              type: string
            startCursor:
              type: string
            hasPreviousPage:
              type: boolean
            hasNextPage:
              type: boolean
          required:
          - hasPreviousPage
          - hasNextPage
          type: object
        data:
          items:
            $ref: '#/components/schemas/Event'
          type: array
      required:
      - pageInfo
      - data
      type: object
    Event:
      properties:
        id:
          type: string
          description: 'Unique identifier for the event. This can be used as an idempotency key

            to avoid double-processing of the same underlying event.'
          example: evt_1234567890
        object:
          type: string
          enum:
          - event
          nullable: false
        type:
          $ref: '#/components/schemas/EventType'
          description: 'Description of the event.


            Refer to [types of events](https://docs.rye.com/api-v2/webhooks/types) for a list of possible values.'
          example: checkout_intent.offer_retrieved
        createdAt:
          type: string
          description: Timestamp of when the event was created.
          example: '2026-03-25T00:00:00Z'
        source:
          $ref: '#/components/schemas/EventSource'
        data:
          $ref: '#/components/schemas/EventData'
      required:
      - id
      - object
      - type
      - createdAt
      - source
      type: object
      additionalProperties: false
    FieldErrors:
      properties: {}
      type: object
      additionalProperties:
        properties:
          value: {}
          message:
            type: string
        required:
        - message
        type: object
    EventSource:
      description: 'A reference to the object which triggered the event.


        You should use the API to fetch the full object details.'
      properties:
        id:
          type: string
          description: ID of the object which triggered the event.
          example: ci_1234567890
        type:
          $ref: '#/components/schemas/EventSourceType'
          description: Type of the object which triggered the event.
          example: checkout_intent
      required:
      - id
      - type
      type: object
      additionalProperties: false
    NotFoundError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
    WebhookEndpointEventType:
      type: string
      enum:
      - webhook_endpoint.verification_challenge
      nullable: false
    ShipmentEventType:
      type: string
      enum:
      - shipment.created
      - shipment.updated
    EventTriggerRequest:
      properties:
        productUrl:
          type: string
          description: Product URL (e.g. `https://flybyjing.com/products/sichuan-chili-crisp`).
        topic:
          type: string
          enum:
          - product.updated
          nullable: false
          description: The webhook event topic to trigger.
      required:
      - productUrl
      - topic
      type: object
      description: 'Request body for `POST /api/v1/events/trigger`. Generates a webhook event

        for the product at the given URL so integrations can be exercised on

        demand without waiting for an upstream update.'
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Rye API key