-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmembership.yaml
96 lines (89 loc) · 2.67 KB
/
membership.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
openapi: 3.0.1
info:
title: Create a membership app
description: >-
The OpenAPI specification for creating a membership application using the [Paystack API](https://paystack.com/docs/api/).
### Prerequisites
1. Sign up on [Paystack](https://paystack.com/signup) to get your secret API key
2. Set your API key as an environment variable on [Postman](https://learning.postman.com/docs/sending-requests/variables/)
When using the [Subscriptions API](https://paystack.com/docs/payments/subscriptions), Paystack automatically charges the customer at the due time.
This saves you the need to run scheduled tasks for every customer.
While with the [Charge Authorization API](https://paystack.com/docs/payments/recurring-charges), you send Paystack the charge details at the due time.
version: 1.0.0
servers:
- url: https://api.paystack.co
description: Base API endpoint
paths:
/plan:
post:
$ref: '../main/resources/plan/create.yaml'
/subscription:
post:
$ref: '../main/resources/subscription/create.yaml'
/transaction/initialize:
$ref: '../main/resources/transaction/initialize.yaml'
/transaction/charge_authorization:
$ref: '../main/resources/transaction/charge-authorization.yaml'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
schemas:
Customer:
$ref: '../main/schemas/customer/Customer.yaml'
Error:
type: object
properties:
status:
type: boolean
message:
type: string
Response:
type: object
properties:
status:
type: boolean
message:
type: string
data:
type: object
responses:
Ok:
description: Successful operation
content:
application/json:
schema:
$ref: '../main/responses/response.yaml'
Created:
description: Resource created
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
NotFound:
description: Entity not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
status: false
message: Entity not found
Unauthorized:
description: Unauthorized operation
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
status: false
message: Invalid key
GeneralError:
description: General Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth: []