> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Blocked Customers

> List the customers on your blocklist, with filters and a total count.



## OpenAPI

````yaml get /blocklist/customers
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.120.20
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
  - name: Payment Connector Webhooks
  - name: Moderation
  - name: Locales
paths:
  /blocklist/customers:
    get:
      tags:
        - Blocklist
      operationId: list_blocked_customers
      parameters:
        - name: identifier
          in: query
          description: Partial, case-insensitive match on the email and on the customer id.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: blocked_by_email
          in: query
          description: Filter by the dashboard user who blocked the customer.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: created_at_gte
          in: query
          description: Blocked on or after this time.
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: created_at_lte
          in: query
          description: Blocked on or before this time.
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: page_size
          in: query
          description: Page size. Default 10, maximum 100.
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: page_number
          in: query
          description: Page number. Default 0.
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBlockedCustomersResponse'
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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 blockedCustomer of
            client.blocklist.customers.list()) {
              console.log(blockedCustomer.id);
            }
        - lang: Python
          source: |-
            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.blocklist.customers.list()
            page = page.items[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tpage, err := client.Blocklist.Customers.List(context.TODO(), dodopayments.BlocklistCustomerListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import
            com.dodopayments.api.models.blocklist.customers.CustomerListPage;

            import
            com.dodopayments.api.models.blocklist.customers.CustomerListParams;


            public final class Main {
                private Main() {}

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

                    CustomerListPage page = client.blocklist().customers().list();
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import
            com.dodopayments.api.models.blocklist.customers.CustomerListPage

            import
            com.dodopayments.api.models.blocklist.customers.CustomerListParams


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

                val page: CustomerListPage = client.blocklist().customers().list()
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

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

            page = dodo_payments.blocklist.customers.list

            puts(page)
        - lang: PHP
          source: |-
            <?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->blocklist->customers->list(
                blockedByEmail: 'blocked_by_email',
                createdAtGte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
                createdAtLte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
                identifier: 'identifier',
                pageNumber: 0,
                pageSize: 0,
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Blocklist.Customers;

            DodoPaymentsClient client = new();

            CustomerListParams parameters = new();

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

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let result = client
                    .blocklist()
                    .customers()
                    .list()
                    .query(serde_json::json!({}))
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    ListBlockedCustomersResponse:
      type: object
      required:
        - items
        - total
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BlockedCustomerResponse'
        total:
          type: integer
          format: int64
          description: Blocked customers that match the filters, before pagination.
    BlockedCustomerResponse:
      type: object
      required:
        - id
        - customer_id
        - customer_name
        - customer_email
        - identifier
        - source
        - created_at
      properties:
        blocked_by_email:
          type:
            - string
            - 'null'
          description: >-
            Dashboard user who blocked the customer. `null` for an API-key
            caller.
        cancelled_subscription_ids:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Subscriptions this block cancelled. Present on the create response
            only.
        created_at:
          type: string
          format: date-time
        customer_email:
          type: string
        customer_id:
          type: string
        customer_name:
          type: string
        id:
          type: string
        identifier:
          type: string
          description: Customer id or email that the merchant supplied.
        notes:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BlockedCustomerNote'
          description: Activity log. Present on the detail response only.
        reason:
          type:
            - string
            - 'null'
        remaining_subscription_ids:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Subscriptions this block left live, because the cancel failed or the

            inline batch filled up. Repeat the create call to continue; the
            block

            itself is already in force.
        source:
          $ref: '#/components/schemas/BlockedCustomerSource'
        subscriptions_swept:
          type:
            - boolean
            - 'null'
          description: >-
            False when the block left live subscriptions behind, including the
            case

            where the sweep could not list them and `remaining_subscription_ids`
            is

            therefore unknown. Repeat the create call until it reads true.
        unblocked_at:
          type:
            - string
            - 'null'
          format: date-time
    BlockedCustomerNote:
      type: object
      required:
        - id
        - note
        - created_at
      properties:
        author_email:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        id:
          type: string
        note:
          type: string
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    BlockedCustomerSource:
      type: string
      description: |-
        Where a block came from. `Api` marks an API-key caller, which carries no
        dashboard actor. The other values name the screen the merchant used.
      enum:
        - blocklist_page
        - customer_page
        - payment_page
        - dispute_page
        - api
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.