From 1b37aae7dbf62343daf08933a7a5866ee9f94ca2 Mon Sep 17 00:00:00 2001 From: Damilola Odujoko Date: Fri, 24 Oct 2025 17:00:32 +0100 Subject: [PATCH] chore: update orders examples and descriptions --- dist/paystack.yaml | 67 +++++++++++++++---- .../components/schemas/OrderCreate.yaml | 31 +++++++-- .../components/schemas/OrderItems.yaml | 7 +- .../components/schemas/OrderShipping.yaml | 6 ++ src/assets/openapi/paths/order.yaml | 2 + .../openapi/paths/order_product_{id}.yaml | 9 ++- .../openapi/paths/order_{code}_validate.yaml | 7 +- src/assets/openapi/paths/order_{id}.yaml | 5 +- 8 files changed, 110 insertions(+), 24 deletions(-) diff --git a/dist/paystack.yaml b/dist/paystack.yaml index 22cb84e..a798e5c 100644 --- a/dist/paystack.yaml +++ b/dist/paystack.yaml @@ -3975,6 +3975,7 @@ paths: tags: - Order summary: Create Order + description: Create an order for selected items operationId: order_create requestBody: content: @@ -3995,6 +3996,7 @@ paths: tags: - Order summary: List Orders + description: List the previously created orders operationId: order_list parameters: - in: query @@ -4031,14 +4033,17 @@ paths: /order/{id}: parameters: - name: id + description: The unique identifier of the order in: path required: true schema: - type: string + type: integer + example: 1559046 get: tags: - Order summary: Fetch Order + description: Fetch the details of a previously created order operationId: order_fetch responses: '200': @@ -4052,15 +4057,18 @@ paths: /order/product/{id}: parameters: - name: id + description: The unique identifier of the order in: path required: true schema: - type: string + type: integer + example: 1559046 get: tags: - Order - summary: Fetch Products Order - operationId: order_fetchProducts + summary: Fetch Product Orders + description: Fetch all orders for a particular product + operationId: order_product responses: '200': $ref: '#/components/responses/OrderFetchProductSuccess' @@ -4073,15 +4081,18 @@ paths: /order/{code}/validate: parameters: - name: code + description: The unique code of a previously created order in: path required: true schema: type: string + example: ORD_6z0lqwpmxrm7dsp get: tags: - Order - summary: Validate pay for me order - operationId: order_validatePayForMe + summary: Validate Order + description: Validate a pay for me order + operationId: order_validate responses: '200': $ref: '#/components/responses/OrderValidateSuccess' @@ -14989,7 +15000,7 @@ components: properties: item: description: The product ID of the item - type: string + type: integer type: description: The type of the item. `product` is currently the acceptable value type: string @@ -14999,6 +15010,11 @@ components: amount: description: The cost of the item type: integer + example: + item: 2179824 + type: product + quantity: 200000 + amount: 2 OrderShipping: type: object description: The shipping details of the order @@ -15027,6 +15043,12 @@ components: delivery_note: description: Extra details to be aware of for the delivery type: string + example: + street_line: Somewhere on Earth + city: Atlantic + state: Pacific + country: Equator + shipping_fee: 10000 OrderCreate: type: object required: @@ -15051,8 +15073,14 @@ components: description: The customer's mobile number type: string currency: - description: Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD + description: Currency in which amount is set type: string + enum: + - GHS + - KES + - NGN + - USD + - ZAR items: type: array items: @@ -15060,13 +15088,28 @@ components: shipping: $ref: '#/components/schemas/OrderShipping' is_gift: - description: | - A flag to indicate if the order is for someone else + description: A flag to indicate if the order is for someone else type: boolean pay_for_me: - description: | - A flag to indicate if the someone else should pay for the order + description: A flag to indicate if the someone else should pay for the order type: boolean + example: + email: test@email.com + first_name: Demo + last_name: User + phone: '+2348031245678' + currency: NGN + items: + - item: 2179824 + type: product + quantity: 200000 + amount: 2 + shipping: + street_line: Somewhere on Earth + city: Atlantic + state: Pacific + country: Equator + shipping_fee: 10000 OrderCreateResponse: type: object properties: diff --git a/src/assets/openapi/components/schemas/OrderCreate.yaml b/src/assets/openapi/components/schemas/OrderCreate.yaml index b062789..f17d469 100644 --- a/src/assets/openapi/components/schemas/OrderCreate.yaml +++ b/src/assets/openapi/components/schemas/OrderCreate.yaml @@ -21,8 +21,14 @@ properties: description: The customer's mobile number type: string currency: - description: Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD + description: Currency in which amount is set type: string + enum: + - GHS + - KES + - NGN + - USD + - ZAR items: type: array items: @@ -30,10 +36,25 @@ properties: shipping: $ref: ./OrderShipping.yaml is_gift: - description: | - A flag to indicate if the order is for someone else + description: A flag to indicate if the order is for someone else type: boolean pay_for_me: - description: | - A flag to indicate if the someone else should pay for the order + description: A flag to indicate if the someone else should pay for the order type: boolean +example: + email: test@email.com + first_name: Demo + last_name: User + phone: '+2348031245678' + currency: NGN + items: + - item: 2179824 + type: product + quantity: 200000 + amount: 2 + shipping: + street_line: Somewhere on Earth + city: Atlantic + state: Pacific + country: Equator + shipping_fee: 10000 \ No newline at end of file diff --git a/src/assets/openapi/components/schemas/OrderItems.yaml b/src/assets/openapi/components/schemas/OrderItems.yaml index e165ebe..35c9b6e 100644 --- a/src/assets/openapi/components/schemas/OrderItems.yaml +++ b/src/assets/openapi/components/schemas/OrderItems.yaml @@ -8,7 +8,7 @@ required: properties: item: description: The product ID of the item - type: string + type: integer type: description: The type of the item. `product` is currently the acceptable value type: string @@ -18,3 +18,8 @@ properties: amount: description: The cost of the item type: integer +example: + item: 2179824 + type: product + quantity: 200000 + amount: 2 \ No newline at end of file diff --git a/src/assets/openapi/components/schemas/OrderShipping.yaml b/src/assets/openapi/components/schemas/OrderShipping.yaml index a438862..0ba5065 100644 --- a/src/assets/openapi/components/schemas/OrderShipping.yaml +++ b/src/assets/openapi/components/schemas/OrderShipping.yaml @@ -25,3 +25,9 @@ properties: delivery_note: description: Extra details to be aware of for the delivery type: string +example: + street_line: Somewhere on Earth + city: Atlantic + state: Pacific + country: Equator + shipping_fee: 10000 \ No newline at end of file diff --git a/src/assets/openapi/paths/order.yaml b/src/assets/openapi/paths/order.yaml index 1eee9de..c5d2016 100644 --- a/src/assets/openapi/paths/order.yaml +++ b/src/assets/openapi/paths/order.yaml @@ -2,6 +2,7 @@ post: tags: - Order summary: Create Order + description: Create an order for selected items operationId: order_create requestBody: content: @@ -22,6 +23,7 @@ get: tags: - Order summary: List Orders + description: List the previously created orders operationId: order_list parameters: - in: query diff --git a/src/assets/openapi/paths/order_product_{id}.yaml b/src/assets/openapi/paths/order_product_{id}.yaml index 20bb37b..ca01bcb 100644 --- a/src/assets/openapi/paths/order_product_{id}.yaml +++ b/src/assets/openapi/paths/order_product_{id}.yaml @@ -1,14 +1,17 @@ parameters: - name: id + description: The unique identifier of the order in: path required: true schema: - type: string + type: integer + example: 1559046 get: tags: - Order - summary: Fetch Products Order - operationId: order_fetchProducts + summary: Fetch Product Orders + description: Fetch all orders for a particular product + operationId: order_product responses: '200': $ref: ../components/responses/OrderFetchProductSuccess.yaml diff --git a/src/assets/openapi/paths/order_{code}_validate.yaml b/src/assets/openapi/paths/order_{code}_validate.yaml index e85fad7..6d20023 100644 --- a/src/assets/openapi/paths/order_{code}_validate.yaml +++ b/src/assets/openapi/paths/order_{code}_validate.yaml @@ -1,14 +1,17 @@ parameters: - name: code + description: The unique code of a previously created order in: path required: true schema: type: string + example: ORD_6z0lqwpmxrm7dsp get: tags: - Order - summary: Validate pay for me order - operationId: order_validatePayForMe + summary: Validate Order + description: Validate a pay for me order + operationId: order_validate responses: '200': $ref: ../components/responses/OrderValidateSuccess.yaml diff --git a/src/assets/openapi/paths/order_{id}.yaml b/src/assets/openapi/paths/order_{id}.yaml index 5b6d1af..9add038 100644 --- a/src/assets/openapi/paths/order_{id}.yaml +++ b/src/assets/openapi/paths/order_{id}.yaml @@ -1,13 +1,16 @@ parameters: - name: id + description: The unique identifier of the order in: path required: true schema: - type: string + type: integer + example: 1559046 get: tags: - Order summary: Fetch Order + description: Fetch the details of a previously created order operationId: order_fetch responses: '200':