Skip to content

Commit d5416c7

Browse files
committed
feat: simple Rafiki integration guide
1 parent 4f25c87 commit d5416c7

4 files changed

Lines changed: 144 additions & 2 deletions

File tree

530 KB
Loading
915 KB
Loading
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
title: 'Simple Rafiki Integration Guide'
3+
description: 'A short developer guide for integrating your Account Servicing Entity (ASE) with Rafiki.'
4+
date: 2026-03-18
5+
slug: simple-rafiki-integration-guide
6+
authors:
7+
- Max Kurapov
8+
- Timea Nagy
9+
- Dragos Palade
10+
- Tadej Golobic
11+
author_urls: []
12+
tags:
13+
- Rafiki
14+
- Integration
15+
- Updates
16+
---
17+
18+
import LargeImg from '/src/components/blog/LargeImg.astro'
19+
20+
In this guide, we provide you, a developer who's starting to integrate Rafiki into your ASE (Account Servicing Entity), a simple walkthrough for how to make your first payment using Rafiki.
21+
Here, we will introduce simple concepts, and the necessary APIs & webhook events to complete a payment between a sender and receiver in your ASE.
22+
23+
While we have detailed [documentation](https://rafiki.dev), we understand that this may be overwhelming for someone new in the ecosystem, so this guide will be a good starting point in the journey of adapting Interledger technologies.
24+
25+
First of all, let's see what an ASE is responsible for, in comparison to what Rafiki takes care of.
26+
27+
28+
## ASE and Rafiki responsibilities
29+
30+
<LargeImg
31+
src="/developers/img/blog/2026-03-18/responsibilites.png"
32+
alt="Overview of responsibilities between ASE and Rafiki"
33+
/>
34+
35+
## Open Payments and ILP
36+
37+
### Open Payments API
38+
39+
Open Payments is an API standard for allowing **third-party clients** to initiate payments between wallet addresses.
40+
41+
#### Use cases
42+
43+
- eCommerce payments
44+
- Peer to peer payments (e.g. remittances)
45+
- Recurring payments (e.g. subscriptions)
46+
47+
### ILP (Interledger Protocol)
48+
49+
A protocol for transferring payments (through packets).
50+
If the Open Payments API is responsible for payment authorization, then ILP is **how** the payments actually happen.
51+
52+
### Basic concepts
53+
54+
#### Wallet addresses
55+
56+
A wallet address is a sharable identifier (URL) linked to an underlying user account at an ASE, and accessible via the Open Payments API standard.
57+
58+
#### Assets
59+
60+
Assets represent monetary values, for example, country currencies. Each asset is made up of a code, and a scale to represent the decimal units. For example, US dollars can be delineated as code: `USD`, with scale `2`, where value `1000` represents `$10.00`.
61+
62+
### Integrating Rafiki with your system
63+
64+
#### Components
65+
66+
Currently, Rafiki is made up of three software components:
67+
68+
- `backend`: hosts the Open Payments resource server, ILP connector, and the Admin API
69+
- `auth`: hosts the Open Payments auth server
70+
- `frontend`: UI to manage the Rafiki resources (wallet addresses, payments, assets, e.t.c.) through the Admin API.
71+
72+
#### Admin API
73+
74+
As an ASE, the main entrypoint into the Rafiki system will be through the Admin API. This is a GraphQL API.
75+
76+
### Integration steps
77+
78+
#### Creating assets
79+
80+
In order to begin your Rafiki integration, you need to load the assets you will support for your users. For example, if you will be supporting US dollars, you must create an USD asset in Rafiki [through the Admin UI or Admin API](https://rafiki.dev/integration/requirements/assets/).
81+
82+
#### Creating wallet addresses
83+
84+
After creating at least one asset, you can start [creating wallet addresses](https://rafiki.dev/integration/requirements/wallet-addresses/) under that asset. This wallet address must be linked to a user account in your sytem, and will be publicly accessible through the Open Payments API.
85+
86+
#### Making payments
87+
88+
Making payments consists of three parts:
89+
90+
##### 1. Creating an incoming payment
91+
92+
First, you will need to create an incoming payment for a recipient's wallet address using the [Admin API's `createIncomingPayment`](https://rafiki.dev/apis/graphql/backend/#mutation-createIncomingPayment). This will set up a resource to pay into.
93+
94+
##### 2. Creating a quote
95+
96+
Second, you will need to create a quote for a sender's wallet address using the [Admin API's `createQuote`](https://rafiki.dev/apis/graphql/backend/#mutation-createQuote). This will show how much it will cost the sender to deliver an amount to the receiver.
97+
98+
##### 3. Creating an outgoing payment
99+
100+
Third, you will create an outgoing payment for the sender's wallet address using the [Admin API's `createOutgoingPayment`](https://rafiki.dev/apis/graphql/backend/#mutation-createOutgoingPayment). This will be the operation to actually start the payment. At this point, you as the ASE will need to fund/approve the outgoing payment before it gets sent.
101+
102+
##### Webhook request handling
103+
104+
When operating Rafiki, you as the ASE will be notified about events that happen in the system, e.g. an incoming payment was created or expired. Some of these events are actionable, for example, the outgoing payment created event. When an outgoing payment is created, you as the ASE will need to:
105+
106+
1. Check that the user account (for the linked wallet address) is active
107+
2. Check that the user account has enough balance to make the payment
108+
3. Reserve funds on the user account
109+
4. Notify Rafiki to approve the outgoing payment by calling the [`depositOutgoingPaymentLiquidity` API](https://rafiki.dev/apis/graphql/backend/#mutation-depositOutgoingPaymentLiquidity).
110+
111+
Once the outgoing payment has been approved/funded, Rafiki will make the payment between the sender and receiver.
112+
113+
5. If the payment in Rafiki is successful, you will receive an outgoing payment completed webhook. When this is received, you should finalize the debit of the sending user's account.
114+
6. You will also receive an incoming payment completed (or incoming payment expired) webhook. For these webhooks, you should credit the recipient's user account.
115+
116+
<LargeImg
117+
src="/developers/img/blog/2026-03-18/sequence-diagram.png"
118+
alt="Sequence diagram for payment flow"
119+
/>
120+
121+
The [Rafiki documentation](https://rafiki.dev/integration/requirements/webhook-events/) describes all of the webhook events and how they should be handled.
122+
123+
##### Note
124+
125+
When Rafiki sends a webhook to the ASE, it expects a 200 response. Otherwise, it will keep retrying.
126+
127+
<hr/>
128+
129+
Hopefully, this provided you a good starting point to complete your first payment!
130+
131+
If you have other questions, we invite you to join our community [Slack channel](https://communityinviter.com/apps/interledger/interledger-working-groups-slack), and attend our [Rafiki community calls](https://github.com/interledger/rafiki?tab=readme-ov-file#community-calls) every third Tuesday of the month at 14:30 UTC.
132+
The FAQ section below is a living one, and any new questions you may have will be added below.
133+
134+
## FAQ
135+
136+
### What APIs are exposed publicly?
137+
138+
Open Payments endpoints + ILP connector. The Admin API must not be exposed externally.
139+
140+
### Can you make cross-currency payments?
141+
142+
In order to make cross-currency payments, you will need to create the corresponding assets, and [provide a way for Rafiki to fetch rates](https://rafiki.dev/integration/requirements/exchange-rates/).
143+

src/layouts/BlogLayout.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ const rawHTMLString = `This article was originally published at <a href=${frontm
8282
<a href={frontmatter.author_urls[index]}>{author}</a>
8383
) : (
8484
author
85-
)}
86-
{index < frontmatter.authors.length - 1 ? ', ' : ''}
85+
)}{index < frontmatter.authors.length - 1 ? ', ' : ''}
8786
</span>
8887
))
8988
}

0 commit comments

Comments
 (0)