---
updatedAt: 2026-05-27T09:42:40.000Z
agentTools:
  projectIndex: https://docs.truelayer.com/llms.txt
---

# Create closed-loop withdrawal

Enable paying out from merchant account to one that has been used to pay-in.

> 🚧 Payments API v3
>
> The [Payments API v3](https://docs.truelayer.com/reference/create-payment) is the latest version of the TrueLayer payments API. It includes all of the functionality of the PayDirect API, so we recommend you use it instead.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Legacy - PayDirect API",
    "version": "1.0"
  },
  "x-readme": {
    "samples-languages": [
      "shell",
      "java",
      "csharp",
      "php"
    ]
  },
  "servers": [
    {
      "url": "https://paydirect.truelayer-sandbox.com",
      "description": "Sandbox server"
    },
    {
      "url": "https://paydirect.truelayer.com",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Withdrawals",
      "description": "Withdrawal (Payouts) Endpoints."
    },
    {
      "name": "Users",
      "description": "User Endpoints."
    }
  ],
  "paths": {
    "/v1/users/withdrawals": {
      "post": {
        "tags": [
          "Withdrawals",
          "Users"
        ],
        "summary": "Create closed-loop withdrawal",
        "description": "Enable paying out from merchant account to one that has been used to pay-in.\n\n> 🚧 Payments API v3\n>\n> The [Payments API v3](https://docs.truelayer.com/reference/create-payment) is the latest version of the TrueLayer payments API. It includes all of the functionality of the PayDirect API, so we recommend you use it instead.\n",
        "security": [
          {
            "Oauth2": [
              "paydirect"
            ]
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Tl-Signature",
            "description": "A JWS with detached content, signed with your private key.\nSee [Request Signing](https://docs.truelayer.com/docs/sign-your-payments-requests)\n",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json; charset=UTF-8": {
              "schema": {
                "$ref": "#/components/schemas/ClosedLoopPayout"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Invalid Request",
        "content": {
          "application/json; charset=UTF-8": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json; charset=UTF-8": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found",
        "content": {
          "application/json; charset=UTF-8": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal Server Error",
        "content": {
          "application/json; charset=UTF-8": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description"
        ]
      },
      "ClosedLoopPayout": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID identifying the user for the current client"
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the account that was previously generated from a deposit"
          },
          "transaction_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID to identify this withdrawal"
          },
          "beneficiary_reference": {
            "type": "string",
            "description": "The reference that will appear in the beneficiary account against"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "GBP"
            ]
          },
          "amount_in_minor": {
            "type": "number",
            "description": "The 'cent' value representing the amount, e.g. 100 == 1GBP"
          }
        },
        "required": [
          "user_id",
          "account_id",
          "transaction_id",
          "beneficiary_reference",
          "currency",
          "amount_in_minor"
        ]
      }
    }
  }
}
```