Saltar al contenido principal
GET
/
customers
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const customer of client.customers.list()) {
  console.log(customer.business_id);
}
import os
from dodopayments import DodoPayments

client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
page = client.customers.list()
page = page.items[0]
print(page.business_id)
package main

import (
"context"
"fmt"

"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)

func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
page, err := client.Customers.List(context.TODO(), dodopayments.CustomerListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.dodopayments.api.example;

import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.CustomerListPage;
import com.dodopayments.api.models.customers.CustomerListParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

CustomerListPage page = client.customers().list();
}
}
package com.dodopayments.api.example

import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.CustomerListPage
import com.dodopayments.api.models.customers.CustomerListParams

fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

val page: CustomerListPage = client.customers().list()
}
require "dodopayments"

dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)

page = dodo_payments.customers.list

puts(page)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;

$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);

try {
$page = $client->customers->list(
createdAtGte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
createdAtLte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
email: 'email',
name: 'name',
pageNumber: 0,
pageSize: 0,
);

var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}
using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Customers;

DodoPaymentsClient client = new();

CustomerListParams parameters = new();

var page = await client.Customers.List(parameters);
await foreach (var item in page.Paginate())
{
Console.WriteLine(item);
}
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let result = client
.customers()
.list()
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}
curl --request GET \
--url https://test.dodopayments.com/customers \
--header 'Authorization: Bearer <token>'
{
  "items": [
    {
      "business_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "customer_id": "<string>",
      "email": "<string>",
      "name": "<string>",
      "metadata": {},
      "phone_number": "<string>"
    }
  ]
}

Autorizaciones

Authorization
string
header
requerido

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parámetros de consulta

page_size
integer<int32>

Page size default is 10 max is 100

Rango requerido: x >= 0
page_number
integer<int32>

Page number default is 0

Rango requerido: x >= 0
email
string

Filter by customer email

name
string

Filter by customer name (partial match, case-insensitive)

created_at_gte
string<date-time>

Filter customers created on or after this timestamp

created_at_lte
string<date-time>

Filter customers created on or before this timestamp

Respuesta

Customers List

items
object[]
requerido
Última modificación el 1 de abril de 2026