paybridgeAPI
The API supports only GET and POST requests, with POST requests requiring JSON for data submission.
All responses, whether successful or failed, follow a consistent structure, as shown on the right side of the page.
Please note that all numbers in this documentation are displayed in the following format: $1 = 100.
{ success: true, details: \'\', data: {...some data} } { success: false, details: \'details on the error\', data: {} }Retrieves the information about the user
| Status code | Description |
|---|---|
| 200 | User is logged in |
| 401 | User is not logged in |
| 404 | User has not been found |
{
"success": true,
"details": "",
"data": {
"id": "66a4e99a0151621a45429a40",
"username": "username",
"name": "DMarket",
"balance": 1000,
"settings": {
"language": "en"
},
"statistics": {
"deposit": 1000,
"orders": {
"paypal": 1000,
"usdt": 1000
}
},
"createdAt": "2024-08-21",
"updatedAt": "2024-08-21"
}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
}Retrieves user's API Key and webhook
| Status code | Description |
|---|---|
| 200 | User is logged in |
| 401 | User is not logged in |
| 404 | User has not been found |
{
"success": true,
"details": "",
"data": {
"key": "fc18e0c514c9dc34c26d2d6b08fe80d9101fe513cad3feb9ebc"
}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
}Creates multiple withdraw orders based on different parameters
| Status code | Description |
|---|---|
| 200 | User is logged in |
| 401 | User is not logged in |
| 404 | User has not been found |
If you want to be certain about an amount in PLN that will be sent to your BLIK account, please provide amountQuote in your request body. Otherwise, leave it as null.
{
"orders": [
{
"amount": 1000,
"method": "paypal" | "usdt",
"receiver": "test@test.com",
"comment": "id: 141"
}
]
}{
"orders": [
{
"amount": 1000,
"method": "blik",
"receiver": {
"name": "John Doe",
"phoneNumber": "+48551671915",
"accountNumber": "PL57109024028593174953674724",
"amountQuote": 45920 | null
},
"comment": "id: 141"
}
]
} {
"success": true,
"details": "",
"data": {
"results": {
"created": [
{
"id": 670696d284683836c55e766a,
"amount": 1000,
"method": "paypal",
"receiver": "test@test.com",
"comment": "id: 141",
"status": 1,
"reason": "string"
}
],
"failed": [
{
"id": 670696d284683836c55e766a,
"amount": 1000,
"method": "paypal",
"receiver": "test@test.com",
"comment": "id: 141",
"reason": "Bad method"
}
]
}
}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
}Retrieves user's orders using limit, offset and allows to filter them by method and status
| Status code | Description |
|---|---|
| 200 | User is logged in |
| 400 | Invalid range OR method OR status provided |
| 401 | User is not logged in |
| 404 | User has not been found |
| Property | Description |
|---|---|
| limit | Number of orders returned, default to 20 |
| skip | Number of orders you want to offset |
| method | Payment method, either 'paypal' or 'usdt' |
| status | 2 - processing, 3 - completed, 5 - rejected |
| search | Phrase that will be looked for |
| filter | Processing (status 2) or finished (statuses 3, 5) |
{
"success": true,
"details": "",
"data": {
"total": 981,
"orders": [
{
"id": 670696d284683836c55e766a,
"amount": 1000,
"method": "paypal",
"receiver": "test@test.com",
"comment": "id: 141",
"status": 1,
"reason": "string"
}
]
}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
}Retrieves current tariffs for orders
| Status code | Description |
|---|---|
| 200 | User is logged in |
| 401 | User is not logged in |
| 404 | User has not been found |
{
"success": true,
"details": "",
"data": {
"prices": [
{
"method": "paypal",
"base": 0,
"multiplier": 1.01,
"min": 0,
"max": null
}
]
}
} {
"success": true,
"details": "string",
"data": {}
} {
"success": true,
"details": "string",
"data": {}
}A webhook allows our server to communicate with your application, particularly when there is a change in the status of your order. \
This is achieved through a POST request to the webhook URL that you configure on your settings page. The data is sent in JSON format (an example is provided on the right side of the page).
| Property | Description |
|---|---|
| method | Payment method, either 'paypal' or 'usdt' |
| receiver | Credentials of the receiving party |
| comment | Comment you've sent us when creating an order |
| status | One of 3 order statuses. Read more about it below |
| amount | Amount you asked us to send to the receiver |
| checkout | Amount you paid for this order (including fee) |
| reason | Reason for order rejection at status 5 |
| sign | Verification signature. Read more about it here |
| Status | Description |
|---|---|
| 2 | Order is being processed |
| 3 | Order is fulfilled |
| 5 | Order is rejected (In this case, you will also find a reason behind this in a "reason" field) |
{
"method": "paypal",
"receiver": "penta@gmail.com",
"comment": null,
"status": 3,
"amount": 100,
"checkout": 101,
"createdAt": "2024-08-23T15:05:02.107Z",
"updatedAt": "2024-08-26T11:55:42.924Z",
"reason": null,
"id": "66c8a51eb47bfdea9730d617",
"sign": "OGZiNzVlN2Y3OGI4ZDYwOTY1OTYyZmRjMTk0ODNiZjU1NjZhZTBlMzZiZDY2NGExMmVhNjRlMWRhYTNkODRiZA=="
}To verify the authenticity of the message, we include a signature alongside the data we send. You can confirm that the data is from us by generating a signature using your API key and comparing it with the signature provided. See the example below for details:
const data = { ... } // Data you have received from us
const key = '...' // Your api key
const sortedData = Object.keys(data)
.filter((key) => key !== 'sign')
.sort()
.reduce((object, key) => { object[key] = data[key]; return object }, {}) // Sort the keys
const sign = Buffer.from(crypto.createHash('sha256').update(JSON.stringify({ ...sortedData, key })).digest('hex')).toString('base64')