Rye

Rye Payment Gateways API

The Payment Gateways API from Rye — 1 operation(s) for payment gateways.

OpenAPI Specification

rye-payment-gateways-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Universal Checkout Betas Payment Gateways 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: Payment Gateways
paths:
  /api/v1/payment-gateways/{gateway}/session:
    post:
      operationId: CreateSession
      responses:
        '200':
          description: Gateway-specific session credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGatewaySession'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeError'
      description: 'Create a payment gateway session for client-side card tokenization.


        Returns short-lived credentials scoped to the authenticated developer.

        Use the credentials with the corresponding gateway''s client-side SDK to

        tokenize a card. Tokens created this way are locked to the developer''s

        container and cannot be used by other developers.'
      summary: Create payment gateway session
      tags:
      - Payment Gateways
      security:
      - bearerAuth:
        - checkout_intents:write
      parameters:
      - description: The payment gateway to create a session for
        in: path
        name: gateway
        required: true
        schema:
          $ref: '#/components/schemas/PaymentGateway'
      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 paymentGatewaySession = await client.paymentGateways.createSession('basis-theory');\n\nconsole.log(paymentGatewaySession.container);"
      - 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)\npayment_gateway_session = client.payment_gateways.create_session(\n    \"basis-theory\",\n)\nprint(payment_gateway_session.container)"
      - lang: Java
        source: "package com.rye.example;\n\nimport com.rye.client.CheckoutIntentsClient;\nimport com.rye.client.okhttp.CheckoutIntentsOkHttpClient;\nimport com.rye.models.paymentgateways.PaymentGateway;\nimport com.rye.models.paymentgateways.PaymentGatewayCreateSessionParams;\nimport com.rye.models.paymentgateways.PaymentGatewaySession;\n\npublic final class Main {\n    private Main() {}\n\n    public static void main(String[] args) {\n        CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();\n\n        PaymentGatewaySession paymentGatewaySession = client.paymentGateways().createSession(PaymentGateway.BASIS_THEORY);\n    }\n}"
      - lang: cURL
        source: "curl https://staging.api.rye.com/api/v1/payment-gateways/$GATEWAY/session \\\n    -X POST \\\n    -H \"Authorization: Bearer $CHECKOUT_INTENTS_API_KEY\""
components:
  schemas:
    PaymentGateway:
      type: string
      enum:
      - basis-theory
      nullable: false
    PaymentGatewaySession:
      properties:
        container:
          type: string
        sessionKey:
          type: string
        gateway:
          type: string
          enum:
          - basis_theory
          nullable: false
      required:
      - container
      - sessionKey
      - gateway
      type: object
    AuthenticationError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
    RuntimeError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
      - name
      - message
      type: object
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Rye API key