Skip to content

Commit 7613430

Browse files
authored
Add discoveries api endpoint. This GET endpoint returns payment railes available by currency and country (#298)
### TL;DR Added a new `/discoveries` endpoint to retrieve available payment rails for specific country and currency combinations. ### What changed? - Added a new "Discoveries" tag and endpoint group for payment rail discovery functionality - Implemented `GET /discoveries` endpoint that accepts `country` (ISO 3166-1 alpha-2) and `currency` (ISO 4217) query parameters - The endpoint returns a list of payment rails with stable identifiers, names, display names, country, and currency information - Each payment rail's `id` field serves as the stable identifier to use when creating external accounts - Included comprehensive error handling for 400, 401, and 500 status codes - Added example response showing Philippine banks (BDO Unibank and Bank of the Philippine Islands) ### How to test? 1. Make a GET request to `/discoveries?country=PH&currency=PHP` with proper authentication 2. Verify the response contains a `payment_rails` array with bank information 3. Test error cases by omitting required parameters or using invalid country/currency codes 4. Confirm the returned `id` values can be used as `bankName` when creating external accounts via `POST /customers/{id}/external-accounts` ### Why make this change? This endpoint enables developers to programmatically discover which payment rails, banks, and providers are available for specific country-currency corridors supported by Grid's partners, eliminating the need to hardcode bank names and providing a dynamic way to populate payment options in applications.
1 parent 69402bc commit 7613430

4 files changed

Lines changed: 289 additions & 0 deletions

File tree

mintlify/openapi.yaml

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi.yaml

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
get:
2+
summary: List available receiving institution names
3+
description: |
4+
Retrieve available payment institution names for a given country and currency. Use this endpoint
5+
to look up supported banks and payment providers for a specific corridor.
6+
If no country and currency parameter are provided, all payment institutions will be returned
7+
8+
The `bankName` field in each result is the value to pass as `bankName` when
9+
creating an external account via `POST /customers/external-accounts`.
10+
operationId: getDiscoveries
11+
tags:
12+
- Discoveries
13+
security:
14+
- BasicAuth: []
15+
parameters:
16+
- name: country
17+
in: query
18+
description: ISO 3166-1 alpha-2 country code (e.g. PH)
19+
required: false
20+
schema:
21+
type: string
22+
example: PH
23+
- name: currency
24+
in: query
25+
description: ISO 4217 currency code (e.g. PHP)
26+
required: false
27+
schema:
28+
type: string
29+
example: PHP
30+
responses:
31+
"200":
32+
description: Successful operation
33+
content:
34+
application/json:
35+
schema:
36+
type: object
37+
properties:
38+
data:
39+
type: array
40+
description: List of payment rails matching the filter criteria
41+
items:
42+
type: object
43+
required:
44+
- bankName
45+
- displayName
46+
- country
47+
- currency
48+
properties:
49+
bankName:
50+
type: string
51+
description: >
52+
Canonical name for this payment rail. Pass this value as
53+
`bankName` when creating an external account.
54+
displayName:
55+
type: string
56+
description: Human-friendly display name for this payment rail.
57+
country:
58+
type: string
59+
description: ISO 3166-1 alpha-2 country code.
60+
currency:
61+
type: string
62+
description: ISO 4217 currency code.
63+
examples:
64+
philippinesBanks:
65+
summary: Payment rails for Philippines (PHP)
66+
value:
67+
data:
68+
- bankName: BDO Unibank
69+
displayName: BDO Unibank
70+
country: PH
71+
currency: PHP
72+
- bankName: BPI
73+
displayName: Bank of the Philippine Islands
74+
country: PH
75+
currency: PHP
76+
"400":
77+
description: Bad request - Invalid parameters
78+
content:
79+
application/json:
80+
schema:
81+
$ref: ../../components/schemas/errors/Error400.yaml
82+
"401":
83+
description: Unauthorized
84+
content:
85+
application/json:
86+
schema:
87+
$ref: ../../components/schemas/errors/Error401.yaml
88+
"500":
89+
description: Internal service error
90+
content:
91+
application/json:
92+
schema:
93+
$ref: ../../components/schemas/errors/Error500.yaml

0 commit comments

Comments
 (0)