Refunds

Learn how to get refund transactions to your server via webhooks

This webhook service keeps you informed about any successful refund transaction triggered by the user or merhant including both one-time and subscription based payments.

Setup the Endpoint URL

Webhook events are sent to your server via HTTP POST. You configure the endpoint URL through Developer Tools / Webhooks menu under your project.

Events Format

Webhook events are serialized in JSON. The body of a POST request to your server will contain the serialized event.

{
  "queue": {
    "type": "TransactionRefund",
    "eventType": "refund",
    "requestID": "bbb3a4bc-93fc-46da-9d35-b2a7db6f2e3c",
    "createDate": {
      "date": "2024-10-25 15:23:48",
      "timezone_type": 3,
      "timezone": "UTC"
    },
    "appId": 7
  },
  "parameters": {
    "id": 9599,
    "payment_type": "subscription",
    "original_transaction_id": "093b8307-1658-4f94-a9bd-f101748d3c4b",
    "transaction_id": "093b8307-16-a9bd-f101748d3c4b",
    "package_id": "premium2005",
    "team_id": 7,
    "app_id": 7,
    "status": "start_paid",
    "create_date": "2024-10-25 15:23:48",
    "purchase_date": "2024-10-25 15:23:48",
    "original_purchase_date": "2024-10-25 15:23:48",
    "price": "9.99",
    "currency": "TRY",
    "country": "TR",
    "expire_date": "2024-10-25 15:23:48",
    "subscriber_id": "test@mail.com",
    "credit_card": "41111111****1111",
    "refund_price": "9.99",
    "refund_date": "2024-10-25 15:23:48",
    "refund_reason": "",
    "is_refund": 1,
    "provider_id": 2005,
    "provider_transaction_id": "c9d9e426-c3a2-4b5f-ba67-e09618f1d066",
    "provider_status": "visa",
    "provider_name": "Credit Card",
    "comment": null,
    "json_payload": "",
    "quantity": 1,
    "package_price": "9.99",
    "subscription_id": 2005,
    "is_transfer": null,
    "paymentMethod": "creditCard"
  }
}

Fields

queue

Webhook type and history.

queue.type

It specifies that the webhook is of the refund type. For this webhook type, it can only take the value of TransactionRefund.

queue.eventType

It is the transaction type information. In this webhook, since only a refund transaction occurs, it can only take the value of refund.

parameters

Details about the webhook.

is_refund

This value is always sent as 1.

refund_price

Refunded amount.

refund_reason

Refund reason.

credit_card

Credit card used in the transaction.

status

Contains the transaction type associated with refund, possible values:

trial : Trial start transaction

trial_to_paid : Trial conversion transaction

renewal : Subscription renewal

reactivate : Reactivation of a passive subscription

consumable : Purchase of one-time package

start_paid : Subscription start transaction without trial

transaction_id

Unique ID of transaction.This information is used in refund transactions.

provider_transaction_id

Transaction ID in the relevant payment provider.

currency

Currency used in the transaction.

provider_name

Payment provider name.

create_date

Transaction start date.

subscriber_id

Subscriber ID associated with the transaction.

custom_parameters

If the subscriber has custom parameters, they are sent in this field.

original_purchase_date

Subscriptions original start date.

package_id

ID of the package purchased.

expire_date

Expiration date if it is a subscription purchase.

purchase_date

The transaction completion date.

payment_type

Contains the type of payment, possible values :

subscription : Transaction is for a subscription

consumable: Transaction is for a in-app product or one-time payment.

quantity

The number of items purchased.

package_price

Package price.

price

Transaction amount.

Last updated