Customers
List all customers
Returns a list of all your customers.
GET
/
customers
List all customers
curl --request GET \
--url https://pay.chargily.net/test/api/v2/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://pay.chargily.net/test/api/v2/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pay.chargily.net/test/api/v2/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pay.chargily.net/test/api/v2/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pay.chargily.net/test/api/v2/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pay.chargily.net/test/api/v2/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hj0p5s3ygy2mx1czg2wzcc4x",
"entity": "customer",
"name": "Hocine Saad",
"email": null,
"phone": null,
"address": {
"country": "Algeria",
"state": "Tizi-Ouzou",
"address": "123 Main Street"
},
"metadata": null,
"created_at": 1702977791,
"updated_at": 1702977791
},
{
"id": "01hj0rs3s3swmba43ef21rd2nv",
"entity": "customer",
"name": "Mahdi Chawki",
"email": null,
"phone": null,
"address": null,
"metadata": null,
"created_at": 1702980521,
"updated_at": 1702980521
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"last_page": 1,
"last_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"next_page_url": null,
"path": "https://pay.chargily.net/test/api/v2/customers",
"per_page": 10,
"prev_page_url": null,
"total": 2
}
Query parameters
A numeric value indicating the quantity of customers to be returned with the
request, with a minimum value of 1 and a maximum value of 50.
Returns
A key-value array, containing a data property which is an array of customers, limited to a maximum ofper_page value.
{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hj0p5s3ygy2mx1czg2wzcc4x",
"entity": "customer",
"name": "Hocine Saad",
"email": null,
"phone": null,
"address": {
"country": "Algeria",
"state": "Tizi-Ouzou",
"address": "123 Main Street"
},
"metadata": null,
"created_at": 1702977791,
"updated_at": 1702977791
},
{
"id": "01hj0rs3s3swmba43ef21rd2nv",
"entity": "customer",
"name": "Mahdi Chawki",
"email": null,
"phone": null,
"address": null,
"metadata": null,
"created_at": 1702980521,
"updated_at": 1702980521
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"last_page": 1,
"last_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"next_page_url": null,
"path": "https://pay.chargily.net/test/api/v2/customers",
"per_page": 10,
"prev_page_url": null,
"total": 2
}
⌘I
List all customers
curl --request GET \
--url https://pay.chargily.net/test/api/v2/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://pay.chargily.net/test/api/v2/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pay.chargily.net/test/api/v2/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pay.chargily.net/test/api/v2/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pay.chargily.net/test/api/v2/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pay.chargily.net/test/api/v2/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hj0p5s3ygy2mx1czg2wzcc4x",
"entity": "customer",
"name": "Hocine Saad",
"email": null,
"phone": null,
"address": {
"country": "Algeria",
"state": "Tizi-Ouzou",
"address": "123 Main Street"
},
"metadata": null,
"created_at": 1702977791,
"updated_at": 1702977791
},
{
"id": "01hj0rs3s3swmba43ef21rd2nv",
"entity": "customer",
"name": "Mahdi Chawki",
"email": null,
"phone": null,
"address": null,
"metadata": null,
"created_at": 1702980521,
"updated_at": 1702980521
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"last_page": 1,
"last_page_url": "https://pay.chargily.net/test/api/v2/customers?page=1",
"next_page_url": null,
"path": "https://pay.chargily.net/test/api/v2/customers",
"per_page": 10,
"prev_page_url": null,
"total": 2
}