Precog Stripe API

The Stripe API from Precog — 2 operation(s) for stripe.

OpenAPI Specification

precog-stripe-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: http-api Admin Stripe API
  version: '1.0'
  summary: The Precog admin HTTP REST API.
  description: The Precog admin HTTP REST API.
  contact:
    url: https://precog.com
    email: support@precog.com
servers:
- url: http://localhost:30000
security:
- BearerAuth: []
tags:
- name: Stripe
paths:
  /stripe/check:
    post:
      summary: Check Stripe subscription status
      tags:
      - Stripe
      operationId: post-stripe-check
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  trialEndsAt:
                    type: number
                  url:
                    type: string
                required:
                - trialEndsAt
                - url
        '204':
          description: Valid Subscription
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
        '401':
          description: Unauthorized
        '422':
          description: Semantic error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
        '502':
          description: Problematic Request to External Server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
      description: Check the Stripe subscription status
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                returnUrl:
                  type: string
              required:
              - returnUrl
  /stripe/session:
    parameters: []
    post:
      summary: Create Stripe session
      tags:
      - Stripe
      operationId: post-stripe-session
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/url'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
        '401':
          description: Unauthorized
        '404':
          description: Stripe customer not found
        '422':
          description: Semantic error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
        '502':
          description: Problematic Request to External Server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error-message'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                returnUrl:
                  type: string
                  minLength: 1
              required:
              - returnUrl
      description: Create a Stripe customer portal session
components:
  schemas:
    error-message:
      title: error-message
      type: object
      properties:
        error:
          type: object
          required:
          - type
          - details
          properties:
            type:
              type: string
              minLength: 1
            details:
              type: string
      required:
      - error
    url:
      title: url
      type: object
      properties:
        url:
          type: string
          minLength: 1
      required:
      - url
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer