Reversals
API reference
Requests to retrieve funds from a payment sent in error, such as a duplicate payment or one sent to the wrong account.
Endpoint: /ach/v1/payments/{id}/reversals
POST
https://sandbox.crbcos.com/ach/v1/payments/{id}/reversals
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.crbcos.com/ach/v1/payments/9a3ba6f6-206c-42bf-b266-b339008a2c3e/reversals"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"reason": "IncorrectAmount"`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}See Request and response codes: ACH to learn more about reversal reasons.