Test VRPs in sandbox

Use our sandbox environment to test your variable recurring payments integration.

Before you start processing real payments, test our VRP endpoints in the Sandbox environment as part of your integration. The behaviour of our Sandbox API is identical to the Live API, except that no actual money moves.

📘

Collections

The Insomnia collection for Payments v3 contains preconfigured API requests to get you testing as quickly as possible.

To test VRPs in sandbox, we recommend that you use the NatWest sandbox provider. This provider_id for testing mandates is ob-natwest-vrp-sandbox.

1. Create a mandate and select the sandbox provider

In a mandate creation request with preselected provider selection, you provide this ID in the mandate.provider_selection.provider_id parameter of your request.

In a mandate creation request with user_selected provider selection, you can select the Natwest VRP Sandbox provider from the list of providers that display.

2. Go through mandate authorisation

When you create a mandate using the ob-natwest-vrp-sandbox provider, you see a mandate authorisation screen. Your user would see the same screens when they authorise a mandate with NatWest (and equivalent screens when authorising with any other provider).

The two screens you have to complete when authorising a mandate to the `ob-natwest-vrp-sandbox` provider.

The three screens you have to complete when authorising a mandate to the ob-natwest-vrp-sandbox provider.

To authorise the mandate with this sandbox provider, use these credentials:

  • Customer number: 123456789012
  • Pin / password: 5 7 2 / 4 3 6.

[Optional] Test the optional remitter object

When you create a mandate, you can include the optional remitter object. If you do this, the user doesn't need to select an account when they authorise the mandate. Instead, you can preselect an account for them by supplying the SCAN or IBAN of that account.

Using the test provider above, ob-natwest-vrp-sandbox, there are only two sets of account details you can use to test the remitter object:

Account numberSort code
12345601500000
12345602500000

Example mandate creation requests

Below are two example mandates created in the sandbox environment. One is for a user_selected mandate, where the bank selection displays. The other is for a preselected mandate with the remitter object filled in, so the user doesn't have to select a bank or account.

The constraints in both of these examples mean that:

  • the mandates are valid between the 1st January 2024 until 1st January 2025
  • the maximum value of an individual payment is 50 pence
  • the maximum value that can be paid in a given day is 1 GBP
  • the maximum value that can be paid in a given month is 10 GBP
POST /v3/mandates HTTP/1.1
Content-Type: application/json
Idempotency-Key: {RANDOM_UUID}
Tl-Signature: {SIGNATURE}
Authorization: Bearer {ACCESS_TOKEN}
Host: api.truelayer-sandbox.com
{
  "mandate":  {
    "type":  "sweeping",
    "provider_filter":  {
      "countries":  [
        "GB"
      ],
      "release_channel":  "private_beta"
    },
    "provider_selection":  {
      "type":  "user_selected"
    },
    "beneficiary":  {
      "type":  "merchant_account",
      "merchant_account_id":  "200552da-13da-43c5-a9ba-04ee1502ac57",
        "account_holder_name":  "Docs  Test  Merchant  Account"
    }
  },
  "currency":  "GBP",
  "user":  {
    "id":  "7e8711ee-7741-472c-acca-7e99166ffe63",
    "name":  "Docs  Test  User",
    "email":  "[email protected]",
    "phone":  "+441234567890"
  },
  "constraints":  {
    "valid_from":  "2024-02-16T15:53:58.649Z",
    "valid_to":  "2025-01-01T00:00:00.000Z",
    "maximum_individual_amount":  50,
    "periodic_limits":  {
      "day":  {
        "maximum_amount":  100,
        "period_alignment":  "calendar"
      },
      "month":  {
        "maximum_amount":  1000,
        "period_alignment":  "calendar"
      }
    }
  }
}
POST /v3/mandates HTTP/1.1
Content-Type: application/json
Idempotency-Key: {RANDOM_UUID}
Tl-Signature: {SIGNATURE}
Authorization: Bearer {ACCESS_TOKEN}
Host: api.truelayer-sandbox.com
{
  "mandate": {
    "type": "sweeping",
    "provider_filter": {
      "countries": [
        "GB"
      ],
      "release_channel": "private_beta"
    },
    "provider_selection": {
      "type": "preselected",
      "provider_id": "ob-natwest-vrp-sandbox",
      "remitter": {
      "account_identifier": {
        "type": "sort_code_account_number",
        "account_number": "12345601",
        "sort_code": "500000"
      },
      "account_holder_name": "Docs Test User"
      }
    },
    "beneficiary": {
      "type": "merchant_account",
      "merchant_account_id": "200552da-13da-43c5-a9ba-04ee1502ac57",
      "account_holder_name": "Docs Test Merchant Account"
    }
  },
  "currency": "GBP",
  "user": {
    "id": "c0b2aa52-edf0-462c-82f4-fb951a14afa7",
    "name": "qwerty",
    "email": "[email protected]",
    "phone": "+441234567890"
  },
  "constraints": {
    "valid_from": "2024-02-16T16:02:42.323Z",
    "valid_to": "2025-01-01T00:00:00.000Z",
    "maximum_individual_amount": 50,
    "periodic_limits": {
      "day": {
        "maximum_amount": 100,
        "period_alignment": "calendar"
      },
      "month": {
        "maximum_amount": 1000,
        "period_alignment": "calendar"
      }
    }
  }
}