> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toffeepay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Refund



## OpenAPI

````yaml POST /v1/refunds
openapi: 3.1.0
info:
  title: ToffeePay API
  description: Public API for game partners
  version: 0.1.1
servers:
  - url: https://api.toffeepay.com
    description: Production
  - url: https://api.sandbox.toffeepay.com
    description: Sandbox
security:
  - BearerAuth: []
paths:
  /v1/refunds:
    post:
      summary: CreateRefund
      operationId: RefundService_CreateRefund
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pay.v1.CreateRefundRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pay.v1.Refund'
                title: refund
components:
  schemas:
    pay.v1.CreateRefundRequest:
      type: object
      properties:
        payment_id:
          type: string
          title: payment_id
        reason:
          type:
            - string
            - 'null'
          title: reason
      title: CreateRefundRequest
      required:
        - payment_id
      additionalProperties: false
    pay.v1.Refund:
      type: object
      properties:
        id:
          type: string
          title: id
        payment_id:
          type: string
          title: payment_id
        status:
          type: string
          title: status
          enum:
            - pending
            - succeeded
            - failed
            - cancelled
        reason:
          type:
            - string
            - 'null'
          title: reason
        created_at:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
        succeeded_at:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: succeeded_at
        failed_at:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: failed_at
        cancelled_at:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: cancelled_at
        error:
          oneOf:
            - $ref: '#/components/schemas/pay.v1.Error'
            - type: 'null'
          title: error
      title: Refund
      required:
        - id
        - payment_id
        - status
        - created_at
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      format: date-time
    pay.v1.Error:
      type: object
      properties:
        code:
          type: string
          title: code
        message:
          type: string
          title: message
      title: Error
      additionalProperties: false
      description: Error handling
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````