---
title: Pull funding (ACH debit) rail
slug: apis/lending/loan-funding-payment-rails/pull-funding-ach-debit-rail
description: Pull funds from a merchant (ACH debit) via the pull funding flow; submit instructions through the funding API (PUT /FundingInfo)
icon: {"apiMethod":"PUT"}
docTags: 
createdAt: 2024-11-10T10:44:01.526Z
---

## PullFunding API

The PullFunding API provides a method for MPLs to retrieve funds from merchant accounts back into the bank, using Nacha Debits. This is especially useful when a merchant initiates a return or refund, as it reduces the need for manual reconciliation or additional requests, by reusing previously funded loan.

:::hint{type="success"}
It is best practice to wait three days before sending out funds after a successful pull.

According to Nacha standards, a pull can be returned to the merchant. Most returns tend to occur within the first three days. To reduce the likelihood of overfunding, it is advisable to wait before sending out the next `FundingInfo` request.
:::

## Flow of funds

### When this API can be called

Before calling the PullFunding API, ensure the loan is eligible for using this API according to `Loan Status` and `Amount` being requested.&#x20;

Loan status should be one of the following:

- `NotFullyFunded`
- `Funded` 
- `ReadyToSell`&#x20;
- `Sold`

`Amount` being requested in the API should be greater than 0 and less than the sum of rails that have been successfully sent and have not been returned.

- 0 \< `Amount `\<=`  loan.amountFunded  `

### Flow of PullFunding

When this API succeeds, you receive an ID in the response. Track this Rail ID using the `RailUpdated` [Hook notifications](docId\:jXGfRbtNHOshrZJYHYKTo) .&#x20;

The full list of FundResults of the rail is in the RailResultType [Enums](docId\:hpq_QWOAKV9JprqwkFR1I) .&#x20;

:::hint{type="warning"}
Using the PullFunding API, is essentially asking for a return of funds to the loan.&#x20;

Unlike the success of a standard push rail, a successful pull will be in a **`returned`** status and *not&#x20;*&#x69;n a **`success`** status.
:::

These statuses have different meanings than other rail statuses:

| Action                    | FundResult (`RailResultType` [Enums](docId\:hpq_QWOAKV9JprqwkFR1I) ) | Description                                                                                                                                                        |
| ------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Put /PullFunding succeeds | Requested                                                            | Pull Funds has been requested.                                                                                                                                     |
| The Pull Succeeds         | Returned                                                             | The Pull Funds request has **been successfully&#x20;**&#x72;eceived by NACHA, and the bank has received the funds. The pull amount has been returned to the loan.  |
| Pull is returned          | PullReturned                                                         | The ACH Pull, has been returned. The amount available in the loan for funding, will be deducted by the rail amount.                                                |

## PUT /&#x7B;LoanID}/PullFunding

:::ApiMethodV2
```json
{
  "name": "Pull Funding",
  "method": "PUT",
  "url": "https://arixapisandbox.crbnj.net/Loan/{LoanID}/PullFunding",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "t_DbvA86d68lA7ZVJefrn",
        "language": "curl",
        "code": "curl --location --request PUT 'https://arixapisandbox.crbnj.net/Loan/215eb077-3a00-4ed3-995b-b226010ccc78/PullFunding' \\\n--header 'Authorization: Bearer <token>' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"FundingPull\": {\n   \"Rail\":\n           {\n         \"ACHFields\": {\n          \"StandardEntryClassCode\": \"PPD\",\n          \"TransactionType\": \"pull\",\n          \"ToRoutingNumber\": \"021214891\",\n          \"ToAccountType\": \"GL\",\n          \"ToAccountName\": \"Ari\",\n          \"ToAccountNumber\": \"9999999999\",\n          \"Description\": \"Pulling from Ari\"\n        },\n        \"RailType\": \"COSACH\",\n        \"Priority\": 1,\n        \"Amount\": 100\n      }\n  }\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "t_DbvA86d68lA7ZVJefrn"
  },
  "results": {
    "languages": [
      {
        "id": "QqHiLt-FHhPgn7vzGSzAQ",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"LoanId\": \"e92081b4-8735-4294-a061-b22400cdeb8b\",\n    \"Rail\": {\n        \"ACHFields\": {\n            \"StandardEntryClassCode\": \"PPD\",\n            \"TransactionType\": \"pull\",\n            \"ToRoutingNumber\": \"021214891\",\n            \"ToAccountType\": \"GL\",\n            \"ToAccountName\": \"Account name to pull from\",\n            \"ToAccountNumber\": \"9999999999\"\n        },\n        \"Id\": \"68e96cb3-a449-460b-ad7e-b22400ce10fe\",\n        \"RailType\": \"COSACH\",\n        \"Priority\": 1,\n        \"Amount\": 500,\n        \"LoanId\": \"e92081b4-8735-4294-a061-b22400cdeb8b\",\n        \"MPLId\": \"TST\",\n        \"IsFailed\": false,\n        \"LoanType\": \"Undefined\"\n    }\n}"
      },
      {
        "id": "tyfobRzvVk1n0SUYH7D-l",
        "language": "400",
        "code": " {\n    \"ResponseStatus\": {\n        \"ErrorCode\": \"BadRequest\",\n        \"Message\": \"PullFunding amount should be less than or equal to current AmountFunded: 500\",\n        \"Errors\": []\n    }\n}\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "tyfobRzvVk1n0SUYH7D-l"
  },
  "request": {
    "pathParameters": [
      {
        "name": "LoanID",
        "kind": "required",
        "type": "string",
        "description": "The Unique ID of the loan returned from the POST /Loan API call.",
        "": "The Unique ID of the loan returned from the POST /Loan API call."
      }
    ],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "FundingPull",
        "kind": "required",
        "type": "Object",
        "description": "",
        "children": [
          {
            "name": "Rail",
            "kind": "required",
            "type": "Object",
            "description": "",
            "children": [
              {
                "name": "ACHFields",
                "kind": "required",
                "type": "Object",
                "description": "",
                "children": [
                  {
                    "name": "StandardEntryClassCode",
                    "kind": "required",
                    "type": "string",
                    "description": "The type of account:\n\nPPD - consumer accounts\n\n CCD - corporate accounts\n\n"
                  },
                  {
                    "name": "ToRoutingNumber",
                    "kind": "required",
                    "type": "string",
                    "description": "Routing number of the bank we are attempting to pull funds from. \nThe value entered for this field is validated up front and it must be 9 digits long."
                  },
                  {
                    "name": "ToAccountName",
                    "kind": "required",
                    "type": "string",
                    "description": "Name on the merchant account that we are pulling from.\nLimited to 22 characters."
                  },
                  {
                    "name": "ToAccountNumber",
                    "kind": "required",
                    "type": "string",
                    "description": "Account number.\n\nLimited to 17 digits.\n"
                  },
                  {
                    "name": "Description",
                    "kind": "required",
                    "type": "string",
                    "description": "Mapped to identification field in the NACHA file.\nLimited to 15 characters."
                  },
                  {
                    "name": "TransactionType",
                    "kind": "required",
                    "type": "string",
                    "description": "Pull\n\nThis should be a constant value for PullFunding."
                  },
                  {
                    "name": "ToAccountType",
                    "kind": "required",
                    "type": "string",
                    "description": "Checking account or savings account."
                  }
                ]
              },
              {
                "name": "RailType",
                "kind": "required",
                "type": "string",
                "description": "COSACH - For standard ACH.\nCOSACHSD - For same day funding ACH."
              },
              {
                "name": "Amount",
                "kind": "required",
                "type": "Number",
                "description": "The amount of money to pull. "
              },
              {
                "name": "Priority",
                "kind": "optional",
                "type": "Integer",
                "description": "If more than one Pull is needed, then the order in which they are sent can have a priority.\nThis is the order the rails should be processed - starts with number 1."
              }
            ]
          }
        ],
        "schema": [
          {
            "name": "Rail",
            "kind": "required",
            "type": "Object",
            "description": "",
            "children": [
              {
                "name": "ACHFields",
                "kind": "required",
                "type": "Object",
                "description": "",
                "children": [
                  {
                    "name": "StandardEntryClassCode",
                    "kind": "required",
                    "type": "string",
                    "description": "The type of account:\n\nPPD - consumer accounts\n\n CCD - corporate accounts\n\n"
                  },
                  {
                    "name": "ToRoutingNumber",
                    "kind": "required",
                    "type": "string",
                    "description": "Routing number of the bank we are attempting to pull funds from. \nThe value entered for this field is validated up front and it must be 9 digits long."
                  },
                  {
                    "name": "ToAccountName",
                    "kind": "required",
                    "type": "string",
                    "description": "Name on the merchant account that we are pulling from.\nLimited to 22 characters."
                  },
                  {
                    "name": "ToAccountNumber",
                    "kind": "required",
                    "type": "string",
                    "description": "Account number.\n\nLimited to 17 digits.\n"
                  },
                  {
                    "name": "Description",
                    "kind": "required",
                    "type": "string",
                    "description": "Mapped to identification field in the NACHA file.\nLimited to 15 characters."
                  },
                  {
                    "name": "TransactionType",
                    "kind": "required",
                    "type": "string",
                    "description": "Pull\n\nThis should be a constant value for PullFunding."
                  },
                  {
                    "name": "ToAccountType",
                    "kind": "required",
                    "type": "string",
                    "description": "Checking account or savings account."
                  }
                ]
              },
              {
                "name": "RailType",
                "kind": "required",
                "type": "string",
                "description": "COSACH - For standard ACH.\nCOSACHSD - For same day funding ACH."
              },
              {
                "name": "Amount",
                "kind": "required",
                "type": "Number",
                "description": "The amount of money to pull. "
              },
              {
                "name": "Priority",
                "kind": "optional",
                "type": "Integer",
                "description": "If more than one Pull is needed, then the order in which they are sent can have a priority.\nThis is the order the rails should be processed - starts with number 1."
              }
            ]
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "response": [
    {
      "name": "id",
      "kind": "optional",
      "type": "string",
      "description": "The ID of the rail being pulled. Use this to track updates of the RailUpdated hook event.\n "
    }
  ],
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "pull-funding",
  "legacyHash": "GiyxreRBS0oUFTGmVV7-K"
}
```
:::

