# Assinaturas

## Criação de assinatura para um usuário

<mark style="color:blue;">`POST`</mark> `URL_BASE/users/create/user-subscription/{token_do_desenvolvedor}/{token_da_plataforma}`

#### Request Body

| Name                                          | Type   | Description                                            |
| --------------------------------------------- | ------ | ------------------------------------------------------ |
| product\_id<mark style="color:red;">\*</mark> | String | Id do produto                                          |
| user\_id                                      | String | Id do usuário (uuid)                                   |
| payment\_last\_date                           | Date   | Data do último pagamento - formato: Y-m-d H:i:s        |
| expiration\_date                              | Date   | Data de expiração da assinatura - formato: Y-m-d H:i:s |
| reference\_id                                 | String | Id referência                                          |

## Editar de assinatura para um usuário

<mark style="color:orange;">`PUT`</mark> `URL_BASE/users/update/user-subscription/{token_do_desenvolvedor}/{token_da_plataforma}`

#### Request Body

| Name                                          | Type   | Description                                            |
| --------------------------------------------- | ------ | ------------------------------------------------------ |
| product\_id<mark style="color:red;">\*</mark> | String | Id do produto                                          |
| user\_id<mark style="color:red;">\*</mark>    | String | Id do usuário (uuid)                                   |
| payment\_last\_date                           | Date   | Data do último pagamento - formato: Y-m-d H:i:s        |
| expiration\_date                              | Date   | Data de expiração da assinatura - formato: Y-m-d H:i:s |

## Ativar a assinatura para um usuário

<mark style="color:orange;">`PUT`</mark> `URL_BASE/users/update/active-user-subscription/{token_do_desenvolvedor}/{token_da_plataforma}`

#### Request Body

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| product\_id<mark style="color:red;">\*</mark> | String | Id do produto        |
| user\_id<mark style="color:red;">\*</mark>    | String | Id do usuário (uuid) |

## Desativar a assinatura para um usuário

<mark style="color:orange;">`PUT`</mark> `URL_BASE/users/update/disable-user-subscription/{token_do_desenvolvedor}/{token_da_plataforma}`

#### Request Body

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| product\_id<mark style="color:red;">\*</mark> | String | Id do produto        |
| user\_id<mark style="color:red;">\*</mark>    | String | Id do usuário (uuid) |

## Deletar assinatura por id referência

<mark style="color:red;">`DELETE`</mark> `URL_BASE/users/destroy-subscription-reference-id/{reference_id}/{product_id}/{token_do_desenvolvedor}/{token_da_plataforma}`

Após a exclusão do usuário a operação não poderá ser revertida.

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

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

## Deletar assinatura por id do usuário

<mark style="color:red;">`DELETE`</mark> `URL_BASE/users/destroy-subscription-user-id/{user_id}/{product_id}/{token_do_desenvolvedor}/{token_da_plataforma}`

Após a exclusão do usuário a operação não poderá ser revertida.

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

{% endtab %}

{% tab title="400: Bad Request " %}

{% 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://documentation.themembers.dev.br/api-gerenciamento-de-usuarios/referencia-da-api/assinaturas.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.
