4. Payments into a wallet – direct debit

Introduction

This endpoint enables a one-off payment from the customer’s bank to their Customate wallet using direct debit.

All payments within Customate have a source (funding source) and a destination (payee). Funding sources and payees have a type.

When a profile is created and verified, a funding source and a payee (both of type wallet) are created.

First create a Direct Debit funding source

Our system needs to know the details of the external bank to pull funds from and into the wallet.

The funding source for this payment must be of type direct_debit and the payee must be of type wallet. The currency is GBP.

To create a direct debit funding source, use the direct_debit_funding_sources endpoint. It will take several days for the bank to validate it.

We have described this process in detail earlier in the knowledge base.

Then create a schedule to pull funds from the funding source into the wallet

Specify the amount (in pence), an optional description and metadata.

To make regular direct debit payments according to a schedule, use the direct_debit_to_wallet_schedules endpoint.

process flow - direct debit

Payments take place after any non-processing dates (bank holidays, weekends).

Required information for the endpoint, direct_debit_to_wallet_payments

  • amount, in pence
  • funding source ID (funding source must be of type direct debit)
  • payee ID currency (payee must be of type wallet)

Optional information

  • description
  • execution date (UTC, in YYYY-MM-DD format, takes place after any bank holidays or weekends)
  • metadata (useful for storing client-specific information, e.g. your payment ID)

Example JSON request

{
  "amount": 1200,
  "description": "Deposit for apartment #121",
  "execution_date": "2022-04-12",
  "metadata": {
    "sample_internal_id": "d2f148cf-901c-4fee-8792-21016da755a0"
  },
  "funding_source_id": "12d24482-fbb1-4d9d-b41d-0d506ea4bc9b",
  "payee_id": "fdbf7995-84f6-4c28-b5e8-9ebec78c8edc"
}

 

Example response

{
  "id": "00c7cc70-6fcb-4d0f-89de-3387e2a284c3",
  "creation_datetime": "202109-30T12:28:22.768085Z",
  "amount": 1200,
  "scenario": "IncomingDirectDebit",
  "status": "processing",
  "currency": "GBP",
  "description": "Deposit for apartment #121",
  "wallet_id": "37cc0dd7-0744-48b2-946d-506e4b26074b",
  "schedule_id": "7dac1a26-07ca-49a6-b610-fc0280e1b9c7",
  "execution_date": "2022-04-12",
  "metadata": {},
  "funding_source": {
    "id": "12d24482-fbb1-4d9d-b41d-0d506ea4bc9b"
  },
  "payee": {
    "id": "fdbf7995-84f6-4c28-b5e8-9ebec78c8edc"
  }
}

Non-processing dates

Use the get non-processing dates endpoint to get a list of dates that banks cannot process payments (bank holidays, weekends).

Example Scenario 1: Money into a wallet from direct debit using previously validated funding source

1 – User pulls £2.99 via previously established and verified funding source to a wallet at 04:42:33 UTC as a one time DD.

2 – the Customate wallet showed payment status move from PENDING immediately (does not increase wallet balance) and then PROCESSING 2 seconds later

 

Webhook 1
{

  "items": [

    {

      "id": "da35e4dd-d979-4a66-8d0e-0cf6c4a68f82",

      "type": "payment.updated",

      "creation_datetime": "2021-09-02T04:42:33.538716+00:00",

      "data": {

        "status": "pending",

        "metadata": {},

        "scenario": "IncomingDirectDebit",

        "error_code": null,

        "error_message": null,

        "closing_balance": 0,

        "funding_source": {

          "id": "4adb5595-6865-4fcd-a76c-5dcb07b606c1"

        },

        "payee": {

          "id": "e07648f2-0900-4d7c-9f41-973b9daf3430"

        },

        "id": "23b00d9c-d188-4e91-b77c-a9a4005660cb",

        "schedule": {

          "id": null

        },

        "profile": {

          "id": "d871c453-18fe-497e-a84a-01b0f14d7a7c"

        }

      }

    }

  ]

}
Webhook 2
{

  "items": [

    {

      "id": "f932e8db-e07e-4bfb-bdcd-dd48f8362b8c",

      "type": "transaction.updated",

      "creation_datetime": "2021-09-02T04:42:35.383314+00:00",

      "data": {

        "name": "IncomingDirectDebit",

        "amount": 299,

        "status": "processing",

        "metadata": {},

        "error_code": null,

        "net_amount": "299",

        "error_message": null,

        "closing_balance": 0,

        "external_reference": "90045973-08/2",

        "funding_source": {

          "id": "4adb5595-6865-4fcd-a76c-5dcb07b606c1"

        },

        "payee": {

          "id": "e07648f2-0900-4d7c-9f41-973b9daf3430"

        },

        "schedule": {

          "id": null

        },

        "id": "b6d65c68-46ca-4e1c-bff0-4247ee61905b",

        "payment": {

          "id": "23b00d9c-d188-4e91-b77c-a9a4005660cb"

        },

        "profile": "d871c453-18fe-497e-a84a-01b0f14d7a7c",

        "fee": 0

      }

    },

    {

      "id": "d6c33255-ad50-487a-bdfe-0b393edd21ec",

      "type": "payment.updated",

      "creation_datetime": "2021-09-02T04:42:35.384427+00:00",

      "data": {

        "status": "processing",

        "metadata": {},

        "scenario": "IncomingDirectDebit",

        "error_code": null,

        "error_message": null,

        "closing_balance": 0,

        "funding_source": {

          "id": "4adb5595-6865-4fcd-a76c-5dcb07b606c1"

        },

        "payee": {

          "id": "e07648f2-0900-4d7c-9f41-973b9daf3430"

        },

        "id": "23b00d9c-d188-4e91-b77c-a9a4005660cb",

        "schedule": {

          "id": null

        },

        "profile": {

          "id": "d871c453-18fe-497e-a84a-01b0f14d7a7c"

        }

      }

    }

  ]

}