> For the complete documentation index, see [llms.txt](https://docs.txn.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.txn.io/channels/updating-channel.md).

# Updating channel

<mark style="color:green;">`PATCH`</mark> `/api/public/v1/channels/:id`

Enables or disables a channel. Deposits to a disabled channel are not processed or credited; re-enable the channel to resume. See [Channels deposit flow](https://docs.txn.io/channels/channels-deposit-flow.md).

**Headers**

| Name          | Value                      |
| ------------- | -------------------------- |
| Content-Type  | `application/vnd.api+json` |
| Authorization | `Bearer <api_key>`         |

**Path Parameters**

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | Channel ID. |

**Request Body**

| Name                   | Type   | Required | Description              |
| ---------------------- | ------ | -------- | ------------------------ |
| data.type              | string | Yes      | Always `channels`.       |
| data.attributes.status | string | Yes      | `enabled` or `disabled`. |

**cURL**

```bash
curl -X "PATCH" "https://api.sandbox.txn.io/api/public/v1/channels/ace25dae-dc26-4fdc-9a7a-6561237f340b" \
     -H 'Content-Type: application/vnd.api+json' \
     -H 'Authorization: Bearer <api_key>' \
     -d $'{
  "data": {
    "type": "channels",
    "attributes": {
      "status": "enabled"
    }
  }
}'
```

**Response**

{% tabs %}
{% tab title="HTTP 200" %}

```json
{
  "data": {
    "id": "ace25dae-dc26-4fdc-9a7a-6561237f340b",
    "type": "channels",
    "attributes": {
      "reference": "docs-try-eur-example-001",
      "status": "enabled",
      "createdAt": "2026-05-26T09:44:53.750Z",
      "updatedAt": "2026-10-30T15:28:39.982Z",
      "payCurrency": "USDT",
      "targetCurrency": "EUR",
      "localCurrency": "TRY",
      "address": "TUbpY2zUNFDcpacgNzoJczT4x8ctV2mmLn",
      "network": "ttrx:usdt",
      "networkName": "Tron (TRC20)",
      "hostedPageUrl": "https://sandbox.txn.io/redirect?channel_id=ace25dae-dc26-4fdc-9a7a-6561237f340b&request_type=channel_hosted_page",
      "networkCode": "ttrx:usdt"
    },
    "relationships": {
      "targetAccount": {
        "data": {
          "type": "accounts",
          "id": "13a85b45-8543-41c7-b963-394d4ea128ae"
        }
      }
    }
  },
  "included": [
    {
      "id": "13a85b45-8543-41c7-b963-394d4ea128ae",
      "type": "accounts",
      "attributes": {
        "master": true,
        "currencyCode": "EUR",
        "label": "master",
        "bankReference": "BDR6421088115176062",
        "balance": "39272.08",
        "totalBalance": null,
        "bankWithdrawalAvailable": true,
        "bankDepositAvailable": true,
        "transferAvailable": true,
        "currencyType": "fiat"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        },
        "txnBankCredentials": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}
```

{% endtab %}

{% tab title="HTTP 422" %}

```json
{
  "errors": [
    {
      "status": 422,
      "title": "Invalid attribute",
      "code": "channel_invalid",
      "detail": "Status is not included in the list",
      "source": {
        "pointer": "/data/attributes/status"
      }
    }
  ]
}
```

{% endtab %}

{% tab title="HTTP 404" %}

```json
{
  "errors": [
    {
      "status": 404,
      "title": "Record not found",
      "code": "channel_not_found",
      "detail": "Channel not found"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

**Response Body**

| Name                                               | Type    | Description                                                                                                                                                                                                                                                                               |
| -------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data.id                                            | string  | Channel ID.                                                                                                                                                                                                                                                                               |
| data.type                                          | string  | Always `channels`.                                                                                                                                                                                                                                                                        |
| data.attributes.targetCurrency                     | string  | Specifies the merchant’s currency account on the txn platform to which the deposit will be credited. Must be a tradable fiat or cryptocurrency listed on the [Supported currencies](https://docs.txn.io/api-basics/supported-currencies) page — display fiat currencies are not accepted. |
| data.attributes.localCurrency                      | string  | Currency to display to end users, e.g. their local currency in which they hold a balance on the merchant’s platform. This field is optional and can be different from the `targetCurrency` value.                                                                                         |
| data.attributes.payCurrency                        | string  | Crypto currency that customer must pay in. Refer to [supported](https://docs.txn.io/api-basics/supported-currencies.md) currencies.                                                                                                                                                       |
| data.attributes.address                            | string  | Channel address.                                                                                                                                                                                                                                                                          |
| data.attributes.networkCode                        | string  | Payment network code. Refer to [supported](https://docs.txn.io/api-basics/supported-currencies) networks.                                                                                                                                                                                 |
| data.attributes.network                            | string  | Alias for `networkCode`. Refer to [supported](https://docs.txn.io/api-basics/supported-currencies) networks.                                                                                                                                                                              |
| data.attributes.networkName                        | string  | Network name.                                                                                                                                                                                                                                                                             |
| data.attributes.hostedPageUrl                      | string  | Channel redirect URL hosted by Txn.                                                                                                                                                                                                                                                       |
| data.attributes.reference                          | string  | The custom reference ID to tie the channel and its deposits to end-user who pays.                                                                                                                                                                                                         |
| data.attributes.status                             | string  | Channel status. Can be either `enabled` or `disabled`. If `enabled`, deposits get processed and credited to the merchant's account as normal. If `disabled`, deposits do not get credited to the merchant's account.                                                                      |
| data.attributes.createdAt                          | string  | Timestamp when a channel was created.                                                                                                                                                                                                                                                     |
| data.attributes.updatedAt                          | string  | Timestamp when a channel was last updated.                                                                                                                                                                                                                                                |
| data.relationships.targetAccount                   | object  | The account channel deposits are credited to. `data.type` is `accounts` and `data.id` is the account ID; the entity is returned in `included[]`.                                                                                                                                          |
| included\[].type(accounts)                         | object  | The target account (`data.relationships.targetAccount`). Same fields as [Reading account](https://docs.txn.io/accounts/reading-account.md); the ones most relevant here are listed below.                                                                                                 |
| included\[].type(accounts).attributes.currencyCode | string  | Account currency. Equals `data.attributes.targetCurrency`.                                                                                                                                                                                                                                |
| included\[].type(accounts).attributes.label        | string  | Account label.                                                                                                                                                                                                                                                                            |
| included\[].type(accounts).attributes.master       | boolean | `true` for the master account, `false` for a subaccount.                                                                                                                                                                                                                                  |
| included\[].type(accounts).attributes.balance      | string  | Account balance at the time of the request.                                                                                                                                                                                                                                               |
| included\[].type(accounts).attributes.currencyType | string  | `fiat` or `crypto`.                                                                                                                                                                                                                                                                       |
| included\[].type(accounts).relationships           | object  | `company`, `networks` and `txnBankCredentials`: not expanded (`meta.included` is `false`).                                                                                                                                                                                                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.txn.io/channels/updating-channel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
