GET /api/v1/customers/:id
Show Customers

Retrieves customer personal information. This endpoint does not reveal the saved payment details.

Examples

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

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

get_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/customers/3t9aqamysm8ffhxybe6vkgbcn')
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.get(uri.path, headers)
puts res.body
{
  "id": "3t9aqamysm8ffhxybe6vkgbcn",
  "resource": "customer",
  "email": "alleen@stehr.info",
  "source": null,
  "metadata": {
    "order_id": "abcdefg"
  },
  "created_at": "2020-06-09T07:41:51Z"
}