From 62f001c902eb5c9b9682ce01b08090db0dcd4256 Mon Sep 17 00:00:00 2001 From: "b.boterman@htm.nl" Date: Fri, 13 Feb 2026 14:17:17 +0100 Subject: [PATCH] OVPAY-2442 - Added POST /issuedvouchers. --- src/openapi/products/vouchers-se.yaml | 121 ++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 7 deletions(-) diff --git a/src/openapi/products/vouchers-se.yaml b/src/openapi/products/vouchers-se.yaml index 238c3d5..5167462 100644 --- a/src/openapi/products/vouchers-se.yaml +++ b/src/openapi/products/vouchers-se.yaml @@ -72,13 +72,14 @@ paths: "isTravelProduct": false, "name": "Voucher", }, - "requiredProducts": [ - { - "productId": 126, - "productName": "HTM-30001", - "productDescription": "Reis met 20% korting op je betaalpas bij HTM.", - }, - ], + "requiredProducts": + [ + { + "productId": 126, + "productName": "HTM-30001", + "productDescription": "Reis met 20% korting op je betaalpas bij HTM.", + }, + ], "mandatoryCustomerDataItems": [ { @@ -392,6 +393,112 @@ paths: "detail": "An unexpected error occurred while processing your request.", "instance": "/issuedvouchers", } + post: + summary: Issue a voucher for a specific product to a customer + description: | + Issue a voucher for a specific product to a customer. The voucher will be issued for the touch point that is associated with the access token used in the request. + The product for which the voucher should be issued must have active selling periods for touch points within the same retailer as the calling touch point. + tags: + - Vouchers + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + examples: + Issue a single voucher: + summary: Issue a single voucher + value: + { + "issuedVouchers": + [ + { + "voucherCode": "VOUCHER123", + "fromInclusive": "2024-10-04T00:00:00.000", + "untilInclusive": "2024-11-04T00:00:00.000", + "productId": 263, + "voucherClaims": + [ + { + "mandatoryCustomerDataItemId": 8, + "value": "1970-01-01", + }, + { + "mandatoryCustomerDataItemId": 4, + "value": "stasjo@html.nl", + }, + ], + }, + ], + } + Issue multiple vouchers: + summary: Issue multiple vouchers + value: + { + "issuedVouchers": + [ + { + "voucherCode": "VOUCHER123", + "fromInclusive": "2024-10-04T00:00:00.000", + "untilInclusive": "2024-11-04T00:00:00.000", + "productId": 263, + "voucherClaims": + [ + { + "mandatoryCustomerDataItemId": 8, + "value": "1970-01-01", + }, + { + "mandatoryCustomerDataItemId": 4, + "value": "stasjo@html.nl", + }, + ], + }, + { + "voucherCode": "VOUCHER456", + "fromInclusive": "2024-10-04T00:00:00.000", + "untilInclusive": "2024-11-04T00:00:00.000", + "productId": 263, + "voucherClaims": + [ + { + "mandatoryCustomerDataItemId": 8, + "value": "1970-01-01", + }, + { + "mandatoryCustomerDataItemId": 4, + "value": "joey@htm.nl", + }, + ], + }, + ], + } + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + examples: + Successfully issued a single voucher: + summary: Successfully issued a single voucher + value: + { + "issuedVoucherIds": + ["d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"], + } + Successfully issued multiple vouchers: + summary: Successfully issued multiple vouchers + value: + { + "issuedVoucherIds": + [ + "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90", + "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d", + ], + } components: securitySchemes: bearerToken: