🇬🇧
Yativo Documentation
Spanish
English
English
  • Yativo
  • Introduction to Yativo
    • Financial Infrastructure
    • About Us
  • Dashboard
  • Business Plans
  • Getting Started with Yativo API
  • Yativo API Glossary
  • API reference
    • Misc.
      • Countries
      • States
      • City
  • Security and Authentication
    • Security
    • Authentication
    • Idempotency in API Requests
  • Environment
    • Environments
  • Notifications
    • Webhook
  • Compliance
    • Verification
      • KYC
      • KYB
      • KYC/KYB Update
      • KYC Status
      • Global Business Search
    • Supported Jurisdiction
    • Supported Countries, Currencies and Payment Method
  • User Management
    • Customer
      • Get Customers
      • Retrieve customer
      • Add Customer
  • Payments
    • Currencies
    • Crypto Wallets
      • Generate Wallet Address
      • Fetch Wallet Address
      • Crypto Deposit History
      • Single crypto deposit history
    • Payout
      • Payout
      • Get Payouts
      • Get Payout
      • Beneficiaries
        • Get Beneficiaries
        • Add Beneficiary Payment Details
        • Update Beneficiary
        • Archive Beneficiary
        • Add Beneficiary
    • Payin
    • Virtual Cards
      • Supported Currency, Country
      • Create card
      • Fetch card
      • Top up card
      • Get Transactions
      • Freeze and Unfreeze Card
    • Virtual Accounts
      • Create VIrtual Accounts
        • USD Virtual Account
        • Mexico Virtual Account
        • Brazil PIX QR
      • Virtual Account Management
      • Transaction History
  • Foreign Exchange
    • Exchange Rate
      • Request Quote
  • Transactions
    • Transaction Summary
    • Get Single Transaction
  • Crypto System
    • Yativo Crypto Platform API
Powered by GitBook
On this page
  1. User Management
  2. Customer

Delete Customer

DELETE Customer Endpoint - Yativo

The DELETE /customer/{{customer_id}} endpoint allows you to delete a specific customer profile using their unique customer ID. This endpoint is useful for closing a customer account within your application or for performing operations that require customer details.

Key Features:

  1. HTTP Method: DELETE

  2. Endpoint URL: /customer/{{customer_id}}

  3. Authentication: Requires Bearer token to ensure secure access.

Response Structure:

  • Status Code: 200 OK on success, with other codes indicating various errors (e.g., 401 Unauthorized, 404 Not Found).

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Request sample and Response

import requests

customer_id = "5ae2f659-45d2-4256-9f82-2811726a5376" //example customer ID
url = f"{{baseUrl}}/customer/{customer_id}"
headers = {
    "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}

response = requests.delete(url, headers=headers)
print(response.text)
const customer_id = "5ae2f659-45d2-4256-9f82-2811726a5376"; // example customer ID
const url = `{{baseUrl}}/customer/${customer_id}`;

const options = {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9'
  }
};

fetch(url, options)
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok ' + response.statusText);
    }
    return response.json();
  })
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
$customer_id = "5ae2f659-45d2-4256-9f82-2811726a5376"; // example customer ID
$url = "{{baseUrl}}/customer/" . $customer_id;

$headers = array(
  'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9'
);

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => $headers
));

$response = curl_exec($curl);

if (curl_errno($curl)) {
  echo 'Error:' . curl_error($curl);
} else {
  echo $response;
}

curl_close($curl);

success response
{
  "message": "Customer successfully deleted"
}
{
  "error": "Customer not found"
}
{
  "error": "Unauthorized access"
}

Last updated 9 months ago