Transaction Refund

Process Your Refunds Using the Zotlo API Service

This API service is designed for processing refunds related to purchases and subscriptions made through Zotlo.

The refund service operates using the POST method. To process a refund, the transactionId parameter must be provided.

Method
POST

Request Parameters

transactionId: The transactionId of the transaction to be refunded. refundReason: The reason for the refund. refundUser: The user information initiating the refund. This can be sent as a string.

Sample Request

To send a request to the refund service, you need the Access Key and Access Secret credentials, which can be found on the Developer Tools/API Keys page in the Zotlo Panel.

Providing the Application ID is optional.

POST https://api.zotlo.com/v1/payment/refund HTTP/1.1
AccessKey: ••••••
AccessSecret: ••••••
Content-Type: application/json
ApplicationId: •
Language: ••
{
    "transactionId": "0741a0ac-21d8-4750-941f-064f340700c3",
    "refundReason": "User request!",
}

Sample Successful Response

{
  "meta": {
    "requestId": "246a8e676214-REQ-659557ea5289c",
    "httpStatus": 200
  },
  "result": {
    "providerResponse": [],
    "transaction": {
      "id": 57333,
      "payment_type": "subscription",
      "original_transaction_id": "d8ff7792-1c63-4370-be93-447dacaa09ea",
      "transaction_id": "0741a0ac-21d8-4750-941f-064f340700c3",
      "package_id": "premium",
      "team_id": 5,
      "app_id": 5,
      "status": "renewal",
      "create_date": "2024-01-03 12:47:20",
      "purchase_date": "2024-01-03 12:47:20",
      "original_purchase_date": "2023-01-03 12:47:16",
      "price": "12.00",
      "currency": "TRY",
      "country": "TR",
      "expire_date": "2025-01-03 12:47:16",
      "subscriber_id": "905456757656",
      "credit_card": "11111111****4111",
      "refund_price": "5.00",
      "refund_date": "2024-01-03 12:49:46",
      "refund_reason": "{\"reason\":\"Test .\",\"user\":\"API: \"}",
      "is_refund": 1,
      "provider_id": 8,
      "provider_transaction_id": "e963981a-4ee1-494b-b1e8-73db2a694c58",
      "provider_status": "unknown",
      "provider_name": "Zotlo",
      "comment": null,
      "json_payload": null,
      "quantity": 1,
      "package_price": "12.00",
      "subscription_id": 5370,
      "is_transfer": null
    },
    "refundHistory": [
      {
        "id": 3627,
        "team_id": 5,
        "app_id": 5,
        "provider_id": 8,
        "package_id": "premium",
        "subscriber_id": "905456757656",
        "transaction_id": "0741a0ac-21d8-4750-941f-064f340700c3",
        "country": "TR",
        "price": "5.00",
        "currency": "TRY",
        "exchange_rate": "[]",
        "reason": "{\"reason\":\"Test .\",\"user\":\"API: \"}",
        "refund_date": "2024-01-03 12:49:46"
      }
    ]
  }
}

Successful Response Parameters

The parameters included in a successful response are as follows:

Parameter
Description

providerResponse

This is the refund response provided by the payment provider.

transaction

The latest details of the refunded payment.

Failed Example Response

Our services return an HTTP status code of 200 for successful requests. In case of failure, an HTTP status code of 400 or 500 is returned. An example error response is shown below.

{
    "meta": {
        "requestId": "75472fafd4f9-REQ-65982cee82930",
        "httpStatus": 400,
        "errorMessage": "İadesini yapmak istediğiniz sipariş numarasına ait bir satın alma bulunamadı.",
        "errorCode": "400013"
    },
    "result": []
}

Failed Example Response Parameters

Below are the parameters included in failed responses.

Parameter
Description

requestId

It is the unique request parameter generated and stored by Zotlo for your transaction.

httpStatus

It is the HTTP status code related to the response. The standard codes 400 or 500 are returned.

errorMessage

It is the detail of the received error. The error message is provided in the language specific to the parameter you sent.

errorCode

It is the error code from Zotlo.

result

The values this field can take are variable.If there’s an error, it will include data; otherwise, it will return as an empty object.

Last updated