# Affiliations

## Criação da afiliação do programa de fidelidade para o merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/loyalty/api/v1/{merchantId}/affiliations/{programId}`

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
|      | String |             |
|      | String |             |
|      | String |             |

{% hint style="success" %}
**Exemplo do conteúdo da requisição**
{% endhint %}

```json
[
  {
    "key": "string",
    "value": "string"
  }
]
```

## Edição da afiliação do programa de fidelidade para o merchant

<mark style="color:orange;">`PUT`</mark> `https://{account}.myhubdelivery.io/loyalty/api/v1/{merchantId}/affiliations/{programId}`

{% hint style="success" %}
**Exemplo do conteúdo da requisição**
{% endhint %}

```json
[
  {
    "key": "string",
    "value": "string"
  }
]
```

## Remove uma afiliação do programa de fidelidade para o merchant

<mark style="color:red;">`DELETE`</mark> `https://{account}.myhubdelivery.io/loyalty/api/v1/{merchantId}/affiliations/{programId}`

## Consulta uma afiliação do programa de fidelidade para o merchant

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

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

```javascript
[
  {
    "key": "string",
    "value": "string"
  }
]
```

{% 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://developers.myhubdelivery.io/orders/loyalty/affiliations.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.
