API Skril Docs Vasanth
API Skril Docs Vasanth
www.skrill.com
Version 2.19
Skrill Limited, 25 Canada Square, Canary Wharf, London, E14 5LQ, UK.
Copyright
2014. Skrill Ltd. All rights reserved.
The material contained in this guide is copyrighted and owned by Skrill Ltd together with any other
intellectual property in such material. Except for personal and non-commercial use, no part of this
guide may be copied, republished, performed in public, broadcast, uploaded, transmitted,
distributed, modified or dealt with in any manner at all, without the prior written permission of Skrill
Ltd, and, then, only in such a way that the source and intellectual property rights are acknowledged.
To the maximum extent permitted by law, Skrill Ltd shall not be liable to any person or organisation,
in any manner whatsoever from the use, construction or interpretation of, or the reliance upon, all
or any of the information or materials contained in this guide.
The information in these materials is subject to change without notice and Skrill Ltd. assumes no
responsibility for any errors.
Skrill Ltd.
Registered office: Skrill Limited, 25 Canada Square, Canary Wharf, London, E14 5LQ, UK.
Version
Description
13/09/2013
2.16
25/11/2013
2.1.7
21/02/2014
2.1.8
14/03/2014
2.19
Skrill 2014
Page 1
Contents
1
1.2
1.3
Introduction ......................................................................................................................... 5
Security ................................................................................................................................ 6
3.1
Security requirements............................................................................................................. 6
3.2
3.3
3.4
4.1.2
4.1.3
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.1.8
5.2
6
6.1.1
Prepare .......................................................................................................................... 18
6.1.2
Request ......................................................................................................................... 19
Refunds .............................................................................................................................. 21
7.1
7.2
7.3
Appendices......................................................................................................................... 26
Skrill 2014
Page 2
8.1
8.2
Error Messages...................................................................................................................... 27
Glossary ............................................................................................................................. 29
10 Index .................................................................................................................................. 30
Skrill 2014
Page 3
Guide
Description
Convention
Description
Reference
File path
Glossary
Glossary term
Skrill 2014
Page 4
2 INTRODUCTION
The Skrill Automated Payments Interface enables you to execute automated requests to Skrill,
including:
Skrill 2014
Page 5
3 SECURITY
3.1 Security requirements
All requests to the API must be standard HTTPs requests. The HTTPs protocol provides a secure
means of verification of the program on the client host. Plain text HTTP requests are forbidden and if
the client sends an HTTP request to the server it will be denied.
Tip: If you currently do not send HTTPs headers for tracking reasons, you should be aware that this
can be used as a loophole by potential website hackers.
4. Specify at least one IP address from which requests will be made. All requests from other IP
addresses are denied. Access can be granted to:
o
o
o
Enter a list of IPs or at least one IP address (or an IP range) in the text fields in the
corresponding sections.
5. To apply your changes, click Save.
Skrill 2014
Page 6
Note: the password must be at least 8 characters long and must contain at least one alphabetic and
one non-alphabetic character.
3. Click Save.
Note: If you insert any uppercase symbols, they will automatically be converted to lowercase.
3. To apply your changes, click Save.
Skrill 2014
Page 7
After each step Skrill returns a XML response that contains the result of the performed action. See
the example below.
Note: we recommend you open a test account to test your mass payment transaction. You can open
a new Skrill digital wallet account online and send a request to the Merchant Service team to
enable this as a test account. Test accounts operate in the live environment, but funds cannot
be sent from a test account to a live account.
Skrill 2014
Page 8
Parameter
Description
The required action. In the first step,
this is prepare.
Your email address.
password
amount
currency
bnf_email
subject
Amount to be transferred.
Currency of the amount.
Recipients email address.
Subject of the notification email
Comment to be included in the
notification email.
Your reference ID (must be unique if
submitted).
action
note
frn_trn_id
Required?
Example value
Yes
action=prepare
Yes
Yes
[email protected]
9f535b6ae672f627e4a5f79f2b7c
63fe
10.95
EUR
[email protected]
Your order is ready
Details are available on our
website.
Yes
Yes
Yes
Yes
Yes
No
A1234
Skrill response
Skrill returns an XML response to your request, which contains a 'response' tag with one of the
following elements:
'sid' element - returned if the authorisation and payment preparation is successful. The SID
(Session Identifier) must be submitted in your transfer execution request (see section 4.1.2
on page 10).
'error' element included if an error occurs. It includes an 'error_msg' tag, which contains
the error message description.
Response:
<?xml version="1.0" encoding="UTF-8"?> <response>
<sid>5e281d1376d92ba789ca7f0583e045d4</sid> </response>
Skrill 2014
Page 9
Response:
<?xml version="1.0" encoding="UTF-8"?> <response> <error>
<error_msg>MISSING_AMOUNT</error_msg> </error> </response>
Field
Description
The required action. In the second step,
this is transfer.
Session identifier returned in response
to the prepare request.
action
sid
Required?
Example value
Yes
action=transfer
Yes
5e281d1376d92ba789ca7f0583e04
5d4
Skrill response
The correct XML response contains a 'response' tag that includes the following elements:
'transaction' element - returned if the payment is successful; the response includes the
fields described in Table 4 below.
'error' element returned if an error occurs. The response includes the 'error_msg' field,
which provides details of the error.
Field
Description
Amount
Currency
Id
Status
status_msg
Skrill 2014
Page 10
Response:
<?xml version="1.0" encoding="UTF-8"?> <response> <transaction>
<amount>1.20</amount> <currency>EUR</currency> <id>497029</id>
<status>2</status> <status_msg>processed</status_msg> </transaction>
</response>
If a transaction has already been executed within this session, then you will need to
generate a new session ID, since only one transaction is allowed per session.
If there is a transaction in the process of execution, which is already associated with this
session, then Skrill responds with status EXECUTION_PENDING. In this case you do not need
to generate a new session ID and can wait for the response.
If the transfer request is new (i.e., not executed or pending) then it will either succeed or fail
and the result will be a response as described in the section Skrill Response on page 10
above.
Skrill 2014
Page 11
Field Name
Description
Required?
Example value
Yes
password
Yes
9f535b6ae672f627e4e5f79
f2b7c63fe
action
Yes
repost
Skrill 2014
Page 12
Field Name
Description
Required?
Example value
trn_id
Yes/No
500123
mb_trn_id
Yes/No
4585262
status_url
No
https://www.merchant.com/mb
_notifications.asp
Notes:
Either trn_id or mb_trn_id must be supplied. If both are given, trn_id will be used.
If status_url is not provided, the status_url given at the time the transaction was created will
be used.
For a successful HTTP request, the HTTP response code 200 - OK is returned.
Description
Required?
Example value
trn_id
Yes/No
500123
mb_trn_id
Yes/No
4585262
Notes:
Either trn_id or mb_trn_id must be supplied and if both are given, trn_id will be used.
If a transaction with the given ID is found, the response will be a query string that contains
the transaction details. The string is encoded using the application/x-www-formurlencoded format.
5.1.2.1 Examples
API transaction
Request:
POST
https://www.moneybookers.com/app/query.pl?action=status_trn&[email protected]&password=53903d
217504eb37f3fdb0ce77610558&mb_trn_id=104627261
Response:
200 OK
status=2&merchant_id=6999381&mb_transaction_id=104627261&mb_amount=1.2&pay_
to_email=mb654%40abv.bg¤cy=BGN&amount=2.346996&transaction_id=&pay_fr
om_email=test%40test.bg&mb_currency=EUR
Skrill 2014
Page 13
Gateway transaction
Request:
POST
https://www.moneybookers.com/app/query.pl?action=status_trn&[email protected]&password=53
903d217504eb37f3fdb0ce77610558&mb_trn_id=104441110
Response:
200 OK
status=2&Field1=TR234567&md5sig=6AB68D3465F57492B7412ED0EB013621&merchant_i
d=9999981&pay_to_email=merchant%40host.com&mb_amount=33.24911&mb_transactio
n_id=101149910¤cy=EUR&amount=17&transaction_id=49989810fa3ed45c&pay_f
rom_email=payeremail%40host.bg&mb_currency=BGN
Field Name
Description
Required?
Example value
start_date
Yes
29-05-2012
end_date
No
30-06-2013
Notes:
Upon success, Skrill returns the complete account history for the specified period in CSV
(comma separated values) format.
If the end_date parameter is not specified, Skrill uses todays date.
5.1.3.1 Example
Request:
POST
https://www.moneybookers.com/app/[email protected]&password=53903d217504eb37f3f
db0ce77610558&action=history&start_date=25-05-2013&end_date=25-06-2013
Response:
text/csv
Skrill 2014
file: mb_history.csv
Page 14
Description
Required?
Example value
trn_id
Yes
500123
For a successful HTTP request, the HTTP response code 200 - OK is returned.
Description
Required?
Example value
trn_id
Yes
500123
If a transaction with the given ID is found, the response contains the following parameters:
Response:
200 OK Status: 0 Next payment date: 26-05-2013, End date: 26-12-2013
Skrill 2014
Page 15
Description
Required?
Example value
trn_id
Yes
500123
rec_end_date
Yes
30-06-2013
For a successful HTTP request, the HTTP response code 200 - OK is returned.
Description
Required?
Example value
trn_id
Yes
500123
For a successful HTTP request, the HTTP response code 200 - OK is returned.
Description
Required?
Example value
trn_id
Yes
500123
If a transaction with the given ID is found, the response will contain following parameters:
Skrill 2014
Page 16
Description
Unauthorised/ Cannot log in
been provided.
Reserved for future use.
Forbidden
Not Found
405
Skrill 2014
Payment Required
403
404
Page 17
6.1.1 Prepare
Query parameter: action=prepare
This action prepares the transaction to be executed later on with the request action. The following
parameters are required:
Field Name
Description
Required?
Example value
Yes
password
Yes
9f535b6ae672f627e4e5f
79f2b7c63fe
action
Yes
prepare
Yes
10.50
Yes
EUR
No
amount
currency
ondemand_note
Skrill 2014
Page 18
rec_payment_id
merchant_fields
Field 1
Field 2
Description
Your transaction ID, used for the
recurring payment. This is your own
unique reference for this transaction
Recurring payment ID as sent to your
status_url and rec_status_url pages
upon creating the Skrill 1-Tap payment.
This should be the same as the original
Skrill transaction ID returned to your
systems with the original transaction
A comma-separated list of field names
that are passed back to your web server
when the Skrill 1-Tap payment is
confirmed (maximum 5 fields).
An additional field you can include,
containing your own unique parameters.
An additional field you can include,
containing your own unique parameters.
Required?
Example value
Yes
A205220
Yes
200005
Field1,Field2
Value1
Value2
Notes:
Both frn_trn_id and rec_payment_id should be provided. You should use the
rec_payment_id field to reference the original 1-tap transaction and provide a unique
frn_trn_id as the reference for the current transaction.
If ondemand_note is not provided, the one that is submitted when creating the Skrill 1-Tap
payment will be used.
A session identifier (SID) parameter is returned upon success.
You can track the status of any 1-tap transaction and perform refunds using the unique
frn_trn_id for that transaction.
6.1.2 Request
Query parameter: action=request
This action executes the actual transaction. The following parameters are required:
Field Name
Description
Required?
Example value
Sid
Yes
7783bfa23641a627
e4a5f79f2b7c6
Action
Yes
request
Upon success, returns the details of the transaction as an XML response. This response contains the
following fields:
Field Name
Description
Example value
Amount
Amount requested.
10.50
Currency
EUR
Id
Transaction ID.
500123
Skrill 2014
Page 19
Description
Example value
Status
status_msg
2 processed
-2 failed
processed
Notes:
If a request fails, you are not allowed to make more than two requests for a debit of a
customers account using a Skrill 1-Tap payment per customer per 24 hours.
The customer is notified via email for every Skrill 1-Tap payment request executed.
Skrill 2014
Page 20
7 REFUNDS
You can use the Automated Payments Interface to make automated part or full refunds to
customers, up to the amount of the original payment.
You must send your refund request to the following URL:
https://www.moneybookers.com/app/refund.pl
The refund is made in two steps:
Field
action
Required
Yes
Example
action=prepare
Yes
Yes
[email protected]
9f535b6ae672f627e4a5f79
f2b7c63fe
transaction_id
mb_transaction_id
amount
Description
Defines the prepare step of the refund
request.
Your email address.
The MD5 of your API/MQI password.
Note: only lowercase of the MD5 value is
accepted.
Your transaction ID to be refunded.
The Skrill transaction ID to be refunded.
Amount to be refunded.
Yes /No
Yes / No
No
500123
4585262
9.99
refund_note
No
merchant_fields
No
Field1, Field2
No
Value1
No
Value2
No
https://www.merchant.co
m/refund_update.cqi
email
password
Field 1
Field 2
refund_status_url
Notes:
Skrill 2014
Page 21
'sid' (session identifier) element returned if the prepare request is successful. This must be
submitted with the refund action in the next step:
<response>
<sid>4504848cb1ed0d29f60458bf992399fd</sid>
</response>
'error' element returned if an error occurs. Contains an 'error_msg' tag with the error
message:
<response>
<error>
<error_msg>CANNOT_LOGIN</error_msg>
</error>
</response>
Error message
INVALID_OR_MISSING_ACTION
Description
The action parameter is not supplied in the query.
REFUND_DENIED
LOGIN_INVALID
INVALID_EMAIL
CANNOT_LOGIN
Response:
<response>
<sid>d831e9072e8b89c57a3654ddf5fcb907</sid>
</response>
Skrill 2014
Page 22
Response:
<response>
<error>
<error_msg>CANNOT_LOGIN</error_msg>
</error>
</response>
Field
action
sid
Description
Defines the execution step of the refund
request.
Session identifier returned in response
to the prepare request.
Required
Yes
Example
action=refund
Yes
d831e9072e8b89c57a3654ddf
5fcb907
Field
mb_amount
Description
Amount refunded in the currency of your Skrill account.
Example
9.99
mb_currency
EUR
transaction_id
500123
mb_transaction_id
5585262
Field1
Value1
Field2
status
error
Skrill 2014
Value2
2
CC_REFUND_FAILED
Page 23
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>
Field
transaction_id
mb_transaction_id
status
mb_amount
mb_currency
md5sig
sha2sig
Skrill 2014
Description
Your transaction ID for the refund as
submitted in the request.
The Skrill transaction ID for the
refund.
2 processed and -2 - failed.
Required
Yes /No
Example
500123
Yes
5585262
Yes
Yes
9.99
Yes
Yes
EUR
9f535b6ae672f627e4a5f79f2
b7c63fe
dbb7101322257a311f08d1c
527053058fc7e464e30bcfb4
613f09053c22dd1f8
No
Page 24
Value
Description
Example
merchant_id
mb_transaction_id
MD5 of secret word
4637827
5585262
327638C253A4637199CE
BA6642371F20
mb_amount
mb_currency
status
9.99
EUR
Example code
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 Table 13 above, the following MD5 code returned:
CF9DCA614656D19772ECAB978A56866D
Skrill 2014
Page 25
8 APPENDICES
8.1 ISO 4217 currencies
Table 14: ISO 4217 Currencies accepted by Skrill
EUR
USD
GBP
HKD
SGD
JPY
CAD
AUD
CHF
DKK
SEK
NOK
ILS
MYR
NZD
TRY
AED
MAD
QAR
SAR
Euro
U.S. Dollar
British Pound
Hong Kong Dollar
Singapore Dollar
Japanese Yen
Canadian Dollar
Australian Dollar
Swiss Franc
Danish Krone
Swedish Krona
Norwegian Krone
Israeli Shekel
Malaysian Ringgit
New Zealand Dollar
New Turkish Lira
Utd. Arab Emir. Dirham
Moroccan Dirham
Qatari Rial
Saudi Riyal
Skrill 2014
TWD
THB
CZK
HUF
SKK
EEK
BGN
PLN
ISK
INR
KRW
ZAR
RON
HRK
LTL
JOD
OMR
RSD
TND
Taiwan Dollar
Thailand Baht
Czech Koruna
Hungarian Forint
Slovakian Koruna
Estonian Kroon
Bulgarian Leva
Polish Zloty
Iceland Krona
Indian Rupee
South-Korean Won
South-African Rand
Romanian Leu New
Croatian Kuna
Lithuanian Litas
Jordanian Dinar
Omani Rial
Serbian dinar
Tunisian Dinar
Page 26
Error
Resolution
INVALID_OR_MISSING_ACTION
LOGIN_INVALID
INVALID_REC_PAYMENT_ID
MISSING_EMAIL
MISSING_PASSWORD
MISSING_AMOUNT
MISSING_CURRENCY
MISSING_BNF_EMAIL
MISSING_SUBJECT
MISSING_NOTE
Error
Resolution
CANNOT_LOGIN
PAYMENT_DENIED
Check in your account profile that the API is enabled and you are
posting your requests from the IP address specified
Error
Resolution
INVALID_BNF_EMAIL
INVALID_SUBJECT
INVALID_NOTE
INVALID_FRN_TRN_ID
INVALID_AMOUNT
INVALID_CURRENCY
EXECUTION_PENDING
ALREADY_EXECUTED
If you have requested that the value for frn_trn_id must be unique
for each transfer, this error will be returned when you try to
submit the same value for more than one transfer
BALANCE_NOT_ENOUGH
SINGLE_TRN_LIMIT_VIOLATED
DISALLOWED_RECIPIENT
You are not permitted to send money to the recipient. E.g. Gaming
merchants are not permitted to send or receive payments to/from
US based customers
CHECK_FOR_VERIFIED_EMAIL
LL_NO_PAYMENT
Skrill 2014
Page 27
Error
Resolution
CUSTOMER_IS_LOCKED
BALANCE_NOT_ENOUGH
RECIPIENT_LIMIT_EXCEEDED
CARD_FAILED
REQUEST_FAILED
ONDEMAND_CANCELLED
ONDEMAND_INVALID
MAX_REQ_REACHED
Too many failed Skrill 1-Tap payment requests to the API. For
security reasons, only two failed attempts per user per 24 hours
are allowed
Skrill 2014
Page 28
9 GLOSSARY
This section provides a description of key terms used in this guide.
Term
Automated Payments
Interface (API)
Browser
HTML POST
Skrill Payment
Gateway
Slim Gateway
Transaction
Transaction ID
Transaction status
Skrill 2014
Explanation
The API is a collection of tools that enables merchants to execute
requests to the Skrill Payment Gateway. For example: to send money,
make 1-tap payments, make refunds, check the status of transactions
and download reports.
Application that enables a customer or merchant to access web pages.
Examples include: Internet Explorer, Google Chrome and Mozilla
Firefox.
Integration method where the merchant sends details to the Skrill
Payment Gateway using a standard HTML form that posts this
information in the HTML header.
3-digit currency code of the International Standards Organisation (ISO)
that identifies the currency. For example, GBP for British Pound.
Skrill team responsible for providing technical and service support to
merchants.
Merchant and customer account administration portal that enables
viewing of transactions and transferring funds.
Each financial interaction on the system is referred to as a transaction.
Skrills Digital Wallet, enabling customers to link cards and pay directly
from their wallet account using cards or bank transfer. Up to 4
payment cards and 10 bank accounts can be linked to a wallet
account.
Skrills secure page for processing transactions. Merchants connect to
the Payment Gateway, which will then process transactions from their
website.
Option in which the Skrill account Login fields are hidden from the
customer, providing a simplified user experience. Note that on the
new Gateway payment page we hide the login fields by default.
Each financial interaction with the Skrill Payment Gateway is referred
to as a transaction. Transactions are linked to payments.
Unique ID assigned to a transaction by the Skrill Payment Gateway.
Each transaction on the Skrill Payment Gateway is given a status. This
includes: processed, pending, temporary, scheduled, cancelled, failed,
chargeback and successful.
Page 29
10 INDEX
Enable mass payments on My Account, 6
Example of a successful authorisation request,
10
Example of a successful transfer request, 11
Executing the Transfer, 10
ISO 4217 currencies, 12
Mass Payments option on My Account, 6
Skrill 2014
Page 30