# MD for: https://www.mercadopago.com.mx/developers/es/docs/automatic-payments-orders/manage-profiles.md \# Profile management After completing the initial configurations, you will be able to access a set of calls for managing the created profiles. In this section, we present the main available operations to manage a profile and how to execute them. :::AccordionComponent{title="Query payment profile"} This operation allows you to query a payment profile associated with a specific customer using an ID, which provides access to all registered information, for example, when you need to confirm profile data before making a new payment or show the user the stored payment method information. To do so, send a \*\*GET\*\* to the endpoint :TagComponent{tag="API" text="Query a specific payment profile" href="/developers/en/reference/automatic-payments/payment-profiles/retrieve-profile/get"} considering the parameters listed in the table below the code. \`\`\`curl curl -X GET \\ 'https://api.mercadopago.com/v1/customers/{{customer\_id}}/payment-profiles/{{payment\_profile\_id}}' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer {{access\_token}}' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`customer\_id\` | \_Path.String\_ | Unique identifier of the customer whose payment profile is being queried. | Required | | \`payment\_profile\_id\` | \_Path.String\_ | Unique identifier of the payment profile, associated with the customer. | Required | > SUCCESS\_MESSAGE > > For more details on the parameters to be sent in this request and possible processing errors, see our \[API Reference\](https://www.mercadopago.com.mx/developers/en/reference/automatic-payments/payment-profiles/retrieve-profile/get). In case of success, the returned response will follow the format shown in the example below. \`\`\`json { "id": "7036b192b541454fa9b9990660dfa1b5", "created\_date": "2024-05-22T14:03:28.653Z", "last\_updated\_date": "2024-05-22T14:03:28.653Z", "description": "Payment description", "max\_day\_overdue": 5, "statement\_descriptor": "Test Descriptor", "status": "READY", "sequence\_control": "AUTO", "payment\_methods": \[ { "payment\_method\_id": "64abf0f5-3e15-48a5-9be0-a8ac56bbd87a", "id": "visa", "type": "credit\_card", "card\_id": 1234567890, "status": "READY", "default\_method": true } \] } \`\`\` ::: :::AccordionComponent{title="Query payment profile list"} This operation allows you to query the list of payment profiles associated with a customer through their ID, being useful when you need to identify which profiles the customer has to choose which one will be used in subsequent payments. To do so, send a \*\*GET\*\* to the endpoint :TagComponent{tag="API" text="Query payment profile list" href="/developers/en/reference/automatic-payments/payment-profiles/get"} considering the parameters listed in the table below the code. \`\`\`curl curl -X GET \\ 'https://api.mercadopago.com/v1/customers/{{customer\_id}}/payment-profiles?limit=50&status=READY' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer {{access\_token}}' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`customer\_id\` | \_Header.String\_ | Unique identifier of the customer for whom payment profiles are being queried. | Required | | \`limit\` | \_Query.Integer\_ | Pagination limit. Specifies the maximum number of records you want to get in the response. Must be a numeric value between 1 and 100, with 50 being the default value. | Optional | | \`offset\` | \_Query.Integer\_ | Pagination offset. Determines the starting point from which records should be retrieved. Must be a numeric value greater than or equal to zero (0). | Optional | | \`status\` | \_Query.String\_ | Current status of the payment profile. Send it if you want to filter profiles by status. | Optional | > SUCCESS\_MESSAGE > > For more details on the parameters to be sent in this request and possible processing errors, see our \[API Reference\](https://www.mercadopago.com.mx/developers/en/reference/automatic-payments/payment-profiles/get). In case of success, the returned response will follow the format shown in the example below. \`\`\`json { "paging": { "total": 10, "total\_pages": 100, "offset": 1, "limit": 10 }, "data": \[ { "id": "7036b192b541454fa9b9990660dfa1b5", "created\_date": "2024-05-22T14:03:28.653Z", "last\_updated\_date": "2024-05-22T15:03:28.653Z", "description": "Simple description", "max\_day\_overdue": 5, "statement\_descriptor": "Statement description", "status": "READY", "sequence\_control": "AUTO", "payment\_methods": \[ { "payment\_method\_id": "64abf0f5-3e15-48a5-9be0-a8ac56bbd87a", "id": "visa", "type": "credit\_card", "card\_id": 1234567890, "status": "READY", "default\_method": true } \] } \] } \`\`\` ::: :::AccordionComponent{title="Add payment method to a profile"} This operation allows you to add a new payment method to the customer's profile or update an existing one, including the possibility of adjusting the \`default\_method\` field to \`true\` or \`false\`, thus defining whether it will be the default payment method or not. > NOTE > > Updates can only be made for one payment method at a time. If you want to add more than one payment method to the same profile, you will need to send a request for each method you want to register. To add a payment method, send a \*\*POST\*\* to the endpoint :TagComponent{tag="API" text="Add payment method to a profile" href="/developers/en/reference/automatic-payments/payment-profiles/add-payment-method/post"} considering the parameters listed in the table below the code. \`\`\`curl curl -X POST \\ 'https://api.mercadopago.com/v1/customers/{{customer\_id}}/payment-profiles/{{payment\_profile\_id}}/payment-methods' \\ -H 'Content-Type: application/json' \\ -H 'X-Idempotency-Key: {{x\_idempotency\_key}}' \\ -H 'Authorization: Bearer {{access\_token}}' \\ -d '{ "id": "{{card\_brand}}", "type": "credit\_card", "token": "{{card\_token}}", "default\_method": true }' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`X-Idempotency-Key\` | \_Header.String\_ | Idempotency key. Allows you to safely repeat requests, preventing the same action from being processed more than once. We recommend using a UUID V4 or random \_strings\_. | Required | | \`Authorization\` | \_Header.String\_ | Private key used to authenticate requests. Use your test Access Token in the development environment and your production Access Token in the production environment. | Required | | \`customer\_id\` | \_Path.String\_ | Unique identifier of the customer to whom the payment profile being modified belongs. | Required | | \`payment\_profile\_id\` | \_Path.String\_ | Unique identifier of the payment profile to modify, associated with the customer. | Required | | \`id\` | \_Body.String\_ | Identifier of the selected payment method. For card payments, indicate the brand (visa, master, debmaster, debvisa). | Required | | \`type\` | \_Body.String\_ | Type of the selected payment method: \`credit\_card\`, \`debit\_card\`, \`prepaid\_card\`. | Required | | \`token\` | \_Body.String\_ | Secure token that identifies the payment method. It is required for card transactions and must be between 32 and 33 characters. | Required for card | | \`card\_id\` | \_Body.Long\_ | ID of the card associated with the payment method. | Required | | \`default\_method\` | \_Body.Boolean\_ | Defines whether this method will be used as the default in future payment attempts. | Optional | > SUCCESS\_MESSAGE > > For more details on the parameters to be sent in this request and possible processing errors, see our \[API Reference\](https://www.mercadopago.com.mx/developers/en/reference/automatic-payments/payment-profiles/add-payment-method/post). In case of success, the returned response will follow the format shown in the example below. \`\`\`json { "payment\_method\_id": "64abf0f5-3e15-48a5-9be0-a8ac56bbd87a", "id": "visa", "type": "credit\_card", "card\_id": 1234567890, "status": "READY", "default\_method": true } \`\`\` When adding a payment method to a profile, the API automatically performs its validation to verify if it can be used in future charges. The result of this validation is indicated by the \`status\` field, which shows the current status of the payment method. Learn more about the payment method status checking our \[documentation\](https://www.mercadopago.com.mx/developers/es/docs/automatic-payments-orders/profile-payment-methods-status). ::: :::AccordionComponent{title="Delete payment method from profile"} This operation allows you to delete a payment method from a profile, which may be necessary when the user chooses to remove a card they no longer want to use or when the method is no longer valid for future charges. To do so, send a \*\*DELETE\*\* to the endpoint :TagComponent{tag="API" text="Delete payment method from a profile" href="/developers/en/reference/automatic-payments/payment-profiles/delete-payment-method/delete"} considering the parameters listed in the table below the code. \`\`\`curl curl -X DELETE \\ 'https://api.mercadopago.com/v1/customers/{{customer\_id}}/payment-profiles/{{payment\_profile\_id}}/payment-methods/{{payment\_method\_id}}' \\ -H 'Content-Type: application/json' \\ -H 'X-Idempotency-Key: {{x\_idempotency\_key}}' \\ -H 'Authorization: Bearer {{access\_token}}' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`X-Idempotency-Key\` | \_Header.String\_ | Allows you to safely repeat requests without the risk of executing the same action twice by mistake. Use a unique value (for example, UUID v4 or random string) to ensure request uniqueness. | Required | | \`Authorization\` | \_Header.String\_ | Private key used to authenticate requests. Use your test Access Token in the development environment and your production Access Token in the production environment. | Required | | \`customer\_id\` | \_Path.String\_ | Unique identifier of the customer whose payment profile is being canceled. | Required | | \`payment\_profile\_id\` | \_Path.String\_ | Unique identifier of the payment profile to cancel, associated with the customer. | Required | | \`payment\_method\_id\` | \_Path.String\_ | Unique identifier of the payment method to delete from the profile, obtained in the response to profile creation. | Required | In case of success, the response will return a \`status 202\`, which confirms its correct processing. ::: :::AccordionComponent{title="Cancel payment profile"} This operation allows you to cancel a payment profile linked to a customer through their respective IDs, being used when the profile will no longer be used for future charges or when it is necessary to register a new profile from the beginning. To do so, send a \*\*POST\*\* to the endpoint :TagComponent{tag="API" text="Cancel payment profile" href="/developers/en/reference/automatic-payments/payment-profiles/cancel-profile/post"} considering the parameters listed in the table below the code. \`\`\`curl curl -X POST \\ 'https://api.mercadopago.com/v1/customers/{{customer\_id}}/payment-profiles/{{payment\_profile\_id}}/cancel' \\ -H 'Content-Type: application/json' \\ -H 'X-Idempotency-Key: {{x\_idempotency\_key}}' \\ -H 'Authorization: Bearer {{access\_token}}' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`X-Idempotency-Key\` | \_Header.String\_ | Allows you to safely repeat requests without the risk of executing the same action twice by mistake. Use a unique value (for example, UUID v4 or random string) to ensure request uniqueness. | Required | | \`Authorization\` | \_Header.String\_ | Private key used to authenticate requests. Use your test Access Token in the development environment and your production Access Token in the production environment. | Required | | \`customer\_id\` | \_Path.String\_ | Unique identifier of the customer whose payment profile is being canceled. | Required | | \`payment\_profile\_id\` | \_Path.String\_ | Unique identifier of the payment profile to cancel, associated with the customer. | Required | In case of success, the response will return a \`status 202\`, which confirms its correct processing. ::: If you want to check the main statuses that a payment profile can have, as well as the statuses of its associated payment methods, access the \[documentation\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/profile-payment-methods-status).