{"openapi":"3.1.0","info":{"title":"Legacy - PayDirect API","version":"1.0"},"servers":[{"url":"https://paydirect.truelayer.com"},{"url":"https://paydirect.truelayer-sandbox.com"}],"tags":[{"name":"Withdrawals","description":"Withdrawal (Payouts) Endpoints."},{"name":"Deposits","description":"Deposit (Payins) Endpoints."},{"name":"Users","description":"User Endpoints."},{"name":"Balances","description":"Balance Endpoints."},{"name":"Transactions","description":"Transaction Endpoints."}],"paths":{"/v1/withdrawals":{"post":{"tags":["Withdrawals"],"summary":"Create open-loop withdrawal","description":"Enable paying out from merchant account to any beneficiary.\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/OpenLoopPayout"}}}},"responses":{"202":{"description":"Accepted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/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"}}}},"/v1/users/deposits":{"post":{"tags":["Deposits","Users"],"summary":"Create deposit","description":"Create a deposit into a merchant account from a users account.\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","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/DepositRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/DepositRequestResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/ProviderError"}}}},"/v1/users/{user_id}/accounts/{account_id}/withdrawals/{transaction_id}":{"get":{"tags":["Withdrawals","Users"],"summary":"Get user withdrawal","description":"Fetch the details of a previously created closed-loop withdrawal.\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":[{"name":"user_id","in":"path","description":"User ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the user for the current client"}},{"name":"account_id","in":"path","description":"Account ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the account"}},{"name":"transaction_id","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the withdrawal transaction"}}],"responses":{"200":{"description":"Success","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/UserAccountWithdrawalResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/withdrawals/{transaction_id}":{"get":{"tags":["Withdrawals"],"summary":"Get withdrawal","description":"Fetch the details of a previously created withdrawal.\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":[{"name":"transaction_id","in":"path","description":"Transaction ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the withdrawal transaction"}}],"responses":{"200":{"description":"Success","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/UserAccountWithdrawalResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/users/{user_id}/deposits/{deposit_id}":{"get":{"tags":["Deposits","Users"],"summary":"Get deposit for user","description":"Fetches details for a previously created deposit.\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":[{"name":"user_id","in":"path","description":"User ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the user for the current client"}},{"name":"deposit_id","in":"path","description":"Deposit ID","required":true,"schema":{"type":"string","format":"uuid","description":"UUID identifying the deposit"}}],"responses":{"200":{"description":"Success","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/UserDeposit"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/users/{id}":{"get":{"tags":["Users"],"summary":"Get user","description":"Returns 204 if this user exists for the authenticated client, and 404 if not.\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":[{"name":"id","in":"path","description":"User ID","required":true,"schema":{"type":"string","description":"UUID identifying the user for the current client"}}],"responses":{"204":{"description":"The supplied UUID exists for the current client"},"404":{"description":"The supplied UUID does not exist for the current client"}}}},"/v1/users/{id}/accounts":{"get":{"tags":["Users"],"summary":"Get user accounts","description":"Fetches account identifiers associated with the supplied user id.\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":[{"name":"id","in":"path","description":"User ID","required":true,"schema":{"type":"string","description":"UUID identifying the user for the current client"}}],"responses":{"200":{"description":"zero or more accounts associated with this user id","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/UserAccountsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/transactions":{"get":{"tags":["Transactions"],"summary":"Get transactions","description":"Get list of merchant account transactions.\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":[{"name":"from","in":"query","description":"from","required":true,"schema":{"type":"string","description":"ISO8601 UTC string representing start of transaction list window"}},{"name":"to","in":"query","description":"to","required":true,"schema":{"type":"string","description":"ISO8601 UTC string representing end of transaction list window"}},{"name":"type","in":"query","description":"type","required":false,"schema":{"type":"string","description":"Filter on type of transaction"}},{"name":"currencies","in":"query","description":"currencies","required":false,"schema":{"type":"string","description":"Comma separated list of currencies to to filter by"}}],"responses":{"200":{"description":"collection of transactions","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/TransactionsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/balances":{"get":{"tags":["Balances"],"summary":"Get account balances","description":"Fetches balances of the merchant accounts belonging to the calling client.\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"]}],"responses":{"200":{"description":"Balances","content":{"application/json; charset=UTF-8":{"schema":{"$ref":"#/components/schemas/BalancesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"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"}}}},"Conflict":{"description":"Request Conflict","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"}}}},"ProviderError":{"description":"Provider 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"]},"DepositResponseDetails":{"type":"object","properties":{"deposit_id":{"type":"string","format":"uuid"},"initiated_at":{"type":"string","format":"date-time"},"status":{"type":"string"},"provider_id":{"type":"string"},"scheme_id":{"type":"string"},"fee_option_id":{"type":"string"},"amount_in_minor":{"type":"integer"},"currency":{"$ref":"#/components/schemas/Currency"},"remitter":{"$ref":"#/components/schemas/DepositRemitter"},"remitter_reference":{"type":"string"}},"required":["deposit_id","initiated_at","status","provider_id","scheme_id","amount_in_minor","currency"]},"DepositResponseAuthFlow":{"type":"object","properties":{"type":{"type":"string"},"uri":{"type":"string","format":"uri"},"expiry":{"type":"string"},"step":{"type":"object","properties":{"type":{"type":"string"},"step_id":{"type":"string"},"additional_inputs":{"type":"object","additionalProperties":{"type":"string"}},"outcome":{"type":"string"}},"required":["type"]}},"required":["type"]},"DepositRequestResponse":{"type":"object","properties":{"result":{"type":"object","properties":{"deposit":{"$ref":"#/components/schemas/DepositResponseDetails"},"auth_flow":{"$ref":"#/components/schemas/DepositResponseAuthFlow"}}}},"required":["result"]},"DepositRemitter":{"type":"object","properties":{"name":{"type":"string"},"account":{"$ref":"#/components/schemas/PayV2Account"}},"required":["account"]},"DepositRequestDetails":{"type":"object","properties":{"deposit_id":{"type":"string","format":"uuid"},"provider_id":{"type":"string"},"scheme_id":{"type":"string"},"fee_option_id":{"type":"string"},"amount_in_minor":{"type":"integer"},"currency":{"$ref":"#/components/schemas/Currency"},"remitter":{"$ref":"#/components/schemas/DepositRemitter"},"remitter_reference":{"type":"string"}},"required":["deposit_id","provider_id","scheme_id","amount_in_minor","currency"]},"DepositRequestAuthFlow":{"type":"object","properties":{"type":{"type":"string"},"return_uri":{"type":"string","format":"uri"},"psu_ip_address":{"type":"string","format":"ipaddress"},"data_access_token":{"type":"string"},"additional_inputs":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},"DepositRequest":{"type":"object","properties":{"user_id":{"type":"uuid"},"deposit":{"$ref":"#/components/schemas/DepositRequestDetails"},"auth_flow":{"$ref":"#/components/schemas/DepositRequestAuthFlow"}},"required":["user_id","deposit","auth_flow"]},"Balance":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"iban":{"type":"string","format":"iban"},"status":{"type":"string"},"account_owner":{"type":"string"},"current_balance_in_minor":{"type":"integer"},"available_balance_in_minor":{"type":"integer"}}},"WithdrawalContextCode":{"type":"string","enum":["withdrawal","service_payment","internal"]},"Remitter":{"type":"object","properties":{"name":{"type":"string"},"iban":{"type":"string","format":"IBAN"},"reference":{"type":"string"}}},"Beneficiary":{"allOf":[{"$ref":"#/components/schemas/Remitter"}]},"Currency":{"type":"string","enum":["GBP","EUR"]},"PayV2Account":{"type":"object","example":{"type":"sort_code_account_number","sort_code":"987654","account_number":"98765432"},"properties":{"type":{"type":"string"},"sort_code":{"type":"string"},"account_number":{"type":"string"},"iban":{"type":"string"},"bban":{"type":"string"},"nrb":{"type":"string"}},"required":["type"]},"UserDeposit":{"type":"object","properties":{"result":{"type":"object","properties":{"deposit_id":{"type":"uuid"},"status":{"type":"string"},"initiated_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"amount_in_minor":{"type":"integer"},"currency":{"$ref":"#/components/schemas/Currency"},"provider_id":{"type":"string"},"scheme_id":{"type":"string"},"fee_option_id":{"type":"string"},"beneficiary":{"type":"object","properties":{"name":{"type":"string"},"account":{"$ref":"#/components/schemas/PayV2Account"}}},"remitter":{"type":"object","properties":{"name":{"type":"string"},"account":{"$ref":"#/components/schemas/PayV2Account"}}},"references":{"type":"object","example":{"type":"single","reference":"REF123"},"properties":{"type":{"type":"string"},"reference":{"type":"string"},"beneficiary":{"type":"string"},"remitter":{"type":"string"}}},"settled":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"},"settled_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"account_id":{"type":"string","format":"uuid"}}}}}}},"WithdrawalCommon":{"type":"object","properties":{"type":{"type":"string","enum":["payout"]},"transaction_id":{"type":"string","format":"uuid"},"amount_in_minor":{"type":"number"},"currency":{"$ref":"#/components/schemas/Currency"},"beneficiary":{"$ref":"#/components/schemas/Beneficiary"},"context_code":{"$ref":"#/components/schemas/WithdrawalContextCode"}}},"SettledWithdrawal":{"allOf":[{"$ref":"#/components/schemas/WithdrawalCommon"},{"type":"object","properties":{"settled_at":{"type":"string","format":"date-time"},"submitted_at":{"type":"string","format":"date-time"},"authorised_at":{"type":"string","format":"date-time"}}}]},"DepositTransaction":{"type":"object","properties":{"type":{"type":"string","enum":["topup"]},"transaction_id":{"type":"string","format":"uuid"},"settled_at":{"type":"string","format":"date-time"},"amount_in_minor":{"type":"integer"},"currency":{"$ref":"#/components/schemas/Currency"},"remitter_name":{"type":"string"},"remitter_iban":{"type":"string"},"reference":{"type":"string"},"deposit_id":{"type":"string","description":"The deposit_id of the close loop payment"}}},"TransactionsResponse":{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/DepositTransaction"},{"$ref":"#/components/schemas/SettledWithdrawal"}]}}}},"BalancesResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Balance"}}}},"UserAccountWithdrawalResponse":{"type":"object","properties":{"result":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"},"authorised_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"submitted_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"settled_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"rejected_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"failed_at":{"type":"string","format":"date-time","description":"Utc DateTime ISO8601 string"},"beneficiary_name":{"type":"string"},"beneficiary_iban":{"type":"string","format":"iban"},"beneficiary_reference":{"type":"string"},"amount_in_minor":{"type":"number"},"currency":{"$ref":"#/components/schemas/Currency"},"status":{"type":"string"},"context_code":{"$ref":"#/components/schemas/WithdrawalContextCode"}}}}},"UserAccountsResponse":{"type":"object","properties":{"results":{"type":"array","items":{"properties":{"account_id":{"type":"string","format":"uuid","description":"UUID of the account"},"name":{"type":"string","description":"Name as it appears in Remitter Details"},"iban":{"type":"string","description":"IBAN associated with this account"},"currency":{"type":"string","enum":["EUR","GBP"],"description":"ISO 4217 alpha-3 currency code"}}}}}},"OpenLoopPayout":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid","description":"UUID identifying the user for the current client"},"beneficiary_name":{"type":"string","description":"The beneficiary name as it should appear against the account"},"beneficiary_iban":{"type":"string","description":"IBAN of the beneficiary account"},"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. eg 100 == 1GBP"}},"required":["transaction_id","beneficiary_name","beneficiary_iban","beneficiary_reference","currency","amount_in_minor"]},"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. eg 100 == 1GBP"}},"required":["user_id","account_id","transaction_id","beneficiary_reference","currency","amount_in_minor"]}},"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://auth.truelayer.com/connect/token","scopes":{"paydirect":"for enacting deposits and withdrawals"}}}}}}}