# Search in subscriptions Search for subscriptions by using different parameters. **GET** `/preapproval/search` ## Request parameters ### Path - `q` (string, optional) Free search field. - `payer_id` (number, optional) Unique customer ID to find related subscriptions. - `payer_email` (string, optional) Allows you to search for subscriptions registered with this email. - `preapproval_plan_id` (string, optional) Specifies a plan ID for filtering results from the search. - `transaction_amount` (number, optional) Specifies a subscription amount for filtering results from the search. - `semaphore` (string, optional) Specifies the control status of the subscription. - `status` (string, optional) Specifies a status for filtering results from the export. Can be null, one or many. - `sort` (string, optional) Specifies the type of sorting selected to retrieve the subscriptions. You must indicate a field and a sort type with the following format field_name:sort_type. - `offset` (number, optional) Specifies the offset of the first item in the collection to return. - `limit` (number, optional) Specifies the maximum number of items to return. ## Response parameters - `paging` (object, optional) Information for pagination of search results. - `paging.offset` (number, optional) The offset of the first item in the collection to return. - `paging.limit` (number, optional) The maximum number of entries to return. - `paging.total` (number, optional) The total number of items in the collection. - `results` (array, optional) The page of items. This will be an empty array if there are no results. - `results[].id` (string, optional) Unique subscription identifier. - `results[].version` (number, optional) Indicates how many times the subscription was modified. - `results[].application_id` (number, optional) Unique ID that identifies your application/integration. One of the keys in the pair that make up the credentials that identify an application/integration in your account. - `results[].collector_id` (number, optional) Unique ID that identifies your user as a seller. This ID matches your User ID in our ecosystem. - `results[].preapproval_plan_id` (string, optional) Unique subscription plan identifier. This parameter is only available when it is a subscription with a plan and indicates from which plan the subscription was created. - `results[].reason` (string, optional) It is a short description that the subscriber will see during the checkout process and in the notifications. It is only required for subscriptions without a plan. - `results[].external_reference` (string, optional) Reference to sync with your system. This is a free text field to help you with your integration to link the entities. - `results[].back_url` (string, optional) Successful return URL. Use this setting to redirect your customers to your site after our checkout. - `results[].init_point` (string, optional) URL to checkout to add or modify payment method. - `results[].auto_recurring` (object, optional) Configuration data for recurrence. - `results[].auto_recurring.frequency` (number, optional) Indicates the frequency value. Together with frequency_type they define the invoice cycle that a subscription will have. - `results[].auto_recurring.frequency_type` (string, optional) Indicates the type of frequency. Together with frequency they define the invoice cycle that a subscription will have. Possible enum values: - `days` Indicate a frequency in units of days. - `months` Indicate a frequency in units of months. - `results[].auto_recurring.start_date` (string, optional) Date from which the subscription will be active and we start collecting invoices. - `results[].auto_recurring.end_date` (string, optional) Date until which the subscription will be active and we will stop charging invoices. - `results[].auto_recurring.currency_id` (string, optional) ID of the currency used in the payment. - `results[].auto_recurring.transaction_amount` (number, optional) Amount we will charge on each invoice. - `results[].auto_recurring.free_trial` (object, optional) Free trial data. - `results[].auto_recurring.free_trial.frequency` (number, optional) Indicates the frequency value. Together with frequency_type they define the invoice cycle that a subscription will have. - `results[].auto_recurring.free_trial.frequency_type` (string, optional) Indicates the type of frequency. Together with frequency they define the invoice cycle that a subscription will have. Possible enum values: - `days` Indicate a frequency in units of days. - `months` Indicate a frequency in units of months. - `results[].first_invoice_offset` (number, optional) Number of days to collect the first invoice. - `results[].payer_id` (number, optional) Unique customer identifier. This is created from the email you used to create the subscription. - `results[].payer_first_name` (string, optional) Customer name. - `results[].payer_last_name` (string, optional) Customer lastname. - `results[].card_id` (number, optional) Unique identifier to retrieve data from the card used as a payment method. - `results[].payment_method_id` (string, optional) Payment method configured. - `results[].next_payment_date` (string, optional) Date of the next payment debit. - `results[].date_created` (string, optional) Creation date. - `results[].last_modified` (string, optional) Date of last modification. - `results[].summarized` (object, optional) Summary information on subscription invoices and charges. - `results[].summarized.quotas` (number, optional) How many payments are going to be made. - `results[].summarized.charged_quantity` (number, optional) Total charged of charged quotas. - `results[].summarized.charged_amount` (number, optional) Total amount collected to date. - `results[].summarized.pending_charge_quantity` (number, optional) Pending quotas to charge. - `results[].summarized.pending_charge_amount` (number, optional) Amount pending collection. - `results[].summarized.last_charged_date` (number, optional) Date of last charge. - `results[].summarized.last_charged_amount` (number, optional) Date of last charged amount. - `results[].summarized.semaphore` (number, optional) Subscription collection status summary. Possible enum values: - `green` All collections made. - `yellow` With collection problems. We are trying to collect an invoice. - `red` With pending collections. An invoice could not be collected. - `blank` Discounted collection. - `results[].status` (string, optional) Status Possible enum values: - `pending` Preapproval without a payment method. - `authorized` Preapproval with a valid payment method. - `paused` Preapproval with temporally discontinued collection of payments. - `canceled` Preapproval terminated. This is an irreversible state. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 400 | Bad request | | 401 | 401 | Unauthorized | | 500 | 500 | Error | ## Request example ### cURL ```bash curl -X GET \ 'https://api.mercadopago.com/preapproval/search' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` ## Response example ```json { "paging": { "offset": 0, "limit": 20, "total": 100 }, "results": [ { "id": "2c938084726fca480172750000000000", "version": 0, "application_id": 1234567812345678, "collector_id": 100200300, "preapproval_plan_id": "2c938084726fca480172750000000000", "reason": "Yoga classes.", "external_reference": 23546246234, "back_url": "https://www.mercadopago.com.ar", "init_point": "https://www.mercadopago.com.ar/subscriptions/checkout?preapproval_id=2c938084726fca480172750000000000", "auto_recurring": { "frequency": 1, "frequency_type": "months", "start_date": "2020-06-02T13:07:14.260Z", "end_date": "2022-07-20T15:59:52.581Z", "currency_id": "COP", "transaction_amount": "24.50", "free_trial": { "frequency": null, "frequency_type": null } }, "first_invoice_offset": 7, "payer_id": 123123123, "payer_first_name": "Sofia", "payer_last_name": "Rodríguez", "card_id": 123123123, "payment_method_id": "master", "next_payment_date": "2022-01-01T11:12:25.892-04:00", "date_created": "2022-01-01T11:12:25.892-04:00", "last_modified": "2022-01-01T11:12:25.892-04:00", "summarized": { "quotas": 6, "charged_quantity": 3, "charged_amount": "24.50", "pending_charge_quantity": 1, "pending_charge_amount": 200, "last_charged_date": "2022-01-01T11:12:25.892-04:00", "last_charged_amount": 100, "semaphore": "green" }, "status": "pending" } ] } ```