Charthop stripe API

The stripe API from Charthop — 4 operation(s) for stripe.

OpenAPI Specification

charthop-stripe-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: REST API for ChartHop
  version: V1.0.0
  title: ChartHop access stripe API
  contact:
    name: ChartHop
    url: https://www.charthop.com
    email: support@charthop.com
host: localhost
schemes:
- https
- http
consumes:
- application/json
produces:
- application/json
tags:
- name: stripe
paths:
  /v1/stripe/plan:
    get:
      tags:
      - stripe
      summary: Return all billing plans directly from Stripe (staff only)
      operationId: findStripePlans
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/ResultsPlan'
        '400':
          description: bad request
        '404':
          description: not found
  /v1/stripe/product:
    get:
      tags:
      - stripe
      summary: Return all products directly from Stripe (staff only)
      operationId: findStripeProducts
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/ResultsStripeProduct'
        '400':
          description: bad request
        '404':
          description: not found
  /v1/stripe/product/{productId}:
    get:
      tags:
      - stripe
      summary: Return a particular product by its Stripe id
      operationId: getStripeProduct
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: productId
        in: query
        description: Stripe product id
        required: true
        type: string
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/StripeProduct'
        '400':
          description: bad request
        '404':
          description: not found
  /v1/stripe/setup-intent:
    post:
      tags:
      - stripe
      summary: Creates a Stripe setupIntent object and returns the secret for that object
      operationId: getSetupIntent
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/SetupIntent'
        '400':
          description: bad request
        '404':
          description: not found
definitions:
  ResultsPlan:
    type: object
    required:
    - data
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/Plan'
      next:
        type: string
  StripeProduct:
    type: object
    required:
    - stripeId
    - label
    properties:
      stripeId:
        type: string
        description: unique Stripe identifier for this product
      label:
        type: string
        description: human-readable nickname for this product
  SetupIntent:
    type: object
    required:
    - clientSecret
    properties:
      clientSecret:
        type: string
        description: Secret of setup_intent object created
        example: st_ersasdfasdf
  Plan:
    type: object
    required:
    - id
    - name
    - interval
    - intervalCount
    - tiers
    - stripeProductId
    properties:
      id:
        type: string
        description: unique Stripe identifier for this plan
      name:
        type: string
        description: human-readable nickname for this plan
      interval:
        type: string
        description: interval for billing on this plan
        enum:
        - DAY
        - WEEK
        - MONTH
        - YEAR
      intervalCount:
        type: integer
        format: int32
        description: number of intervals, for example 3 for quarterly billing
      tiers:
        type: array
        description: pricing tiers, per employee per interval
        items:
          $ref: '#/definitions/PlanTier'
      stripeProductId:
        type: string
        description: stripe product id that this plan belongs to
  ResultsStripeProduct:
    type: object
    required:
    - data
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/StripeProduct'
      next:
        type: string
  PlanTier:
    type: object
    required:
    - unitAmount
    properties:
      upTo:
        type: integer
        format: int64
        description: headcount up to this level is charged at the below rate
      unitAmount:
        type: number
        description: PEPM rate