Make a payment
This guide will walk you through making a payment to a UK bank account. Payment processing is a multi-step process which requires interacting with several resource types. Learn about payments, transactions, submissions and admissions here
Prerequisites
You have already set up a bank account to make the payment from - if you haven’t, you can learn more about bank accounts here.
Overview
There are three steps to making a payment:
there are two approaches to tracking submissions:
- Create a webhook and listen for submission events.
- Poll the submission resource.
- Webhook based tracking
- Poll based tracking
The sequence diagram below captures the payment submission lifecycle using webhooks.
Webhook events may be sent out of order.
Create a payment
When creating a payment, you need to set the payment-amount
and the creditor
. The creditor
is the account the payment will be sent to.
You have the option to set a payment-reference
to identify or categorise the payment. This is limited to 35 characters.
If you don't supply a payment-reference
, it will default to "Sent from X", where X is the legal person who owns the account. This will be the entity-name
or business-name
for companies, or the given-name
and surname
for individuals. This is also subject to a 35 character limit, so longer names may be cut off.
Next, choose your creditor-type
:
- Sort code and account number (SCAN).
- A payee.
- A Griffin bank account.
- Pay to a SCAN
- Pay a payee
- Pay to a Griffin account
For the creditor
:
- Set the
creditor-type
to"uk-domestic"
. - Set the
account-number
to that of the account you're sending money to. - Set the
account-number-code
to"bban"
. - Set the
bank-id
to the sort code of the account you're sending money to. - Set the
bank-id-code
to"gbdsc"
. - Set the
account holder
to the name on the account that you're sending money to.
Dashes are not currently accepted in sort codes.
For the payment-amount
:
- Set the
amount
to your desired amount. - Set the
currency
to"gbp"
.
curl "https://api.griffin.com/${BANK_ACCOUNT_PAYMENTS_URL}" \
-X 'POST' \
-H 'Content-Type: application/json' \
-H "Authorization: GriffinAPIKey $GRIFFIN_API_KEY" \
--data '
{
"creditor": {
"creditor-type": "uk-domestic",
"account-number": "35890906",
"account-number-code": "bban",
"bank-id": "000000",
"bank-id-code": "gbdsc",
"account-holder": "John Doe"
},
"payment-amount": {
"currency": "GBP",
"value": 20.00
}
}'
For the creditor
:
- Set the
creditor-type
to "payee". - Set the
payee-url
to thepayee-url
that you captured from the previous response.
For the payment-amount
:
- Set the
amount
to your desired amount. - Set the
currency
to "gbp".
curl 'https://api.griffin.com/v0/bank/accounts/ac.svcsUO4KS3uz0ChEr5l9zA/payments' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H "Authorization: GriffinAPIKey $GRIFFIN_API_KEY" \
--data '
{
"creditor": {
"creditor-type": "payee",
"payee-url": "$PAYEE_URL"
},
"payment-amount": {
"currency": "GBP",
"value": 20.00
},
}'
For the creditor
:
- Set the
creditor-type
to"griffin-bank-account"
. - Set the
account-url
to that of another Griffin bank account in your organisation.
For the payment-amount
:
- Set the
amount
to your desired amount. - Set the
currency
to"gbp"
.
curl 'https://api.griffin.com/v0/bank/accounts/ac.svcsUO4KS3uz0ChEr5l9zA/payments' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H "Authorization: GriffinAPIKey $GRIFFIN_API_KEY" \
--data '
{
"creditor": {
"creditor-type": "griffin-bank-account",
"account-url": "$DESTINATION_GRIFFIN_ACCOUNT_URL"
},
"payment-amount": {
"currency": "GBP",
"value": 20.00
},
}'
A successful response indicates that an "outbound-payment"
has been created. At this point the payment is recorded in our system, but no movement of funds has occurred. To send the payment for processing, you must submit it using the returned payment-submissions-url
.
{
"creditor": {
"creditor-type": "uk-domestic",
"account-holder": "John Doe",
"account-number": "35890906",
"account-number-code": "bban",
"bank-id": "000000",
"bank-id-code": "gbdsc"
},
"payment-submissions-url": "/v0/payments/pm.hSJXUxRZT7KGzVrn1bAAdg/submission",
"payment-amount": {
"currency": "GBP",
"value": "20.00"
},
"payment-direction": "outbound-payment",
"created-at": "2023-11-20T16:11:48.283Z",
"debtor": {
"account-holder": "Funds",
"account-number": "97144921",
"account-number-code": "bban",
"bank-id": "000000",
"bank-id-code": "gbdsc",
"account-url": "/v0/bank/accounts/ba.2Xmn1OCvTzGvC-SmWx2Zrg"
},
"payment-url": "/v0/payments/pm.hSJXUxRZT7KGzVrn1bAAdg"
}
Submit the payment
To submit the payment for processing, create a new submission using the payment-submissions-url
from the response above.
Optionally you can set a payment-scheme
. If no value is provided for payment-scheme, then the payment will be routed via FPS.
Payment schemes may apply a limit to the amount that a single payment may transfer. Griffin will reject your payment submission if the amount in the payment you are trying to submit exceeds the chosen payment scheme's limit.
For FPS, the limit is 1,000,000.00 GBP.
curl 'https://api.griffin.com${PAYMENT_SUBMISSION_URL}' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H "Authorization: GriffinAPIKey $GRIFFIN_API_KEY"\
--data '
{}
You must send a request body, even if it is the empty object.
- Single immediate payments
- Scheduled payments
A successful response contains a submission-url
that you can query to track the submission-status
. Initially the submission-status
is processing
which indicates that funds still haven't moved.
{
"submission-url": "/v0/submissions/ps.nsy0zkWEXlWecCgoRsUuug",
"submission-scheme-information": {
"payment-scheme": "fps",
"end-to-end-identification": "24NENI24TROEBLRUOB55DD6P2E"
},
"created-at": "2023-11-22T17:01:54.359Z",
"submission-status": "processing",
"payment-url": "/v0/payments/pm.ssvMhtYTTc6DTyX_R1kM4A"
}
Payments made from bare trust and easy access savings accounts are subject to a withdrawal schedule, which introduces a delay between payment submission and payment processing, making them future dated payments. A future dated payment is indicated by a submission with submission-status
set to scheduled
and the presence of a scheduled-at
field, which defines the earliest time at which payment processing can start. Once the scheduled-at
time has passed you can track the progression of the payment by querying the submission-url
for changes in submission-status
.
{
"submission-url": "/v0/submissions/ps.nsy0zkWEXlWecCgoRsUuug",
"submission-scheme-information": {
"payment-scheme": "fps",
"end-to-end-identification": "24NENI24TROEBLRUOB55DD6P2E"
},
"created-at": "2023-11-22T17:01:54.359Z",
"submission-status": "scheduled",
"scheduled-at": "2023-11-22T17:00:00.0000"
"payment-url": "/v0/payments/pm.ssvMhtYTTc6DTyX_R1kM4A"
}
Track the submission
Payment processing is asynchronous. Once you have triggered processing by creating a submission you have two options for tracking that submission until the payment is delivered
.
- Listen to events sent to your webhook.
- Poll the submission.
- webhook based tracking
- poll based tracking
After creating the submission you will initially receive a submission-created
event.
{
"event-url": "/v0/events/ev._GXe6VjtU-ykVVAbjMt2oQ",
"event-type": "submission-created",
"event-payload": {
"created-at": "2023-11-22T17:10:42.021Z",
"payment-url": "/v0/payments/pm.ssvMhtYTTc6DTyX_R1kM4A",
"submission-scheme-information": {
"end-to-end-identification": "HEHYFKNFNRNW3OEN4W3KDEPDCU",
"payment-scheme": "fps"
},
"submission-status": "processing",
"submission-url": "/v0/submissions/ps.hnj5b1cHV9a5ezf0Zcjt_A"
},
"created-at": "2023-11-22T17:10:42.021Z"
}
If your payment is a future dated payment, you will propmptly receive a submission-updated
event with submission-status
set to scheduled
; payment processing will pause at this point as dictated by the withdrawal schedule. Otherwise, the payment will be processed immediately, the funds will be debited from your account, and you will receive a transaction-created
event.
{
"event-url": "/v0/events/ev.r9EERwzIVVWzjTwcPe2pgA",
"event-type": "transaction-created",
"event-payload": {
"account-url": "/v0/bank/accounts/ba.Hdq7jeJvQomDbMFWfojj3A",
"balance-change": {
"currency": "GBP",
"value": "20.00"
},
"account-transaction-url": "/v0/bank/transactions/tr.itUux2E-Uqy18hUSeAkxBQ",
"account-balance": {
"currency": "GBP",
"value": "1940"
},
"transaction-origin-type": "payment",
"balance-change-direction": "debit",
"post-datetime": "2023-11-22T17:10:42.223Z",
"payment-url": "/v0/payments/pm.ssvMhtYTTc6DTyX_R1kM4A"
},
"created-at": "2023-11-22T17:10:42.021Z"
}
If payment processing succeeds you will receive a submission-updated
event where submission-status
is delivered
. At this point the debit of funds from your account is confirmed and they are unlikely to be credited back.
{
"event-url": "/v0/events/ev.xApuTv4iWpOEYlYXENVdnA",
"event-type": "submission-updated",
"event-payload": {
"created-at": "2023-11-22T17:10:42.021Z",
"payment-url": "/v0/payments/pm.ssvMhtYTTc6DTyX_R1kM4A",
"submission-scheme-information": {
"end-to-end-identification": "HEHYFKNFNRNW3OEN4W3KDEPDCU",
"payment-scheme": "fps"
},
"submission-status": "delivered",
"submission-url": "/v0/submissions/ps.hnj5b1cHV9a5ezf0Zcjt_A"
},
"created-at": "2023-11-22T17:10:42.021Z"
}
Poll the submission-url
returned in the previous response until the submission-status
is delivered
. At this point the debit of funds from your account is confirmed and they are unlikely to be credited back.
If the submission-status
is scheduled
you will see no further change in submission-status
until after the scheduled-at
time.
curl 'https://api.griffin.com${SUBMISSION_URL}' \
-H 'Content-Type: application/json' \
-H "Authorization: GriffinAPIKey $GRIFFIN_API_KEY"
{
"submission-url": "/v0/submissions/ps.zlN6XNfMUjOUxQZeLPYlHQ",
"submission-scheme-information": {
"payment-scheme": "fps",
"end-to-end-identification": "COJ3RENWIVJ5RIIAMBIO4MQAQ4"
},
"created-at": "2023-11-22T16:45:46.970Z",
"submission-status": "delivered",
"payment-url": "/v0/payments/pm.pKnif2DATdalIWbteD8W9w"
}
Payment processing may fail, in which case you will receive a submission-updated
event where submission-status
is set to failed
. Failure can occur due to insufficient funds in the account or an invalid sort code and account number combination, for example. If funds were debited from the account during payment processing, they will be credited back upon failure.