{"openapi":"3.0.1","info":{"title":"Voucher","description":"Provide a generic voucher management app\n <b><h1>Deprecated endpoints:</h1></b><table border=\"1px;\"><tr><th style=\"text-align: center; vertical-align: middle;\"><b><h3>Uri</b></h3></th><th><b>Method</b></th><th><b><h3>Since</h3></b></th><th><b><h3>End of life</h3></b></th></tr></table>","version":"1-apps"},"servers":[{"url":"api.test.bluestonepim.com/voucher"}],"tags":[{"name":"Technical","description":"To get technical information."}],"paths":{"/technical/version":{"get":{"tags":["Technical"],"summary":"Show service version.","operationId":"presentVersion","responses":{"200":{"description":"Show service version."},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oauth2":[]}]}},"/fields/report":{"get":{"tags":["Fields"],"summary":"Get order report fields configuration.","operationId":"getReportFields","responses":{"200":{"description":"Get order report fields configuration success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldConfigurationResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Cannot get fields configuration"}},"security":[{"oauth2":[]}]},"put":{"tags":["Fields"],"summary":"Upsert order report fields configuration.","operationId":"upsertReportFields","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldConfigurationRequest"}}}},"responses":{"200":{"description":"Upsert order report fields configuration success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldConfigurationResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Cannot upsert fields configuration"}},"security":[{"oauth2":[]}]}},"/redemptions/{id}":{"get":{"tags":["Redemption"],"summary":"Get redemption by ID","operationId":"getRedemption","parameters":[{"name":"id","in":"path","description":"Redemption id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get redemption successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedemptionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Redemption not found."},"500":{"description":"Internal server error."}},"security":[{"oauth2":[]}]}},"/redemptions":{"get":{"tags":["Redemption"],"summary":"List redemption.","operationId":"listRedemption","parameters":[{"name":"page","in":"query","description":"Number of page. default 0","schema":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32","default":0}},{"name":"pageSize","in":"query","description":"Size per page. default 20","schema":{"maximum":1000,"minimum":1,"type":"integer","format":"int32","default":20}},{"name":"fromTime","in":"query","description":"Redemption created after the given value in ISO 8601 date format.","schema":{"type":"string","format":"date-time"}},{"name":"toTime","in":"query","description":"Redemption created before the given value in ISO 8601 date format.","schema":{"type":"string","format":"date-time"}},{"name":"status","in":"query","description":"Redemption status equals the given value.","schema":{"$ref":"#/components/schemas/RedemptionStatus"}},{"name":"voucherId","in":"query","description":"Voucher ID equals the given value.","schema":{"type":"string"}},{"name":"customerUserId","in":"query","description":"Customer User ID equals the given value.","schema":{"type":"string"}}],"responses":{"200":{"description":"List redemption successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRedemptionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/redeem":{"post":{"tags":["Redemption"],"summary":"Redeem voucher.","operationId":"redeemVoucher","requestBody":{"description":"redeemVoucherRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemVoucherRequest"}}}},"responses":{"200":{"description":"Redeemed voucher successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedemptionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/redemptions/{id}/rollback":{"post":{"tags":["Redemption"],"summary":"Rollback voucher.","operationId":"rollbackVoucher","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"rollbackVoucherRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackVoucherRequest"}}}},"responses":{"200":{"description":"Rolled back voucher successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedemptionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/report/{id}":{"delete":{"tags":["Report"],"summary":"Remove voucher report.","operationId":"deleteReport","parameters":[{"name":"id","in":"path","description":"Report id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Remove voucher report success."},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Cannot remove voucher report."}},"security":[{"oauth2":[]}]}},"/report/download/{id}":{"get":{"tags":["Report"],"summary":"Download voucher report.","operationId":"downloadReport","parameters":[{"name":"id","in":"path","description":"Report id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Download voucher report success"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oauth2":[]}]}},"/report/generate":{"post":{"tags":["Report"],"summary":"Generate voucher report by search.","operationId":"generateReport","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVoucherReportRequest"}}}},"responses":{"200":{"description":"Successfully generating voucher report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oauth2":[]}]}},"/report":{"get":{"tags":["Report"],"summary":"Get voucher report.","operationId":"getReport","parameters":[{"name":"filterId","in":"query","description":"Filter report id.","schema":{"type":"string"}},{"name":"page","in":"query","description":"Number of page.","schema":{"type":"integer","format":"int32","default":0}},{"name":"pageSize","in":"query","description":"Size of page.","schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Get voucher report success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Cannot get voucher report"}},"security":[{"oauth2":[]}]}},"/vouchers/{id}/attributes":{"get":{"tags":["Voucher Attributes"],"summary":"Get voucher attributes.","operationId":"getVoucherAttributes","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Voucher attributes returns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherAttributesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found."}},"security":[{"oauth2":[]}]},"post":{"tags":["Voucher Attributes"],"summary":"Upsert attributes to voucher.","operationId":"upsertVoucherAttributes","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherAttributesRequest"}}},"required":true},"responses":{"201":{"description":"Upsert attributes to voucher success."},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"voucher is not found."}},"security":[{"oauth2":[]}]},"delete":{"tags":["Voucher Attributes"],"summary":"Delete voucher attributes.","operationId":"deleteVoucherAttributes","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveVoucherAttributesRequest"}}},"required":true},"responses":{"204":{"description":"Delete voucher attributes successfully."},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher is not found."}},"security":[{"oauth2":[]}]}},"/vouchers/predefined-attributes":{"get":{"tags":["Voucher Attributes"],"summary":"Get voucher predefined attributes.","operationId":"getVoucherPredefined","responses":{"200":{"description":"Voucher predefined attributes returns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherPredefinedAttributesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found."}},"security":[{"oauth2":[]}]},"put":{"tags":["Voucher Attributes"],"summary":"Update predefined attributes to organization.","operationId":"upsertVoucherPredefined","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherPredefinedAttributesRequest"}}},"required":true},"responses":{"201":{"description":"Update predefined attributes to voucher success."},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"voucher is not found."}},"security":[{"oauth2":[]}]}},"/vouchers/{id}/{entity}":{"get":{"tags":["Voucher link"],"summary":"Get voucher entity links by voucher id and entity type.","operationId":"getVoucherProductLinks","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}},{"name":"entity","in":"path","description":"Entity type.","required":true,"schema":{"type":"string","enum":["products","categories","users","profiles","groups"]}}],"responses":{"200":{"description":"Get voucher entity links successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEntityIdResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]},"post":{"tags":["Voucher link"],"summary":"Link voucher entities.","operationId":"createVoucherProductLinks","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}},{"name":"entity","in":"path","description":"Entity type.","required":true,"schema":{"type":"string","enum":["products","categories","users","profiles","groups"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoucherLinkRequest"}}}},"responses":{"201":{"description":"Create link of entities successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]},"delete":{"tags":["Voucher link"],"summary":"Remove link of voucher entities.","operationId":"deleteVoucherProductLinks","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}},{"name":"entity","in":"path","description":"Entity type.","required":true,"schema":{"type":"string","enum":["products","categories","users","profiles","groups"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoucherLinkRequest"}}}},"responses":{"200":{"description":"Remove link of entities successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/vouchers":{"get":{"tags":["Voucher"],"summary":"List vouchers.","operationId":"listVouchers","parameters":[{"name":"name","in":"query","description":"Voucher name contains the given value","schema":{"type":"string","description":"Voucher name contains the given value"}},{"name":"nmc","in":"query","description":"Voucher name matching conditions (default: CONTAINS)","schema":{"type":"string","description":"Voucher name matching conditions (default: CONTAINS)","default":"CONTAINS","enum":["EQUALS","CONTAINS","BEGINS","ENDS"]}},{"name":"code","in":"query","description":"Voucher code equals the given value","schema":{"type":"string","description":"Voucher code equals the given value"}},{"name":"cmc","in":"query","description":"Voucher code matching conditions (default: CONTAINS)","schema":{"type":"string","description":"Voucher code matching conditions (default: CONTAINS)","default":"CONTAINS","enum":["EQUALS","CONTAINS","BEGINS","ENDS"]}},{"name":"redeemed","in":"query","description":"Voucher has been redeemed","schema":{"type":"boolean","description":"Voucher has been redeemed"}},{"name":"status","in":"query","description":"Voucher status equals the given value","schema":{"type":"string","description":"Voucher status equals the given value","enum":["ACTIVE","INACTIVE"]}},{"name":"voucherType","in":"query","description":"Voucher type equals the given value","schema":{"type":"string","description":"Voucher type equals the given value","enum":["ORDER","PURCHASABLE"]}},{"name":"activeAt","in":"query","description":"Voucher's active date in ISO 8601 date format","schema":{"type":"string","description":"Voucher's active date in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"}},{"name":"startDateFrom","in":"query","description":"Voucher's start date from value in ISO 8601 date format","schema":{"type":"string","description":"Voucher's start date from value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"}},{"name":"startDateTo","in":"query","description":"Voucher's start date to value in ISO 8601 date format","schema":{"type":"string","description":"Voucher's start date to value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"}},{"name":"expirationDateFrom","in":"query","description":"Voucher's expiration date from value in ISO 8601 date format","schema":{"type":"string","description":"Voucher's expiration date from value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"}},{"name":"expirationDateTo","in":"query","description":"Voucher's expiration date to value in ISO 8601 date format","schema":{"type":"string","description":"Voucher's expiration date to value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"}},{"name":"discountType","in":"query","description":"Discount type equals the given value","schema":{"type":"string","description":"Discount type equals the given value","enum":["AMOUNT","PERCENT"]}},{"name":"discountValue","in":"query","description":"Discount value equals the given value","schema":{"type":"number","description":"Discount value equals the given value"}},{"name":"includeEntities","in":"query","description":"Include entities","schema":{"type":"boolean","description":"Include entities"}},{"name":"sortBy","in":"query","description":"Sort by field. (default sort by newest)","schema":{"type":"string","description":"Sort by field. (default sort by newest)","enum":["NAME","CODE","START_DATE","EXPIRATION_DATE","REDEEMED_QUANTITY","STATUS","CREATED_AT"]}},{"name":"sortDirection","in":"query","description":"Sort direction","schema":{"type":"string","description":"Sort direction","enum":["ASC","DESC"]}},{"name":"page","in":"query","description":"Number of page. default 0","schema":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32","default":0}},{"name":"pageSize","in":"query","description":"Size per page. default 20","schema":{"maximum":1000,"minimum":1,"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"List vouchers successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVoucherWithEntitiesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]},"post":{"tags":["Voucher"],"summary":"Create a new voucher with code.","operationId":"createVoucher","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddVoucherRequest"}}}},"responses":{"201":{"description":"Create voucher successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/vouchers/{id}":{"get":{"tags":["Voucher"],"summary":"Get voucher info by ID.","operationId":"getVoucherById","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get voucher info successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]},"put":{"tags":["Voucher"],"summary":"Update voucher.","operationId":"updateVoucher","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoucherRequest"}}}},"responses":{"200":{"description":"Update voucher successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]},"delete":{"tags":["Voucher"],"summary":"Delete voucher by ID.","operationId":"deleteVoucherById","parameters":[{"name":"id","in":"path","description":"Voucher id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delete voucher successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/vouchers/generate":{"post":{"tags":["Voucher"],"summary":"Create new vouchers asynchronously.","operationId":"generateVoucherCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVoucherRequest"}}}},"responses":{"202":{"description":"Accepted"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}},"/voucher":{"get":{"tags":["Voucher"],"summary":"Get voucher info by Code.","operationId":"getVoucherByCode","parameters":[{"name":"code","in":"query","description":"Voucher code.","schema":{"type":"string"}}],"responses":{"200":{"description":"Get voucher info successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoucherWithEntitiesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Voucher not found"},"500":{"description":"Internal server error"}},"security":[{"oauth2":[]}]}}},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"status":{"title":"Error status code.","type":"integer","format":"int32"},"error":{"title":"General error description.","type":"string"},"errorDetails":{"title":"List of errors details.","type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}},"requestId":{"title":"Request ID used for logging.","type":"string"},"timestamp":{"title":"Error timestamp.","type":"integer","format":"int64"},"quotaLimitExceededDetails":{"title":"Additional entity id list related to error","type":"array","items":{"$ref":"#/components/schemas/QuotaLimitExceededDetails"}}}},"ErrorDetails":{"type":"object","properties":{"message":{"title":"Error message.","type":"string"},"field":{"title":"Error related field.","type":"string"},"rejectedValue":{"title":"Invalid value causing error.","type":"string"}}},"QuotaLimitExceededDetails":{"type":"object","properties":{"quota":{"title":"Quota name.","type":"string"},"message":{"title":"Quota limit message.","type":"string"},"limit":{"title":"Quota limit.","type":"integer","format":"int32"},"entityId":{"title":"Id of the entity that caused the quota limit to be exceeded.","type":"string","nullable":true},"entityType":{"title":"Type of the entity that caused the quota limit to be exceeded.","type":"string","nullable":true}}},"ContentSeparator":{"title":"Content separator.","type":"string","enum":["NEW_LINE","COMMA","COMMA_WITH_SPACE","SPACE","COLON","SEMI_COLON"]},"Field":{"type":"object","properties":{"name":{"title":"Field name.","type":"string"},"paths":{"title":"Paths.","type":"array","items":{"type":"string"}},"fieldType":{"$ref":"#/components/schemas/FieldType"},"sectionType":{"$ref":"#/components/schemas/SectionType"},"separator":{"$ref":"#/components/schemas/ContentSeparator"},"listMapSetting":{"$ref":"#/components/schemas/ListMapSetting"}}},"FieldConfigurationResponse":{"type":"object","properties":{"id":{"title":"Field id.","type":"string"},"createdAt":{"title":"Created at.","type":"string","format":"date-time"},"modifiedAt":{"title":"Modified at.","type":"string","format":"date-time"},"createdBy":{"title":"Created by.","type":"string"},"modifiedBy":{"title":"Modified by.","type":"string"},"fields":{"title":"Fields.","type":"array","items":{"$ref":"#/components/schemas/Field"}}}},"FieldType":{"title":"Field type.","type":"string","enum":["TEXT","DATETIME","NUMBER","BOOLEAN","LIST","MAP","LIST_MAP"]},"ListMapSetting":{"type":"object","properties":{"keyField":{"title":"Key.","type":"string"},"valueField":{"title":"Value.","type":"string"}}},"SectionType":{"title":"Section type.","type":"string","enum":["HEAD","LINE"]},"ReportFieldConfigurationRequest":{"type":"object","properties":{"fields":{"title":"Fields.","type":"array","items":{"$ref":"#/components/schemas/Field"}}}},"RedemptionResponse":{"type":"object","properties":{"id":{"title":"Redemption ID.","type":"string"},"voucherId":{"title":"Voucher ID.","type":"string"},"status":{"title":"Status.","type":"string"},"failureMessage":{"title":"Failure message.","type":"string"},"referenceType":{"title":"Reference type.","type":"string"},"referenceId":{"title":"Reference ID.","type":"string"},"customerUserId":{"title":"Customer user ID.","type":"string"},"modifiedAt":{"title":"Modified at.","type":"string","format":"date-time"},"modifiedBy":{"title":"Modified by.","type":"string"},"createdAt":{"title":"Created at.","type":"string"},"createdBy":{"title":"Created by.","type":"string"}}},"ListRedemptionResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64"},"data":{"type":"array","items":{"$ref":"#/components/schemas/RedemptionResponse"}}}},"RedemptionStatus":{"type":"string","enum":["SUCCESS","ROLLBACK"]},"ObjectId":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int32"},"date":{"type":"string","format":"date-time"}}},"RedeemVoucherRequest":{"required":["code","customerUserId","referenceId","referenceType"],"type":"object","properties":{"code":{"title":"Voucher code.","type":"string"},"referenceType":{"title":"Reference type of entity that redeem the voucher.","type":"string"},"referenceId":{"title":"Reference id of entity that redeem the voucher.","type":"string"},"customerUserId":{"title":"The customer id that redeem the voucher.","type":"string"}}},"RollbackVoucherRequest":{"type":"object","properties":{"reason":{"title":"Reason for rolling back voucher.","type":"string"}}},"ReportResponse":{"type":"object","properties":{"id":{"title":"Report id.","type":"string"},"createdAt":{"title":"Created at.","type":"string"},"modifiedAt":{"title":"Modified at.","type":"string"},"createdBy":{"title":"Created by.","type":"string"},"modifiedBy":{"title":"Modified by.","type":"string"},"status":{"title":"Report status.","type":"string","enum":["INIT","START","IN_PROGRESS","COMPLETE","FAIL"]},"filename":{"title":"Filename.","type":"string"},"reportName":{"title":"Report name.","type":"string"}}},"GenerateVoucherReportRequest":{"required":["filters"],"type":"object","properties":{"reportName":{"maxLength":250,"minLength":0,"type":"string"},"filters":{"$ref":"#/components/schemas/VoucherFilter"}}},"VoucherFilter":{"type":"object","properties":{"name":{"type":"string","description":"Voucher name contains the given value"},"nmc":{"type":"string","description":"Voucher name matching conditions (default: CONTAINS)","enum":["EQUALS","CONTAINS","BEGINS","ENDS"]},"code":{"type":"string","description":"Voucher code equals the given value"},"cmc":{"type":"string","description":"Voucher code matching conditions (default: CONTAINS)","enum":["EQUALS","CONTAINS","BEGINS","ENDS"]},"redeemed":{"type":"boolean","description":"Voucher has been redeemed"},"status":{"type":"string","description":"Voucher status equals the given value","enum":["ACTIVE","INACTIVE"]},"type":{"type":"string","description":"Voucher type equals the given value","enum":["ORDER","PURCHASABLE"]},"activeAt":{"type":"string","description":"Voucher's active date in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"},"startDateFrom":{"type":"string","description":"Voucher's start date from value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"},"startDateTo":{"type":"string","description":"Voucher's start date to value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"},"expirationDateFrom":{"type":"string","description":"Voucher's expiration date from value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"},"expirationDateTo":{"type":"string","description":"Voucher's expiration date to value in ISO 8601 date format","format":"date-time","example":"2021-04-04T00:00:00Z"},"discountType":{"type":"string","description":"Discount type equals the given value","enum":["AMOUNT","PERCENT"]},"discountValue":{"type":"number","description":"Discount value equals the given value"},"includeEntities":{"type":"boolean","description":"Include entities"},"sortBy":{"type":"string","description":"Sort by field. (default sort by newest)","enum":["NAME","CODE","START_DATE","EXPIRATION_DATE","REDEEMED_QUANTITY","STATUS","CREATED_AT"]},"sortDirection":{"type":"string","description":"Sort direction","enum":["ASC","DESC"]}}},"RemoveVoucherAttributesRequest":{"type":"object","properties":{"attributeKeys":{"type":"array","items":{"type":"string"}}}},"VoucherAttributesResponse":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"modifiedAt":{"type":"string"},"modifiedBy":{"type":"string"},"createdAt":{"type":"string"},"createdBy":{"type":"string"},"organizationId":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}}},"PredefinedAttributes":{"type":"object","properties":{"type":{"type":"string","enum":["TEXT","BOOLEAN","MARKDOWN","NUMBER","DATETIME","SINGLE_SELECT"]},"name":{"type":"string"},"title":{"type":"string"},"defaultValue":{"type":"string"},"selectOptions":{"type":"array","items":{"$ref":"#/components/schemas/SelectOptions"}},"helpText":{"type":"string"},"readonly":{"type":"boolean"},"required":{"type":"boolean"},"section":{"type":"string"}}},"SelectOptions":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}}},"VoucherPredefinedAttributesResponse":{"type":"object","properties":{"id":{"type":"string"},"modifiedAt":{"type":"string"},"modifiedBy":{"type":"string"},"createdAt":{"type":"string"},"createdBy":{"type":"string"},"organizationId":{"type":"string"},"attributes":{"type":"array","items":{"$ref":"#/components/schemas/PredefinedAttributes"}}}},"VoucherAttributesRequest":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{"type":"string"}}}},"VoucherPredefinedAttributesRequest":{"type":"object","properties":{"attributes":{"type":"array","items":{"$ref":"#/components/schemas/PredefinedAttributes"}}}},"UpdateVoucherLinkRequest":{"required":["values"],"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}}}},"EntityIdResponse":{"type":"object","properties":{"id":{"type":"string"}}},"ListEntityIdResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64"},"data":{"type":"array","items":{"$ref":"#/components/schemas/EntityIdResponse"}}}},"Discount":{"type":"object","properties":{"type":{"type":"string","enum":["AMOUNT","PERCENT"]},"valueOff":{"type":"number"},"minimumOrderAmount":{"type":"number"},"maxAmountOff":{"type":"number"},"applyAfterTax":{"type":"boolean"}}},"Redemption":{"title":"Redemption.","type":"object","properties":{"quantity":{"type":"integer","format":"int32"},"quantityPerUser":{"type":"integer","format":"int32"},"redeemedQuantity":{"type":"integer","format":"int32"}}},"VoucherResponse":{"type":"object","properties":{"id":{"title":"Voucher id.","type":"string"},"code":{"title":"Voucher code.","type":"string"},"name":{"title":"Voucher name.","type":"string"},"description":{"title":"Description.","type":"string"},"startDate":{"title":"Start date.","type":"string"},"expirationDate":{"title":"Expiration date.","type":"string"},"discount":{"$ref":"#/components/schemas/Discount"},"redemption":{"$ref":"#/components/schemas/Redemption"},"status":{"title":"Status.","type":"string"},"type":{"title":"Type.","type":"string"},"modifiedAt":{"title":"Modified at.","type":"string"},"modifiedBy":{"title":"Modified by.","type":"string"},"createdAt":{"title":"Created at.","type":"string"},"createdBy":{"title":"Created by.","type":"string"}}},"AddVoucherRequest":{"required":["code","description","discount","expirationDate","name","redemption","startDate"],"type":"object","properties":{"name":{"title":"Voucher name.","type":"string"},"description":{"title":"Voucher description.","type":"string"},"type":{"title":"Voucher type.","type":"string","enum":["ORDER","PURCHASABLE"]},"startDate":{"title":"Voucher's activation start date in ISO 8601 date format.","type":"string","example":"2019-01-23T10:02:34Z"},"expirationDate":{"title":"Voucher's activation expiration date in ISO 8601 date format.","type":"string","example":"2019-01-23T10:02:34Z"},"discount":{"$ref":"#/components/schemas/DiscountRequest"},"redemption":{"$ref":"#/components/schemas/RedemptionRequest"},"products":{"title":"Products that can redeem the voucher.","type":"array","items":{"type":"string"}},"categories":{"title":"Categories that can redeem the voucher.","type":"array","items":{"type":"string"}},"users":{"title":"Users that can redeem the voucher.","type":"array","items":{"type":"string"}},"profiles":{"title":"Customer profiles that can redeem the voucher.","type":"array","items":{"type":"string"}},"groups":{"title":"Customer groups that can redeem the voucher.","type":"array","items":{"type":"string"}},"code":{"title":"Voucher code.","type":"string"}}},"DiscountRequest":{"required":["type","valueOff"],"type":"object","properties":{"type":{"title":"Type of discount.","type":"string","enum":["AMOUNT","PERCENT"]},"valueOff":{"title":"Value that will be taken off.","minimum":1,"type":"number"},"minimumOrderAmount":{"title":"Minimum amount of order that can use voucher.","type":"number"},"maxAmountOff":{"title":"Maximum amount can be discounted.","type":"number"},"applyAfterTax":{"title":"Discount price included tax.","type":"boolean"}}},"RedemptionRequest":{"type":"object","properties":{"quantity":{"title":"Number of times a voucher can be redeemed. (0 or null means unlimited)","type":"integer","format":"int32"},"quantityPerUser":{"title":"Number of times a voucher can be redeemed per user. (0 or null means unlimited)","type":"integer","format":"int32"}}},"GenerateVoucherRequest":{"required":["codeConfig","description","discount","expirationDate","name","redemption","startDate","vouchersCount"],"type":"object","properties":{"name":{"title":"Voucher name.","type":"string"},"description":{"title":"Voucher description.","type":"string"},"type":{"title":"Voucher type.","type":"string","enum":["ORDER","PURCHASABLE"]},"startDate":{"title":"Voucher's activation start date in ISO 8601 date format.","type":"string","example":"2019-01-23T10:02:34Z"},"expirationDate":{"title":"Voucher's activation expiration date in ISO 8601 date format.","type":"string","example":"2019-01-23T10:02:34Z"},"discount":{"$ref":"#/components/schemas/DiscountRequest"},"redemption":{"$ref":"#/components/schemas/RedemptionRequest"},"products":{"title":"Products that can redeem the voucher.","type":"array","items":{"type":"string"}},"categories":{"title":"Categories that can redeem the voucher.","type":"array","items":{"type":"string"}},"users":{"title":"Users that can redeem the voucher.","type":"array","items":{"type":"string"}},"profiles":{"title":"Customer profiles that can redeem the voucher.","type":"array","items":{"type":"string"}},"groups":{"title":"Customer groups that can redeem the voucher.","type":"array","items":{"type":"string"}},"vouchersCount":{"title":"Number of vouchers to be generated.","minimum":1,"type":"integer","format":"int32"},"codeConfig":{"$ref":"#/components/schemas/VoucherCodeConfigRequest"}}},"VoucherCodeConfigRequest":{"title":"Defines code's pattern (prefix, suffix, length, charset).","required":["charset","length"],"type":"object","properties":{"length":{"title":"Number of characters in a generated code (excluding prefix and suffix).","type":"integer","format":"int32"},"charset":{"title":"Characters that can appear in the code.","type":"string"},"prefix":{"title":"A text appended before the code.","type":"string"},"suffix":{"title":"A text appended after the code.","type":"string"},"pattern":{"title":"A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.","type":"string"}}},"VoucherEntities":{"type":"object","properties":{"groups":{"title":"Customer groups that can redeem the voucher.","type":"array","items":{"type":"string"}},"profiles":{"title":"Customer profiles that can redeem the voucher.","type":"array","items":{"type":"string"}},"users":{"title":"Users that can redeem the voucher.","type":"array","items":{"type":"string"}},"categories":{"title":"Categories that can redeem the voucher.","type":"array","items":{"type":"string"}},"products":{"title":"Products that can redeem the voucher.","type":"array","items":{"type":"string"}}}},"VoucherWithEntitiesResponse":{"type":"object","properties":{"id":{"title":"Voucher id.","type":"string"},"code":{"title":"Voucher code.","type":"string"},"name":{"title":"Voucher name.","type":"string"},"description":{"title":"Description.","type":"string"},"startDate":{"title":"Start date.","type":"string"},"expirationDate":{"title":"Expiration date.","type":"string"},"discount":{"$ref":"#/components/schemas/Discount"},"redemption":{"$ref":"#/components/schemas/Redemption"},"status":{"title":"Status.","type":"string"},"type":{"title":"Type.","type":"string"},"modifiedAt":{"title":"Modified at.","type":"string"},"modifiedBy":{"title":"Modified by.","type":"string"},"createdAt":{"title":"Created at.","type":"string"},"createdBy":{"title":"Created by.","type":"string"},"entities":{"$ref":"#/components/schemas/VoucherEntities"}}},"ListVoucherWithEntitiesResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64"},"data":{"type":"array","items":{"$ref":"#/components/schemas/VoucherWithEntitiesResponse"}}}},"UpdateVoucherRequest":{"type":"object","properties":{"name":{"title":"Voucher name.","type":"string"},"description":{"title":"Voucher description.","type":"string"},"startDate":{"title":"Voucher's activation start date. (ISO 8601 date format)","type":"string","example":"2023-01-01T00:00:00Z"},"expirationDate":{"title":"Voucher's activation start date. (ISO 8601 date format)","type":"string","example":"2023-12-01T00:00:00Z"},"code":{"title":"Voucher code.","type":"string"},"discount":{"$ref":"#/components/schemas/Discount"},"quantity":{"title":"Quantity.","type":"integer","format":"int32"},"quantityPerUser":{"title":"Quantity per user.","type":"integer","format":"int32"},"status":{"$ref":"#/components/schemas/VoucherStatus"},"type":{"title":"Voucher type.","type":"string","enum":["ORDER","PURCHASABLE"]}}},"VoucherStatus":{"title":"Voucher status.","type":"string","enum":["ACTIVE","INACTIVE"]}},"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://idp.test.bluestonepim.com/op/token","scopes":{"openid profile systemRoles permissions organization email name nickname":"All needed scopes."}}}}}},"x-amazon-apigateway-api-key-source":"AUTHORIZER"}