openapi: 3.0.0
servers:
- url: https://sandbox.przelewy24.pl
description: Sandbox server (uses test data)
- url: https://secure.przelewy24.pl
description: Production server (uses live data)
info:
x-logo:
url: "getfile/przelewy24-logo_mini.png"
altText: LogoP24
contact:
name: Przelewy24 Support
url: https://www.przelewy24.pl/support
title: Ekspres Przelewy24 REST API Documentation
version: 1.0.6
description: >
# Ekspres Przelewy24
Przelewy24 provides an authorisation and clearing system and provides payment services as a Domestic Payment Institution.
Ekspres-Przelewy24 service allows to quickly and effortlessly send money between accounts from different banks.
Below documentation describes the process of information exchange in the course of ordering a transfer via Ekspres Przelewy24 with the use of REST API.
In order to be able to access Ekspres API Przelewy24, first you need to [create an account](https://ekspres.przelewy24.pl/kontakt/index) in Ekspres P24 Administration Panel.
# Basic notions
The following notions will be used for describing the operation of Ekspres Przelewy24:
**WWW system** – access to Ekspres Przelewy24 in the WWW version through the following websites:
## Transfer processing in P24 and P24mobile
P24 and P24mobile processes payments based on the funds paid in by the Client through [przelewy24.pl](https://www.przelewy24.pl). Using this mode, the partner registers the transfer in API and, subsequently, sends a payment link to the client (alternatively, the payment link may also be sent automatically via email). Once the transaction is paid by the client in [przelewy24.pl](https://www.przelewy24.pl), the transfer registered by the partner is sent for processing.
# Codes of responses and erros
## HTTP response codes
Ekspres Przelewy24 REST API uses response codes in HTTP headers to communicate the result of a query, potential problems and errors.
NOTE!
All the responses returned by API are UTF-8-coded JSON objects without “slash” sign filters and unicode characters!
All the responses are returned using the following method:
json_encode($response, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
For more information see [PHP documentation](https://www.php.net/manual/en/json.constants.php).
Przykład odpowiedzi z obiektem GeneralErrorObject:
```html HTTP/1.1 400 Bad Request Content-Type: application/json { „error”: { „code”: 1011, „description”: „Given IBAN value ”iban” is not valid” } } ``` # Environments ## Production environment Every request is differentiated by its own unique request URL. This way Ekspres P24 knows which API-function you want to access. Combined with the base URL for either the production- or test-environment, you will get the complete API-URL. Base URL production system:Note!
/v1/transfer/request method is idempotent.
It means that if the method is called for the first time and a positive result is obtained, a new transfer will be created. In this case, the http code returned is 201 Created.
If the same query is called again, the transfer will not be repeated and the same result as in the case of the original transfer will be generated. In this case, the http code returned is 200 OK. It is important to note that only code 201 Created means that the transfer has been sent / registered. Code 200 OK means that such a transfer already exists and the system only returns the result of the original call.
The mechanism serves to prevent accidental duplication of transfers. If the same transfer is called twice, the money will be sent only once. In case the API connection is interrupted (e.g. Timeout) while the method is being called, it can be repeated without worrying about the possibility of generating a duplicate transfer. At the same time, it is possible to check if the original query was successful and to obtain a link.
The mechanism is based on the ‘id’ parameter. In case the parameter is changed, the query is treated as an entirely new transfer. That is why one must still exercise caution so as to avoid creating a duplicate.
Warning! Refunds in foreign currencies are evaluated and refunded in PLN!
NOTE!
Method /v1/transfer/p24/refund is idempotent!
The operation details are analogous to /v1/transfer/request
NOTE!
Even if the method of returning that the bank is an existing system, re-recover the information for a given user, which will direct the transfer to another bank.
tags:
- Ekspres P24 API
summary: Verification of the bank's activity
parameters:
- name: iban
in: path
description: IBAN number
required: true
schema:
type: string
maxLength: 40
default: PL0000000000000000000000000000
responses:
"200":
description: The returned JSON object with the default bank activity parameter for the given IBAN
content:
application/json:
schema:
$ref: "#/components/schemas/GetBankCheck"
"400":
description: The provided IBAN is incorrect or parameters were provided incorrected
security:
- basicAuth: []
components:
securitySchemes:
basicAuth:
description: This is the default authentication method. User login is API REST key the password assigned to it.
type: http
scheme: basic
schemas:
PostTransferRefundBody:
properties:
refund:
type: object
description: Refund object
allOf:
- $ref: "#/components/schemas/TransferP24RefundObject"
id:
type: string
maxLength: 255
description: Unique transfer ID, UUID recommended
sign:
type: string
maxLength: 255
description: Signature calculated separately for each transfer. For more information see sign parameter calculation
required:
- refund
- id
- sign
TransferP24RefundObject:
properties:
sessionId:
type: string
maxLength: 255
description: Session ID in Przelewy24 system
title:
type: string
maxLength: 255
description: Title of refund transaction
currency:
type: string
maxLength: 3
description: 'Currency in which refund will be executed as ISO 4217 code (currently available: EUR, PLN)'
amount:
type: integer
description: 'Amount of created refund in smallest denomination
Example: "100" (1 PLN)'
overrefund:
type: boolean
default: false
description: If TRUE, refund will be executed no matter if there was any other refunds executed for this transaction earlier. It ignores error 2010.
Default value is FALSE
required:
- sessionId
- title
- currency
- amount
PutPaymentRefundBody:
properties:
transferId:
type: integer
description: ID of Ekspres transfer that we want to refund
amount:
type: integer
description: Amount to refund, if empty by default whole transfer will be refunded. Refund is always in currency of original transfer
required:
- transferId
PutPaymentRefundResponse:
properties:
transferId:
type: integer
description: ID of refunded transfer
refundId:
type: integer
description: ID of refund (important for notifications)
amount:
type: integer
description: Amount of created refund in smallest denomination
1000 = 10.00
currency:
type: string
maxLength: 3
description: Currency of created refund as ISO 4217 code
TransferRequestPostBody:
properties:
transfer:
description: Object of transfer
allOf:
- $ref: "#/components/schemas/TransferObjectBody"
type:
type: string
description: 'Payment types available: wallet, p24, p24mobile'
example: wallet
express:
type: boolean
description: 'Default setting - True:
True – upon payment, the transfer will be sent in the express mode,
False – upon payment, the transfer will be sent in the elixir mode.'
default: true
example: true
currency:
type: string
maxLength: 3
description: 'Transfer currency in which the funds will be collected for specific payment types:
wallet – funds will be collected from the wallet in a given currency;
p24, p24mobile – the currency in which the client will pay in their funds,
'
example: PLN
send:
type: integer
description: 'Values:
0 - none,
1 – send an email with the url to the recipient of the transfer ,
2 – send an email with the url to the sender of the transfer,
4 – send an email with a confirmation of completion to the recipient,
8 – send an email with a confirmation of completion to the sender.
In order to choose, e.g. two options, provide the sum of the respective values: email with url to the sender + to the recipient + email with confirmation to the sender:
2 + 1 + 8 = 11 -> value to be provided'
example: 11
regulations:
type: boolean
default: false
description: 'Acceptance of Przelewy24 regulations:
false – display consent on p24 website (default),
true – consent granted, do not display.
In case the „true” parameter is sent, the consent – worded as follows – must be displayed on the Partner’s website: „I hereby state that I have read the [regulations](https://www.przelewy24.pl/regulamin) and [information obligation](https://www.przelewy24.pl/obowiazekinformacyjny) of ”Przelewy24”.
Under words regulations and information obligation there must be hyperlinks redirecting to websites with these documents. The checkbox must not be ticked by default.'
id:
type: string
maxLength: 255
description: Unique transfer ID, UUID recommended
sign:
type: string
maxLength: 255
description: Signature calculated separately for each transfer. For more information see Calculation of sign parameter
label:
type: string
maxLength: 20
description: Additional fields used solely for payments of the following types p24, p24mobile.
Additional description in the transfer title.
Can be send in the object of transfer, in the label parameter. Value from the object overwirtes value from this parameter
ttl:
type: integer
description: Additional fields used solely for payments of the following types p24, p24mobile.
Timestamp – date and time after which it will not be possible to pay the transaction
NOTE! For the parameter to work in P24 system, please send a request to partner@przelewy24.pl
Example:
1577833200 = 2020-01-01 00:00:00
0 = no limit (as default)
paymentMethod:
type: integer
description: Additional fields used solely for payments of the following types p24, p24mobile.
The payment method selected in P24, see v1/payment/methods
returnUrl:
type: string
maxLength: 255
description: Additional fields used solely for payments of the following types p24, p24mobile.
The address to which the client will be redirected after processing the payment in Przelewy24.pl. By default, the client will return to the URL address generated upon transfer registration.
sdkVersion:
type: string
maxLength: 10
default: '3.0'
description: Additional fields used solely for payments of the following type p24mobile.
Mobile library version number must be provided. This parameter may be obtained directly from the library (iOS - class P24, Android - class P24SdkVersion). The default value sent is „3.0”.
required:
- transfer
- type
- currency
- send
- id
- sign
TransferObjectBody:
properties:
iban:
type: string
maxLength: 40
description: Recipient’s IBAN no. with country prefix
recipient:
description: Object representing recipient’s details
allOf:
- $ref: "#/components/schemas/PersonObjectBody"
sender:
description: Object representing sender’s details
allOf:
- $ref: "#/components/schemas/PersonObjectBody"
label:
type: string
description: Additional description in the transfer title – only for p24, p24mobile modes
maxLength: 20
title:
type: string
maxLength: 150
description: Transaction title
amountOut:
type: integer
description: Amount of transaction in the smallest denomination
1000 = 10.00
currencyOut:
type: string
maxLength: 3
description: Transfer currency [ISO 4217 code](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
externalParam:
type: string
maxLength: 100
description: We recommend that additional, individual transfer ids are used with this parameter, as it significantly simplifies transaction identification in notifications.
The parameter is defined at the user’s discretion and is generated when notifications are sent.
This parameter may be the same as the “id” parameter.
confirmation:
type: boolean
default: false
description: Defines if this transfer should get generated confirmation from outgoing bank in PDF format.
Warning! This feature of generating PDF confirmations from outgoing bank is required to be consulted and enabled with integrations support before use! By default using this parameter will do nothing instead!
confirmationFilename:
type: string
maxLength: 100
example: "string"
description: The name of the generated confirmation from the bank (PDF file).
If the `confirmationFilename` parameter isn't sent in request and `confirmation` parametr is set to 'true' then the default file name takes the value from the formula "EX_timestamp_idtransfer_iduser".
required:
- iban
- recipient
- sender
- title
- amountOut
- currencyOut
- externalParam
PersonObjectBody:
properties:
name:
type: string
maxLength: 100
description: Name (company / name and surname)
email:
type: string
maxLength: 100
description: Email (used later for sending notifications)
address:
type: string
maxLength: 100
description: Address – street name, street no., apartment no.
zip:
type: string
maxLength: 10
description: Postal code – validated depending on the country parameter
city:
type: string
maxLength: 50
description: City
country:
type: string
maxLength: 2
description: '2-character country code ([ISO-3166-1](https://pl.wikipedia.org/wiki/ISO_3166-1_alfa-2))
exception: UK = GB, Great Britain'
required:
- name
- email
- address
- zip
- city
- country
TransferBasketPostBody:
properties:
transfers:
description: Comprises a table of transfers to be processed once they are paid through przelewy24.pl or with a payment card.
items:
$ref: "#/components/schemas/TransferObjectBody"
type:
type: string
description: 'Payment methods available: p24, p24mobile.
Wallet mode is not accepted in this method.'
express:
type: boolean
description: 'Default setting - True:
True – upon payment, the transfer will be sent in the express mode,
False – upon payment, the transfer will be sent in the elixir mode.'
default: true
example: true
currency:
type: string
maxLength: 3
description: 'Transfer currency in which the funds will be collected for specific payment types:
wallet – funds will be collected from the wallet in a given currency;
p24, p24mobile – the currency in which the client will pay in their funds,
'
example: PLN
send:
type: integer
description: 'Wartości:
0 - none,
1 – send an email with the url to the recipient of the transfer ,
2 – send an email with the url to the sender of the transfer,
4 – send an email with a confirmation of completion to the recipient,
8 – send an email with a confirmation of completion to the sender.
In order to choose, e.g. two options, provide the sum of the respective values: email with url to the sender + to the recipient + email with confirmation to the sender:
2 + 1 + 8 = 11 -> value to be provided'
example: 11
regulations:
type: boolean
default: false
description: 'Acceptance of Przelewy24 regulations:
false – display consent on p24 website (default),
true – consent granted, do not display.
In case the „true” parameter is sent, the consent – worded as follows – must be displayed on the Partner’s website: „I hereby state that I have read the [regulations](https://www.przelewy24.pl/regulamin) and [information obligation](https://www.przelewy24.pl/obowiazekinformacyjny) of ”Przelewy24”.
Under words regulations and information obligation there must be hyperlinks redirecting to websites with these documents. The checkbox must not be ticked by default.'
id:
type: string
maxLength: 255
description: Unique transfer ID, UUID recommended
sign:
type: string
maxLength: 255
description: Signature calculated separately for each transfer. For more information see Calculation of sign parameter
label:
type: string
maxLength: 20
description: Additional fields used solely for payments of the following types p24, p24mobile.
Additional description in the transfer title.
Can be send in the object of transfer, in the label parameter. Value from the object overwirtes value from this parameter
ttl:
type: integer
description: Additional fields used solely for payments of the following types p24, p24mobile.
Timestamp – date and time after which it will not be possible to pay the transaction
NOTE! For the parameter to work in P24 system, please send a request to partner@przelewy24.pl
Example:
1577833200 = 2020-01-01 00:00:00
0 = no limit (as default)
paymentMethod:
type: integer
description: Additional fields used solely for payments of the following types p24, p24mobile.
The payment method selected in P24 v1/payment/methods
returnUrl:
type: string
maxLength: 255
description: Additional fields used solely for payments of the following types p24, p24mobile.
The address to which the client will be redirected after processing the payment in Przelewy24.pl. By default, the client will return to the URL address generated upon transfer registration.
sdkVersion:
type: string
maxLength: 10
default: '3.0'
description: Additional fields used solely for payments of the following type p24mobile.
Mobile library version number must be provided. This parameter may be obtained directly from the library (iOS - class P24, Android - class P24SdkVersion). The default value sent is „3.0”.
example: 3.0
required:
- transfers
- type
- currency
- send
- id
- sign
NotificationTransferStatusBody:
properties:
type:
type: string
description: 'Sent: always.
Specifies which stage the notification refers to.
Possible values:
- pay - transfer payment(transferRequestId),
- payout - payout of funds (transferIds),
- refund.'
id:
type: string
description: 'Sent: always.
Identifier of transfer, payout or refund which the notification refers to.'
status:
type: integer
description: Sent: always.
Operation statuses are described in Table of tansaction statuses
externalParam:
type: string
description: 'Sent: always.
Parameter defined at transfer registration.
Note!
For method /v1/transfer/basket n case of notifications of the type „pay”, the field comprises all the externalParam values of the sent transfers separated with commas.'
method:
type: string
description: 'Sent: only if it is a notification on the payment of the transfer.
Transfer payment method: p24/p24code/wallet/card.'
example: wallet
sign:
type: string
description: Sent: always.
Control sum is a value calculated with the use of sha384 algorithm. For details, see Calculation of sign parameter dla powiadomień.
UserBalanceResponse200Body:
properties:
balance:
description: Object representing the account balance for a given wallet
items:
$ref: "#/components/schemas/BalanceObjectBody"
timestamp:
type: integer
description: Unix time stamp of the exact moment for which the results are presented
BalanceObjectBody:
properties:
amount:
type: integer
description: The amount of the balance in the smallest denomination (grosz)
currency:
type: string
maxLength: 3
description: Currency in the form of [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code
example: PLN
GetBankCheck:
properties:
available:
type: boolean
description: Indication whether the bank is active
example: true
BankAvailabilityObjectResponseBody:
properties:
name:
type: string
maxLength: 50
description: Bank name
workweek:
type: string
maxLength: 50
description: Working hours from Monday to Friday
saturday:
type: string
maxLength: 50
description: Working hours on Saturdays
sunday:
type: string
maxLength: 50
description: Working hours on Sundays
holidays:
type: boolean
description: 'Availability on public holidays:
false – unavailable
true – available'
PaymentMethodObjectResponseBody:
properties:
id:
type: integer
description: Unique payment method ID
name:
type: string
description: Name of a payment method
status:
type: boolean
description: True – ON, False – OFF
TransferRequestResultObjectBody:
properties:
result:
description: Includes the object of the query result
$ref: "#/components/schemas/TransferOutObjectBody"
TransferOutObjectBody:
properties:
transferRequestId:
type: string
description: Query ID of a registered transfer, marked in notifications as type „pay”
transferIds:
type: array
description: Table of registered transfers, marked in notifications as type „payout”
items:
type: integer
url:
type: string
description: The URL address that allows you to check the current status of the transfer. In case of payments in P24 mode, the redirection to przelewy24.pl will take place in order for the transaction to be paid.
TransferBasketResultBody:
properties:
result:
description: Includes the object of the query result
$ref: "#/components/schemas/TransferBasketOutObjectBody"
TransferBasketOutObjectBody:
properties:
transferRequestId:
type: string
description: Query ID of a registered transfer, marked in notifications.
as type „pay”
transferIds:
type: array
description: Table of registered transfers, marked in notifications.
as type „payout”
items:
type: integer
url:
type: string
description: The URL address that allows you to check the current status of the transfer. In case of payments in P24 mode, the redirection to przelewy24.pl will take place in order for the transaction to be paid.
TransferHistory200ResponseBody:
properties:
result:
description: Comprises a table of objects of the transfer history or an empty table if no transfers have been found
items:
$ref: "#/components/schemas/HistoryOutObjectBody"
HistoryOutObjectBody:
properties:
transfer:
description: Object of transfer TransferObject
$ref: "#/components/schemas/TransferObjectBody"
express:
type: boolean
description: Was the transfer ordered in the express mode?
date:
type: string
description: Transfer registration date
status:
type: integer
description: Transfer current status
statusDescription:
type: string
description: Current status (description)
type:
type: string
description: 'Type of payment: wallet, p24, p24code'
id:
type: string
description: “id” parameter provided during transfer registration
transferId:
type: integer
description: Transfer identifier in the express system
transferRequestId:
type: integer
description: Request identifier in the express mode
GeneralErrorObjectResponseBody:
properties:
error:
description:
$ref: "#/components/schemas/GeneralErrorObject"
GeneralErrorObject:
properties:
code:
type: string
description:
type: string
##############################
tags:
- name: Calculation of sign parameter
x-displayName: Calculation of sign parameter
description: >
# Calculation of sign parameter for API methods
The sign parameter is used to sign queries which trigger registration of transfers or process other important operations. It is always accompanied by the “id” parameter, which guarantees the idempotent character of the method.
Note!
The sign parameter for notifications is calculated in a different manner than for calling methods.
For details concerning the calculation of the signature for notifications, see: Calculation of sign parameter for notifications.
Note!
The sign parameter for the API methods is calculated in a different manner than for notifications.
For details concerning the calculation of the signature for transfers, see: Calculation of sign parameter for API methods.
Note! Special attention should be given to parameters type and id!
Parameter type specifies the value that parameter id possess.
In case the value is pay, parameter id will have transferRequestId identifier.
In case the value is payout, parameter id will have transferId identifier.
In case the value is refunded, parameter id will have refund identifier.
All the identifiers are unique, nd they should be considered separately. If they are confused, the respective transfers may be ascribed wrong statuses.
Use externalParam to ascribe notifications in a simpler way according to an independently assigned identifier.
Note!
For status 1 “Registered” no notification is sent!
This is because it is an input status, i.e. obtaining the correct response from API during transfer registration serves to inform that it was assigned this status.