Skip to content

Refund

The refund allows you to credit the customer, for example in case of returned goods or cancellation.


Request

To make a refund transaction, send a POST request to https://api.begateway.com/beyag/transactions/refunds with the following parameters:

Parameter Type Description
request object
parent_uid * required
string UID of a parent transaction.
reason * required
string A note why a refund was made.
amount integer Amount to refund in minimal currency units, for example 1000 for $10.00
tracking_id string The ID of your transaction or order.
Example of the request
{
  "request":{
    "parent_uid":"1-310b0da80b",
    "reason":"reason",
    "amount": 50
  }
}
Response
Parameter Type Description
transaction object
uid * required
string Processed transaction UID
parent_uid * required
string UID of a parent transaction.
type * required
string Transaction type.
status * required
string Status of processed transaction.
created_at * required
string Time when transaction was created in ISO 8601 format.
updated_at * required
string Time when transaction was updated in ISO 8601 format.
message string Processing result message.
amount integer Amount to refund.
currency * required
string A transaction currency in the ISO-4217 alpha-3 code format. For example, USD.
tracking_id string The ID of your transaction or order.
test boolean true or false. The transaction will be a test one if it is true
language string Language of your checkout page or customer.
paid_at string Transaction processing date.
method_type * required
string A payment method type or payment brand name supported by the payment method.
receipt_url * required
string Transaction receipt URL
refund object
status * required
string Transaction status.
ref_id string A transaction ID of the external system of the payment method provider.
message string A message from the system of the payment method provider.
be_protected_verification object A section of parameters of the beProtected verification service.
Example of the response
{
  "transaction": {
    "uid": "2-310b0da80b",
    "parent_uid": "1-310b0da80b",
    "type": "refund",
    "status": "successful",
    "message": "The operation was successfully processed",
    "created_at": "2014-06-11T12:04:59+03:00",
    "updated_at": "2014-06-11T12:04:59+03:00",
    "amount": 50,
    "currency": "USD",
    "test": false,
    "method_type": ":method_name",
    "receipt_url": "https://demo-backoffice.begateway.com/customer/transactions/2-310b0da80b/11443f39ae75aa1f955a9c9283cd5045bfb0413b65d666f834a9da4e7d3926b5",
    "refund": {
      "message": "The operation was successfully processed",
      "ref_id": "8889999",
      "status": "successful"
    }
  }
}
Example of the response with beProtected section
{
  "transaction": {
    "uid": "2-310b0da80b",
    "parent_uid": "1-310b0da80b",
    "type": "refund",
    "status": "successful",
    "message": "The operation was successfully processed",
    "created_at": "2014-06-11T12:04:59+03:00",
    "updated_at": "2014-06-11T12:04:59+03:00",
    "amount": 50,
    "currency": "USD",
    "test": false,
    "method_type": ":method_name",
    "receipt_url": "https://demo-backoffice.begateway.com/customer/transactions/2-310b0da80b/11443f39ae75aa1f955a9c9283cd5045bfb0413b65d666f834a9da4e7d3926b5",
    "refund": {
      "message": "The operation was successfully processed",
      "ref_id": "8889999",
      "status": "successful"
    },
    "be_protected_verification":{
      "status":"successful",
      "rules":{
        "1_123_My Shop":{
          "more_100_eur" : {"Transaction amount more than 100 AND Transaction currency is EUR": "passed"}
        },
        "1_John Doe":{},
        "Demo PSP":{}
      }
    }
  }
}