Skip to content

Commit fd84433

Browse files
Feat: Add use case specifications
1 parent d5edaed commit fd84433

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4033
-872
lines changed

dist/betting.yaml

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

dist/lending.yaml

Lines changed: 498 additions & 0 deletions
Large diffs are not rendered by default.

dist/marketplace.yaml

Lines changed: 420 additions & 0 deletions
Large diffs are not rendered by default.

dist/membership.yaml

Lines changed: 413 additions & 0 deletions
Large diffs are not rendered by default.

dist/paystack.yaml

Lines changed: 337 additions & 325 deletions
Large diffs are not rendered by default.

dist/savings.yaml

Lines changed: 448 additions & 0 deletions
Large diffs are not rendered by default.

dist/wallet.yaml

Lines changed: 364 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,364 @@
1+
openapi: 3.0.1
2+
info:
3+
title: Create a wallet app
4+
description: The OpenAPI specification for creating a wallet application using the Paystack API
5+
version: 1.0.0
6+
servers:
7+
- url: 'https://api.paystack.co'
8+
description: Base API endpoint
9+
paths:
10+
/customer:
11+
post:
12+
tags:
13+
- Customer
14+
summary: Create Customer
15+
operationId: customer_create
16+
requestBody:
17+
content:
18+
application/x-www-form-urlencoded:
19+
schema:
20+
allOf:
21+
- $ref: '#/components/schemas/Customer/allOf/0'
22+
- $ref: '#/components/schemas/Customer/allOf/1'
23+
application/json:
24+
schema:
25+
allOf:
26+
- $ref: '#/components/schemas/Customer/allOf/0'
27+
- $ref: '#/components/schemas/Customer/allOf/1'
28+
responses:
29+
'200':
30+
description: Request successful
31+
content:
32+
application/json:
33+
schema:
34+
$ref: '#/components/responses/Ok/content/application~1json/schema'
35+
'401':
36+
description: Unauthorized operation
37+
content:
38+
application/json:
39+
schema:
40+
type: object
41+
properties:
42+
status:
43+
type: boolean
44+
message:
45+
type: string
46+
default:
47+
description: Server error
48+
'/customer/{code}/identification':
49+
parameters:
50+
- name: code
51+
in: path
52+
required: true
53+
schema:
54+
type: string
55+
post:
56+
tags:
57+
- Customer
58+
summary: Validate Customer
59+
operationId: customer_validatte
60+
description: Validate a customer's identity
61+
requestBody:
62+
content:
63+
application/x-www-form-urlencoded:
64+
schema:
65+
$ref: '#/components/schemas/Customer/allOf/4'
66+
application/json:
67+
schema:
68+
$ref: '#/components/schemas/Customer/allOf/4'
69+
responses:
70+
'202':
71+
description: Request accepted for processing
72+
content:
73+
application/json:
74+
schema:
75+
type: object
76+
properties:
77+
status:
78+
type: boolean
79+
message:
80+
type: string
81+
'401':
82+
$ref: '#/paths/~1customer/post/responses/401'
83+
default:
84+
description: Server error
85+
/dedicated_account:
86+
post:
87+
tags:
88+
- Dedicated Virtual Account
89+
summary: Create Dedicated Account
90+
operationId: dedicatedAccount_create
91+
requestBody:
92+
content:
93+
application/x-www-form-urlencoded:
94+
schema:
95+
$ref: '#/paths/~1dedicated_account/post/requestBody/content/application~1json/schema'
96+
application/json:
97+
schema:
98+
type: object
99+
required:
100+
- customer
101+
properties:
102+
customer:
103+
description: Customer ID or code
104+
type: string
105+
preferred_bank:
106+
description: 'The bank slug for preferred bank. To get a list of available banks, use the List Providers endpoint'
107+
type: string
108+
subaccount:
109+
description: Subaccount code of the account you want to split the transaction with
110+
type: string
111+
split_code:
112+
description: Split code consisting of the lists of accounts you want to split the transaction with
113+
type: string
114+
responses:
115+
'200':
116+
$ref: '#/paths/~1customer/post/responses/200'
117+
'401':
118+
$ref: '#/paths/~1customer/post/responses/401'
119+
default:
120+
description: Server error
121+
/transferrecipient:
122+
post:
123+
tags:
124+
- Transfer Recipient
125+
summary: Create Transfer Recipient
126+
operationId: transferrecipient_create
127+
requestBody:
128+
content:
129+
application/x-www-form-urlencoded:
130+
schema:
131+
$ref: '#/paths/~1transferrecipient/post/requestBody/content/application~1json/schema'
132+
application/json:
133+
schema:
134+
type: object
135+
required:
136+
- type
137+
- name
138+
- account_number
139+
- bank_code
140+
properties:
141+
type:
142+
description: Recipient Type (Only nuban at this time)
143+
type: string
144+
name:
145+
description: Recipient's name
146+
type: string
147+
account_number:
148+
description: Recipient's bank account number
149+
type: string
150+
bank_code:
151+
description: Recipient's bank code. You can get the list of Bank Codes by calling the List Banks endpoint
152+
type: string
153+
description:
154+
description: A description for this recipient
155+
type: string
156+
currency:
157+
description: Currency for the account receiving the transfer
158+
type: string
159+
authorization_code:
160+
description: An authorization code from a previous transaction
161+
type: string
162+
metadata:
163+
description: Stringified JSON object of custom data
164+
type: string
165+
responses:
166+
'201':
167+
description: Resource created
168+
content:
169+
application/json:
170+
schema:
171+
$ref: '#/components/responses/Ok/content/application~1json/schema'
172+
'401':
173+
$ref: '#/paths/~1customer/post/responses/401'
174+
default:
175+
description: Server error
176+
/transfer:
177+
post:
178+
tags:
179+
- Transfer
180+
summary: Initiate Transfer
181+
operationId: transfer_initiate
182+
requestBody:
183+
content:
184+
application/x-www-form-urlencoded:
185+
schema:
186+
$ref: '#/paths/~1transfer/post/requestBody/content/application~1json/schema'
187+
application/json:
188+
schema:
189+
type: object
190+
required:
191+
- source
192+
- amount
193+
- recipient
194+
properties:
195+
source:
196+
description: Where should we transfer from? Only balance is allowed for now
197+
type: string
198+
amount:
199+
description: Amount to transfer in kobo if currency is NGN and pesewas if currency is GHS.
200+
type: string
201+
recipient:
202+
description: The transfer recipient's code
203+
type: string
204+
reason:
205+
description: The reason or narration for the transfer.
206+
type: string
207+
currency:
208+
description: Specify the currency of the transfer. Defaults to NGN.
209+
type: string
210+
reference:
211+
description: |-
212+
If specified, the field should be a unique identifier (in lowercase) for the object.
213+
Only -,_ and alphanumeric characters are allowed.
214+
type: string
215+
responses:
216+
'200':
217+
$ref: '#/paths/~1customer/post/responses/200'
218+
'401':
219+
$ref: '#/paths/~1customer/post/responses/401'
220+
default:
221+
description: Server error
222+
components:
223+
securitySchemes:
224+
bearerAuth:
225+
type: http
226+
scheme: bearer
227+
schemas:
228+
Customer:
229+
allOf:
230+
- type: object
231+
required:
232+
- email
233+
properties:
234+
email:
235+
description: Customer's email address
236+
type: string
237+
- type: object
238+
properties:
239+
first_name:
240+
description: Customer's first name
241+
type: string
242+
last_name:
243+
description: Customer's last name
244+
type: string
245+
phone:
246+
description: Customer's phone number
247+
type: string
248+
metadata:
249+
description: Stringified JSON object of custom data
250+
type: string
251+
- type: object
252+
required:
253+
- authorization_code
254+
properties:
255+
authorization_code:
256+
description: Customer's authorization code to be deactivated
257+
type: string
258+
- type: object
259+
required:
260+
- customer
261+
properties:
262+
customer:
263+
description: 'Customer''s code, or email address'
264+
type: string
265+
risk_action:
266+
description: |
267+
One of the possible risk actions [ default, allow, deny ]. allow to whitelist.
268+
deny to blacklist. Customers start with a default risk action.
269+
type: string
270+
enum:
271+
- default
272+
- allow
273+
- deny
274+
- type: object
275+
required:
276+
- type
277+
- country
278+
- bvn
279+
- bank_code
280+
- account_number
281+
properties:
282+
type:
283+
description: Predefined types of identification.
284+
type: string
285+
enum:
286+
- bvn
287+
- bank_account
288+
country:
289+
description: Two-letter country code of identification issuer
290+
type: string
291+
bvn:
292+
description: Customer's Bank Verification Number
293+
type: string
294+
bank_code:
295+
description: 'You can get the list of bank codes by calling the List Banks endpoint (https://api.paystack.co/bank).'
296+
type: string
297+
account_number:
298+
description: Customer's bank account number.
299+
type: string
300+
value:
301+
description: Customer's identification number. Required if type is bvn
302+
type: string
303+
Error:
304+
type: object
305+
properties:
306+
status:
307+
type: boolean
308+
message:
309+
type: string
310+
Response:
311+
type: object
312+
properties:
313+
status:
314+
type: boolean
315+
message:
316+
type: string
317+
data:
318+
type: object
319+
responses:
320+
Ok:
321+
description: Successful operation
322+
content:
323+
application/json:
324+
schema:
325+
type: object
326+
properties:
327+
status:
328+
type: boolean
329+
message:
330+
type: string
331+
data:
332+
type: object
333+
Created:
334+
description: Resource created
335+
content:
336+
application/json:
337+
schema:
338+
$ref: '#/components/schemas/Response'
339+
NotFound:
340+
description: Entity not found
341+
content:
342+
application/json:
343+
schema:
344+
$ref: '#/components/schemas/Error'
345+
example:
346+
status: false
347+
message: Entity not found
348+
Unauthorized:
349+
description: Unauthorized operation
350+
content:
351+
application/json:
352+
schema:
353+
$ref: '#/components/schemas/Error'
354+
example:
355+
status: false
356+
message: Invalid key
357+
GeneralError:
358+
description: General Error
359+
content:
360+
application/json:
361+
schema:
362+
$ref: '#/components/schemas/Error'
363+
security:
364+
- bearerAuth: []
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
tags:
2+
- Customer
3+
summary: Create Customer
4+
operationId: customer_create
5+
requestBody:
6+
content:
7+
application/x-www-form-urlencoded:
8+
schema:
9+
allOf:
10+
- $ref: '../../schemas/customer/CustomerRequired.yaml'
11+
- $ref: '../../schemas/customer/CustomerBase.yaml'
12+
application/json:
13+
schema:
14+
allOf:
15+
- $ref: '../../schemas/customer/CustomerRequired.yaml'
16+
- $ref: '../../schemas/customer/CustomerBase.yaml'
17+
responses:
18+
200:
19+
$ref: '../../responses/ok.yaml'
20+
401:
21+
$ref: '../../responses/unauthorized.yaml'
22+
default:
23+
description: Server error

main/resources/customer/identification.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
parameters:
2+
- name: code
3+
in: path
4+
required: true
5+
schema:
6+
type: string
17
post:
28
tags:
39
- Customer

0 commit comments

Comments
 (0)