Overview
The Customers API allows you to create and manage customer records in Mercado Pago, retrieve customer information, and manage their saved payment cards. This is useful for storing customer payment methods for future transactions.Create Customer
Creates a new customer record in Mercado Pago.Endpoint
Request Parameters
Customer email address. Must be a valid email format.
Customer first name
Customer last name
Customer phone information
Customer identification document
Customer default address
Custom metadata object for additional information
Request Example
Response
Indicates if the request was successful
The customer object returned by Mercado Pago
Additional metadata (typically empty)
cURL Example
Get Customer
Retrieves details of a specific customer.Endpoint
Path Parameters
The unique identifier of the customer to retrieve
Response
Indicates if the request was successful
Complete customer object with all details including saved cards
cURL Example
Add Card to Customer
Adds a tokenized card to a customer’s saved payment methods.Endpoint
Path Parameters
The unique identifier of the customer
Request Parameters
Card token generated by Mercado Pago’s tokenization service
Request Example
Response
Indicates if the request was successful
The card object returned by Mercado Pago
cURL Example
Delete Customer Card
Removes a saved card from a customer’s payment methods.Endpoint
Path Parameters
The unique identifier of the customer
The unique identifier of the card to delete
Response
Indicates if the request was successful
Confirmation object from Mercado Pago
cURL Example
Error Response
Implementation Notes
Availability
These endpoints are protected by themercadopago.demo middleware and only respond when:
MERCADOPAGO_ENABLE_DEMO_ROUTES=truein configuration- Application environment is
localortesting
404.
Controller Reference
Implemented in:src/Http/Controllers/Api/CustomerController.php
store()method: line 15show()method: line 26storeCard()method: line 35destroyCard()method: line 47
- Customer creation:
src/Http/Requests/CreateCustomerRequest.php:16 - Card storage:
src/Http/Requests/StoreCustomerCardRequest.php:16
Related Services
- CustomerService - Service layer for customer operations
- CardService - Service layer for card operations
Related Guides
- Managing Customers - Complete guide on customer management
- Saved Cards - Working with saved payment methods
Best Practices
Card Tokens: Card tokens must be generated using Mercado Pago’s client-side tokenization. Never send raw card data through your server.