# Caixa Associada

### Obter  Todas as Caixas Associadas

De modo a obter informações sobre um dado descritor, poderá realizar o seguinte pedido

{% openapi src="<https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7>" path="/api/cash\_accounts" method="get" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media\&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7)
{% endopenapi %}

<details>

<summary>Exemplo de Response</summary>

```json
{
    "data": [
        {
            "type": "cash_accounts",
            "id": "2",
            "attributes": {
                "name": "Caixa Teste 1"
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        }
    ]
}
```

</details>

### Obter  Caixas Associadas por ID

{% openapi src="<https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7>" path="/api/cash\_accounts/{id}" method="get" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media\&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7)
{% endopenapi %}

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

```
GET /api/bank_accounts/2
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "type": "bank_accounts",
        "id": "2",
        "attributes": {
            "entity_type": "User",
            "description": null,
            "name": "BANCO BPI, SA",
            "nib": "001049282327079673218",
            "swift": "BBPIPTPL",
            "iban": "PT50001049282327079673218",
            "initial_balance": null,
            "sub_type": "ticket_account",
            "card_number": "",
            "account_type": "DO",
            "only_one_payment": null,
            "is_connected": false,
            "consent_until": null
        },
        "relationships": {
            "supplier": {
                "data": null
            },
            "user": {
                "data": {
                    "type": "current_company_users",
                    "id": "800000863"
                }
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Criar  Caixas Associadas

{% openapi src="<https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7>" path="/api/cash\_accounts" method="post" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media\&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7)
{% endopenapi %}

### Remover  Caixas Associadas

{% openapi src="<https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7>" path="/api/bank\_accounts/{bankAccountId}" method="delete" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2FZBJyxFky3EPPL5hA0Lxx%2FTOConline%20Open%20API.yaml?alt=media\&token=a2616c07-07e1-4b6e-b74f-3de4caae92d7)
{% endopenapi %}
