# Test the Sapo connection

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

Before saving: body `store_url`, `api_key`, `api_secret` of the private app on Sapo; when editing, send `integration_id` instead of `api_secret` to use the saved secret. Returns HTTP 200 `{connected, error}`; with `connected: false`, `error` gives the reason.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/service/@id/tinopay/sapo-integrations/test` |
| Method | `POST` |
| 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 |
| `store_url` | body | string | — | <tên-cửa-hàng>.mysapo.net |
| `api_key` | body | string | — | — |
| `api_secret` | body | string | — | — |
| `integration_id` | body | int | — | — |

## Example request

```bash
curl -X POST "https://api.tino.vn/service/100001/tinopay/sapo-integrations/test" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "store_url": "<tên-cửa-hàng>.mysapo.net",
  "api_key": "<api_key>",
  "api_secret": "<api_secret>"
}'
```

`$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("POST", "/service/@id/tinopay/sapo-integrations/test")`.

## Example response

```json
{
 "data": {
  "connected": true,
  "error": null
 }
}
```

Sample built from the TinoPay API v1 documentation (Tino relays TinoPay data as is); values are examples.
