Omise Refunds API

Full or partial refunds against a charge.

Documentation

Specifications

Other Resources

OpenAPI Specification

omise-refunds-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Omise (Opn Payments) Account Refunds API
  description: 'Omise, now Opn Payments (part of Opn), is an online payment gateway for Thailand, Japan, and Singapore. This OpenAPI document describes a representative, grounded subset of the public REST API. The core API is served from https://api.omise.co and authenticated with a secret key via HTTP Basic (the key is the username, the password is empty). Raw card data is tokenized on a separate PCI-scoped vault host, https://vault.omise.co, authenticated with the public key. API behavior is pinned with the optional `Omise-Version` header. All monetary amounts are integers in the smallest unit of the currency (for example satang for THB, yen for JPY).

    Scope note: paths, methods, and object identifiers here are grounded in the published Omise documentation (docs.omise.co). Request and response schemas are modeled as a solid representative subset rather than a byte-for-byte mirror of every field; verify exact payloads against the live docs.'
  version: 2019-05-29
  contact:
    name: Opn Payments (Omise)
    url: https://www.omise.co
  license:
    name: Proprietary
    url: https://www.omise.co
servers:
- url: https://api.omise.co
  description: Core API (secret key)
- url: https://vault.omise.co
  description: Vault - tokenization only (public key)
security:
- secretKeyAuth: []
tags:
- name: Refunds
  description: Full or partial refunds against a charge.
paths:
  /charges/{id}/refunds:
    parameters:
    - $ref: '#/components/parameters/Id'
    post:
      operationId: createRefund
      tags:
      - Refunds
      summary: Create a refund
      description: Refunds all or part of a charge.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - amount
              properties:
                amount:
                  type: integer
                  description: Amount to refund, in the smallest currency unit.
                metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: The created refund.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '401':
          $ref: '#/components/responses/Unauthorized'
    get:
      operationId: listChargeRefunds
      tags:
      - Refunds
      summary: List refunds for a charge
      responses:
        '200':
          description: A list of refunds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/List'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /charges/{id}/refunds/{refund_id}:
    parameters:
    - $ref: '#/components/parameters/Id'
    - name: refund_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getRefund
      tags:
      - Refunds
      summary: Retrieve a refund
      responses:
        '200':
          description: The requested refund.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /refunds:
    get:
      operationId: listAllRefunds
      tags:
      - Refunds
      summary: List all refunds
      responses:
        '200':
          description: A list of refunds across the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/List'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      description: The object identifier.
      schema:
        type: string
  schemas:
    List:
      type: object
      description: Omise paginated list envelope.
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
        order:
          type: string
        location:
          type: string
    Error:
      type: object
      properties:
        object:
          type: string
          example: error
        location:
          type: string
        code:
          type: string
          description: For example authentication_failure, not_found, invalid_charge.
        message:
          type: string
    Refund:
      type: object
      properties:
        object:
          type: string
          example: refund
        id:
          type: string
        livemode:
          type: boolean
        amount:
          type: integer
        currency:
          type: string
        funding_amount:
          type: integer
        funding_currency:
          type: string
        charge:
          type: string
        status:
          type: string
        voided:
          type: boolean
        metadata:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The object was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKeyAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth against https://api.omise.co. The secret key (skey_test_... or skey_... ) is the username; the password is left empty.
    publicKeyAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth against https://vault.omise.co for tokenization and for creating sources. The public key (pkey_test_... or pkey_... ) is the username; the password is left empty.