Generate a link for a specific payment salescenter.payment.getPublicUrl
Scope:
salescenterWho can execute the method: any user
This method generates a link for a specific payment. The payment method selected will be passed to this particular payment.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
Payment identifier |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1063}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/salescenter.payment.getPublicUrl
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1063,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/salescenter.payment.getPublicUrl
try
{
const response = await $b24.callMethod(
'salescenter.payment.getPublicUrl', {
id: 1063,
}
);
const result = response.getData().result;
console.log(result);
}
catch( error )
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'salescenter.payment.getPublicUrl',
[
'id' => 1063,
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting public URL: ' . $e->getMessage();
}
BX24.callMethod(
'salescenter.payment.getPublicUrl', {
id: 1063,
},
function(result) {
if (result.error()) {
console.error(result.error());
} else {
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'salescenter.payment.getPublicUrl',
[
'id' => 1063
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Successful Response
HTTP status: 200
{
"result": {
"payment": {
"url": "http:\/\/account.home\/pub\/site\/10\/oformleniezakaza\/?orderId=3689\u0026access=f83b5926bd8cb4f0248b4b5a8e48b6fb\u0026paymentId=1063",
"shortUrl": "http:\/\/account.home\/~tR9sB",
"qr": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAF8CAYAAADM5wDKAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAHaElEQVR4nO3csW7jVhRF0SjQ\/\/+y0owFN4GVeYou7+y1KhdjiCI5G8\/NuT0ej8dfAPzx\/p6+AA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IAIwQeIEHyACMEHiBB8gAjBB4gQfIAIwQeIEHyACMEHiBB8gAjBB4i4f\/2wceZ040wxr6vNX5+oTVhvvOYT73q+TvgAEYIPECH4ABGCDxAh+AARgg8QIfgAEYIPECH4ABGCDxAh+AARgg8QIfgAEYIPEPGcR944N7pxEnbjfZ5ycq+mppU3TmdvvOaNrnCfnfABIgQfIELwASIEHyBC8AEiBB8gQvABIgQfIELwASIEHyBC8AEiBB8gQvABIgQfIOI5jzw13Tk1Fzw1rbxx0rlm47txYuM1X2Fq+L+6wn12wgeIEHyACMEHiBB8gAjBB4gQfIAIwQeIEHyACMEHiBB8gAjBB4gQfIAIwQeIEHyAiNtjeHO3NnM6ZeN9nrJxsvvExveZ3+OEDxAh+AARgg8QIfgAEYIPECH4ABGCDxAh+AARgg8QIfgAEYIPECH4ABGCDxAh+AAR968fzOd+xsl93jhju3FqeOoZnfzu1PfdaOM7+a5rdsIHiBB8gAjBB4gQfIAIwQeIEHyACMEHiBB8gAjBB4gQfIAIwQeIEHyACMEHiBB8gAjBB4gQfIAIwQeIuD1qe64AUU74ABGCDxDxD3Dwaiq9kYVcAAAAAElFTkSuQmCC"
}
},
"time": {
"start": 1718372619.163703,
"finish": 1718372619.567831,
"duration": 0.4041280746459961,
"processing": 0.15733885765075684,
"date_start": "2024-06-14T16:43:39+02:00",
"date_finish": "2024-06-14T16:43:39+02:00"
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response |
|
url |
Payment link |
|
shortUrl |
Short payment link |
|
qr |
QR code containing the short payment link |
|
time |
Information about the request execution time |
Error Handling
HTTP status: 400
{
"error": 200640400001,
"error_description": "payment does not exist"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Description |
|
|
Payment not found |
|
|
Required fields not provided |
|
|
Other errors (e.g., fatal errors) |
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Add Payment crm.item.payment.add
- Update Payment Fields crm.item.payment.update
- Get Payment Information crm.item.payment.get
- Get the list of payments crm.item.payment.list
- Change Payment Status to "Paid" crm.item.payment.pay
- Change Payment Status to "Unpaid" crm.item.payment.unpay
- Delete Payment crm.item.payment.delete