Skip to main content

Refunds

You can use the Automated Payments Interface to make automated partial or full refunds to customers, up to the amount of the original payment.

You must send your HTTPS refund request to the following URL:

https://www.skrill.com/app/refund.pl

The refund is made in two steps:

  • Preparation of the refund
  • Execution of the refund

Executing a Refund Preparation request

The following parameters must be included in the refund prepare request:

FieldDescriptionRequiredExample
actionDefines the prepare step of the refund request.Yesaction=prepare
emailYour email address.Yesinfo@merchant.com
passwordThe MD5 of your API/MQI password. Note: only the lower-case of the MD5 value is accepted.Yes9f535b6ae672f627e4a5f79f2b7c63fe
transaction_idYour transaction ID to be refunded.Yes/No *500123
mb_transaction_idThe Skrill transaction ID to be refunded.Yes/No *4585262
amountAmount to refund in the currency used by the merchant account. This field is only used for partial refunds.No9.99
refund_noteRefund note sent to the customer. This note forms part of the email sent to the customer to inform them that they have received a refund.NoProduct no longer in stock
merchant_fieldsA comma-separated list of field names that are passed back to your server when the refund payment is confirmed (maximum 5 fields).NoField1,Field2
Field1An additional field you can include, containing your own unique parameters.NoValue1
Field2An additional field you can include, containing your own unique parameters.NoValue2
refund_status_urlURL or email address to which status updates should be sent. The following ports can be used for this URL: 80, 81, 82, 83, 88, 90, 178, 419, 433, 443, 444, 448, 451, 666, 800, 888, 1025, 1430, 1680, 1888, 1916, 1985, 2006, 2221, 3000, 4111, 4121, 4423, 4440, 4441, 4442, 4443, 4450, 4451, 4455, 4567, 5443, 5507, 5653, 5654, 5656, 5678, 6500, 7000, 7001, 7022, 7102, 7777, 7878, 8000, 8001, 8002, 8011, 8014, 8015, 8016, 8027, 8070, 8080, 8081, 8082, 8085, 8086, 8088, 8090, 8097, 8180, 8181, 8443, 8449, 8680, 8843, 8888, 8989, 9006, 9088, 9443, 9797, 10088, 10443, 12312, 18049, 18079, 18080, 18090, 18443, 20202, 20600, 20601, 20603, 20607, 20611, 21301, 22240, 26004, 27040, 28080, 30080, 37208, 37906, 40002, 40005, 40080, 50001, 60080, 60443Nohttps://www.merchant.com/refund_update.cqi
info

* You must submit either transaction_id or mb_transaction_id.
If no amount value is submitted, the refund will be for the full amount of the original transaction.
If the refund_note value is submitted, it is shown in the body of the notification email sent to the customer.

Response

The resulting XML contains a <response> element with one of the following elements, depending on the success of the operation:

  • <sid> - Session ID element – returned if the prepare request is successful. It must be submitted with the refund action in the next step
  • <error> element – returned if an error occurs. Contains an <error_msg> element containing the error message

Example 1: Successful Refund Preparation

Request:

curl --location 'https://www.skrill.com/app/refund.pl' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'action=prepare' \
--data-urlencode 'email=info@merchant.com' \
--data-urlencode 'password=9f535b6ae672f627e4a5f79f2b7c63fe' \
--data-urlencode 'transaction_id=500123' \
--data-urlencode 'amount=9.99' \
--data-urlencode 'refund_note=example_note' \
--data-urlencode 'refund_status_url=https://www.merchant.com/refund_update.cqi' \
--data-urlencode 'merchant_fields=Field1,Field2' \
--data-urlencode 'Field1=Value1' \
--data-urlencode 'Field2=Value2'

Response:

<response>
<sid>d831e9072e8b89c57a3654ddf5fcb907</sid>
</response>

Example 2: Failed Refund Preparation

Request:

curl --location 'https://www.skrill.com/app/refund.pl' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'action=prepare' \
--data-urlencode 'email=info@merchant.com' \
--data-urlencode 'password=9f535b6ae672f627e4a5f79f2b7c64fe' \
--data-urlencode 'transaction_id=500123' \
--data-urlencode 'amount=9.99' \
--data-urlencode 'refund_note=example_note' \
--data-urlencode 'refund_status_url=https://www.merchant.com/refund_update.cqi' \
--data-urlencode 'merchant_fields=Field1,Field2' \
--data-urlencode 'Field1=Value1' \
--data-urlencode 'Field2=Value2'

Response:

<response>
<error>
<error_msg>CANNOT_LOGIN</error_msg>
</error>
</response>

Error Messages

See the table below for details of error messages.

Error messageDescription
CANNOT_LOGINInvalid combination of email and password is supplied.
INVALID_EMAILAn Invalid email parameter is supplied.
INVALID_OR_MISSING_ACTIONThe action parameter is not supplied in the query.
LOGIN_INVALIDMissing email or password parameters.
NO_LOGIN_EXPLANATIONMerchant using non-existent email address.
REFUND_DENIEDRefund feature is not activated.

Executing a Refund Request

The following parameters must be included in the refund execution request:

FieldDescriptionRequiredExample
actionDefines the execution step of the refund request.Yesrefund
sidSession identifier returned in response to the prepare request.Yesd831e9072e8b89c57a3654ddf5fcb907

Response

The server returns XML containing a <response> element, which includes some of the following elements, depending on the success of the operation:

ElementDescriptionExample
mb_amountAmount refunded in the currency of your Skrill account.9.99
mb_currencyCurrency of your Skrill account.EUR
transaction_idYour refund transaction ID as submitted in the request.500123
mb_transaction_idThe Skrill transaction ID for the refund.5585262
Field1The first additional field pre-defined in merchant_fields parameterValue1
Field2The second additional field pre-defined in merchant_fields parameterValue2
status2 = processed, 0 = pending, -2 = failed.2
errorError codes and their meanings: BALANCE_NOT_ENOUGH (exceeds balance), CC_REFUND_FAILED (card fail), RESERVE_EXCEEDED (blocked by reserve), GENERIC_ERROR (other errors or already refunded).CC_REFUND_ FAILED

Example: Successful Refund

Request:

curl --location 'https://www.skrill.com/app/refund.pl' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'action=refund' \
--data-urlencode 'sid=d831e9072e8b89c57a3654ddf5fcb907'

Response:

<response>
<mb_amount>2</mb_amount>
<mb_currency>EUR</mb_currency>
<mb_transaction_id>381526883</mb_transaction_id>
<Field1>Value1</Field1>
<Field2>Value2</Field2>
<status>2</status>
<transaction_id/>
</response>

Refund Status Report

If a request for refund cannot be executed at the moment, Skrill sends a response with status 0 (pending) in the prepare step. When Skrill receives an update on the status of the refund, a notification is sent to your refund_status_url page.

If you would like to receive notifications for every status of your refund request, contact the Merchant Services team.

This status report consists of the following fields:

FieldDescriptionRequiredExample
transaction_idYour transaction ID for the refund as submitted in the request.Yes/No500123
mb_transaction_idThe Skrill transaction ID for the refund.Yes5585262
status2 = processed, -2 = failed.Yes2
mb_amountAmount refunded in the currency of your Skrill account.Yes9.99
mb_currencyCurrency of your Skrill account.YesEUR
md5sigUpper-case MD5 signature. See MD5 signature below.Yes9F535B6AE672F627E4A5F79F2B7C63FE
sha2sigUpper-case SHA2 signature. This is constructed in the same way as the MD5 signature, but with a different hashing algorithm. This parameter is not available by default. To enable this option, send a request to merchantservices@skrill.comNoDBB7101322257A311F08D1C527053058FC7E464E30BCFB4613F09053C22DD1F8

MD5 Signature

The md5sig parameter consists of an MD5 sum on a string built by concatenating the following parameters and converting the result to upper-case.

FieldDescriptionExample
merchant_idYour Skrill account user ID.4637827
mb_transaction_idThe new Skrill transaction ID for refund.5585262
MD5 of secret wordThe upper-case MD5 value of the secret word submitted in the Settings > Developer Settings section of your Skrill account.327638C253A4637199CEBA6642371F20
mb_amountAmount refunded in the currency of your account.9.99
mb_currencyCurrency of your account.EUR
statusThe status of the refund transaction.2

Example

Concatenated fields in Ruby code:

fields = [merchant_id, mb_transaction_id, Digest::MD5.hexdigest(secret).upcase, mb_amount, mb_currency, status].join
md5sig == Digest::MD5.hexdigest(fields).upcase

Using the example values in the table above, the following MD5 code is returned: CF9DCA614656D19772ECAB978A56866D.