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

# Approve single payin

POST https://api.useroot.com/api/payins/{payin_id}/approve

Approves a single payin for processing. The payin must be in **CREATED** status.

**Response body**

| Field | Type | Description |
|-------|------|-------------|
| `data` | Object | The payin object (`status` reflects the state at response time) |
| `warning` | String | Present on **207** when initiation had a recoverable issue |

**Success responses**

| Status Code | Description |
|-------------|-------------|
| **201** | The payin was approved and processing continued; **`data.status`** reflects the outcome of this request. |
| **202** | The request was accepted and **`data`** includes the payin, but **`data.status`** may still change. Poll **`GET /api/payins/{id}`** until the payin reaches a terminal status. |
| **207** | The payin was approved but initiation did not complete successfully; see **`warning`** and **`data.status`**. |

**Error and retry responses**

| Status Code | Error code | Description |
|-------------|------------|-------------|
| **400** | `INVALID_STATUS` | The payin is not in **CREATED** status and cannot be approved. |
| **401** | `AUTHENTICATION_ERROR` | Authentication credentials are invalid or missing. |
| **403** | `AUTHORIZATION_ERROR` | You do not have permission to perform this action. |
| **404** | `PAYIN_NOT_FOUND` | Payin not found or does not belong to your entity. |
| **503** | (see response body) | **Transient error**—bank initiation did not complete for this request. **Retry** the same approve call after a short wait. The JSON body includes `error_code` and `message` for logging and automation. |

**Notes**

- Treat **202** like any accepted operation: use the returned id and **poll** until status stabilizes.
- **503** is for **retries**, not a final business outcome for the transfer.

Reference: https://docs.useroot.com/api-reference/payins-api/approve-payin

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/payins/{payin_id}/approve:
    post:
      operationId: approve-payin
      summary: Approve single payin
      description: >-
        Approves a single payin for processing. The payin must be in **CREATED**
        status.


        **Response body**


        | Field | Type | Description |

        |-------|------|-------------|

        | `data` | Object | The payin object (`status` reflects the state at
        response time) |

        | `warning` | String | Present on **207** when initiation had a
        recoverable issue |


        **Success responses**


        | Status Code | Description |

        |-------------|-------------|

        | **201** | The payin was approved and processing continued;
        **`data.status`** reflects the outcome of this request. |

        | **202** | The request was accepted and **`data`** includes the payin,
        but **`data.status`** may still change. Poll **`GET /api/payins/{id}`**
        until the payin reaches a terminal status. |

        | **207** | The payin was approved but initiation did not complete
        successfully; see **`warning`** and **`data.status`**. |


        **Error and retry responses**


        | Status Code | Error code | Description |

        |-------------|------------|-------------|

        | **400** | `INVALID_STATUS` | The payin is not in **CREATED** status
        and cannot be approved. |

        | **401** | `AUTHENTICATION_ERROR` | Authentication credentials are
        invalid or missing. |

        | **403** | `AUTHORIZATION_ERROR` | You do not have permission to
        perform this action. |

        | **404** | `PAYIN_NOT_FOUND` | Payin not found or does not belong to
        your entity. |

        | **503** | (see response body) | **Transient error**—bank initiation
        did not complete for this request. **Retry** the same approve call after
        a short wait. The JSON body includes `error_code` and `message` for
        logging and automation. |


        **Notes**


        - Treat **202** like any accepted operation: use the returned id and
        **poll** until status stabilizes.

        - **503** is for **retries**, not a final business outcome for the
        transfer.
      tags:
        - payinsApi
      parameters:
        - name: payin_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - 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: Payin approved and initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovePayinResponse'
        '404':
          description: Payin not found
          content:
            application/json:
              schema:
                description: Any type
        '503':
          description: Payin approved, but bank initiation could not be started—retry later
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    PayinResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        payer_id:
          type: string
          format: uuid
        amount_in_cents:
          type: integer
          description: >-
            Deprecated. Use amount_in_minor_units instead. Still accepted and
            returned for backward compatibility.
        amount_in_minor_units:
          type: integer
          description: Amount in the currency's minor units (e.g. cents for USD).
        currency_code:
          type: string
        rail:
          type: string
        status:
          type: string
        status_recorded_at:
          type: string
          format: date-time
        payin_metadata:
          type: object
          additionalProperties:
            description: Any type
        client_metadata:
          type: object
          additionalProperties:
            description: Any type
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - payer_id
        - amount_in_cents
        - amount_in_minor_units
        - currency_code
        - rail
        - status
        - status_recorded_at
        - payin_metadata
        - created_at
        - updated_at
      description: Response model for payin operations.
      title: PayinResponse
    ApprovePayinResponse:
      type: object
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/PayinResponse'
            - type: 'null'
        warning:
          type:
            - string
            - 'null'
      description: Response model for single payin approval.
      title: ApprovePayinResponse
  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

### Example 1



**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "payer_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "currency_code": "USD",
    "rail": "same_day_ach",
    "status": "initiated",
    "status_recorded_at": "2024-01-15T09:30:00Z",
    "payin_metadata": {
      "invoice_number": "INV-20240115-001",
      "customer_reference": "CUST-789456"
    },
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:45:00Z",
    "amount_in_cents": 2500,
    "client_metadata": {
      "ip_address": "192.168.1.100",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
    }
  },
  "warning": null
}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/payins/payin_id/approve"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/payins/payin_id/approve';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.useroot.com/api/payins/payin_id/approve"

	payload := strings.NewReader("{}")

	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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payins/payin_id/approve")

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 = "{}"

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.useroot.com/api/payins/payin_id/approve")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payins/payin_id/approve', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payins/payin_id/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

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

### Example 2



**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "payer_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "currency_code": "USD",
    "rail": "same_day_ach",
    "status": "initiated",
    "status_recorded_at": "2024-01-15T09:30:00Z",
    "payin_metadata": {
      "invoice_number": "INV-20240115-001",
      "customer_reference": "CUST-789456"
    },
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:45:00Z",
    "amount_in_cents": 2500,
    "client_metadata": {
      "ip_address": "192.168.1.100",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
    }
  },
  "warning": null
}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/payins/payin_id/approve"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/payins/payin_id/approve';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.useroot.com/api/payins/payin_id/approve"

	payload := strings.NewReader("{}")

	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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payins/payin_id/approve")

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 = "{}"

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.useroot.com/api/payins/payin_id/approve")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payins/payin_id/approve', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payins/payin_id/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

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

### Example 3



**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "payer_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "amount_in_minor_units": 2500,
    "currency_code": "USD",
    "rail": "same_day_ach",
    "status": "initiated",
    "status_recorded_at": "2024-01-15T09:30:00Z",
    "payin_metadata": {
      "invoice_number": "INV-20240115-001",
      "customer_reference": "CUST-789456"
    },
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:45:00Z",
    "amount_in_cents": 2500,
    "client_metadata": {
      "ip_address": "192.168.1.100",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
    }
  },
  "warning": null
}
```

**SDK Code**

```python
import requests

url = "https://api.useroot.com/api/payins/payin_id/approve"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.useroot.com/api/payins/payin_id/approve';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.useroot.com/api/payins/payin_id/approve"

	payload := strings.NewReader("{}")

	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
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/payins/payin_id/approve")

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 = "{}"

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.useroot.com/api/payins/payin_id/approve")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useroot.com/api/payins/payin_id/approve', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/payins/payin_id/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

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