---
agentTools:
  projectIndex: https://docs.mundipagg.com/llms.txt
---

# Obter cliente

Através do identificador do cliente (`customer_id`) é possível recuperar seus dados.

<br>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Mundipagg API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.mundipagg.com/core/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/customers/{customer_id}": {
      "get": {
        "summary": "Obter cliente",
        "description": "Através do identificador do cliente (`customer_id`) é possível recuperar seus dados.",
        "operationId": "obter-cliente",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "Código do cliente. Formato `cus_XXXXXXXXXXXXXXXX`.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"cus_6l5dMWZ0hkHZ4XnE\",\n    \"name\": \"Wonderful Woman\",\n    \"email\": \"wonderfulwoman@avengers.com\",\n  \t\"gender\": \"female\",\n    \"delinquent\": false,\n    \"address\": {\n        \"id\": \"addr_ONzp3ZbTvfDJ35k9\",\n        \"line_1\": \"375, Av. General Justo, Centro\",\n        \"line_2\": \"8º andar\",\n        \"zip_code\": \"20021130\",\n        \"city\": \"Rio de Janeiro\",\n        \"state\": \"RJ\",\n        \"country\": \"BR\",\n        \"status\": \"active\",\n        \"created_at\": \"2017-08-22T19:50:44Z\",\n        \"updated_at\": \"2017-08-22T19:50:44Z\"\n    },\n    \"created_at\": \"2017-08-22T19:50:44Z\",\n    \"updated_at\": \"2017-08-22T19:50:51Z\",\n    \"phones\": {},\n    \"metadata\": {\n        \"company\": \"Avengers\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "cus_6l5dMWZ0hkHZ4XnE"
                    },
                    "name": {
                      "type": "string",
                      "example": "Wonderful Woman"
                    },
                    "email": {
                      "type": "string",
                      "example": "wonderfulwoman@avengers.com"
                    },
                    "gender": {
                      "type": "string",
                      "example": "female"
                    },
                    "delinquent": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "addr_ONzp3ZbTvfDJ35k9"
                        },
                        "line_1": {
                          "type": "string",
                          "example": "375, Av. General Justo, Centro"
                        },
                        "line_2": {
                          "type": "string",
                          "example": "8º andar"
                        },
                        "zip_code": {
                          "type": "string",
                          "example": "20021130"
                        },
                        "city": {
                          "type": "string",
                          "example": "Rio de Janeiro"
                        },
                        "state": {
                          "type": "string",
                          "example": "RJ"
                        },
                        "country": {
                          "type": "string",
                          "example": "BR"
                        },
                        "status": {
                          "type": "string",
                          "example": "active"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-08-22T19:50:44Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-08-22T19:50:44Z"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2017-08-22T19:50:44Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2017-08-22T19:50:51Z"
                    },
                    "phones": {
                      "type": "object",
                      "properties": {}
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "company": {
                          "type": "string",
                          "example": "Avengers"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Customer not found.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Customer not found."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "csharp",
              "code": "using MundiAPI.PCL;\nusing System.Web.Mvc;\n\nnamespace MundipaggTest.Controllers {\n\n    public class HomeController : Controller {\n\npublic ActionResult Index() {\n\n    // Secret key fornecida pela Mundipagg\n    string basicAuthUserName = \"SUA_CHAVE_SECRETA\";\n    // Senha em branco. Passando apenas a secret key\n    string basicAuthPassword = \"\";\n\n    var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n    string customerId = \"cus_6l5dMWZ0hkHZ4XnE\";\n\n    var response = client.Customers.GetCustomer(customerId);\n\n    return View();\n}\n}\n}",
              "name": "SDK C#"
            },
            {
              "language": "php",
              "code": "//This example was built using MundiAPI-PHP SDK.\n//For more information, please refer to https://github.com/mundipagg/MundiAPI-PHP\n\n$secretKey = 'YOUR_SECRET_KEY'; //the secret key will be provided by MundiPagg.\n$basicAuthPassword = ''; //fill it with an empty string\n\n$apiClient = new \\MundiAPILib\\MundiAPIClient(\n    $secretKey,\n    $basicAuthPassword\n);\n\n$customersController = $apiClient->getCustomers();\n\n$customerId = \"cus_6l5dMWZ0hkHZ4XnE\";\n\n$result = $customersController->getCustomer($customerId);\n\necho json_encode($result, JSON_PRETTY_PRINT);",
              "name": "SDK PHP"
            },
            {
              "language": "java",
              "code": "package examples.customer;\n\nimport com.mundipagg.api.MundiAPIClient;\nimport com.mundipagg.api.controllers.CustomersController;\nimport com.mundipagg.api.http.client.APICallBack;\nimport com.mundipagg.api.http.client.HttpContext;\nimport com.mundipagg.api.models.GetCustomerResponse;\n\npublic class GetCustomerById {\n\t\n\tpublic static void main(String[] args) {\n\n        String basicAuthUserName = \"YOUR_SECRET_KEY\"; // The username to use with basic authentication\n        String basicAuthPassword = \"\"; // The password to use with basic authentication\n\n        MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n\n        String customerId = \"cus_YL6zwglSxhg2X14g\";\n\n        CustomersController customers_controller = new CustomersController();\n\n        customers_controller.getCustomerAsync(customerId, new APICallBack<GetCustomerResponse>() {\n            @Override\n            public void onSuccess(HttpContext context, GetCustomerResponse response) {\n\n                System.out.println(\"Status response: \" + context.getResponse().getStatusCode());\n                System.out.println(\"Customer found!\");\n                System.out.println(\"Customer ID: \" + response.getId());\n\n            }\n\n            @Override\n            public void onFailure(HttpContext context, Throwable error) {\n\n                System.out.println(\"Status response: \" + context.getResponse().getStatusCode());\n                System.out.println(error.getMessage());\n                error.printStackTrace();\n\n            }\n        });\n    }\n\n}",
              "name": "SDK JAVA"
            },
            {
              "language": "python",
              "code": "from mundiapi.mundiapi_client import MundiapiClient\nfrom mundiapi.models import *\nfrom mundiapi.controllers import *\nfrom mundiapi.exceptions.error_exception import *\n\nMundiapiClient.config.basic_auth_user_name = \"YOUR_SECRET_KEY:\"\ncustomers_controller = customers_controller.CustomersController()\n\nrequest = create_customer_request.CreateCustomerRequest()\nrequest.name = \"sdk customer test\"\nrequest.email = \"tonystark@avengers.com\"\n\ntry:\n    result = customers_controller.create_customer(request)\n    myCustomer = customers_controller.get_customer(result.id)\n    assert result is not None\n    assert myCustomer is not None\n    assert result.id == myCustomer.id\n    print(\"Customer id: \", myCustomer.id)\n\nexcept ErrorException as ex:\n    print(ex.message)\n    print(\"Errors: \", ex.errors)\nexcept Exception as ex:\n    raise ex",
              "name": "SDK PYTHON"
            }
          ],
          "samples-languages": [
            "csharp",
            "php",
            "java",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5aba89f6b169810058a71ea6"
}
```