Razorpay Payments API

The Payments API from Razorpay — 6 operation(s) for payments.

OpenAPI Specification

razorpay-payments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Razorpay Core REST Orders Payments API
  description: 'Razorpay''s RESTful API covering orders, payments, and refunds. All

    endpoints are authenticated with HTTP Basic auth using the API

    key_id as username and key_secret as password and return JSON.

    '
  version: 1.0.0
  contact:
    name: Razorpay
    url: https://razorpay.com/docs/api/
servers:
- url: https://api.razorpay.com/v1
  description: Razorpay production API
security:
- basicAuth: []
tags:
- name: Payments
paths:
  /payments:
    get:
      summary: List payments
      operationId: listPayments
      parameters:
      - $ref: '#/components/parameters/from'
      - $ref: '#/components/parameters/to'
      - $ref: '#/components/parameters/count'
      - $ref: '#/components/parameters/skip'
      responses:
        '200':
          description: Payment list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentList'
      tags:
      - Payments
  /payments/{id}:
    parameters:
    - $ref: '#/components/parameters/id'
    get:
      summary: Get a payment
      operationId: getPayment
      responses:
        '200':
          description: Payment detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
      tags:
      - Payments
    patch:
      summary: Update a payment (notes)
      operationId: updatePayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                notes:
                  type: object
                  additionalProperties:
                    type: string
      responses:
        '200':
          description: Updated payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
      tags:
      - Payments
  /payments/{id}/capture:
    parameters:
    - $ref: '#/components/parameters/id'
    post:
      summary: Capture an authorized payment
      operationId: capturePayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - amount
              - currency
              properties:
                amount:
                  type: integer
                  description: Amount in the smallest currency sub-unit (paise for INR).
                currency:
                  type: string
                  description: ISO currency code, e.g. INR.
      responses:
        '200':
          description: Captured payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
      tags:
      - Payments
  /payments/{id}/card:
    parameters:
    - $ref: '#/components/parameters/id'
    get:
      summary: Get card used for a payment
      operationId: getPaymentCard
      responses:
        '200':
          description: Card detail.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  entity:
                    type: string
                  name:
                    type: string
                  last4:
                    type: string
                  network:
                    type: string
                  type:
                    type: string
                  issuer:
                    type: string
                  international:
                    type: boolean
                  emi:
                    type: boolean
      tags:
      - Payments
  /payments/{id}/refund:
    parameters:
    - $ref: '#/components/parameters/id'
    post:
      summary: Refund a captured payment
      operationId: createRefund
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: Amount to refund in smallest currency sub-unit. Omit for full refund.
                speed:
                  type: string
                  enum:
                  - normal
                  - optimum
                notes:
                  type: object
                  additionalProperties:
                    type: string
                receipt:
                  type: string
      responses:
        '200':
          description: Refund created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
      tags:
      - Payments
  /payments/{id}/refunds:
    parameters:
    - $ref: '#/components/parameters/id'
    get:
      summary: List refunds for a payment
      operationId: listPaymentRefunds
      responses:
        '200':
          description: Refund list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundList'
      tags:
      - Payments
components:
  parameters:
    skip:
      name: skip
      in: query
      schema:
        type: integer
        default: 0
    from:
      name: from
      in: query
      schema:
        type: integer
        description: Unix timestamp (seconds) lower bound.
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
    to:
      name: to
      in: query
      schema:
        type: integer
        description: Unix timestamp (seconds) upper bound.
    count:
      name: count
      in: query
      schema:
        type: integer
        default: 10
        maximum: 100
  schemas:
    RefundList:
      type: object
      properties:
        entity:
          type: string
        count:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/Refund'
    PaymentList:
      type: object
      properties:
        entity:
          type: string
        count:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
    Payment:
      type: object
      properties:
        id:
          type: string
        entity:
          type: string
        amount:
          type: integer
        currency:
          type: string
        status:
          type: string
          enum:
          - created
          - authorized
          - captured
          - refunded
          - failed
        method:
          type: string
        order_id:
          type: string
        description:
          type: string
        international:
          type: boolean
        refund_status:
          type:
          - string
          - 'null'
        amount_refunded:
          type: integer
        captured:
          type: boolean
        email:
          type: string
        contact:
          type: string
        fee:
          type: integer
        tax:
          type: integer
        error_code:
          type:
          - string
          - 'null'
        error_description:
          type:
          - string
          - 'null'
        created_at:
          type: integer
        notes:
          type: object
          additionalProperties:
            type: string
    Refund:
      type: object
      properties:
        id:
          type: string
        entity:
          type: string
        amount:
          type: integer
        currency:
          type: string
        payment_id:
          type: string
        receipt:
          type: string
        status:
          type: string
          enum:
          - pending
          - processed
          - failed
        speed_requested:
          type: string
        speed_processed:
          type: string
        created_at:
          type: integer
        notes:
          type: object
          additionalProperties:
            type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth — username is Razorpay key_id, password is key_secret.