Payment API
The Paysepro API is a service that grants developers access to all info about a Payment Module, from its own server. With such information it is possible to create a personalized UI with all payment methods available in the Module, in order to sell a product or service directly from a website.
First thing to do is to call the API through a URL that you will obtain from section Payment API, which must be done with the following autentication.
The authentication of the accesses to the API must be done by creating a signature of the request with the following parameters:
Parameter | Type | Description |
uid | integer | Value that identifies user account |
mid | integer | Value that identifies the module referenced in the process |
country | string | Country Code (ISO 3166-2) |
string | Email registered on user´s account |
Signature Format
Encryption with the SHA256 algorithm formed by string uid + mid + country + email The encryption secret key must be the user's API KEY. You can get it in the Payment API section of your account.
How to include the signature?
The signature must be included as the header parameter of the request and the name of the parameter must be "signature".
The getData method helps us to obtain all the available methods for a certain country and about module defined in your account as well as to obtain all the detail and thepayment processing URL.
access URL: https://api.paysepro.com/getData.php
Configuration parameters must be sent by GET
Parameter | Required | Type | Description |
uid | yes | numéric | user account identifier |
mid | yes | numéric | user module identifier |
cc | yes | text | country code (ISO 3166-2) |
JSON Key | Description |
error | API error codes |
message | API response message |
data | Objeto con información de pago |
gateway | Object with payment information |
url | URL to process payments |
sites | Object with website information |
status | website status |
url | website URL |
modules | Object with payment module information |
price | Price of the payment module |
status | payment module status |
currency | Payment module currency type |
country | code of access country |
api_ip | IP from which the API can be accessed |
methods | Object with payment methods information |
creditcard | Object with information about Credit Card payment method |
method | Name of payment method |
price | transaction ammount |
pmin | minimum transaction amount |
pmax | maximum transaction amount |
Code | Description |
0 | Successful response |
05 | unknown MID |
06 | unknown UID |
19 | unknown website |
22 | incorrect API KEY |
31 | No data to display |
32 | unknown country code |
40 | incorrect Signature |
It is accessed by the GATEWAY->URL parameter returned in the getData method and allows you to start a payment process to generate an access code to a specific product or service. This access code will be disabled until the customer completes the payment process with the corresponding provider.
Once the payment is completed, the code will be enabled to be used in the URL that was configured as an ACCESS URL in the payment module.
For each customer receiveing a service and paying for it, a unique payment code must be created with the price, country and method configuration.
The following URL must be used to create the code and start the payment process:
access URL: https://api.paysepro.com/createCode.php
Configuration parameters must be sent by POST.
Parámetro | Requerido | Tipo | Descripción |
uid | yes | numeric | user account identifier |
mid | yes | numeric | user module indentifier |
type | yes | text | payment method |
cc | yes | text | country code (ISO 3166-2) |
price | yes | numeric | price |
name | no | text | name of the person using the service |
no | mail of who uses the service |
Correct Result
The URL of the correct result should be used to redirect the end user so that final payment can be done.
Each payment method adds particular parameters that give the necessary information for it.
Code | Description |
0 | Successful response |
01 | Unknown payment method |
02 | empty Email |
03 | empty UID |
04 | empty MID |
05 | unknown MID |
06 | unknown UID |
07 | Disabled account |
08 | Internal Error |
09 | No payment methods enabled |
10 | Ppayment method selected is disabled |
11 | Incorrect Paysepro access data |
12 | Insufficient balance |
16 | Unknown payment method for the API |
17 | Internal processing error |
18 | Account setup error |
19 | unknown website |
20 | No commission configured |
22 | Incorrect API KEY |
26 | Unknown Referrer |
27 | Disabled IP |
28 | Payment module disabled |
29 | Disabled website |
40 | Incorrect Signature |