Cancel a PayID
POSThttps://api.cleverhub.co/api/v1/payment_requests/cancel_payid
Cancel an active pending
PayID transaction, which will deregister the PayID and update the transaction status to expired
. This action is irreversible and will prevent the PayID from being used for further transactions.
This endpoint is useful when a customer decides not to complete the payment, or if the PayID needs to be invalidated for other reasons. Once cancelled, the PayID will no longer be recognised as valid within the system.
Request
- application/json
Bodyrequired
payidstringrequired
The unique PayID to be cancelled, associated with the pending transaction.
Example:
abc.xyz@example.co
Responses
- 200
- 400
- 401
- 422
PayID cancelled successfully.
- application/json
- Schema
- Example (auto)
Schema
payidstring
The PayID that was cancelled.
Example:
abc.xyz@example.co
{
"payid": "abc.xyz@example.co"
}
Bad Request
Unauthorized
Unprocessable Entity
Authorization: app-id
name: app-idtype: apiKeyin: headerdescription: A unique identifier assigned to each application.
name: secret-keytype: apiKeyin: headerdescription: A secure token associated with the `app-id`.
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v1/payment_requests/cancel_payid");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("app-id", "<app-id>");
request.Headers.Add("secret-key", "<app-id>");
var content = new StringContent("{\n \"payid\": \"abc.xyz@example.co\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear