# Executions

A schedule can be executed once or multiple times depending on its frequency.

In order for executions to be performed, the user will need to have enough funds on its gas-wallet to pay for blockchain fees.

An execution can fail if the sender hasn’t got enough funds on his wallet. In that case 8Pay will retry every 6 hours.

## Get a list of executions

<mark style="color:blue;">`GET`</mark> `https://api.8pay.network/v1/:chain/scheduled-payments/executions`

#### Path Parameters

| Name  | Type   | Description                                 |
| ----- | ------ | ------------------------------------------- |
| chain | string | [chain identifier](/api/overview.md#chains) |

#### Query Parameters

| Name | Type   | Description                                           |
| ---- | ------ | ----------------------------------------------------- |
| from | number | filter by `timestamp` (default 0)                     |
| to   | number | filter by `timestamp` (default current timestamp)     |
| sort | string | `asc` or `desc` based on `timestamp` (default `desc`) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "scheduleId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "timestamp": 1684819496,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed",
            "token": "8PAY",
            "receivers": [
                {
                    "user": "0x38B70aC0BEf71A46Fc9E07f9c64913b9F533e54A",
                    "amount": "1000",
                    "fee": "10"
                }
            ]
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}
```

{% endtab %}
{% endtabs %}

## Get executions of a schedule

<mark style="color:blue;">`GET`</mark> `https://api.8pay.network/v1/:chain/scheduled-payments/schedules/:scheduleId/executions`

#### Path Parameters

| Name       | Type   | Description                                 |
| ---------- | ------ | ------------------------------------------- |
| scheduleId | string | ID of the schedule                          |
| chain      | string | [chain identifier](/api/overview.md#chains) |

#### Query Parameters

| Name | Type   | Description                                           |
| ---- | ------ | ----------------------------------------------------- |
| from | number | filter by `timestamp` (default 0)                     |
| to   | number | filter by `timestamp` (default current timestamp)     |
| sort | string | `asc` or `desc` based on `timestamp` (default `desc`) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "scheduleId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "timestamp": 1684819496,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed",
            "token": "8PAY",
            "receivers": [
                {
                    "user": "0x38B70aC0BEf71A46Fc9E07f9c64913b9F533e54A",
                    "amount": "1000",
                    "fee": "10"
                }
            ]
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.8pay.network/api/scheduled-payments/executions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
