Recharge Products API

Products and subscription rules exposed to the storefront.

OpenAPI Specification

recharge-payments-products-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Recharge Addresses Products API
  description: The Recharge API is a REST API (with a few RPC-style action endpoints) for building and operating subscription and recurring-billing commerce on top of Recharge. It has predictable, resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP status codes and verbs. All requests are made over HTTPS to https://api.rechargeapps.com and authenticated with a store API token passed in the X-Recharge-Access-Token header. The API is versioned via the X-Recharge-Version header; supported versions are 2021-11 (recommended) and 2021-01. This document grounds a representative subset of the public surface - Subscriptions, Customers, Orders, Charges, Products, Addresses, Payment Methods, Onetimes, Discounts, and Webhook endpoints. See developer.rechargepayments.com for the complete reference.
  version: 2021-11
  contact:
    name: Recharge
    url: https://developer.rechargepayments.com
  termsOfService: https://getrecharge.com/legal
servers:
- url: https://api.rechargeapps.com
  description: Recharge API
security:
- apiToken: []
tags:
- name: Products
  description: Products and subscription rules exposed to the storefront.
paths:
  /products:
    get:
      operationId: listProducts
      tags:
      - Products
      summary: List products
      parameters:
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/PageCursor'
      responses:
        '200':
          description: A list of products.
          content:
            application/json:
              schema:
                type: object
                properties:
                  products:
                    type: array
                    items:
                      $ref: '#/components/schemas/Product'
    post:
      operationId: createProduct
      tags:
      - Products
      summary: Create a product
      responses:
        '201':
          description: The created product.
  /products/{id}:
    parameters:
    - $ref: '#/components/parameters/Id'
    get:
      operationId: getProduct
      tags:
      - Products
      summary: Retrieve a product
      responses:
        '200':
          description: The requested product.
          content:
            application/json:
              schema:
                type: object
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
    put:
      operationId: updateProduct
      tags:
      - Products
      summary: Update a product
      responses:
        '200':
          description: The updated product.
    delete:
      operationId: deleteProduct
      tags:
      - Products
      summary: Delete a product
      responses:
        '204':
          description: The product was deleted.
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      description: The unique identifier of the resource.
      schema:
        type: integer
        format: int64
    PageCursor:
      name: page_info
      in: query
      required: false
      description: Cursor for cursor-based pagination, taken from the Link response header.
      schema:
        type: string
    Limit:
      name: limit
      in: query
      required: false
      description: The maximum number of results per page (default 50, max 250).
      schema:
        type: integer
        default: 50
        maximum: 250
  schemas:
    Product:
      type: object
      properties:
        id:
          type: integer
          format: int64
        title:
          type: string
        external_product_id:
          type: object
        subscription_defaults:
          type: object
        created_at:
          type: string
          format: date-time
  securitySchemes:
    apiToken:
      type: apiKey
      in: header
      name: X-Recharge-Access-Token
      description: Store API token generated in the Recharge merchant portal under Apps and integrations.