Skip to content
HitchPay API Docs

CARDS

Withdraw from Card

Pull funds from the card back to your business USD wallet.

POST /v1/cards/:tracking_id/withdraw

Use this endpoint to

  • Recover the unused balance from a card back into your wallet
  • Empty a card's balance before terminating it

Request

Path parameters

Parameter Type Required Description
tracking_id string Yes Card id from Issue Card

Body parameters

Field Type Required Description
amount number Yes Amount in USD to pull from the card

Note: The wallet is credited only after the funds actually leave the card.


Code Samples

const response = await fetch(
  "https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/withdraw",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_ACCESS_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ amount: 30 })
  }
);

const data = await response.json();
console.log(data);
<?php

$ch = curl_init();

curl_setopt_array($ch, [
  CURLOPT_URL => "https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/withdraw",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode(["amount" => 30]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
    "Content-Type: application/json"
  ]
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
import requests

url = "https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/withdraw"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}
payload = {"amount": 30}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Response

{
  "status": "success",
  "message": "Card withdrawal successful",
  "data": {
    "tracking_id": "EXTCARD…",
    "amount": 30,
    "currency": "USD",
    "balance": 45.00,
    "reference": "CWTD…"
  }
}

Fields

Field Type Description
tracking_id string Card id
amount number Amount withdrawn
currency string USD
balance number Card balance after this withdrawal
reference string Our transaction id for this withdrawal event

Errors

Code Meaning
INVALID_REQUEST Missing/invalid amount, e.g. non-positive or exceeding card balance
UNAUTHORIZED Business not found or inactive
NOT_FOUND Card not found
CARD_NOT_READY Card is still provisioning
CARD_TERMINATED The card has been permanently closed
REQUEST_FAILED The card partner rejected the operation

Questions? Email [email protected]. Also on GitBook.