Skip to content

Commit 9678dea

Browse files
Merge pull request #66 from PaystackOSS/patch-orders
chore: update orders examples and descriptions
2 parents 482c3a5 + 1b37aae commit 9678dea

8 files changed

Lines changed: 110 additions & 24 deletions

File tree

dist/paystack.yaml

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,6 +3975,7 @@ paths:
39753975
tags:
39763976
- Order
39773977
summary: Create Order
3978+
description: Create an order for selected items
39783979
operationId: order_create
39793980
requestBody:
39803981
content:
@@ -3995,6 +3996,7 @@ paths:
39953996
tags:
39963997
- Order
39973998
summary: List Orders
3999+
description: List the previously created orders
39984000
operationId: order_list
39994001
parameters:
40004002
- in: query
@@ -4031,14 +4033,17 @@ paths:
40314033
/order/{id}:
40324034
parameters:
40334035
- name: id
4036+
description: The unique identifier of the order
40344037
in: path
40354038
required: true
40364039
schema:
4037-
type: string
4040+
type: integer
4041+
example: 1559046
40384042
get:
40394043
tags:
40404044
- Order
40414045
summary: Fetch Order
4046+
description: Fetch the details of a previously created order
40424047
operationId: order_fetch
40434048
responses:
40444049
'200':
@@ -4052,15 +4057,18 @@ paths:
40524057
/order/product/{id}:
40534058
parameters:
40544059
- name: id
4060+
description: The unique identifier of the order
40554061
in: path
40564062
required: true
40574063
schema:
4058-
type: string
4064+
type: integer
4065+
example: 1559046
40594066
get:
40604067
tags:
40614068
- Order
4062-
summary: Fetch Products Order
4063-
operationId: order_fetchProducts
4069+
summary: Fetch Product Orders
4070+
description: Fetch all orders for a particular product
4071+
operationId: order_product
40644072
responses:
40654073
'200':
40664074
$ref: '#/components/responses/OrderFetchProductSuccess'
@@ -4073,15 +4081,18 @@ paths:
40734081
/order/{code}/validate:
40744082
parameters:
40754083
- name: code
4084+
description: The unique code of a previously created order
40764085
in: path
40774086
required: true
40784087
schema:
40794088
type: string
4089+
example: ORD_6z0lqwpmxrm7dsp
40804090
get:
40814091
tags:
40824092
- Order
4083-
summary: Validate pay for me order
4084-
operationId: order_validatePayForMe
4093+
summary: Validate Order
4094+
description: Validate a pay for me order
4095+
operationId: order_validate
40854096
responses:
40864097
'200':
40874098
$ref: '#/components/responses/OrderValidateSuccess'
@@ -14989,7 +15000,7 @@ components:
1498915000
properties:
1499015001
item:
1499115002
description: The product ID of the item
14992-
type: string
15003+
type: integer
1499315004
type:
1499415005
description: The type of the item. `product` is currently the acceptable value
1499515006
type: string
@@ -14999,6 +15010,11 @@ components:
1499915010
amount:
1500015011
description: The cost of the item
1500115012
type: integer
15013+
example:
15014+
item: 2179824
15015+
type: product
15016+
quantity: 200000
15017+
amount: 2
1500215018
OrderShipping:
1500315019
type: object
1500415020
description: The shipping details of the order
@@ -15027,6 +15043,12 @@ components:
1502715043
delivery_note:
1502815044
description: Extra details to be aware of for the delivery
1502915045
type: string
15046+
example:
15047+
street_line: Somewhere on Earth
15048+
city: Atlantic
15049+
state: Pacific
15050+
country: Equator
15051+
shipping_fee: 10000
1503015052
OrderCreate:
1503115053
type: object
1503215054
required:
@@ -15051,22 +15073,43 @@ components:
1505115073
description: The customer's mobile number
1505215074
type: string
1505315075
currency:
15054-
description: Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD
15076+
description: Currency in which amount is set
1505515077
type: string
15078+
enum:
15079+
- GHS
15080+
- KES
15081+
- NGN
15082+
- USD
15083+
- ZAR
1505615084
items:
1505715085
type: array
1505815086
items:
1505915087
$ref: '#/components/schemas/OrderItems'
1506015088
shipping:
1506115089
$ref: '#/components/schemas/OrderShipping'
1506215090
is_gift:
15063-
description: |
15064-
A flag to indicate if the order is for someone else
15091+
description: A flag to indicate if the order is for someone else
1506515092
type: boolean
1506615093
pay_for_me:
15067-
description: |
15068-
A flag to indicate if the someone else should pay for the order
15094+
description: A flag to indicate if the someone else should pay for the order
1506915095
type: boolean
15096+
example:
15097+
email: test@email.com
15098+
first_name: Demo
15099+
last_name: User
15100+
phone: '+2348031245678'
15101+
currency: NGN
15102+
items:
15103+
- item: 2179824
15104+
type: product
15105+
quantity: 200000
15106+
amount: 2
15107+
shipping:
15108+
street_line: Somewhere on Earth
15109+
city: Atlantic
15110+
state: Pacific
15111+
country: Equator
15112+
shipping_fee: 10000
1507015113
OrderCreateResponse:
1507115114
type: object
1507215115
properties:

src/assets/openapi/components/schemas/OrderCreate.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,40 @@ properties:
2121
description: The customer's mobile number
2222
type: string
2323
currency:
24-
description: Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD
24+
description: Currency in which amount is set
2525
type: string
26+
enum:
27+
- GHS
28+
- KES
29+
- NGN
30+
- USD
31+
- ZAR
2632
items:
2733
type: array
2834
items:
2935
$ref: ./OrderItems.yaml
3036
shipping:
3137
$ref: ./OrderShipping.yaml
3238
is_gift:
33-
description: |
34-
A flag to indicate if the order is for someone else
39+
description: A flag to indicate if the order is for someone else
3540
type: boolean
3641
pay_for_me:
37-
description: |
38-
A flag to indicate if the someone else should pay for the order
42+
description: A flag to indicate if the someone else should pay for the order
3943
type: boolean
44+
example:
45+
email: test@email.com
46+
first_name: Demo
47+
last_name: User
48+
phone: '+2348031245678'
49+
currency: NGN
50+
items:
51+
- item: 2179824
52+
type: product
53+
quantity: 200000
54+
amount: 2
55+
shipping:
56+
street_line: Somewhere on Earth
57+
city: Atlantic
58+
state: Pacific
59+
country: Equator
60+
shipping_fee: 10000

src/assets/openapi/components/schemas/OrderItems.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ required:
88
properties:
99
item:
1010
description: The product ID of the item
11-
type: string
11+
type: integer
1212
type:
1313
description: The type of the item. `product` is currently the acceptable value
1414
type: string
@@ -18,3 +18,8 @@ properties:
1818
amount:
1919
description: The cost of the item
2020
type: integer
21+
example:
22+
item: 2179824
23+
type: product
24+
quantity: 200000
25+
amount: 2

src/assets/openapi/components/schemas/OrderShipping.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ properties:
2525
delivery_note:
2626
description: Extra details to be aware of for the delivery
2727
type: string
28+
example:
29+
street_line: Somewhere on Earth
30+
city: Atlantic
31+
state: Pacific
32+
country: Equator
33+
shipping_fee: 10000

src/assets/openapi/paths/order.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ post:
22
tags:
33
- Order
44
summary: Create Order
5+
description: Create an order for selected items
56
operationId: order_create
67
requestBody:
78
content:
@@ -22,6 +23,7 @@ get:
2223
tags:
2324
- Order
2425
summary: List Orders
26+
description: List the previously created orders
2527
operationId: order_list
2628
parameters:
2729
- in: query

src/assets/openapi/paths/order_product_{id}.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
parameters:
22
- name: id
3+
description: The unique identifier of the order
34
in: path
45
required: true
56
schema:
6-
type: string
7+
type: integer
8+
example: 1559046
79
get:
810
tags:
911
- Order
10-
summary: Fetch Products Order
11-
operationId: order_fetchProducts
12+
summary: Fetch Product Orders
13+
description: Fetch all orders for a particular product
14+
operationId: order_product
1215
responses:
1316
'200':
1417
$ref: ../components/responses/OrderFetchProductSuccess.yaml

src/assets/openapi/paths/order_{code}_validate.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
parameters:
22
- name: code
3+
description: The unique code of a previously created order
34
in: path
45
required: true
56
schema:
67
type: string
8+
example: ORD_6z0lqwpmxrm7dsp
79
get:
810
tags:
911
- Order
10-
summary: Validate pay for me order
11-
operationId: order_validatePayForMe
12+
summary: Validate Order
13+
description: Validate a pay for me order
14+
operationId: order_validate
1215
responses:
1316
'200':
1417
$ref: ../components/responses/OrderValidateSuccess.yaml

src/assets/openapi/paths/order_{id}.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
parameters:
22
- name: id
3+
description: The unique identifier of the order
34
in: path
45
required: true
56
schema:
6-
type: string
7+
type: integer
8+
example: 1559046
79
get:
810
tags:
911
- Order
1012
summary: Fetch Order
13+
description: Fetch the details of a previously created order
1114
operationId: order_fetch
1215
responses:
1316
'200':

0 commit comments

Comments
 (0)