Remove redeemId field from redeem response

- Remove redeemId from successful redemption response
- Remove redeemId from error response
- Update swagger documentation to remove redeemId field
- Update README examples to remove redeemId field
- Clean up API response format for better simplicity
This commit is contained in:
Michilis
2025-07-15 18:03:56 +00:00
parent 52d4735712
commit ba36f96f4c
5 changed files with 30 additions and 19 deletions

View File

@@ -305,9 +305,6 @@ app.post('/api/decode', asyncHandler(async (req, res) => {
* error:
* type: string
* example: "This token has already been spent and cannot be redeemed again"
* redeemId:
* type: string
* format: uuid
* errorType:
* type: string
* example: "token_already_spent"
@@ -324,9 +321,6 @@ app.post('/api/decode', asyncHandler(async (req, res) => {
* error:
* type: string
* example: "Token amount is insufficient to cover the minimum fee"
* redeemId:
* type: string
* format: uuid
* errorType:
* type: string
* example: "insufficient_funds"
@@ -355,7 +349,6 @@ app.post('/api/redeem', asyncHandler(async (req, res) => {
if (result.success) {
const response = {
success: true,
redeemId: result.redeemId,
paid: result.paid,
amount: result.amount,
invoiceAmount: result.invoiceAmount,
@@ -400,7 +393,6 @@ app.post('/api/redeem', asyncHandler(async (req, res) => {
res.status(statusCode).json({
success: false,
error: result.error,
redeemId: result.redeemId,
errorType: statusCode === 409 ? 'token_already_spent' :
statusCode === 422 ? 'insufficient_funds' : 'validation_error'
});