1. Refund
Sipay API Documentation
EN
  • EN
  • TR
  • Overview
    • Getting Started
    • Test Cards
    • IP Restriction
  • Authentication
    • Token Generation
      POST
  • Installments & Commission
    • Installment Details
      POST
    • Commission
      POST
    • Merchant Installments
      POST
  • HASH
    • Hash Creation
    • Hash Validation
  • Non-3DS Payment
    • Non-3DS Payment Flow
    • Non-3DS Card Payment
      POST
    • Non-3DS Recurring Payment
      POST
    • Non-3DS Insurance Payment
      POST
    • Non-3DS Pre-Authorization Payment
      POST
    • Confirm Payment
      POST
  • 3D Secure Payment
    • 3D Secure Payment Flow
    • 3D Secure Card Payment
      POST
    • 3D Secure Recurring Payment
      POST
    • 3D Secure Pre-Authorization Payment
      POST
    • Complete Payment
      POST
    • Confirm Payment
      POST
    • 3D Secure Agriculture Payment
      POST
  • Non-3DS and 3DS Payment with Sipay
    • Purchase Link Example
    • Non-3DS and 3D Secure Payment with Sipay
  • DPL
    • DPL
    • Status Codes
    • Options for Creating a DPL
    • Create DPL
    • List Payment Links
    • Payment Link Details
    • Update DPL
    • Remove DPL
  • Check Status
    • Check Status
  • Payment with Saved Card
    • Card Registration
    • 3D Secure Pay by Card Token
    • Non-3DS Pay by Card Token
    • Retrieving Saved Card
    • Edit Saved Card
    • Delete Saved Card
  • Recurring
    • Recurring Query Search
    • Recurring Plan Process
    • Recurring Plan Update
  • Refund
    • Refund
      POST
  • Cashout
    • Cashout to Bank
  • Webhook
    • Webhook
  • Status Codes
    • Status Codes
  • Plugin
    • Magento v1
    • Magento v2
    • Opencart
    • Presta
    • Woocommerce
    • Shopify
  • Settings
    • DPL Settings
    • Settings Update
  1. Refund

Refund

Testing Env
https://provisioning.sipay.com.tr
Testing Env
https://provisioning.sipay.com.tr
POST
/ccpayment/api/refund
This endpoint is used to request a refund for a transaction that has already been successfully completed and paid. Enables merchants to initiate a full or partial refund process in accordance with their business rules and payment provider policies. Once the request is submitted, the transaction is evaluated and processed through the payment system to ensure the appropriate refund action is applied. The outcome of the refund request is then returned to the merchant.

Partial Refunds#

For partial refund operations, the amount field must include the exact amount to be refunded.
If the full transaction amount is submitted in the refund request, the transaction status will be updated as refund.
📌
Example:
If the transaction amount is 10 TRY and a refund of 7 TRY is issued, the transaction status will be updated as partially_refund.
There is no need to send a request to a separate endpoint for void operations. For same-day transactions, void operations are processed by sending a request to the refund endpoint.
The hash key must be sent in the request.
Sample hash keys can be found in the request form panel on the side, corresponding to the selected programming language.
An example of the hash algorithm is included in the request.

Hash Parameters#

The parameters and their order to be used for the hash algorithm are as follows.
amount
invoice_id
merchant_key
app_secret

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Bodyapplication/json

🟠49Failed
Request Request Example
Shell
JavaScript
Java
Swift
#!/usr/bin/env bash
set -euo pipefail

# Example values. Load your merchant app_secret on your server.
# Use an empty first value if amount is empty. For a marketplace sale, sign invoice_id and merchant_key.
parts=(
  "25.50" # amount
  "INV-DOCS-001" # invoice_id
  "merchant_example" # merchant_key
)
app_secret="example_app_secret"

message=$(IFS='|'; printf '%s' "${parts[*]}")
printf '%s' "$message" | openssl dgst -sha256 -hmac "$app_secret" -r | awk '{print $1}'
Response Response Example
200 - Success
{
    "status_code": 100,
    "status_description": "Refund completed successfully",
    "order_no": "VP17695816358637973",
    "invoice_id": "CPIKQUM29TXMQFF-1769581631",
    "ref_no": "602800085396",
    "ref_number": "602800085396"
}
Previous
Recurring Plan Update
Next
Cashout to Bank
Built with