Cancel payment
Relevant webhooks
For this endpoint be sure you have registered for this webhook:
API reference
Cancels an ACH transaction.
Endpoint: /ach/v1/payments/{id}/cancel
POST
https://sandbox.crbcos.com/ach/v1/payments/{id}/cancel
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.crbcos.com/ach/v1/payments/{{id}}/cancel?id=63f87c2b-38e9-438f-a3c8-b07401212511"
method := "POST"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer <token>")
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))
}