1
1
openapi : 3.0.1
2
2
info :
3
3
title : Create a betting platform
4
- description : The OpenAPI specification for creating a betting platform using the Paystack API
4
+ description : |-
5
+ The OpenAPI specification for creating a betting platform 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
+ We strongly recommend using the [Bulk Transfer API](https://paystack.com/docs/transfers/bulk-transfers) for sending customers their winnings instead of using Single Transfers.
5
11
version : 1.0.0
6
12
servers :
7
13
- url : ' https://api.paystack.co'
@@ -118,7 +124,20 @@ paths:
118
124
- subaccount
119
125
responses :
120
126
' 200 ' :
121
- $ref : ' #/paths/~1bank~1resolve/get/responses/200'
127
+ description : Request successful
128
+ content :
129
+ application/json :
130
+ schema :
131
+ $ref : ' #/components/responses/Ok/content/application~1json/schema'
132
+ examples :
133
+ Initiailize Transaction :
134
+ value :
135
+ status : true
136
+ message : Authorization URL created
137
+ data :
138
+ authorization_url : ' https://checkout.paystack.com/spnajmit2hgi2c1'
139
+ access_code : spandaoende
140
+ reference : ad123ada
122
141
' 401 ' :
123
142
$ref : ' #/paths/~1bank~1resolve/get/responses/401'
124
143
default :
@@ -196,7 +215,23 @@ paths:
196
215
type : boolean
197
216
responses :
198
217
' 200 ' :
199
- $ref : ' #/paths/~1bank~1resolve/get/responses/200'
218
+ description : Request successful
219
+ content :
220
+ application/json :
221
+ schema :
222
+ $ref : ' #/components/responses/Ok/content/application~1json/schema'
223
+ examples :
224
+ Charge Authorization :
225
+ value :
226
+ status : true
227
+ message : Charge attempted
228
+ data :
229
+ amount : 500000
230
+ currency : NGN
231
+ reference : 123.uniq=ref-2
232
+ metadata : ' cart_id:398, custom_fields:[{}]'
233
+ split_code : SPL_123AbZ
234
+ subaccount : ACCT_23abcdefgh
200
235
' 401 ' :
201
236
$ref : ' #/paths/~1bank~1resolve/get/responses/401'
202
237
default :
@@ -220,88 +255,34 @@ paths:
220
255
example : ' 063'
221
256
responses :
222
257
' 200 ' :
223
- description : Request successful
258
+ description : Resolve Account Number
224
259
content :
225
260
application/json :
226
261
schema :
227
262
$ref : ' #/components/responses/Ok/content/application~1json/schema'
228
263
examples :
229
- Initiailize Transaction :
230
- value :
231
- status : true
232
- message : Authorization URL created
233
- data :
234
- authorization_url : ' https://checkout.paystack.com/spnajmit2hgi2c1'
235
- access_code : spandaoende
236
- reference : ad123ada
237
- Charge Authorization :
238
- value :
239
- status : true
240
- message : Charge attempted
241
- data :
242
- amount : 500000
243
- currency : NGN
244
- reference : 123.uniq=ref-2
245
- metadata :
246
- ' cart_id:398 custom_fields ' :
247
- - {}
248
- split_code : SPL_123AbZ
249
- subaccount : ACCT_23abcdefgh
250
- Resolve Account Number :
264
+ Resolve Bank :
251
265
value :
252
266
status : true
253
267
message : Account number resolved
254
268
data :
255
269
account_number : 1234567
256
270
account_name : Doe Jane Loren
257
271
bank_id : 9
258
- Initiate Transfer :
259
- value :
260
- status : true
261
- message : Transfer has been queued
262
- data :
263
- reference : on5hyz9poe
264
- integration : 428626
265
- domain : test
266
- amount : 3794800
267
- currency : NGN
268
- source : balance
269
- reason : Holiday Flexing
270
- recipient : 6788170
271
- status : success
272
- transfer_code : TRF_fiyxvgkh71e717b
273
- id : 23070321
274
- createdAt : 2020-05-13T14:22:49.687Z
275
- updatedAt : 2020-05-13T14:22:49.687Z
276
- Initiate Bulk Transfer :
277
- value :
278
- status : true
279
- message : 2 transfers queued.
280
- data :
281
- - recipient : RCP_1a25w1h3n0xctjg
282
- amount : 50000
283
- transfer_code : TRF_mi8oa4liagyvq2md
284
- currency : NGN
285
- status : success
286
- - recipient : RCP_sa1k1btncp993q1
287
- amount : 50000
288
- transfer_code : TRF_1c5upr4hp85l93n7
289
- currency : NGN
290
- status : success
291
272
' 401 ' :
292
273
description : Unauthorized operation
293
274
content :
294
275
application/json :
295
276
examples :
296
- No_Authorization_Header :
277
+ No-Authorization-Header :
297
278
value :
298
279
status : false
299
280
message : No Authorization Header was found
300
281
Bad-Authorization-Header :
301
282
value :
302
283
status : false
303
284
message : ' Format is Authorization Bearer [secret key]'
304
- Invalid_Key :
285
+ Invalid-Key :
305
286
value :
306
287
status : false
307
288
message : Invalid key
@@ -375,16 +356,16 @@ paths:
375
356
description : Stringified JSON object of custom data
376
357
type : string
377
358
example : |
378
- {transfer_id : 123}
359
+ {referrer_id : 123}
379
360
responses :
380
361
' 201 ' :
381
- description : Resource created
362
+ description : Transfer Recipient Created
382
363
content :
383
364
application/json :
384
365
schema :
385
366
$ref : ' #/components/responses/Ok/content/application~1json/schema'
386
367
examples :
387
- Create Transfer Recipient :
368
+ Create Customer :
388
369
value :
389
370
status : true
390
371
message : Transfer recipient created successfully
@@ -395,7 +376,9 @@ paths:
395
376
domain : live
396
377
id : 38770134
397
378
integration : 463433
398
- name : Some Guy
379
+ metadata :
380
+ referrer_id : 123
381
+ name : Ada Lovelace
399
382
recipient_code : RCP_2fl8jmb2v3kbleb
400
383
type : nuban
401
384
updatedAt : 2022-09-16T08:31:43.321Z
@@ -468,7 +451,45 @@ paths:
468
451
example : Transfer-123_unique
469
452
responses :
470
453
' 200 ' :
471
- $ref : ' #/paths/~1bank~1resolve/get/responses/200'
454
+ description : Request successful
455
+ content :
456
+ application/json :
457
+ schema :
458
+ $ref : ' #/components/responses/Ok/content/application~1json/schema'
459
+ examples :
460
+ Initiate Transfer :
461
+ value :
462
+ status : true
463
+ message : Transfer has been queued
464
+ data :
465
+ reference : on5hyz9poe
466
+ integration : 428626
467
+ domain : test
468
+ amount : 3794800
469
+ currency : NGN
470
+ source : balance
471
+ reason : Holiday Flexing
472
+ recipient : 6788170
473
+ status : success
474
+ transfer_code : TRF_fiyxvgkh71e717b
475
+ id : 23070321
476
+ createdAt : 2020-05-13T14:22:49.687Z
477
+ updatedAt : 2020-05-13T14:22:49.687Z
478
+ Initiate Bulk Transfer :
479
+ value :
480
+ status : true
481
+ message : 2 transfers queued.
482
+ data :
483
+ - recipient : RCP_1a25w1h3n0xctjg
484
+ amount : 50000
485
+ transfer_code : TRF_mi8oa4liagyvq2md
486
+ currency : NGN
487
+ status : success
488
+ - recipient : RCP_sa1k1btncp993q1
489
+ amount : 50000
490
+ transfer_code : TRF_1c5upr4hp85l93n7
491
+ currency : NGN
492
+ status : success
472
493
' 401 ' :
473
494
$ref : ' #/paths/~1bank~1resolve/get/responses/401'
474
495
default :
@@ -493,12 +514,15 @@ components:
493
514
first_name :
494
515
description : Customer's first name
495
516
type : string
517
+ example : Some
496
518
last_name :
497
519
description : Customer's last name
498
520
type : string
521
+ example : Body
499
522
phone :
500
523
description : Customer's phone number
501
524
type : string
525
+ example : 2348123456789
502
526
metadata :
503
527
description : Stringified JSON object of custom data
504
528
type : string
@@ -542,18 +566,27 @@ components:
542
566
country :
543
567
description : Two-letter country code of identification issuer
544
568
type : string
569
+ example : NG
545
570
bvn :
546
571
description : Customer's Bank Verification Number
547
572
type : string
573
+ example : 123456789
548
574
bank_code :
549
575
description : ' You can get the list of bank codes by calling the List Banks endpoint (https://api.paystack.co/bank).'
550
576
type : string
577
+ example : 7
551
578
account_number :
552
579
description : Customer's bank account number.
553
580
type : string
554
- value :
555
- description : Customer's identification number. Required if type is bvn
581
+ example : 111111111
582
+ first_name :
583
+ description : Customer's first name
584
+ type : string
585
+ example : Uchenna
586
+ last_name :
587
+ description : Customer's last name
556
588
type : string
589
+ example : Okoro
557
590
Error :
558
591
type : object
559
592
properties :
0 commit comments