# Extract

## Obtém o extrato de crédito, expirações e resgates do participante.

<mark style="color:blue;">`GET`</mark> `https://{account}.myhubdelivery.io/loyalty/api/v1/extract/{programId}/{participantId}`

#### Query Parameters

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| startAt<mark style="color:red;">\*</mark>   | Date   | 2022-01-01T00:00:00.000Z        |
| endAt<mark style="color:red;">\*</mark>     | Date   | 2022-12-31T00:00:00.000Z        |
| orderBy<mark style="color:red;">\*</mark>   | String | ASC\|DESC                       |
| operation<mark style="color:red;">\*</mark> | String | ALL\|CREDIT\|REDEEM\|EXPIRATION |
| expiresAfter                                | Date   | 2022-01-01T00:00:00.000Z        |

#### Headers

| Name                                              | Type   | Description                                                                                                         |
| ------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| x-merchants-ids<mark style="color:red;">\*</mark> | String | <p>Lista de Merchant ids que compõem o extrato do participante.<br><strong>Ex.: 1dbBjnBRmQ, 3duAjnNRmU</strong></p> |

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

```javascript
[
    {
        "merchantId": "1dbBjnBRmQ",
        "operation": "CREDIT|REDEEM|EXPIRATION",
        "externalCode": "Identificador da operação",
        "description": "Descrição da operação",
        "points": 0,
        "amount": 0,
        "expiresAt": "2022-07-05T19:43:43.272Z",
        "expiredAt": "2022-07-05T19:43:43.272Z",
        "createdAt": "2022-07-05T19:43:43.272Z"
    }
]
```

{% endtab %}
{% endtabs %}
