$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Desigining the new GoCardless API
Search
Harry Marr
August 13, 2014
Technology
3
170
Desigining the new GoCardless API
Harry Marr
August 13, 2014
Tweet
Share
More Decks by Harry Marr
See All by Harry Marr
Build your own Heroku
hmarr
1
120
CodeCube: Runnable Gists
hmarr
1
190
Other Decks in Technology
See All in Technology
re:Inventで気になったサービスを10分でいけるところまでお話しします
yama3133
1
120
AWS Trainium3 をちょっと身近に感じたい
bigmuramura
1
130
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
950
安いGPUレンタルサービスについて
aratako
2
2.6k
Ruby で作る大規模イベントネットワーク構築・運用支援システム TTDB
taketo1113
1
210
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
120
形式手法特論:CEGAR を用いたモデル検査の状態空間削減 #kernelvm / Kernel VM Study Hokuriku Part 8
ytaka23
2
450
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
520
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
340
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
1k
Karate+Database RiderによるAPI自動テスト導入工数をCline+GitLab MCPを使って2割削減を目指す! / 20251206 Kazuki Takahashi
shift_evolve
PRO
1
570
Sansanが実践する Platform EngineeringとSREの協創
sansantech
PRO
2
680
Featured
See All Featured
Navigating Team Friction
lara
191
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Speed Design
sergeychernyshev
33
1.4k
GitHub's CSS Performance
jonrohan
1032
470k
[SF Ruby Conf 2025] Rails X
palkan
0
500
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Embracing the Ebb and Flow
colly
88
4.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
What's in a price? How to price your products and services
michaelherold
246
12k
Balancing Empowerment & Direction
lara
5
790
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Documentation Writing (for coders)
carmenintech
76
5.2k
Transcript
Designing the new GoCardless API Harry Marr and Philip Harrison
None
GrouPAY API
GrAPI
None
1. Agile API development 2. Build your framework 3. Prepare
for change
HOW TO BUILD PRODUCTS
None
None
None
None
Work out what people want Build it
Work out what people want Build it Work out what
people really want
Work out what people want Build it Work out what
people really want
HOW TO BUILD APIS
Work out what people want Build it
Work out what people want Build it Work out what
people really want
Work out what people want Build it Work out what
people really want Uh oh!
Changing a product is easy Changing your API is hard
1. Agile API development 2. Build your framework 3. Prepare
for change
MAKING IT LAST
• Content Type • Document/url structure • TLS/SSL • Pagination
• Rate-limiting • Errors
CONTENT TYPE
{ "payment": { "xmlns": "urn:ns:payment", "amount": { "$t": 20000 },
"metadata": { "type": "metadata", "xmlns": "urn:ns:metadata", "description": { "$t": "Rent" } } } }
{ "payment": { "amount": 20000, "metadata": { "description": "Rent" }
} } https://www.mnot.net/blog/2012/04/13/json_or_xml_just_decide
DOCUMENT/URL STRUCTURE
{ "linked": { "author": { "id": "12" } }, "posts":
[{ "id": "1", "title": "API", "links": { "author": "12" } }] } http://jsonapi.org/format/
/customers/1/bank_accounts/2/mandates/1 Don’t map database relations to urls
/mandates?bank_account=2 /customer_bank_accounts?customer=1 Flexible relationships
TLS/SSL All traffic including web hooks https://istlsfastyet.com/
PAGINATION
/payments { "meta": { "cursors": { "after": "abcd1234", "before": "wxyz0987"
}, "limit": 50 }, "payments": [{ ... }] } /payments?limit=50&after=abcd1234
RATE-LIMITING
X-Rate-Limit-Limit: 5000 X-Rate-Limit-Remaining: 0 X-Rate-Limit-Reset: Thu, 01 May 2014 16:00:00
GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Retry-After: Thu, 01 May 2014 16:00:00 GMT
ERRORS
{ "error": { "documentation_url": “https://errors", "id": “ERROR_ID”, "type": "validation_failed”, "code":
422, "errors": [{ "field": "account_number", "type": "missing_field", "message": "is required" }] } }
GoCardless API design https://github.com/gocardless/http-api-design
1. Agile API development 2. Build your framework 3. Prepare
for change
Work out what people want Build it Work out what
people really want Uh oh!
Work out what people want Build it Work out what
people really want
✓ Adding resources ✓ Adding attributes ✗ Removing attributes ✗
Changing attributes ✗ Removing resources ✗ Changing behaviour
/v1
/v1
v1
2014-08-13
/2014-08-13
2014-08-13
You are currently using version 2014-‐05-‐12. ! Click here
to view all changes since 2014-‐05-‐12. To:
[email protected]
From:
[email protected]
GoCardless API Update Available
In summary, • Developing an API is hard • Think
about what you can’t change • And plan for incremental updates
QUESTIONS? ! @harrymarr @harrisonphilip