DELETE /api/v1/customers/:id
Destroy Customers

Deletes the customer with the given id. This completely erases the stored payment details from our database.

Examples

  • cURL
  • Node.js
  • Ruby
curl -X DELETE https://komoju.com/api/v1/customers/3wtumoz052h6rond8um098u4o \
  -u sk_123456:
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var delete_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/customers/3wtumoz052h6rond8um098u4o',
  method: 'DELETE',
  headers: {
    'Authorization': auth
  }
};

var delete_req = https.request(delete_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

delete_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/customers/3wtumoz052h6rond8um098u4o')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
  'Content-Type' => 'application/json',
  'Authorization' => "Basic #{auth}"
}

res = https.delete(uri.path, '{}', headers)
puts res.body
{
  "id": "3wtumoz052h6rond8um098u4o",
  "resource": "customer",
  "email": "elvinskiles@armstrong.com",
  "source": null,
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2020-06-09T07:41:51Z"
}