# New Confirmed Coins Transactions And Each Confirmation

Through this endpoint customers can create callback subscriptions for a specific event. In this case the event is when there are new incoming or outgoing confirmed transactions for coins from/to the customer's address with also a response at each confirmation the transaction has received until the specified confirmations limit is reached. By creating this subscription the user will be notified by Crypto APIs 2.0 when that event occurs. The information is returned per specified address. 

Being confirmed means that the transactions are verified by miners and added to the next block. This endpoint refers to **coins transactions only, not tokens**.


> **Note:** For UTXO-based protocols like Bitcoin, a transaction could have multiple inputs and outputs, which means the address could be both sender and recipient. [Here](https://project-2a14af.doxify.ai/v-1.2023-04-25-105/RESTapis/general-information/callbacks#callback-data-returned-for-utxo-based-transactions) is how we inform you on that.



> **Note:** To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](https://project-2a14af.doxify.ai/v-1.2023-04-25-105/RESTapis/general-information/callbacks#callback-url).



> **Warning:** Crypto APIs will notify the user **only when** the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification **will not** be sent if the event does not or cannot occur, or will take long time to occur.



> **Warning:** Any new subscriptions will lead to additional credits consumption on daily bases! Please, refer to **Data Flow Limiting** in the **General Information** section for details.

- **Endpoint:** `POST https://rest.cryptoapis.io/blockchain-events/{blockchain}/{network}/address-coins-transactions-confirmed-each-confirmation`
- **Authentication:** `x-api-key` header
- **Credits cost:** 30 credits for 1 result
- **Documentation page:** https://developers.cryptoapis.io/v-2.2024-12-12-175/RESTapis/create-subscriptions-for/new-confirmed-coins-transactions-and-each-confirmation/post

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blockchain` | string | yes | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. Allowed values: `bitcoin`, `bitcoin-cash`, `dash`, `dogecoin`, `litecoin`, `ethereum`, `ethereum-classic`, `binance-smart-chain`, `zcash`, `polygon`, `tron`, `xrp`, `tezos`, `optimism`, `arbitrum`, `avalanche`, `base`. |
| `network` | string | yes | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "sepolia" are test networks. Allowed values: `mainnet`, `testnet`, `sepolia`, `mordor`, `amoy`, `nile`, `shadownet`, `fuji`. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |

## Request body (application/json)

```json
{
  "context": "yourExampleString",
  "data": {
    "item": {
      "address": "mho4jHBcrNCncKt38trJahXakuaBnS7LK5",
      "allowDuplicates": false,
      "callbackSecretKey": "yourSecretKey",
      "callbackUrl": "https://example.com",
      "confirmationsCount": 3
    }
  }
}
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.address` | string | yes | Represents the address of the transaction, per which the result is returned. |
| `data.item.allowDuplicates` | boolean | no | Specifies a flag that permits or denies the creation of duplicate addresses. |
| `data.item.callbackSecretKey` | string | no | Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our [Documentation](https://project-2a14af.doxify.ai/v-1.2023-04-25-105/RESTapis/general-information/callbacks#callback-security). |
| `data.item.callbackUrl` | string | yes | Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. `We support ONLY httpS type of protocol`. |
| `data.item.confirmationsCount` | integer | yes | Represents the number of confirmations, i.e. the amount of blocks that have been built on top of this block. |

## Responses

| Status | Description |
| --- | --- |
| 201 | The resource has been successfully created. |
| 400 | 400 |
| 401 | 401 |
| 402 | 402 |
| 403 | 403 |
| 409 | 409 |
| 415 | The selected Media Type is unavailable. The Content-Type header should be 'application/json'. |
| 422 | Your request body for POST requests must have a structure of { data: { item: [...properties] } } |
| 429 | The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. |
| 500 | An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. |

### Example 201 response

```json
{
  "apiVersion": "2024-12-12",
  "requestId": "601c1710034ed6d407996b30",
  "context": "yourExampleString",
  "data": {
    "item": {
      "address": "15XyNC88pujwuuur8DCsXBCfEhJJMzHayU",
      "callbackSecretKey": "yourSecretKey",
      "callbackUrl": "https://example.com",
      "confirmationsCount": 3,
      "createdTimestamp": 1611238648,
      "eventType": "ADDRESS_COINS_TRANSACTION_CONFIRMED_EACH_CONFIRMATION",
      "isActive": true,
      "referenceId": "bc243c86-0902-4386-b30d-e6b30fa1f2aa"
    }
  }
}
```

### 201 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apiVersion` | string | yes | Specifies the version of the API that incorporates this endpoint. |
| `requestId` | string | yes | Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request. |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.address` | string | yes | Represents the address of the transaction, per which the result is returned. |
| `data.item.callbackSecretKey` | string | yes | Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our [Documentation](https://project-2a14af.doxify.ai/v-1.2023-04-25-105/RESTapis/general-information/callbacks#callback-security). |
| `data.item.callbackUrl` | string | yes | Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. `We support ONLY httpS type of protocol`. |
| `data.item.confirmationsCount` | integer | yes | Represents the number of confirmations, i.e. the amount of blocks that have been built on top of this block. |
| `data.item.createdTimestamp` | integer | yes | Defines the specific time/date when the subscription was created in Unix Timestamp. |
| `data.item.eventType` | string | yes | Defines the type of the specific event available for the customer to subscribe to for callback notification. |
| `data.item.isActive` | boolean | yes | Defines whether the subscription is active or not. Set as boolean. |
| `data.item.referenceId` | string | yes | Represents a unique ID used to reference the specific callback subscription. |

## Callback: ADDRESS_COINS_TRANSACTION_CONFIRMED_EACH_CONFIRMATION

Sent as `POST` (application/json) to your callback URL.

```json
{
  "apiVersion": "2024-12-12",
  "referenceId": "6038d09050653d1f0e40584c",
  "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
  "data": {
    "product": "BLOCKCHAIN_EVENTS",
    "event": "ADDRESS_COINS_TRANSACTION_CONFIRMED_EACH_CONFIRMATION",
    "item": {
      "blockchain": "bitcoin",
      "network": "testnet",
      "address": "15282N4BYEwYh3j1dTgJu64Ey5qWn9Po9F",
      "minedInBlock": {
        "height": 667754,
        "hash": "dfe45f6724b550c281107ffaa5880cb280878fb4dbaa742aa21449f3d2340c13",
        "timestamp": 1610365314
      },
      "transactionId": "cbd3dea703bd2bc78bca69ee61ca14e6ffcdd809d07ebbc3b8fea3c30ea38f33",
      "currentConfirmations": 8,
      "targetConfirmations": 12,
      "amount": "0.0611",
      "unit": "BTC",
      "direction": "incoming"
    }
  }
}
```
