Recharge Charges API

Scheduled and processed charges against a customer's payment method.

OpenAPI Specification

recharge-payments-charges-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Recharge Addresses Charges 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: Charges
  description: Scheduled and processed charges against a customer's payment method.
paths:
  /charges:
    get:
      operationId: listCharges
      tags:
      - Charges
      summary: List charges
      parameters:
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/PageCursor'
      responses:
        '200':
          description: A list of charges.
          content:
            application/json:
              schema:
                type: object
                properties:
                  charges:
                    type: array
                    items:
                      $ref: '#/components/schemas/Charge'
  /charges/{id}:
    parameters:
    - $ref: '#/components/parameters/Id'
    get:
      operationId: getCharge
      tags:
      - Charges
      summary: Retrieve a charge
      responses:
        '200':
          description: The requested charge.
          content:
            application/json:
              schema:
                type: object
                properties:
                  charge:
                    $ref: '#/components/schemas/Charge'
  /charges/{id}/skip:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: skipCharge
      tags:
      - Charges
      summary: Skip a charge
      description: Skips a queued charge so it will not process on its scheduled date.
      responses:
        '200':
          description: The skipped charge.
  /charges/{id}/unskip:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: unskipCharge
      tags:
      - Charges
      summary: Unskip a charge
      responses:
        '200':
          description: The unskipped charge.
  /charges/{id}/process:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: processCharge
      tags:
      - Charges
      summary: Process a charge
      description: Attempts to process a queued charge immediately.
      responses:
        '200':
          description: The processed charge.
  /charges/{id}/refund:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: refundCharge
      tags:
      - Charges
      summary: Refund a charge
      responses:
        '200':
          description: The refunded charge.
  /charges/{id}/apply_discount:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: applyDiscountToCharge
      tags:
      - Charges
      summary: Apply a discount to a charge
      responses:
        '200':
          description: The charge with the discount applied.
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:
    Charge:
      type: object
      properties:
        id:
          type: integer
          format: int64
        customer_id:
          type: integer
          format: int64
        address_id:
          type: integer
          format: int64
        status:
          type: string
          enum:
          - success
          - queued
          - skipped
          - error
          - refunded
          - partially_refunded
        total_price:
          type: string
        scheduled_at:
          type: string
          format: date
        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.