Rye

Rye Checkout Intents API

The Checkout Intents API from Rye — 6 operation(s) for checkout intents.

Operations 7

GET /api/v1/checkout-intents List checkout intents #
POST /api/v1/checkout-intents Create checkout intent #
GET /api/v1/checkout-intents/{id} Retrieve checkout intent #
GET /api/v1/checkout-intents/{id}/order Retrieve order #
POST /api/v1/checkout-intents/{id}/confirm Confirm checkout intent #
GET /api/v1/checkout-intents/{id}/shipments List shipments for checkout intent #
POST /api/v1/checkout-intents/purchase Purchase product #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/rye-checkout-intents-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

rye-checkout-intents-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Universal Checkout Betas Checkout Intents 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: Checkout Intents
paths:
  /api/v1/checkout-intents:
    get:
      operationId: ListCheckoutIntents
      responses:
        '200':
          description: Paginated checkout intents response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutIntentListResponse'
        '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 checkout intents


        Enables developers to query checkout intents associated with their account, with filters and cursor-based pagination.'
      summary: List checkout intents
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents: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
      - in: query
        name: id
        required: false
        schema:
          default: []
          type: array
          items:
            type: string
      - in: query
        name: state
        required: false
        schema:
          default: []
          type: array
          items:
            $ref: '#/components/schemas/CheckoutIntentState'
      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 checkoutIntent of client.checkoutIntents.list()) {\n  console.log(checkoutIntent);\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.checkout_intents.list()\npage = page.data[0]\nprint(page)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.CheckoutIntentListPage;\nimport com.rye.models.checkoutintents.CheckoutIntentListParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        CheckoutIntentListPage page = client.checkoutIntents().list();\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
    post:
      operationId: CreateCheckoutIntent
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutIntent'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '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'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmazonUnavailableError'
      description: Create a checkout intent with the given request body.
      summary: Create checkout intent
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:write
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutIntentPostParams'
      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 checkoutIntent = await client.checkoutIntents.create({\n  buyer: {\n    address1: '123 Main St',\n    city: 'New York',\n    country: 'US',\n    email: 'john.doe@example.com',\n    firstName: 'John',\n    lastName: 'Doe',\n    phone: '1234567890',\n    postalCode: '10001',\n    province: 'NY',\n  },\n  productUrl: 'https://www.amazon.com/dp/B0DFC9MT8Q',\n  quantity: 1,\n});\n\nconsole.log(checkoutIntent);"
      - 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)\ncheckout_intent = client.checkout_intents.create(\n    buyer={\n        \"address1\": \"123 Main St\",\n        \"city\": \"New York\",\n        \"country\": \"US\",\n        \"email\": \"john.doe@example.com\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"phone\": \"1234567890\",\n        \"postal_code\": \"10001\",\n        \"province\": \"NY\",\n    },\n    product_url=\"https://www.amazon.com/dp/B0DFC9MT8Q\",\n    quantity=1,\n)\nprint(checkout_intent)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.Buyer;\nimport com.rye.models.checkoutintents.CheckoutIntent;\nimport com.rye.models.checkoutintents.CheckoutIntentCreateParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        CheckoutIntentCreateParams params = CheckoutIntentCreateParams.builder()\n            .buyer(Buyer.builder()\n                .address1(\"123 Main St\")\n                .city(\"New York\")\n                .country(\"US\")\n                .email(\"john.doe@example.com\")\n                .firstName(\"John\")\n                .lastName(\"Doe\")\n                .phone(\"1234567890\")\n                .postalCode(\"10001\")\n                .province(\"NY\")\n                .build())\n            .productUrl(\"https://www.amazon.com/dp/B0DFC9MT8Q\")\n            .quantity(1)\n            .build();\n        CheckoutIntent checkoutIntent = client.checkoutIntents().create(params);\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents \\\n    -H 'Content-Type: application/json' \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\" \\\n    -d '{\n          \"buyer\": {\n            \"address1\": \"123 Main St\",\n            \"city\": \"New York\",\n            \"country\": \"US\",\n            \"email\": \"john.doe@example.com\",\n            \"firstName\": \"John\",\n            \"lastName\": \"Doe\",\n            \"phone\": \"1234567890\",\n            \"postalCode\": \"10001\",\n            \"province\": \"NY\"\n          },\n          \"productUrl\": \"https://www.amazon.com/dp/B0DFC9MT8Q\",\n          \"quantity\": 1,\n          \"referenceId\": \"order-1234\"\n        }'"
  /api/v1/checkout-intents/{id}:
    get:
      operationId: GetCheckoutIntent
      responses:
        '200':
          description: Checkout intent information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutIntent'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      description: 'Retrieve a checkout intent by id


        Returns checkout intent information if the lookup succeeds.'
      summary: Retrieve checkout intent
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:read
      parameters:
      - description: The id of the checkout intent to look up
        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 checkoutIntent = await client.checkoutIntents.retrieve('id');\n\nconsole.log(checkoutIntent);"
      - 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)\ncheckout_intent = client.checkout_intents.retrieve(\n    \"id\",\n)\nprint(checkout_intent)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.CheckoutIntent;\nimport com.rye.models.checkoutintents.CheckoutIntentRetrieveParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        CheckoutIntent checkoutIntent = client.checkoutIntents().retrieve(\"id\");\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents/$ID \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
  /api/v1/checkout-intents/{id}/order:
    get:
      operationId: GetCheckoutIntentOrder
      responses:
        '200':
          description: The order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      description: 'Retrieve the order associated with a checkout intent.


        Returns the single order created when the checkout intent reached the

        `completed` state. 404 if the intent has not produced an order yet.'
      summary: Retrieve order
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:read
      parameters:
      - description: The id of the checkout intent to look up
        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 order = await client.checkoutIntents.retrieveOrder('id');\n\nconsole.log(order.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)\norder = client.checkout_intents.retrieve_order(\n    \"id\",\n)\nprint(order.id)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.CheckoutIntentRetrieveOrderParams;\nimport com.rye.models.orders.Order;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        Order order = client.checkoutIntents().retrieveOrder(\"id\");\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents/$ID/order \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
  /api/v1/checkout-intents/{id}/confirm:
    post:
      operationId: ConfirmCheckoutIntent
      responses:
        '200':
          description: The confirmed checkout intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutIntent'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidCheckoutIntentStateError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeError'
      description: 'Confirm a checkout intent with provided payment information


        Confirm means we have buyer''s name, address and payment info, so we can

        move forward to place the order.'
      summary: Confirm checkout intent
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:write
      parameters:
      - description: The id of the checkout intent to confirm
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        description: The request body containing the payment information
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutIntentConfirmParams'
              description: ''
      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 checkoutIntent = await client.checkoutIntents.confirm('id', {\n  paymentMethod: { stripeToken: 'tok_1RkrWWHGDlstla3f1Fc7ZrhH', type: 'stripe_token' },\n});\n\nconsole.log(checkoutIntent);"
      - 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)\ncheckout_intent = client.checkout_intents.confirm(\n    id=\"id\",\n    payment_method={\n        \"stripe_token\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n        \"type\": \"stripe_token\",\n    },\n)\nprint(checkout_intent)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.CheckoutIntent;\nimport com.rye.models.checkoutintents.CheckoutIntentConfirmParams;\nimport com.rye.models.checkoutintents.PaymentMethod;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        CheckoutIntentConfirmParams params = CheckoutIntentConfirmParams.builder()\n            .id(\"id\")\n            .paymentMethod(PaymentMethod.StripeTokenPaymentMethod.builder()\n                .stripeToken(\"tok_1RkrWWHGDlstla3f1Fc7ZrhH\")\n                .type(PaymentMethod.StripeTokenPaymentMethod.Type.STRIPE_TOKEN)\n                .build())\n            .build();\n        CheckoutIntent checkoutIntent = client.checkoutIntents().confirm(params);\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents/$ID/confirm \\\n    -H 'Content-Type: application/json' \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\" \\\n    -d '{\n          \"paymentMethod\": {\n            \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n            \"type\": \"stripe_token\"\n          }\n        }'"
  /api/v1/checkout-intents/{id}/shipments:
    get:
      operationId: GetShipments
      responses:
        '200':
          description: Shipments list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentsListResponse'
        '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: List shipments for a checkout intent
      summary: List shipments for checkout intent
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:read
      parameters:
      - description: The id of the checkout intent
        in: path
        name: id
        required: true
        schema:
          type: string
      - 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 shipment of client.checkoutIntents.shipments.list('id')) {\n  console.log(shipment);\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.checkout_intents.shipments.list(\n    id=\"id\",\n)\npage = page.data[0]\nprint(page)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.shipments.ShipmentListPage;\nimport com.rye.models.checkoutintents.shipments.ShipmentListParams;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        ShipmentListPage page = client.checkoutIntents().shipments().list(\"id\");\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents/$ID/shipments \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
  /api/v1/checkout-intents/purchase:
    post:
      operationId: Purchase
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutIntent'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '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'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmazonUnavailableError'
      description: 'Create a checkout intent and immediately trigger the purchase workflow.


        This is a "fire-and-forget" endpoint that combines create + confirm in one step.

        The workflow handles offer retrieval, payment authorization, and order placement

        asynchronously. Poll the GET endpoint to check status.'
      summary: Purchase product
      tags:
      - Checkout Intents
      security:
      - bearerAuth:
        - checkout_intents:write
      parameters: []
      requestBody:
        description: The request body containing the checkout intent purchase parameters
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutIntentPurchaseParams'
              description: ''
      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 checkoutIntent = await client.checkoutIntents.purchase({\n  buyer: {\n    address1: '123 Main St',\n    city: 'New York',\n    country: 'US',\n    email: 'john.doe@example.com',\n    firstName: 'John',\n    lastName: 'Doe',\n    phone: '1234567890',\n    postalCode: '10001',\n    province: 'NY',\n  },\n  paymentMethod: { stripeToken: 'tok_1RkrWWHGDlstla3f1Fc7ZrhH', type: 'stripe_token' },\n  productUrl: 'https://www.amazon.com/dp/B0DFC9MT8Q',\n  quantity: 1,\n});\n\nconsole.log(checkoutIntent);"
      - 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)\ncheckout_intent = client.checkout_intents.purchase(\n    buyer={\n        \"address1\": \"123 Main St\",\n        \"city\": \"New York\",\n        \"country\": \"US\",\n        \"email\": \"john.doe@example.com\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"phone\": \"1234567890\",\n        \"postal_code\": \"10001\",\n        \"province\": \"NY\",\n    },\n    payment_method={\n        \"stripe_token\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n        \"type\": \"stripe_token\",\n    },\n    product_url=\"https://www.amazon.com/dp/B0DFC9MT8Q\",\n    quantity=1,\n)\nprint(checkout_intent)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.checkoutintents.Buyer;\nimport com.rye.models.checkoutintents.CheckoutIntent;\nimport com.rye.models.checkoutintents.CheckoutIntentPurchaseParams;\nimport com.rye.models.checkoutintents.PaymentMethod;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        CheckoutIntentPurchaseParams params = CheckoutIntentPurchaseParams.builder()\n            .buyer(Buyer.builder()\n                .address1(\"123 Main St\")\n                .city(\"New York\")\n                .country(\"US\")\n                .email(\"john.doe@example.com\")\n                .firstName(\"John\")\n                .lastName(\"Doe\")\n                .phone(\"1234567890\")\n                .postalCode(\"10001\")\n                .province(\"NY\")\n                .build())\n            .paymentMethod(PaymentMethod.StripeTokenPaymentMethod.builder()\n                .stripeToken(\"tok_1RkrWWHGDlstla3f1Fc7ZrhH\")\n                .type(PaymentMethod.StripeTokenPaymentMethod.Type.STRIPE_TOKEN)\n                .build())\n            .productUrl(\"https://www.amazon.com/dp/B0DFC9MT8Q\")\n            .quantity(1)\n            .build();\n        CheckoutIntent checkoutIntent = client.checkoutIntents().purchase(params);\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/checkout-intents/purchase \\\n    -H 'Content-Type: application/json' \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\" \\\n    -d '{\n          \"buyer\": {\n            \"address1\": \"123 Main St\",\n            \"city\": \"New York\",\n            \"country\": \"US\",\n            \"email\": \"john.doe@example.com\",\n            \"firstName\": \"John\",\n            \"lastName\": \"Doe\",\n            \"phone\": \"1234567890\",\n            \"postalCode\": \"10001\",\n            \"province\": \"NY\"\n          },\n          \"paymentMethod\": {\n            \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n            \"type\": \"stripe_token\"\n          },\n          \"productUrl\": \"https://www.amazon.com/dp/B0DFC9MT8Q\",\n          \"quantity\": 1,\n          \"referenceId\": \"order-1234\"\n        }'"
components:
  schemas:
    PaymentMethod:
      anyOf:
      - $ref: '#/components/schemas/StripeTokenPaymentMethod'
      - $ref: '#/components/schemas/BasisTheoryPaymentMethod'
      - $ref: '#/components/schemas/DrawdownPaymentMethod'
      - $ref: '#/components/schemas/X402PaymentMethod'
    AwaitingConfirmationCheckoutIntent:
      allOf:
      - $ref: '#/components/schemas/BaseCheckoutIntent'
      - properties:
          paymentMethod:
            $ref: '#/components/schemas/PaymentMethod'
          offer:
            $ref: '#/components/schemas/Offer'
          state:
            type: string
            enum:
            - awaiting_confirmation
        required:
        - offer
        - state
        type: object
      title: Awaiting Confirmation
    WithStatus_BaseShipmentWithTracking.shipped_:
      allOf:
      - $ref: '#/components/schemas/BaseShipmentWithTracking'
      - properties:
          status:
            type: string
            enum:
            - shipped
        required:
        - status
        type: object
    RequiresActionCheckoutIntent:
      allOf:
      - $ref: '#/components/schemas/BaseCheckoutIntent'
      - properties:
          nextAction:
            $ref: '#/components/schemas/NextAction'
          paymentMethod:
            $ref: '#/components/schemas/PaymentMethod'
          offer:
            $ref: '#/components/schemas/Offer'
          state:
            type: string
            enum:
            - requires_action
        required:
        - nextAction
        - paymentMethod
        - offer
        - state
        type: object
      title: Requires Action
    CheckoutIntentConfirmParams:
      properties:
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
      required:
      - paymentMethod
      type: object
    ShipmentWithoutTrackingUnion:
      anyOf:
      - $ref: '#/components/schemas/OrderedShipment'
      - $ref: '#/components/schemas/CanceledShipment'
      description: Shipments without tracking information
      title: Without Tracking
    ShipmentsListResponse:
      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/Shipment'
          type: array
      required:
      - pageInfo
      - data
      type: object
    EventLocation:
      properties:
        country:
          type:
          - string
          - 'null'
        province:
          type:
          - string
          - 'null'
        city:
          type:
          - string
          - 'null'
      type: object
    DelayedShipment:
      $ref: '#/components/schemas/WithStatus_BaseShipmentWithTracking.delayed_'
      title: Delayed
    PromoCode:
      type: string
      example: SAVE20
      description: 'Promo code string with validation constraints.

        - Must contain only letters, digits, underscores, or hyphens

        - Maximum length of 32 characters'
      pattern: ^[a-zA-Z0-9_\-]+$
      maxLength: 32
    DeliveryDate:
      properties:
        estimated:
          type: string
          format: date-time
      required:
      - estimated
      type: object
    CheckoutIntentPostParams:
      properties:
        referenceId:
          type: string
          example: order-1234
          maxLength: 255
        discoverPromoCodes:
          type: boolean
        constraints:
          $ref: '#/components/schemas/CheckoutConstraints'
        promoCodes:
          items:
            $ref: '#/components/schemas/PromoCode'
          type: array
          maxItems: 16
        variantSelections:
          items:
            $ref: '#/components/schemas/VariantSelection'
          type: array
        buyer:
          $ref: '#/components/schemas/Buyer'
        quantity:
          type: integer
          format: int32
          example: 1
          minimum: 0
        productUrl:
          type: string
          example: https://www.amazon.com/dp/B0DFC9MT8Q
      required:
      - buyer
      - quantity
      - productUrl
      type: object
    StripeTokenPaymentMethod:
      properties:
        stripeToken:
          type: string
          example: tok_1RkrWWHGDlstla3f1Fc7ZrhH
        type:
          type: string
          enum:
          - stripe_token
          example: stripe_token
      required:
      - stripeToken
      - type
      type: object
      title: Stripe
    Cancellation:
      anyOf:
      - $ref: '#/components/schemas/RequestedCancellation'
      - $ref: '#/components/schemas/CompletedCancellation'
      - $ref: '#/components/schemas/DeniedCancellation'
    RetrievingOfferCheckoutIntent:
      allOf:
      - $ref: '#/components/schemas/BaseCheckoutIntent'
      - properties:
          state:
            type: string
            enum:
            - retrieving_offer
        required:
        - state
        type: object
      title: Retrieving Offer
    RuntimeError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
    OrderResponse:
      description: 'Represents a completed order. Orders are created after a checkout intent reaches

        the `completed` state.'
  

# --- truncated at 32 KB (54 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/rye/refs/heads/main/openapi/rye-checkout-intents-api-openapi.yml