# Update a Sapo integration

`PATCH /service/@id/tinopay/sapo-integrations/@integration` · TinoPay, service owner's sign-in token

Send only the changed fields. Leaving out `api_secret` keeps the saved secret; TinoPay tests the Sapo connection again only when `store_url`, `api_key` or `api_secret` changes (failure: 422 `SAPO_CONNECTION_FAILED`). A `bank_account_id` outside the merchant: 404 `BANK_ACCOUNT_NOT_FOUND`.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/service/@id/tinopay/sapo-integrations/@integration` |
| Method | `PATCH` |
| Authentication | the TinoPay service owner's sign-in token (`Authorization: Bearer <token>`); the `/v1` gateway does not expose TinoPay yet |
| Content-Type | `application/json` |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | int | yes | TinoPay service ID |
| `integration` | path | int | yes | Sapo integration ID (`id` in the Sapo integration list) |
| `name` | body | string | — | — |
| `store_url` | body | string | — | — |
| `api_key` | body | string | — | — |
| `api_secret` | body | string | — | — |
| `bank_account_id` | body | string | — | — |
| `virtual_account` | body | string | — | — |
| `order_prefix` | body | string | — | — |
| `transaction` | body | array | — | — |
| `status` | body | string | — | active \| inactive |

## Example request

```bash
curl -X PATCH "https://api.tino.vn/service/100001/tinopay/sapo-integrations/4" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "inactive"
}'
```

`$TINO_TOKEN` is the TinoPay service owner's sign-in token. Path parameters in the example are sample values.

SDK ([SDK & examples](/en/docs/sdk)): no dedicated function yet, use `client.request("PATCH", "/service/@id/tinopay/sapo-integrations/@integration")`.

## Example response

The source documentation does not show this route's answer. Success is `{"data": …}`; errors follow the common shape in [Getting started with TinoPay](/en/docs/tinopay-start#errors).
