Skip to main content
DELETE
/
v1
/
ugwo
/
{ugwoUid}
curl -X DELETE https://api.kwugwo.africa/v1/ugwo/ugw.VCvr.7K2qPmRtV9xLnQ8sD1cYwHfE \
  -H "Authorization: Bearer $KWUGWO_SECRET_KEY"
await fetch(`https://api.kwugwo.africa/v1/ugwo/${ugwoUid}`, {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.KWUGWO_SECRET_KEY}` },
});
<?php
$ch = curl_init("https://api.kwugwo.africa/v1/ugwo/{$ugwoUid}");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . getenv('KWUGWO_SECRET_KEY')],
]);
$ugwo = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

requests.delete(
    f"https://api.kwugwo.africa/v1/ugwo/{ugwo_uid}",
    headers={"Authorization": f"Bearer {os.environ['KWUGWO_SECRET_KEY']}"},
)
url := fmt.Sprintf("https://api.kwugwo.africa/v1/ugwo/%s", ugwoUid)
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KWUGWO_SECRET_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
{
  "uid": "ugw.VCvr.7K2qPmRtV9xLnQ8sD1cYwHfE",
  "status": "cancelled",
  "amount": 500000,
  "currency": "NGN"
}
{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "Conflict",
  "status": 409,
  "detail": "ugwo.error.cannot_cancel"
}
Moves the ugwo to the cancelled status. Use this to close out abandoned carts or orders the customer aborted.
An ugwo can only be cancelled while it is in requires_ugwo. Once any activity has been started against it (and certainly once it has been paid), the cancel call returns an error. There are no refunds via cancel; refunds are handled separately.
Current statusResult
requires_ugwoTransitions to cancelled.
processing / ugwo_successful / refunded / partially_refunded / cancelled409 Conflict.

Path parameters

ugwoUid
string
required
The ugwo ID, ugw.XXXX.YYYY....

Response

Returns the cancelled ugwo with status: "cancelled".
curl -X DELETE https://api.kwugwo.africa/v1/ugwo/ugw.VCvr.7K2qPmRtV9xLnQ8sD1cYwHfE \
  -H "Authorization: Bearer $KWUGWO_SECRET_KEY"
await fetch(`https://api.kwugwo.africa/v1/ugwo/${ugwoUid}`, {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.KWUGWO_SECRET_KEY}` },
});
<?php
$ch = curl_init("https://api.kwugwo.africa/v1/ugwo/{$ugwoUid}");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . getenv('KWUGWO_SECRET_KEY')],
]);
$ugwo = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

requests.delete(
    f"https://api.kwugwo.africa/v1/ugwo/{ugwo_uid}",
    headers={"Authorization": f"Bearer {os.environ['KWUGWO_SECRET_KEY']}"},
)
url := fmt.Sprintf("https://api.kwugwo.africa/v1/ugwo/%s", ugwoUid)
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KWUGWO_SECRET_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
{
  "uid": "ugw.VCvr.7K2qPmRtV9xLnQ8sD1cYwHfE",
  "status": "cancelled",
  "amount": 500000,
  "currency": "NGN"
}
{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "Conflict",
  "status": 409,
  "detail": "ugwo.error.cannot_cancel"
}