Перейти к основному содержимому

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

ParameterTypeInDescription
idintegerpathThe advertisement ID
exchange_rateintegerbodyNew exchange rate in kopecks
min_amountintegerbodyNew minimum order amount in kopecks
max_amountintegerbodyNew maximum order amount in kopecks
payment_methodsstring[]bodyUpdated list of accepted payment methods
payment_detailsobjectbodyUpdated payment details
instructionsstringbodyUpdated instructions for the counterparty
is_activebooleanbodyEnable 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

StatusCodeDescription
400INVALID_REQUESTMalformed or invalid field values
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENAuthenticated user is not the ad owner
404NOT_FOUNDAd with the given ID does not exist