> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# /async-tasks/{id}

GET https://api.merge.dev/api/accounting/v1/async-tasks/{id}

Returns an `AsyncPostTask` object with the given `id`.

Reference: https://docs.merge.dev/merge-unified/accounting/data-management/async-tasks/retrieve

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Servers

- `https://api.merge.dev/api` (Production, default)
- `https://api-eu.merge.dev/api` (ProductionEU)
- `https://api-ap.merge.dev/api` (ProductionAPSE1)

## Request

### Path parameters

- `id` (string, required)

### Headers

- `X-Account-Token` (string, required) — Token identifying the end user.

## Response

### 200

- `status` (enum, required)
  - Allowed values: `QUEUED`, `IN_PROGRESS`, `COMPLETED`, `FAILURE`
- `result` (AsyncPostTaskResult, required)

## Types

### AsyncPostTaskResult

- `status_code` (integer, optional)
- `response` (map from string to any, optional)

## Examples

**Response**

```json
{
  "status": "COMPLETED",
  "result": {
    "status_code": 201,
    "response": {
      "model": {
        "accounting_period": "7dc5ca17-d311-44cd-9ce0-333080367a18",
        "applied_credit_notes": [],
        "applied_payments": [
          "9017594e-dc33-4113-a5d2-b0f928e34fdd"
        ],
        "applied_vendor_credits": [],
        "balance": 105,
        "company": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
        "contact": "022a2bef-57e5-4def-8ed2-7c41bd9a5ed8",
        "created_at": "2021-09-15T00:00:00Z",
        "currency": "USD",
        "due_date": "2020-04-15T00:00:00Z",
        "employee": "7442f0d5-722d-45bd-b807-6e38489d37fe",
        "exchange_rate": "2.9",
        "field_mappings": {
          "linked_account_defined_targets": {
            "custom_key": "custom_value"
          },
          "organization_defined_targets": {
            "custom_key": "custom_value"
          }
        },
        "id": "9871b4a9-f5d2-4f3b-a66b-dfedbed42c46",
        "inclusive_of_tax": false,
        "integration_params": {
          "unique_integration_field": "unique_integration_field_value"
        },
        "issue_date": "2020-03-31T00:00:00Z",
        "line_items": [],
        "linked_account_params": {
          "unique_linked_account_field": "unique_linked_account_field_value"
        },
        "memo": "Weekly Payment",
        "modified_at": "2021-10-16T00:00:00Z",
        "number": "AIQ12546",
        "paid_on_date": "2020-04-01T00:00:00Z",
        "payments": [
          "b26fd49a-cbae-470a-a8f8-bcbc119e0390"
        ],
        "purchase_orders": [
          "e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7",
          "dd70ca2f-b120-46fa-889a-9604037f45fd",
          "889b281d-739c-4759-95b8-0aedb3947131"
        ],
        "remote_data": [
          {
            "data": [
              "Varies by platform"
            ],
            "path": "/actions"
          }
        ],
        "remote_id": "990110",
        "remote_updated_at": "2020-04-01T00:00:00Z",
        "status": "DRAFT",
        "sub_total": 100,
        "total_amount": 105,
        "total_discount": 0,
        "total_tax_amount": 5,
        "tracking_categories": [
          "7dc5ca17-d311-44cd-9ce0-333080367a18",
          "6aa0700c-48e1-4c4a-8162-02e6a582df05",
          "8c933d61-8f5b-4360-ac0c-c9dc87bee763"
        ],
        "type": "ACCOUNTS_RECEIVABLE"
      }
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.merge.dev/api/accounting/v1/async-tasks/id"

headers = {
    "X-Account-Token": "X-Account-Token",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.merge.dev/api/accounting/v1/async-tasks/id';
const options = {
  method: 'GET',
  headers: {'X-Account-Token': 'X-Account-Token', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.merge.dev/api/accounting/v1/async-tasks/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Account-Token", "X-Account-Token")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.merge.dev/api/accounting/v1/async-tasks/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Account-Token"] = 'X-Account-Token'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.merge.dev/api/accounting/v1/async-tasks/id")
  .header("X-Account-Token", "X-Account-Token")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.merge.dev/api/accounting/v1/async-tasks/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Account-Token' => 'X-Account-Token',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.merge.dev/api/accounting/v1/async-tasks/id");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Account-Token", "X-Account-Token");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Account-Token": "X-Account-Token",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.merge.dev/api/accounting/v1/async-tasks/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```