refacil-pay-mcp 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +485 -8
- package/dist/core/resources.js +34 -6
- package/dist/core/resources.js.map +1 -1
- package/dist/core/tools.d.ts +5 -1
- package/dist/core/tools.js +252 -152
- package/dist/core/tools.js.map +1 -1
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Servidor MCP (Model Context Protocol) generado automáticamente para la API refa
|
|
|
4
4
|
|
|
5
5
|
## 🚀 Características
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **18 herramientas** generadas automáticamente desde la colección Postman
|
|
8
8
|
- **Autenticación flexible**: Username/Password con renovación automática de tokens
|
|
9
9
|
- **Servidor HTTP** con Fastify
|
|
10
10
|
- **Protocolo MCP** estándar para integración con IDEs
|
|
@@ -356,6 +356,8 @@ The table below lists the available payment methods along with their correspondi
|
|
|
356
356
|
| `163` | Cash-in via **TPaga** | 43,200 |
|
|
357
357
|
| `248` | Cash-in via **QR Interoperable** | N/A |
|
|
358
358
|
| `250` | Cash-in via **Llaves Bre-B** | 300 |
|
|
359
|
+
| `273` | Cash-in via **Tarjetas** (Débito y Crédito) | 3,600 |
|
|
360
|
+
| `277` | Cash-in via **Whatsapp** | 2,592,000 |
|
|
359
361
|
|
|
360
362
|
> ⚠ **Important:**
|
|
361
363
|
The value provided in the expiresIn field **must be greater than or equal** to the minimum expiration defined for the selected payment method. **This does not apply to dynamic keys, which always expire 5 minutes after creation.**
|
|
@@ -654,6 +656,138 @@ This behavior does not represent an error or malfunction in our platform.
|
|
|
654
656
|
|
|
655
657
|
---
|
|
656
658
|
|
|
659
|
+
### **Card Payments**
|
|
660
|
+
|
|
661
|
+
This payment method allows processing payments with debit and credit cards (Mastercard and Visa).
|
|
662
|
+
|
|
663
|
+
For this method, the following fields are **required**:
|
|
664
|
+
|
|
665
|
+
- `id`: 273
|
|
666
|
+
|
|
667
|
+
- `description`: Description of the payment detail that will be displayed in the payment link
|
|
668
|
+
|
|
669
|
+
- `external`: Defines the type of link generated
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
#### PaymentMethod Parameters
|
|
673
|
+
|
|
674
|
+
| **Field** | **Type** | **Required** | **Description** |
|
|
675
|
+
| --- | --- | --- | --- |
|
|
676
|
+
| `id` | number | ✅ | Payment method ID: 273 |
|
|
677
|
+
| `description` | string | ✅ | Description of the payment detail that will be displayed in the payment link |
|
|
678
|
+
| `external` | boolean | ✅ | Defines whether to generate a payment link to send directly to the client (`true`) or to embed in an iframe (`false`) |
|
|
679
|
+
|
|
680
|
+
#### Behavior based on the `external` parameter
|
|
681
|
+
|
|
682
|
+
| **Value** | **Description** |
|
|
683
|
+
| --- | --- |
|
|
684
|
+
| `true` | Generates a payment link to send directly to the client. The client can complete the payment from their browser or mobile application. |
|
|
685
|
+
| `false` | Generates a link to embed in an iframe within your own website. The payment is processed within your site. |
|
|
686
|
+
|
|
687
|
+
#### Iframe Implementation Example
|
|
688
|
+
|
|
689
|
+
When `external: false`, you can embed the payment link in an iframe as follows:
|
|
690
|
+
|
|
691
|
+
``` html
|
|
692
|
+
<html>
|
|
693
|
+
<head>
|
|
694
|
+
<title>Add Payment Method</title>
|
|
695
|
+
</head>
|
|
696
|
+
<body>
|
|
697
|
+
<iframe
|
|
698
|
+
src="YOUR-URL-LINK-ID"
|
|
699
|
+
width="100%"
|
|
700
|
+
height="600"
|
|
701
|
+
frameborder="0"
|
|
702
|
+
style="max-width: 500px; margin: 0 auto; display: block;">
|
|
703
|
+
</iframe>
|
|
704
|
+
</body>
|
|
705
|
+
</html>
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
> ⚠️ **Important:**
|
|
709
|
+
> You must use the **complete URL** from the `url` field in the service response as the `src` attribute value in the iframe. The `src` attribute must contain the entire URL returned in the `data.url` field of the API response. For example, if the response contains:
|
|
710
|
+
|
|
711
|
+
``` json
|
|
712
|
+
"data": {
|
|
713
|
+
"url": "https://checkout.akua.la/links/lnk-07595544-cfe6-4d40-8894-0ed7cf3c28b9?sandbox=true"
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
Then the iframe `src` should be:
|
|
718
|
+
|
|
719
|
+
``` html
|
|
720
|
+
<iframe src="https://checkout.akua.la/links/lnk-07595544-cfe6-4d40-8894-0ed7cf3c28b9?sandbox=true" ...></iframe>
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
``` json
|
|
724
|
+
"paymentMethod": {
|
|
725
|
+
"id": 273,
|
|
726
|
+
"description": "Payment description",
|
|
727
|
+
"external": true
|
|
728
|
+
}
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
#### Response Example
|
|
732
|
+
|
|
733
|
+
``` json
|
|
734
|
+
{
|
|
735
|
+
"statusCode": "00",
|
|
736
|
+
"message": "Operación exitosa.",
|
|
737
|
+
"data": {
|
|
738
|
+
"url": "https://checkout.akua.la/links/lnk-07595544-cfe6-4d40-8894-0ed7cf3c28b9?sandbox=true",
|
|
739
|
+
"reference": "db205760-d228-11f0-8923-0d9b7d755dab",
|
|
740
|
+
"resourceId": "2762357",
|
|
741
|
+
"expiresIn": "2025-12-06T22:22:16.000Z",
|
|
742
|
+
"urlStatusPay": "https://mf-core.refacil.co/refacilpay/resumen/79/db205760-d228-11f0-8923-0d9b7d755dab",
|
|
743
|
+
"resourceUrlId": "1762027",
|
|
744
|
+
"status": 1
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
#### Response Fields
|
|
750
|
+
|
|
751
|
+
| **Field** | **Description** |
|
|
752
|
+
| --- | --- |
|
|
753
|
+
| `url` | Payment link URL. Can be used for direct redirection or to embed in an iframe depending on the `external` value |
|
|
754
|
+
| `reference` | Unique transaction reference |
|
|
755
|
+
| `resourceId` | Generated payment resource ID |
|
|
756
|
+
| `expiresIn` | Payment link expiration date and time |
|
|
757
|
+
| `urlStatusPay` | URL to check the payment status |
|
|
758
|
+
| `resourceUrlId` | URL resource ID |
|
|
759
|
+
| `status` | Resource status (1 = Active) |
|
|
760
|
+
---
|
|
761
|
+
|
|
762
|
+
### **Whatsapp**
|
|
763
|
+
|
|
764
|
+
For this method, the following fields are **required**:
|
|
765
|
+
|
|
766
|
+
- `cellphone`
|
|
767
|
+
- `pdfUrl`
|
|
768
|
+
|
|
769
|
+
> ⚠ **pdfUrl — URL standards (Meta/WhatsApp):**
|
|
770
|
+
The value is not arbitrary. The URL must comply with the following so that the document can be sent via WhatsApp:
|
|
771
|
+
|
|
772
|
+
- **Protocol:** Must be **HTTPS**.
|
|
773
|
+
- **Access:** The resource must be **publicly accessible** (no authentication); the system downloads the file from this URL.
|
|
774
|
+
- **Format:** The file must be a valid **PDF**.
|
|
775
|
+
- **Size:** Document size must not exceed **100 MB** (WhatsApp Cloud API limit for documents).
|
|
776
|
+
|
|
777
|
+
Sending a URL that does not meet these requirements may result in rejection or delivery failure.
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
``` json
|
|
781
|
+
"paymentMethod": {
|
|
782
|
+
"id": 277,
|
|
783
|
+
"cellphone": "string",
|
|
784
|
+
"pdfUrl": "string"
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
---
|
|
790
|
+
|
|
657
791
|
## 📥 Request Body Parameters
|
|
658
792
|
|
|
659
793
|
| **Field** | **Type** | **Required** | **Description** |
|
|
@@ -774,7 +908,6 @@ The `key` field must contain a valid Bre-B account alias in the format `@USERNAM
|
|
|
774
908
|
| transactionToken | string | Header personalizado: x-transaction-token |
|
|
775
909
|
| amount | number | Campo del body: amount |
|
|
776
910
|
| reference1 | string | Campo del body: reference1 |
|
|
777
|
-
| bankName | string | Campo del body: bankName |
|
|
778
911
|
| webhookRequest | string | Campo del body: webhookRequest |
|
|
779
912
|
| withdrawMethod | object | Campo del body: withdrawMethod |
|
|
780
913
|
| userMetadata | object | Campo del body: userMetadata |
|
|
@@ -1044,7 +1177,7 @@ For withdraws, a notification will be sent to the webhook provided in the applic
|
|
|
1044
1177
|
|
|
1045
1178
|
### `merchant_enrollment_data`
|
|
1046
1179
|
|
|
1047
|
-
This service allows merchants to
|
|
1180
|
+
This service allows merchants to retrieve enrollment data for the use of the QR interoperable payment method and key creation.
|
|
1048
1181
|
|
|
1049
1182
|
To use the service, an authentication token is required and must be sent as an `Authorization` header.
|
|
1050
1183
|
|
|
@@ -1052,11 +1185,7 @@ To use the service, an authentication token is required and must be sent as an `
|
|
|
1052
1185
|
|
|
1053
1186
|
### **Enrollment Process**
|
|
1054
1187
|
|
|
1055
|
-
1. **
|
|
1056
|
-
|
|
1057
|
-
- Initiates the enrollment process. The enrollment can take up to **7 minutes** to complete.
|
|
1058
|
-
|
|
1059
|
-
2. **Retrieve Enrollment Data**
|
|
1188
|
+
1. **Retrieve Enrollment Data**
|
|
1060
1189
|
|
|
1061
1190
|
- Retrieves the merchant’s enrollment information once the process is completed.
|
|
1062
1191
|
|
|
@@ -1106,6 +1235,354 @@ To avoid these issues, a randomly generated alias is used as a placeholder. This
|
|
|
1106
1235
|
|
|
1107
1236
|
This endpoint retrieves the merchant's enrollment details after the enrollment process has been completed. It provides necessary information to use the QR interoperable payment method.
|
|
1108
1237
|
|
|
1238
|
+
### `user_webhooks`
|
|
1239
|
+
|
|
1240
|
+
Service to **configure backup webhooks per client**. It allows listing, creating and activating/deactivating URLs to which RefacilPay will send notifications when the payment resource has no webhook configured (e.g. for Saldo or Dispersión).
|
|
1241
|
+
|
|
1242
|
+
---
|
|
1243
|
+
|
|
1244
|
+
### Endpoints
|
|
1245
|
+
|
|
1246
|
+
1. **List user webhooks** (GET) – Returns the backup webhooks configured for the **authenticated user** (user inferred from Bearer token).
|
|
1247
|
+
|
|
1248
|
+
2. **Create user webhook** (POST) – Creates a backup webhook for the **authenticated user** and type (Saldo or Dispersión).
|
|
1249
|
+
|
|
1250
|
+
3. **Update webhook status** (PATCH) – Activates or deactivates a backup webhook **owned by the authenticated user**.
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
All endpoints require Bearer token authentication (`Authorization: Bearer {{tokenLogin}}`). The user is always inferred from the token for security.
|
|
1254
|
+
|
|
1255
|
+
---
|
|
1256
|
+
|
|
1257
|
+
### Description
|
|
1258
|
+
|
|
1259
|
+
Returns the **backup webhooks** configured for the **authenticated user**. The user is identified by the Bearer token (header `Authorization`). The response lists all webhooks for that user with their type (e.g. Saldo, Dispersión), URL and active/inactive status.
|
|
1260
|
+
|
|
1261
|
+
---
|
|
1262
|
+
|
|
1263
|
+
### What it is for
|
|
1264
|
+
|
|
1265
|
+
- Query which backup webhook URLs the authenticated client has configured.
|
|
1266
|
+
|
|
1267
|
+
- See the status (active/inactive) of each webhook.
|
|
1268
|
+
|
|
1269
|
+
- List available webhook types (Saldo, Dispersión).
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
---
|
|
1273
|
+
|
|
1274
|
+
### Request
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
---
|
|
1278
|
+
|
|
1279
|
+
### Response
|
|
1280
|
+
|
|
1281
|
+
- **statusCode** (string): Operation status code. `00` = success.
|
|
1282
|
+
|
|
1283
|
+
- **message** (string): Descriptive message (e.g. "Operación exitosa.").
|
|
1284
|
+
|
|
1285
|
+
- **data** (array): List of webhooks, each with: `id`, `userId`, `webhookTypeId`, `typeName`, `url`, `active`, `createdAt`, `updatedAt`.
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
---
|
|
1289
|
+
|
|
1290
|
+
### Example: Success (200 OK)
|
|
1291
|
+
|
|
1292
|
+
```
|
|
1293
|
+
GET {{protocol}}://{{serverNamePayApi}}/user-webhooks
|
|
1294
|
+
Authorization: Bearer {{tokenLogin}}
|
|
1295
|
+
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
Response body:
|
|
1299
|
+
|
|
1300
|
+
``` json
|
|
1301
|
+
{
|
|
1302
|
+
"statusCode": "00",
|
|
1303
|
+
"message": "Operación exitosa.",
|
|
1304
|
+
"data": [
|
|
1305
|
+
{
|
|
1306
|
+
"id": 1,
|
|
1307
|
+
"userId": 12345,
|
|
1308
|
+
"webhookTypeId": 1,
|
|
1309
|
+
"typeName": "Saldo",
|
|
1310
|
+
"url": "https://my-server.com/webhooks/saldo",
|
|
1311
|
+
"active": true,
|
|
1312
|
+
"createdAt": "2025-01-15T10:00:00.000Z",
|
|
1313
|
+
"updatedAt": "2025-01-15T10:00:00.000Z"
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
"id": 2,
|
|
1317
|
+
"userId": 12345,
|
|
1318
|
+
"webhookTypeId": 2,
|
|
1319
|
+
"typeName": "Dispersión",
|
|
1320
|
+
"url": "https://my-server.com/webhooks/dispersion",
|
|
1321
|
+
"active": false,
|
|
1322
|
+
"createdAt": "2025-01-14T08:30:00.000Z",
|
|
1323
|
+
"updatedAt": "2025-01-16T14:20:00.000Z"
|
|
1324
|
+
}
|
|
1325
|
+
]
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
---
|
|
1331
|
+
|
|
1332
|
+
### Example: Empty list (200 OK)
|
|
1333
|
+
|
|
1334
|
+
When the user has no webhooks configured, `data` is an empty array:
|
|
1335
|
+
|
|
1336
|
+
``` json
|
|
1337
|
+
{
|
|
1338
|
+
"statusCode": "00",
|
|
1339
|
+
"message": "Operación exitosa.",
|
|
1340
|
+
"data": []
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
```
|
|
1344
|
+
|
|
1345
|
+
### `create_user_webhook`
|
|
1346
|
+
|
|
1347
|
+
Service to **configure backup webhooks per client**. It allows listing, creating and activating/deactivating URLs to which RefacilPay will send notifications when the payment resource has no webhook configured (e.g. for Saldo or Dispersión).
|
|
1348
|
+
|
|
1349
|
+
---
|
|
1350
|
+
|
|
1351
|
+
### Endpoints
|
|
1352
|
+
|
|
1353
|
+
1. **List user webhooks** (GET) – Returns the backup webhooks configured for the **authenticated user** (user inferred from Bearer token).
|
|
1354
|
+
|
|
1355
|
+
2. **Create user webhook** (POST) – Creates a backup webhook for the **authenticated user** and type (Saldo or Dispersión).
|
|
1356
|
+
|
|
1357
|
+
3. **Update webhook status** (PATCH) – Activates or deactivates a backup webhook **owned by the authenticated user**.
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
All endpoints require Bearer token authentication (`Authorization: Bearer {{tokenLogin}}`). The user is always inferred from the token for security.
|
|
1361
|
+
|
|
1362
|
+
---
|
|
1363
|
+
|
|
1364
|
+
### Description
|
|
1365
|
+
|
|
1366
|
+
Creates a **backup webhook** for a user and webhook type. When a new webhook is created, only this webhook remains active for that user and type; others of the same type are deactivated.
|
|
1367
|
+
|
|
1368
|
+
---
|
|
1369
|
+
|
|
1370
|
+
### What it is for
|
|
1371
|
+
|
|
1372
|
+
- Configure the URL to which RefacilPay will send backup notifications when the resource has no `webhookRequest`.
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
---
|
|
1376
|
+
|
|
1377
|
+
### Request
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
---
|
|
1381
|
+
|
|
1382
|
+
### Possible values for `webhookTypeId`
|
|
1383
|
+
|
|
1384
|
+
| Value | Description |
|
|
1385
|
+
| --- | --- |
|
|
1386
|
+
| **1** | Saldo (cash-in backup notifications) |
|
|
1387
|
+
| **2** | Dispersión (cash-out / dispersion backup notifications) |
|
|
1388
|
+
|
|
1389
|
+
---
|
|
1390
|
+
|
|
1391
|
+
### Example: Success (200 OK)
|
|
1392
|
+
|
|
1393
|
+
```
|
|
1394
|
+
POST {{protocol}}://{{serverNamePayApi}}/user-webhooks
|
|
1395
|
+
Authorization: Bearer {{tokenLogin}}
|
|
1396
|
+
Content-Type: application/json
|
|
1397
|
+
{
|
|
1398
|
+
"webhookTypeId": 2,
|
|
1399
|
+
"url": "https://my-server.com/webhooks/dispersion"
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
```
|
|
1403
|
+
|
|
1404
|
+
The user is inferred from the Bearer token; do not send `userId` in the body.
|
|
1405
|
+
|
|
1406
|
+
Response body:
|
|
1407
|
+
|
|
1408
|
+
``` json
|
|
1409
|
+
{
|
|
1410
|
+
"statusCode": "00",
|
|
1411
|
+
"message": "Operación exitosa.",
|
|
1412
|
+
"data": {
|
|
1413
|
+
"id": 3,
|
|
1414
|
+
"userId": 12345,
|
|
1415
|
+
"webhookTypeId": 2,
|
|
1416
|
+
"url": "https://my-server.com/webhooks/dispersion",
|
|
1417
|
+
"active": true,
|
|
1418
|
+
"createdAt": "2025-01-16T12:00:00.000Z",
|
|
1419
|
+
"updatedAt": "2025-01-16T12:00:00.000Z"
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
---
|
|
1426
|
+
|
|
1427
|
+
### Example: Webhook type not found (404 Not Found)
|
|
1428
|
+
|
|
1429
|
+
When `webhookTypeId` is not an allowed value (only **1** and **2** are valid), the API returns:
|
|
1430
|
+
|
|
1431
|
+
``` json
|
|
1432
|
+
{
|
|
1433
|
+
"statusCode": 404,
|
|
1434
|
+
"message": "Webhook type not found: 99",
|
|
1435
|
+
"error": "Not Found"
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
---
|
|
1441
|
+
|
|
1442
|
+
### Example: Validation error (400 Bad Request)
|
|
1443
|
+
|
|
1444
|
+
When the request body is invalid (e.g. missing required fields, invalid URL format), the API returns validation errors:
|
|
1445
|
+
|
|
1446
|
+
``` json
|
|
1447
|
+
{
|
|
1448
|
+
"statusCode": 400,
|
|
1449
|
+
"message": [
|
|
1450
|
+
"url must be a URL address",
|
|
1451
|
+
"url must be a URL address"
|
|
1452
|
+
],
|
|
1453
|
+
"error": "Bad Request"
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
**Parámetros:**
|
|
1459
|
+
|
|
1460
|
+
| Name | Type | Description |
|
|
1461
|
+
| --- | --- | --- |
|
|
1462
|
+
| webhookTypeId | number | Campo del body: webhookTypeId |
|
|
1463
|
+
| url | string | Campo del body: url |
|
|
1464
|
+
|
|
1465
|
+
### `user_webhooks_status`
|
|
1466
|
+
|
|
1467
|
+
Service to **configure backup webhooks per client**. It allows listing, creating and activating/deactivating URLs to which RefacilPay will send notifications when the payment resource has no webhook configured (e.g. for Saldo or Dispersión).
|
|
1468
|
+
|
|
1469
|
+
---
|
|
1470
|
+
|
|
1471
|
+
### Endpoints
|
|
1472
|
+
|
|
1473
|
+
1. **List user webhooks** (GET) – Returns the backup webhooks configured for the **authenticated user** (user inferred from Bearer token).
|
|
1474
|
+
|
|
1475
|
+
2. **Create user webhook** (POST) – Creates a backup webhook for the **authenticated user** and type (Saldo or Dispersión).
|
|
1476
|
+
|
|
1477
|
+
3. **Update webhook status** (PATCH) – Activates or deactivates a backup webhook **owned by the authenticated user**.
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
All endpoints require Bearer token authentication (`Authorization: Bearer {{tokenLogin}}`). The user is always inferred from the token for security.
|
|
1481
|
+
|
|
1482
|
+
---
|
|
1483
|
+
|
|
1484
|
+
### Description
|
|
1485
|
+
|
|
1486
|
+
Updates the **active/inactive status** of a backup webhook **owned by the authenticated user**. The user is identified by the Bearer token; you can only update webhooks that belong to that user. If a webhook is activated, other webhooks for the same user and type are deactivated (only one active per type per user).
|
|
1487
|
+
|
|
1488
|
+
---
|
|
1489
|
+
|
|
1490
|
+
### What it is for
|
|
1491
|
+
|
|
1492
|
+
- Activate or deactivate a backup webhook URL without deleting it.
|
|
1493
|
+
|
|
1494
|
+
- Switch which URL receives notifications when multiple are configured (activating one deactivates others of the same type).
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
---
|
|
1498
|
+
|
|
1499
|
+
### Request
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
---
|
|
1503
|
+
|
|
1504
|
+
### Example: Success (200 OK)
|
|
1505
|
+
|
|
1506
|
+
```
|
|
1507
|
+
PATCH {{protocol}}://{{serverNamePayApi}}/user-webhooks/1/status
|
|
1508
|
+
Authorization: Bearer {{tokenLogin}}
|
|
1509
|
+
Content-Type: application/json
|
|
1510
|
+
{
|
|
1511
|
+
"active": true
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
```
|
|
1515
|
+
|
|
1516
|
+
Response body:
|
|
1517
|
+
|
|
1518
|
+
``` json
|
|
1519
|
+
{
|
|
1520
|
+
"statusCode": "00",
|
|
1521
|
+
"message": "Operación exitosa.",
|
|
1522
|
+
"data": {
|
|
1523
|
+
"id": 1,
|
|
1524
|
+
"userId": 12345,
|
|
1525
|
+
"webhookTypeId": 1,
|
|
1526
|
+
"url": "https://my-server.com/webhooks/saldo",
|
|
1527
|
+
"active": true,
|
|
1528
|
+
"createdAt": "2025-01-15T10:00:00.000Z",
|
|
1529
|
+
"updatedAt": "2025-01-16T15:30:00.000Z"
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
```
|
|
1534
|
+
|
|
1535
|
+
---
|
|
1536
|
+
|
|
1537
|
+
### Example: User webhook not found (404 Not Found)
|
|
1538
|
+
|
|
1539
|
+
When no webhook exists with the given `id`, the API returns:
|
|
1540
|
+
|
|
1541
|
+
``` json
|
|
1542
|
+
{
|
|
1543
|
+
"statusCode": 404,
|
|
1544
|
+
"message": "User webhook not found: 999",
|
|
1545
|
+
"error": "Not Found"
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
```
|
|
1549
|
+
|
|
1550
|
+
---
|
|
1551
|
+
|
|
1552
|
+
### Example: Forbidden (403 Forbidden)
|
|
1553
|
+
|
|
1554
|
+
When the webhook does not belong to the authenticated user, the API returns:
|
|
1555
|
+
|
|
1556
|
+
``` json
|
|
1557
|
+
{
|
|
1558
|
+
"statusCode": 403,
|
|
1559
|
+
"message": "Webhook does not belong to the authenticated user",
|
|
1560
|
+
"error": "Forbidden"
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
```
|
|
1564
|
+
|
|
1565
|
+
---
|
|
1566
|
+
|
|
1567
|
+
### Example: Validation error (400 Bad Request)
|
|
1568
|
+
|
|
1569
|
+
When `id` is not a valid number or body is invalid:
|
|
1570
|
+
|
|
1571
|
+
``` json
|
|
1572
|
+
{
|
|
1573
|
+
"statusCode": 400,
|
|
1574
|
+
"message": "Validation failed (numeric string is expected)",
|
|
1575
|
+
"error": "Bad Request"
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
```
|
|
1579
|
+
|
|
1580
|
+
**Parámetros:**
|
|
1581
|
+
|
|
1582
|
+
| Name | Type | Description |
|
|
1583
|
+
| --- | --- | --- |
|
|
1584
|
+
| active | boolean | Campo del body: active |
|
|
1585
|
+
|
|
1109
1586
|
|
|
1110
1587
|
## 📝 Logs
|
|
1111
1588
|
|