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

# Create a new payer

POST https://api.useroot.com/api/payers
Content-Type: application/json

Create a new payer in the system. 

A payer is an entity that sends money to your platform via ACH debit transactions. Each payer must have a unique email address within your organization.

## Required Information

When creating a payer, you must provide:

- **Email**: Must be unique within your organization  
- **Name**: Full name of the payer

## Response

Returns the newly created payer object with:
- Unique payer ID
- All provided information
- Timestamps for creation and last update

Reference: https://docs.useroot.com/api-reference/payers-api/create-payer

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/payers:
    post:
      operationId: create-payer
      summary: Create a new payer
      description: >-
        Create a new payer in the system. 


        A payer is an entity that sends money to your platform via ACH debit
        transactions. Each payer must have a unique email address within your
        organization.


        ## Required Information


        When creating a payer, you must provide:


        - **Email**: Must be unique within your organization  

        - **Name**: Full name of the payer


        ## Response


        Returns the newly created payer object with:

        - Unique payer ID

        - All provided information

        - Timestamps for creation and last update
      tags:
        - payersApi
      parameters:
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Payer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_PayerResponse_'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayerRequest'
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    CountryCode:
      type: string
      enum:
        - US
        - GB
        - IN
      title: CountryCode
    PayerRequest:
      type: object
      properties:
        country_code:
          $ref: '#/components/schemas/CountryCode'
        country_sub_division:
          type:
            - string
            - 'null'
          description: State, province, or country subdivision
        city:
          type:
            - string
            - 'null'
          description: City or town name
        address_line:
          type:
            - string
            - 'null'
          description: Street address, building number, postal code, etc.
        postal_code:
          type:
            - string
            - 'null'
          description: Zip or postal code
        name:
          type: string
        email:
          type: string
          format: email
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
      required:
        - name
        - email
      title: PayerRequest
    PayerResponse:
      type: object
      properties:
        country_code:
          $ref: '#/components/schemas/CountryCode'
        country_sub_division:
          type:
            - string
            - 'null'
          description: State, province, or country subdivision
        city:
          type:
            - string
            - 'null'
          description: City or town name
        address_line:
          type:
            - string
            - 'null'
          description: Street address, building number, postal code, etc.
        postal_code:
          type:
            - string
            - 'null'
          description: Zip or postal code
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          format: email
        client_metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - created_at
        - updated_at
        - id
        - name
        - email
      title: PayerResponse
    Response_PayerResponse_:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PayerResponse'
        warning:
          type:
            - string
            - 'null'
      required:
        - data
      title: Response_PayerResponse_
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples



**Request**

```json
{
  "name": "John Doe",
  "email": "john.doe@company.com",
  "country_code": "US",
  "country_sub_division": "NY",
  "city": "New York",
  "address_line": "123 Main Street, Apt 4B",
  "postal_code": "10001"
}
```

**Response**

```json
{
  "data": {
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "John Doe",
    "email": "john.doe@company.com",
    "country_code": "US",
    "country_sub_division": "NY",
    "city": "New York",
    "address_line": "123 Main Street, Apt 4B",
    "postal_code": "10001"
  }
}
```

**SDK Code**

```python United States payer
import requests

url = "https://api.useroot.com/api/payers"

payload = {
    "name": "John Doe",
    "email": "john.doe@company.com",
    "country_code": "US",
    "country_sub_division": "NY",
    "city": "New York",
    "address_line": "123 Main Street, Apt 4B",
    "postal_code": "10001"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript United States payer
const url = 'https://api.useroot.com/api/payers';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"John Doe","email":"john.doe@company.com","country_code":"US","country_sub_division":"NY","city":"New York","address_line":"123 Main Street, Apt 4B","postal_code":"10001"}'
};

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

```go United States payer
package main

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

func main() {

	url := "https://api.useroot.com/api/payers"

	payload := strings.NewReader("{\n  \"name\": \"John Doe\",\n  \"email\": \"john.doe@company.com\",\n  \"country_code\": \"US\",\n  \"country_sub_division\": \"NY\",\n  \"city\": \"New York\",\n  \"address_line\": \"123 Main Street, Apt 4B\",\n  \"postal_code\": \"10001\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	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 United States payer
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payers")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"John Doe\",\n  \"email\": \"john.doe@company.com\",\n  \"country_code\": \"US\",\n  \"country_sub_division\": \"NY\",\n  \"city\": \"New York\",\n  \"address_line\": \"123 Main Street, Apt 4B\",\n  \"postal_code\": \"10001\"\n}"

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

```java United States payer
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.useroot.com/api/payers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"John Doe\",\n  \"email\": \"john.doe@company.com\",\n  \"country_code\": \"US\",\n  \"country_sub_division\": \"NY\",\n  \"city\": \"New York\",\n  \"address_line\": \"123 Main Street, Apt 4B\",\n  \"postal_code\": \"10001\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payers', [
  'body' => '{
  "name": "John Doe",
  "email": "john.doe@company.com",
  "country_code": "US",
  "country_sub_division": "NY",
  "city": "New York",
  "address_line": "123 Main Street, Apt 4B",
  "postal_code": "10001"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp United States payer
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payers");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"John Doe\",\n  \"email\": \"john.doe@company.com\",\n  \"country_code\": \"US\",\n  \"country_sub_division\": \"NY\",\n  \"city\": \"New York\",\n  \"address_line\": \"123 Main Street, Apt 4B\",\n  \"postal_code\": \"10001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift United States payer
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "John Doe",
  "email": "john.doe@company.com",
  "country_code": "US",
  "country_sub_division": "NY",
  "city": "New York",
  "address_line": "123 Main Street, Apt 4B",
  "postal_code": "10001"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/payers")! 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()
```