Skip to content

Commit 97bfbfa

Browse files
Merge pull request #24 from PaystackOSS/dev
Dev
2 parents eef55f4 + 19c3caa commit 97bfbfa

File tree

81 files changed

+2623
-3452
lines changed

Some content is hidden

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

81 files changed

+2623
-3452
lines changed

dist/betting.yaml

Lines changed: 198 additions & 19 deletions
Large diffs are not rendered by default.

dist/lending.yaml

Lines changed: 254 additions & 20 deletions
Large diffs are not rendered by default.

dist/marketplace.yaml

Lines changed: 219 additions & 14 deletions
Large diffs are not rendered by default.

dist/membership.yaml

Lines changed: 181 additions & 18 deletions
Large diffs are not rendered by default.

dist/paystack.yaml

Lines changed: 562 additions & 42 deletions
Large diffs are not rendered by default.

dist/savings.yaml

Lines changed: 197 additions & 18 deletions
Large diffs are not rendered by default.

dist/wallet.yaml

Lines changed: 188 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
openapi: 3.0.1
22
info:
33
title: Create a wallet app
4-
description: The OpenAPI specification for creating a wallet application using the Paystack API
4+
description: |-
5+
The OpenAPI specification for creating a wallet application using the [Paystack API](https://paystack.com/docs/api/).
6+
### Prerequisites
7+
1. Sign up on [Paystack](https://paystack.com/signup) to get your secret API key
8+
2. Set your API key as an environment variable on [Postman](https://learning.postman.com/docs/sending-requests/variables/)
9+
10+
After setting up your secret API key, use the [Customers API](https://paystack.com/docs/api/#customer) to create and validate a customer. You then assign a [Dedicated Virtual Account](https://paystack.com/docs/payments/dedicated-virtual-accounts) to the customer.
11+
12+
Transfers in this case refer to moving money to bank accounts and mobile money accounts using our [Transfers API](https://paystack.com/docs/transfers) rather than other wallet users.
13+
14+
*Dedicated Virtual Account is currently available for [registered businesses](https://support.paystack.com/hc/en-us/articles/360009881220-How-do-I-activate-my-Paystack-Registered-Business-) in Nigeria.*
515
version: 1.0.0
616
servers:
717
- url: 'https://api.paystack.co'
@@ -27,15 +37,51 @@ paths:
2737
- $ref: '#/components/schemas/Customer/allOf/1'
2838
responses:
2939
'200':
30-
description: Request successful
40+
description: Customer Created
3141
content:
3242
application/json:
3343
schema:
3444
$ref: '#/components/responses/Ok/content/application~1json/schema'
45+
examples:
46+
Create Customer:
47+
value:
48+
status: true
49+
message: Customer created
50+
data:
51+
transactions: []
52+
subscriptions: []
53+
authorizations: []
54+
55+
first_name: Some
56+
last_name: Body
57+
phone: '+2348123456789'
58+
integration: 463433
59+
domain: test
60+
metadata: {}
61+
customer_code: CUS_pztcpsx5kng2fbk
62+
risk_action: default
63+
id: 95485991
64+
createdAt: '2022-09-20T12:52:10.583Z'
65+
updatedAt: '2022-09-20T12:52:10.583Z'
66+
identified: false
67+
identifications: []
3568
'401':
3669
description: Unauthorized operation
3770
content:
3871
application/json:
72+
examples:
73+
No-Authorization-Header:
74+
value:
75+
status: false
76+
message: No Authorization Header was found
77+
Bad-Authorization-Header:
78+
value:
79+
status: false
80+
message: 'Format is Authorization Bearer [secret key]'
81+
Invalid-Key:
82+
value:
83+
status: false
84+
message: Invalid key
3985
schema:
4086
type: object
4187
properties:
@@ -68,16 +114,16 @@ paths:
68114
$ref: '#/components/schemas/Customer/allOf/4'
69115
responses:
70116
'202':
71-
description: Request accepted for processing
117+
description: Customer Validation
72118
content:
73119
application/json:
74120
schema:
75-
type: object
76-
properties:
77-
status:
78-
type: boolean
79-
message:
80-
type: string
121+
$ref: '#/components/responses/Ok/content/application~1json/schema'
122+
examples:
123+
Validate Customer:
124+
value:
125+
status: true
126+
message: Customer Identification in progress
81127
'401':
82128
$ref: '#/paths/~1customer/post/responses/401'
83129
default:
@@ -102,18 +148,60 @@ paths:
102148
customer:
103149
description: Customer ID or code
104150
type: string
151+
example: CUS_abc123der
105152
preferred_bank:
106153
description: 'The bank slug for preferred bank. To get a list of available banks, use the List Providers endpoint'
107154
type: string
155+
example: wema-bank
108156
subaccount:
109157
description: Subaccount code of the account you want to split the transaction with
110158
type: string
159+
example: ACCT_123455asdin
111160
split_code:
112161
description: Split code consisting of the lists of accounts you want to split the transaction with
113162
type: string
163+
example: SPL_123asbde
114164
responses:
115165
'200':
116-
$ref: '#/paths/~1customer/post/responses/200'
166+
description: Creation Successful
167+
content:
168+
application/json:
169+
schema:
170+
$ref: '#/components/responses/Ok/content/application~1json/schema'
171+
examples:
172+
Create Dedicated Account:
173+
value:
174+
status: true
175+
message: NUBAN successfully created
176+
data:
177+
bank:
178+
name: Wema Bank
179+
id: 20
180+
slug: wema-bank
181+
account_name: KAROKART / RHODA CHURCH
182+
account_number: 9930000737
183+
assigned: true
184+
currency: NGN
185+
metadata: null
186+
active: true
187+
id: 253
188+
created_at: 2019-12-12T12:39:04.000Z
189+
updated_at: 2020-01-06T15:51:24.000Z
190+
assignment:
191+
integration: 100043
192+
assignee_id: 7454289
193+
assignee_type: Customer
194+
expired: false
195+
account_type: PAY-WITH-TRANSFER-RECURRING
196+
assigned_at: 2020-01-06T15:51:24.764Z
197+
customer:
198+
id: 7454289
199+
first_name: RHODA
200+
last_name: CHURCH
201+
202+
customer_code: CUS_kpb3qj71u1m0rw8
203+
phone: 2349053267565
204+
risk_action: default
117205
'401':
118206
$ref: '#/paths/~1customer/post/responses/401'
119207
default:
@@ -139,36 +227,78 @@ paths:
139227
- bank_code
140228
properties:
141229
type:
142-
description: Recipient Type (Only nuban at this time)
230+
description: 'Recipient Type - nuban for NGN, mobile_money for MOMO in GHS, basa for ZAR and authorization for all.'
143231
type: string
232+
enum:
233+
- nuban
234+
- mobile_money
235+
- basa
236+
- authorization
144237
name:
145238
description: Recipient's name
146239
type: string
240+
example: Ada Lovelace
147241
account_number:
148242
description: Recipient's bank account number
149243
type: string
244+
example: '0000000000'
150245
bank_code:
151246
description: Recipient's bank code. You can get the list of Bank Codes by calling the List Banks endpoint
152247
type: string
248+
example: '011'
153249
description:
154250
description: A description for this recipient
155251
type: string
252+
example: Keeps our servers running
156253
currency:
157254
description: Currency for the account receiving the transfer
158255
type: string
256+
enum:
257+
- NGN
258+
- GHS
259+
- ZAR
159260
authorization_code:
160261
description: An authorization code from a previous transaction
161262
type: string
263+
example: AUTH_CODE
162264
metadata:
163265
description: Stringified JSON object of custom data
164266
type: string
267+
example: |
268+
{referrer_id: 123}
165269
responses:
166270
'201':
167-
description: Resource created
271+
description: Transfer Recipient Created
168272
content:
169273
application/json:
170274
schema:
171275
$ref: '#/components/responses/Ok/content/application~1json/schema'
276+
examples:
277+
Create Customer:
278+
value:
279+
status: true
280+
message: Transfer recipient created successfully
281+
data:
282+
active: true
283+
createdAt: 2022-09-16T08:31:43.321Z
284+
currency: NGN
285+
domain: live
286+
id: 38770134
287+
integration: 463433
288+
metadata:
289+
referrer_id: 123
290+
name: Ada Lovelace
291+
recipient_code: RCP_2fl8jmb2v3kbleb
292+
type: nuban
293+
updatedAt: 2022-09-16T08:31:43.321Z
294+
is_deleted: false
295+
isDeleted: false
296+
details:
297+
authorization_code: null
298+
account_number: 0
299+
account_name: Doe Jane Loren
300+
bank_code: 9
301+
bank_name: First Bank of Nigeria
172302
'401':
173303
$ref: '#/paths/~1customer/post/responses/401'
174304
default:
@@ -195,15 +325,19 @@ paths:
195325
source:
196326
description: Where should we transfer from? Only balance is allowed for now
197327
type: string
328+
example: balance
198329
amount:
199-
description: Amount to transfer in kobo if currency is NGN and pesewas if currency is GHS.
200-
type: string
330+
description: Amount to transfer in kobo if currency is NGN. pesewas if currency is GHS and cents for ZAR.
331+
type: integer
332+
example: 10234
201333
recipient:
202334
description: The transfer recipient's code
203335
type: string
336+
example: RCP_CODE
204337
reason:
205338
description: The reason or narration for the transfer.
206339
type: string
340+
example: Good job
207341
currency:
208342
description: Specify the currency of the transfer. Defaults to NGN.
209343
type: string
@@ -212,9 +346,33 @@ paths:
212346
If specified, the field should be a unique identifier (in lowercase) for the object.
213347
Only -,_ and alphanumeric characters are allowed.
214348
type: string
349+
example: Transfer-123_unique
215350
responses:
216351
'200':
217-
$ref: '#/paths/~1customer/post/responses/200'
352+
description: Request successful
353+
content:
354+
application/json:
355+
schema:
356+
$ref: '#/components/responses/Ok/content/application~1json/schema'
357+
examples:
358+
Initiate Transfer:
359+
value:
360+
status: true
361+
message: Transfer has been queued
362+
data:
363+
reference: on5hyz9poe
364+
integration: 428626
365+
domain: test
366+
amount: 3794800
367+
currency: NGN
368+
source: balance
369+
reason: Holiday Flexing
370+
recipient: 6788170
371+
status: success
372+
transfer_code: TRF_fiyxvgkh71e717b
373+
id: 23070321
374+
createdAt: 2020-05-13T14:22:49.687Z
375+
updatedAt: 2020-05-13T14:22:49.687Z
218376
'401':
219377
$ref: '#/paths/~1customer/post/responses/401'
220378
default:
@@ -239,12 +397,15 @@ components:
239397
first_name:
240398
description: Customer's first name
241399
type: string
400+
example: Some
242401
last_name:
243402
description: Customer's last name
244403
type: string
404+
example: Body
245405
phone:
246406
description: Customer's phone number
247407
type: string
408+
example: '+2348123456789'
248409
metadata:
249410
description: Stringified JSON object of custom data
250411
type: string
@@ -288,18 +449,27 @@ components:
288449
country:
289450
description: Two-letter country code of identification issuer
290451
type: string
452+
example: NG
291453
bvn:
292454
description: Customer's Bank Verification Number
293-
type: string
455+
type: integer
456+
example: 0123456789
294457
bank_code:
295458
description: 'You can get the list of bank codes by calling the List Banks endpoint (https://api.paystack.co/bank).'
296459
type: string
460+
example: '007'
297461
account_number:
298462
description: Customer's bank account number.
299463
type: string
300-
value:
301-
description: Customer's identification number. Required if type is bvn
464+
example: '0111111111'
465+
first_name:
466+
description: Customer's first name
467+
type: string
468+
example: Uchenna
469+
last_name:
470+
description: Customer's last name
302471
type: string
472+
example: Okoro
303473
Error:
304474
type: object
305475
properties:

main/examples/customer/create.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
value:
2+
status: true
3+
message: Customer created
4+
data:
5+
transactions: []
6+
subscriptions: []
7+
authorizations: []
8+
9+
first_name: Some
10+
last_name: Body
11+
phone: "+2348123456789"
12+
integration: 463433
13+
domain: test
14+
metadata: {}
15+
customer_code: CUS_pztcpsx5kng2fbk
16+
risk_action: default
17+
id: 95485991
18+
createdAt: '2022-09-20T12:52:10.583Z'
19+
updatedAt: '2022-09-20T12:52:10.583Z'
20+
identified: false
21+
identifications: []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
value:
2+
status: true
3+
message: Customer Identification in progress

0 commit comments

Comments
 (0)