Showing results for 
Search instead for 
Did you mean: 

Cybersource Refunds REST API

In my case: I process the payment and payment went success but somehow my internal API fails where I store the payment details or ledger kind of. Now I want to refund back to customer. So I found out this endpoint "pts/v2/payments/{id}/refunds", where I pass the paymentId in the query param and order info in the body. But the response is

{"submitTimeUtc":"2020-08-18T07:26:18Z","status":"INVALID_REQUEST","reason":"INVALID_DATA","message":"Declined - One or more fields in the request contains invalid data"}

I tried from here too /omeglz the same thing.

I also check out the sample java code

it does the weird things it first creates payment and then refunds it. Please help me out how the flow and whats need to do for this API.