> 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-passthrough

POST https://api.merge.dev/api/hris/v1/async-passthrough
Content-Type: application/json

Asynchronously pull data from an endpoint not currently supported by Merge.

Reference: https://docs.merge.dev/merge-unified/hris/data-management/async-passthrough/create

## 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

### Headers

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

### Body (application/json)

This endpoint expects a DataPassthroughRequest.

- `method` (enum, required)
  - Allowed values: `GET`, `OPTIONS`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`
- `path` (string, required) — The path of the request in the third party's platform.
- `base_url_override` (string, optional, nullable) — An optional override of the third party's base url for the request.
- `data` (string, optional, nullable) — The data with the request. You must include a `request_format` parameter matching the data's format
- `multipart_form_data` (list of MultipartFormFieldRequest, optional, nullable) — Pass an array of `MultipartFormField` objects in here instead of using the `data` param if `request_format` is set to `MULTIPART`.
- `headers` (map from string to any, optional, nullable) — The headers to use for the request (Merge will handle the account's authorization headers). `Content-Type` header is required for passthrough. Choose content type corresponding to expected format of receiving server.
- `request_format` (enum, optional, nullable)
  - Allowed values: `JSON`, `XML`, `MULTIPART`
- `normalize_response` (boolean, optional) — Optional. If true, the response will always be an object of the form `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`.

## Response

### 200

- `async_passthrough_receipt_id` (string, required)

## Types

### MultipartFormFieldRequest

# The MultipartFormField Object ### Description The `MultipartFormField` object is used to represent fields in an HTTP request using `multipart/form-data`. ### Usage Example Create a `MultipartFormField` to define a multipart form entry.

- `name` (string, required) — The name of the form field
- `data` (string, required) — The data for the form field.
- `encoding` (enum, optional, nullable, default: RAW) — The encoding of the value of `data`. Defaults to `RAW` if not defined.
  - Allowed values: `RAW`, `BASE64`, `GZIP_BASE64`
- `file_name` (string, optional, nullable) — The file name of the form field, if the field is for a file.
- `content_type` (string, optional, nullable) — The MIME type of the file, if the field is for a file.

## Examples

**Request**

```json
{
  "method": "POST",
  "path": "/scooters"
}
```

**Response**

```json
{
  "async_passthrough_receipt_id": "fd29020f-2695-445e-922e-dcd5e81903fd"
}
```

**SDK Code**

```python
import requests

url = "https://api.merge.dev/api/hris/v1/async-passthrough"

payload = {
    "method": "POST",
    "path": "/scooters"
}
headers = {
    "X-Account-Token": "X-Account-Token",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.merge.dev/api/hris/v1/async-passthrough';
const options = {
  method: 'POST',
  headers: {
    'X-Account-Token': 'X-Account-Token',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"method":"POST","path":"/scooters"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.merge.dev/api/hris/v1/async-passthrough"

	payload := strings.NewReader("{\n  \"method\": \"POST\",\n  \"path\": \"/scooters\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Account-Token", "X-Account-Token")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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/hris/v1/async-passthrough")

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

request = Net::HTTP::Post.new(url)
request["X-Account-Token"] = 'X-Account-Token'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"method\": \"POST\",\n  \"path\": \"/scooters\"\n}"

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.post("https://api.merge.dev/api/hris/v1/async-passthrough")
  .header("X-Account-Token", "X-Account-Token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"method\": \"POST\",\n  \"path\": \"/scooters\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.merge.dev/api/hris/v1/async-passthrough', [
  'body' => '{
  "method": "POST",
  "path": "/scooters"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Account-Token' => 'X-Account-Token',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.merge.dev/api/hris/v1/async-passthrough");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Account-Token", "X-Account-Token");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"method\": \"POST\",\n  \"path\": \"/scooters\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Account-Token": "X-Account-Token",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "method": "POST",
  "path": "/scooters"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.merge.dev/api/hris/v1/async-passthrough")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```