Create payment
POST https://wallet.paysera.com/rest/v1/payment
Create payment in Paysera system.
After creating payment, user should be redirected to payment confirmation page.
Note: Payments with status new are deleted automatically 1 month after creation.
Authorization​
This endpoint requires MAC (Message Authentication Code) authentication.
Authorization Header Format:
Authorization: MAC id="CLIENT_ID", ts="TIMESTAMP", nonce="RANDOM_STRING", mac="MAC_HASH", ext="body_hash=BODY_HASH"
Example:
Authorization: MAC id="a9b8c7d6e5f4g3h2", ts="1234567890", nonce="xyz123abc456def", mac="dGhpcyBpcyBhIHJhbmRvbSBtYWMgaGFzaCB2YWx1ZQ==", ext="body_hash=cmFuZG9tQm9keUhhc2hWYWx1ZQ%3D%3D"
For more details, see the Authentication section.
Request Body​
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Payment description | |
price | integer | Total price in cents | |
currency | string | Currency code | |
price_decimal | string | Decimal price | |
items | array | Payment items | |
beneficiary | object | Wallet identifier for the payment beneficiary | |
parameters | object | Custom parameters | |
freeze | object | Freeze settings | |
password | object | Password settings |
Beneficiary parameter​
The beneficiary parameter identifies the wallet that receives the payment. Exactly one of the following sub-fields must be specified:
| Field | Type | Description |
|---|---|---|
id | integer | Internal wallet ID |
email | string | Resolves the wallet by the owner's registered email |
phone | string | Resolves the wallet by the owner's registered phone number |
card | object | Card identifier object - resolves the wallet tied to that card |
barcode | string | Resolves the wallet by a barcode identifier (e.g. loyalty/physical card barcode) |
"beneficiary": {
"id": 60123
}
Note: If beneficiary is not provided, the payment defaults to the client's own account.
Freeze parameter​
The freeze parameter allows adding a reservation period onto a payment. It accepts one of the following formats:
-
Freeze until a specified Unix timestamp:
"freeze": {
"until": 1785964452
} -
Freeze for a specified duration, in seconds:
"freeze": {
"for": 604800
}
Example​
Request​
POST https://wallet.paysera.com/rest/v1/payment
Content-Type: application/json
Authorization: MAC id="CLIENT_ID", ts="TIMESTAMP", nonce="RANDOM_STRING", mac="MAC_HASH", ext="body_hash=BODY_HASH"
{
"description": "Payment for order No. 1234",
"price": 1299,
"currency": "EUR",
"parameters": {
"orderid": 1234
}
}
Response​
{
"id": 2987,
"transaction_key": "pDAlAZ3z",
"created_at": 1355314332,
"status": "new",
"price": 1299,
"currency": "EUR",
"price_decimal": "12.99",
"description": "Payment for order No. 1234"
}
AUTHORIZATION: HTTP
REQUEST
{
"description": "Payment for order No. 1234",
"price": 1299,
"currency": "EUR",
"parameters": {
"orderid": 1234
}
}
RESPONSE
{
"id": 2987,
"transaction_key": "pDAlAZ3z",
"created_at": 1355314332,
"status": "new",
"cancelable": false,
"price": 1299,
"currency": "EUR",
"price_decimal": "12.99",
"freeze": {
"for": 3600
},
"freeze_for": 1,
"description": "Payment for order No. 1234",
"parameters": {
"orderid": 1234
}
}