Endpoint:
POST /v2/payments/voucher

Authentication:
Grant_type: client_credentials
Scopes: [ credit ]

Headers:
Content-Type: application/json
Authentication: Bearer %access_token%

Request body:
{
  "user": "string",
  "voucherCode": "string",
  "description": "string"
}


Response body:
{
  "paymentId": "string",
  "amount": 0
}
CODE

Note that the %access_token% needs to be replaced by the token you received as a response from auth endpoint.

The endpoint is used to refund the voucher generated prior to calling this endpoint. The request body should contain user name of the user that should receive the credit and a voucherCode. The response is the paymentId that was created and the amount of credit that voucher added to the user. This payment is not yet committed and another endpoint should be called to commit the payment and actually make a change.