Update swap request status.
Update the status of a swap request. Only the receiver can change the status.
PUT
/api/v1/swap-requests/{id}/status
curl \
--request PUT 'http://localhost:8080/api/v1/swap-requests/{id}/status' \
--header "Content-Type: application/json" \
--header "X-User-Id: string" \
--data '{"status":"Accepted"}'
Request examples
# Headers
X-User-Id: string
# Payload
{
"status": "Accepted"
}
Response examples (500)
{
"error": {
"code": "string",
"message": "string",
"target": "string",
"details": [
{
"code": "string",
"message": "string",
"target": "string"
}
]
}
}
Response examples (401)
{
"error": {
"code": "string",
"message": "string",
"target": "string",
"details": [
{
"code": "string",
"message": "string",
"target": "string"
}
]
}
}
Response examples (403)
{
"error": {
"code": "string",
"message": "string",
"target": "string",
"details": [
{
"code": "string",
"message": "string",
"target": "string"
}
]
}
}
Response examples (200)
{
"id": "string",
"senderId": "string",
"receiverId": "string",
"bookToSwapWith": {
"id": "string",
"title": "string",
"author": "string",
"genres": [
"string"
],
"language": "string",
"description": "string",
"condition": "string",
"coverPhotoUrls": [
"string"
],
"owner": {
"id": "string",
"name": "string"
},
"swapCondition": {
"swapType": "string",
"giveAway": true,
"openForOffers": true,
"swappableGenres": [
{
"id": "string",
"name": "string"
}
],
"swappableBooks": [
{
"id": "string",
"title": "string",
"author": "string",
"coverPhotoUrl": "string"
}
]
}
},
"swapType": "string",
"swapOffer": {
"offeredBook": {
"id": "string",
"title": "string",
"author": "string",
"coverPhotoUrl": "string"
},
"offeredGenre": {
"id": "string",
"name": "string"
}
},
"askForGiveaway": true,
"swapStatus": "string",
"note": "string",
"requestedAt": "2025-05-04T09:42:00Z",
"updatedAt": "2025-05-04T09:42:00Z"
}