🛰️
xPay.Stream
  • 📡xPay.Stream
  • 📌Prerequisites
  • Authentication API
  • Wallets
    • Create Wallet
    • Update Wallet
    • Get Wallet Info
    • Search Wallets
  • Billing
    • Create Bill
    • Cancel Bill
    • Get Bill Info
    • Search Bills
  • Transactions
    • 〰️Preview Transaction
    • ✔️Broadcast Transaction
    • 🔎Search Transactions
  • Notifications
    • Webhook
    • Email Alerts
Powered by GitBook
On this page
  1. Billing

Cancel Bill

Cancel an active bill

PreviousCreate BillNextGet Bill Info

Last updated 9 months ago

API Endpoint

POST


Request Headers:

Authorization: Bearer

Content-Type: application/json Request Body:

{
    "reference":"<billRef>" // bill unique reference
}

Success Response

{
    "success": {
        "message": "Bill Canceled",
        "data": null
    },
    "uuid": "d8012583-e2c5-4778-9eda-bbf0313c1646"
}

curl 'https://apis.xpay.stream/client/wallets/save'    \
  -H 'Content-Type: application/json'                  \
  -H 'Authorization: Bearer <access_token>'            \
  --data-raw '{"reference":"<billRef>"}'              
// npm i cross-fetch
const fetch = require("cross-fetch");

const API_URL = "https://apis.xpay.stream/client/wallets/save";

const method = "POST";

const headers = { 
    "Content-Type": "application/json",
    "Authorization": "Bearer <access_token>"
};

const body = JSON.stringify({
    "reference":"<billRef>"
});

fetch(API_URL, { headers, body, method })
.then(async res =>  await res.json())
.then(result => {
    if(result.error)
        console.log("Bill Cancel Error", result);
    if(result.success)
        console.log("Bill Canceled", result);
})
.catch((err) => {
    console.error("Bill Cancel API Exception", err);
});

/client/bills/
cancel
<access_token>