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

# Create a refund

> Create a refund or partial refund for an approved intent




## OpenAPI

````yaml /openapi.yaml post /refund
openapi: 3.0.1
info:
  title: Push API
  version: 0.0.1
servers:
  - url: https://api.pushcash.com
    description: Production API
  - url: https://sandbox.pushcash.com
    description: Sandbox API used for developing an integration with Push
security:
  - bearer: []
tags:
  - name: user
  - name: tokenization
  - name: authorization
  - name: intent
  - name: dispute
  - name: refund
  - name: accounts
  - name: transactions
  - name: transfer
paths:
  /refund:
    post:
      tags:
        - refund
      summary: Create a refund
      description: |
        Create a refund or partial refund for an approved intent
      operationId: createRefund
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - intent_id
              properties:
                intent_id:
                  type: string
                  description: The ID of the intent to refund
                  example: intent_sandbox_dMggQ93ZYH6DH9LBhVeijE
                amount:
                  type: integer
                  description: >
                    Amount to refund in the smallest unit of the specified
                    currency. If omitted, the full intent amount is refunded.
                  example: 1450
      responses:
        '200':
          description: Refund approved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '400':
          description: |
            The refund request was invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: |
            The refund was declined by the payment network.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The ID of the declined refund
                    example: refund_28CJjV7P4Go5PNJvfzghiD
                required:
                  - id
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    Refund:
      type: object
      description: A refund issued against an approved intent
      example:
        id: refund_28CJjV7P4Go5PNJvfzghiD
        intent_id: intent_sandbox_dMggQ93ZYH6DH9LBhVeijE
        amount: 1450
        currency: USD
        status: approved
        created_at: '2023-05-24T20:36:50.694Z'
      properties:
        id:
          type: string
          description: The unique identifier assigned by Push
        intent_id:
          type: string
          description: The intent which corresponds to the refund
        amount:
          type: integer
          description: >-
            Amount of the refund in the smallest unit of specified currency (ie
            if currency is USD, the unit would be cents)
        currency:
          $ref: '#/components/schemas/Currency'
        status:
          $ref: '#/components/schemas/RefundStatus'
        created_at:
          type: string
          format: date-time
          description: When the refund was created (ISO 8601 date string)
      required:
        - id
        - intent_id
        - amount
        - currency
        - status
        - created_at
    error:
      description: Description of the error encountered from the API request
      type: object
    Currency:
      type: string
      description: Currency associated with the amount
      enum:
        - USD
    RefundStatus:
      type: string
      description: The status of the refund
      enum:
        - approved
        - declined
      x-enumDescriptions:
        approved: The refund was successfully processed
        declined: The refund was declined
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````