# Outgoing Payments

You can make payments from an application into a bank account of your choice, the primary function of this is to refund a payment.

First you will need to call our API and request a payment. This should be done from your back-end to prevent users from accessing your application credentials.

To do this you need to send a POST request to the following url

https://api.vendreo.com/v1/request-outgoing-payment

curl --location --request POST 'https://api.vendreo.com/v1/request-outgoing-payment' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
    "application_key": "{APPLICATION_KEY}",
    "amount": "120",
    "currency": "GBP",
    "description" : "Product Description",
    "redirect_url": "https://example.com/redirect",
    "original_payment_uuid": null,
    "options": "optional string ",
    "account_name": "Joe Blogs",
    "sort_code": "123456",
    "account_number": "12345678"
  }'

# Header Parameters :

Header Value
Content-Type application/json
Authorization Bearer {application_secret}
(this will be included in the JSON object downloaded after creating the application. Details)

# Query Parameters :

Key Value
application_key Required - String
This will be included in the JSON object downloaded after creating the application. Details
amount Required - Integer
Amount to charge in pence e.g.: 150 for £1.5
currency Required - String
ISO CURRENCY code (accepted GBP)
description Required - String
Short Description of the payment. This will appear on the payment summary
original_payment_uuid Optional - String
Once request completed, the system will mark the original payment as REFUNDED
redirect_url Required - URL
This is the URL where the user will be redirected after completing the payment
options Optional - String
Any optional parameters which will be passed to all the requests to Application Callback URL
account_name Optional - String
Name of customer where the transfer will be sent to
sort_code Optional - String
Sortcode where the transfer will be sent to
account_number Optional - String
Account Number where the transfer will be sent to

TIP

If any of the account_name, sort_code or account_number is not filled in, the user will be prompted to enter their details, if all three are present, the user will be locked into using the details you provide.

# Response

{
	"redirect_url": "https://pay.vendreo.com/dynamic-payment/{DynamicPaymentUUID}",
	"outgoing_payment_request_id": 536
}

User will be redirected to redirect_url where the payment process will start.

# Sandbox Credentials:

Bank How to login
AIB GB Sandbox Click on the login link. Authorisation will complete immediately and you will be redirected.
Natwest Sandbox Customer Number: 123456789012

When prompted to enter your PIN and Password, Natwest Sandbox will display the values to enter above each text box. Please enter these values in each box before selecting 'Continue'
Royal Bank Of Scotland Customer Number: 123456789012

When prompted to enter your PIN and Password, Natwest Sandbox will display the values to enter above each text box. Please enter these values in each box before selecting 'Continue'
Modelo Sandbox Username: mits
Passwords: mits

WARNING

For Sandbox environment, Vendreo recommends using Modelo Sandbox bank for testing your API integration.

As soon as the payment process is complete (success/fail), the user will be redirected to the redirect_url provided on request-outgoing-payment API request.

Vendreo will attempt to inform your system about the status of a payment by making a series of API requests to your Application callback URL.