# Mercado Pago

> Find and manage Mercado Pago payments, refunds and subscriptions.

App · 13 actions. Web page: https://docs.lodol.com/docs/integrations/mercado-pago

## Actions

### Cancel payment

Cancel payment.

**Inputs**

- Payment ID (`payment_id`, text, required): Payment ID from Search payments.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "date_created": "example",
    "date_last_updated": "example",
    "external_reference": "example",
    "id": 1,
    "status": "example"
  }
}
```

### Create checkout preference

Create checkout preference.

**Inputs**

- Items (`items`, list, required): Each item has a title, quantity, currency_id and unit_price.
- External reference (`external_reference`, text): Your internal order reference.
- Expires (`expires`, true/false): Set an expiration window.
- Expires at (`expires_at`, date and time): Last time this preference can be used.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": "example",
    "init_point": "example",
    "sandbox_init_point": "example"
  }
}
```

### Get account

Get account.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": 1,
    "nickname": "example",
    "site_id": "example"
  }
}
```

### Get checkout preference

Get checkout preference.

**Inputs**

- Preference ID (`preference_id`, text, required): Checkout preference ID from Create checkout preference.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": "example",
    "init_point": "example"
  }
}
```

### Get order

Get order.

**Inputs**

- Order ID (`order_id`, text, required): Order ID from your Mercado Pago checkout.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": "example",
    "status": "example"
  }
}
```

### Get payment

Get payment.

**Inputs**

- Payment ID (`payment_id`, text, required): Payment ID from Search payments.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "date_created": "example",
    "date_last_updated": "example",
    "external_reference": "example",
    "id": 1,
    "status": "example"
  }
}
```

### Get payment refund

Get payment refund.

**Inputs**

- Payment ID (`payment_id`, text, required): Payment ID from Search payments.
- Refund ID (`refund_id`, text, required): Refund ID from List payment refunds.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": 1,
    "payment_id": 1,
    "status": "example"
  }
}
```

### Get subscription

Get subscription.

**Inputs**

- Subscription ID (`subscription_id`, text, required): Subscription ID from Search subscriptions.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": "example",
    "reason": "example",
    "status": "example"
  }
}
```

### List payment methods

List payment methods.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Mercado Pago.

**Example output**

```json
{
  "data": [
    {
      "id": "example",
      "name": "example",
      "payment_type_id": "example"
    }
  ]
}
```

### List payment refunds

List payment refunds.

**Inputs**

- Payment ID (`payment_id`, text, required): Payment ID from Search payments.

**Outputs**

- `data` (list): The response from Mercado Pago.

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "payment_id": 1,
      "status": "example"
    }
  ]
}
```

### Refund payment

Refund payment.

**Inputs**

- Payment ID (`payment_id`, text, required): Payment ID from Search payments.
- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse the same key if you retry it.
- Amount (`amount`, number): Amount to refund. Leave blank for a full refund. At least 0.01.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "id": 1,
    "payment_id": 1,
    "status": "example"
  }
}
```

### Search payments

Search payments.

**Inputs**

- Limit (`limit`, number): Maximum results per page. From 1 to 100.
- Offset (`offset`, number): Number of results to skip. At least 0.
- External reference (`external_reference`, text): Your own payment reference.
- Status (`status`, text): Only return payments with this status. One of: `pending`, `approved`, `authorized`, `in_process` (In process), `in_mediation` (In mediation), `rejected`, `cancelled`, `refunded`, `charged_back` (Charged back).
- Sort by (`sort_by`, text): Which payment date to sort by. One of: `date_created` (Date created), `date_last_updated` (Date last updated), `date_approved` (Date approved), `money_release_date` (Money release date), `id`.
- Sort order (`sort_order`, text): Order of the results. One of: `asc`, `desc`.
- Range field (`range_field`, text): Which field the date window applies to. One of: `date_created` (Date created), `date_last_updated` (Date last updated), `date_approved` (Date approved), `money_release_date` (Money release date).
- Start time (`start_time`, date and time): Start of the date window.
- End time (`end_time`, date and time): End of the date window.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "paging": {
      "limit": 1,
      "offset": 1,
      "total": 1
    },
    "results": [
      {
        "date_created": "example",
        "date_last_updated": "example",
        "external_reference": "example",
        "id": 1,
        "status": "example"
      }
    ]
  }
}
```

### Search subscriptions

Search subscriptions.

**Inputs**

- Limit (`limit`, number): Maximum results per page. From 1 to 100.
- Offset (`offset`, number): Number of results to skip. At least 0.
- Status (`status`, text): Filter by subscription status. One of: `pending`, `authorized`, `paused`, `cancelled`.
- External reference (`external_reference`, text): Your own subscription reference.

**Outputs**

- `data` (object): The response from Mercado Pago.

**Example output**

```json
{
  "data": {
    "paging": {},
    "results": [
      {
        "id": "example",
        "status": "example"
      }
    ]
  }
}
```
