PUT /api/v1/p2p/ads/{id}
Update an existing P2P advertisement. Only the ad owner can perform this action. All body fields are optional; only provided fields are updated.
Authentication​
Required. Pass a Bearer token in the Authorization header. The authenticated user must be the ad owner.
Request​
| Parameter | Type | In | Description |
|---|---|---|---|
id | integer | path | The advertisement ID |
exchange_rate | integer | body | New exchange rate in kopecks |
min_amount | integer | body | New minimum order amount in kopecks |
max_amount | integer | body | New maximum order amount in kopecks |
payment_methods | string[] | body | Updated list of accepted payment methods |
payment_details | object | body | Updated payment details |
instructions | string | body | Updated instructions for the counterparty |
is_active | boolean | body | Enable or disable the ad |
Example​
curl -X PUT https://example.com/api/v1/p2p/ads/42 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"exchange_rate": 9400,
"min_amount": 100000,
"payment_methods": ["sber", "tinkoff", "raiffeisen"]
}'
Response​
200 OK​
Returns a success indicator.
{
"success": true
}
Errors​
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Malformed or invalid field values |
| 401 | UNAUTHORIZED | Missing or invalid token |
| 403 | FORBIDDEN | Authenticated user is not the ad owner |
| 404 | NOT_FOUND | Ad with the given ID does not exist |