Developers

Developers

  • Docs
  • Help
  • Blog

›/api

Overview

  • Getting Started
  • Testing

Integrations

  • Simple link
  • Simple embed
  • React SDK
  • Embed SDK
  • Webhooks
  • REST Hooks
  • Wix Embed SDK

API

  • Authentication

/api

    /v1/current_company

    • GET /
    • PUT /
    • GET /stats

    /v1/customers

    • GET /
    • GET /:id

    /v1/payments

    • GET /
    • GET /:id

    /v1/plans

    • GET /
    • POST /
    • PUT /:id

    /v1/refunds

    • POST /

    /v1/subscriptions

    • GET /
    • GET /:id
    • DELETE /:id

    /v1/user

    • GET /

POST /api/v1/refunds

This will refund a customer the amount specified, can be a partial refund.

Request

Curl
Ruby
$ curl -X POST https://api.payhere.co/api/v1/refunds \
       -H "Accept: application/json" \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer ${api_key_here}" \
       -d '{"payment_id": 373, "amount": 0.5, "reason": "requested_by_customer"}'
require "http"
require "json"

resp = HTTP.auth("Bearer #{api_key_here}")
           .post(
              "https://api.payhere.co/api/v1/refunds",
              payment_id: 373,
              amount: 0.5,
              reason: "requested_by_customer"
            )

success = resp.status == 204

Params

  • payment_id - ID of the payment to refund
  • amount - amount to refund the customer, uses the currency of their payment, if USD, amount should be in dollars and can use decimal point i.e. 1.5 is $1.50 USD
  • reason - Reason for the refund, one of: requested_by_customer, duplicate or fraudulent

Response

204 No content

Errors

  • 400 Bad request - if validation fails
  • 401 Unauthorized
← PUT /:idGET / →
  • Request
    • Params
  • Response
  • Errors
Developers
Docs
Getting StartedEmbed SDKAPI Reference
Payhere
HelpSignup freeFeatures
More
Our BlogGitHubTwitter
Copyright © 2025 Payhere Payments Ltd