Skip to main content

Documentation

Delete Customer

Delete a customer profile.

This method triggers the Customer Deleted Webhook. This webhook contains the same information as the response.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string customerId = "cus_d0a21d402a105c38f75948d9500d07a1";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/customers/{customerId}");
        
                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error completing request: " + e.Message);
                    }
                }
            }
        }
        
    • JavaScript

      • const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const result = await makeRequest(
              'DELETE',
              '/v1/customers/cus_f3923ec56a56578b6a18df24d4f32d54'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
        
    • PHP

      • <?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('delete', "/v1/customers/cus_5861b2ec3e7441bfd43756bb491ddf10");
            var_dump($object);
        } catch (Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='delete', path=f'/v1/customers/cus_81b7f135ed36ea4f7e897a793394a5b2')
        pprint(result)
  • /v1/customers/:customer

  • Delete Customer

  • curl -X delete
    https://sandboxapi.rapyd.net/v1/customers/cus_217f61d6757465a9716666ccf4d3ec73
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'salt: your-random-string-here'
    -H 'signature: your-calculated-signature-here'
    -H 'timestamp: your-unix-timestamp-here'
    
  • {
        "status": {
            "error_code": "0",
            "status": "SUCCESS",
            "message": "",
            "operation_id": "a8353412-7907-4bc6-8cab-b5d73d9b8b7f"
        },
        "data": {
            "deleted": true,
            "id": "cus_6585694083539162f772aeb0255c488b"
        }
    }