Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Request Bodies in API Documentation #4066

Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
530b93f
Fix API docs for request body of addresses
kennyadsl May 14, 2021
e6e4ab8
Fix API docs for request body of payments
kennyadsl May 14, 2021
ff1cfe5
Fix API docs for request body of products
kennyadsl May 14, 2021
718a510
Fix API docs for request body of variants
kennyadsl May 17, 2021
defc7d8
Fix API docs for request body of line items
kennyadsl May 20, 2021
49701a5
Fix API docs for request body of orders
kennyadsl May 20, 2021
9082e28
Remove deprecated coupon code property from order's input
kennyadsl May 20, 2021
c955115
Fix API docs for request body of coupon codes
kennyadsl May 21, 2021
b0d9752
Fix API docs for request body of shipments
kennyadsl May 21, 2021
16bea19
Fix API docs for request body of zones
kennyadsl May 21, 2021
76ba37a
Fix API docs for request body of product properties
kennyadsl May 21, 2021
da32fea
Fix API docs for request body of stock locations
kennyadsl May 21, 2021
fe32401
Fix API docs for request body of taxons
kennyadsl May 21, 2021
a11c626
Fix API docs for request body of taxonomies
kennyadsl May 21, 2021
f27cf6c
Fix API docs for request body of properties
kennyadsl May 27, 2021
a41e5c9
Fix API docs for request body of images
kennyadsl May 27, 2021
bf26b5f
Fix API docs for request body of users
kennyadsl May 27, 2021
413b360
Fix API docs for request body of return authorizations
kennyadsl May 27, 2021
43f60ef
Fix API docs for request body of customer returns
kennyadsl May 27, 2021
58898c5
Fix API docs for request body of option values
kennyadsl May 27, 2021
046d3af
Fix API docs for request body of stock items
kennyadsl May 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix API docs for request body of payments
  • Loading branch information
kennyadsl committed May 17, 2021
commit e6e4ab80da607598bc9be55c02726f3db6248998
114 changes: 93 additions & 21 deletions api/openapi/solidus-api.oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ paths:
'404':
$ref: '#/components/responses/not-found'
summary: List checkout payments
description: Lists a checkout's payments.
description: 'Lists a checkout''s payments. The list of payments is only visible by the checkout''s owner and by users authorized to see the order, eg. users with admin role. '
operationId: list-checkout-payments
tags:
- Payments
Expand Down Expand Up @@ -1285,15 +1285,38 @@ paths:
'422':
$ref: '#/components/responses/unprocessable-entity'
summary: Create checkout payment
description: Creates a new payment for a checkout.
description: Creates a new payment for a checkout. Only the checkout's owner and users that can create a payment (eg. users with admin role) are allowed to perform this action.
operationId: create-checkout-payment
tags:
- Payments
security:
- api-key: []
- order-token: []
requestBody:
$ref: '#/components/requestBodies/payment-input'
content:
application/json:
schema:
type: object
properties:
payment:
$ref: '#/components/schemas/payment-input'
examples:
Example without a payment source:
value:
payment:
amount: '42.42'
payment_method_id: 1
Example with a payment source:
value:
payment:
amount: '42.42'
payment_method_id: 1
source_attributes:
gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
description: |-
This requests only accepts available Payment Methods in the `payment_method_id` field.

The Payment Methods available to users for creating a new payment are the ones with both attributes `available_to_users` and `active` set to `true`.
'/checkouts/{checkout_id}/payments/{id}':
get:
responses:
Expand Down Expand Up @@ -1325,6 +1348,7 @@ paths:
- name: id
in: path
required: true
description: The payment id
schema:
type: string
patch:
Expand All @@ -1337,12 +1361,21 @@ paths:
$ref: '#/components/schemas/payment'
'401':
$ref: '#/components/responses/invalid-api-key'
'403':
description: 'Forbidden '
content:
application/json:
schema:
type: object
properties:
error:
type: string
'404':
$ref: '#/components/responses/not-found'
'422':
$ref: '#/components/responses/unprocessable-entity'
summary: Update checkout payment
description: Updates a checkout's payment.
description: 'Updates a checkout''s payment. Please note that this action can be done by users with the admin permissions on Payments (eg. users with the admin role). Only pending payment can be updated. '
operationId: update-checkout-payment
tags:
- Payments
Expand All @@ -1355,12 +1388,13 @@ paths:
schema:
type: object
properties:
amount:
type: number
payment_method_id:
type: integer
payment_method:
$ref: '#/components/schemas/payment-method'
payment:
$ref: '#/components/schemas/payment-input'
examples:
Example:
value:
payment:
amount: '12.10'
'/checkouts/{checkout_id}/return_authorizations':
get:
responses:
Expand Down Expand Up @@ -1725,6 +1759,7 @@ paths:
- name: order_number
in: path
required: true
description: The order number
schema:
type: string
post:
Expand All @@ -1742,15 +1777,38 @@ paths:
'422':
$ref: '#/components/responses/unprocessable-entity'
summary: Create order payment
description: Creates a payment for an order.
description: Creates a new payment for a checkout. Only the order's owner and users that can create a payment (eg. users with admin role) are allowed to perform this action.
operationId: create-order-payment
tags:
- Payments
security:
- api-key: []
- order-token: []
requestBody:
$ref: '#/components/requestBodies/payment-input'
content:
application/json:
schema:
type: object
properties:
payment:
$ref: '#/components/schemas/payment-input'
examples:
Example without a payment source:
value:
payment:
amount: '42.42'
payment_method_id: 1
Example with a payment source:
value:
payment:
amount: '42.42'
payment_method_id: 1
source_attributes:
gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
description: |-
This requests only accepts available Payment Methods in the `payment_method_id` field.

The Payment Methods available to users for creating a new payment are the ones with both attributes `available_to_users` and `active` set to `true`.
'/orders/{order_number}/payments/{id}':
get:
responses:
Expand Down Expand Up @@ -1792,20 +1850,40 @@ paths:
$ref: '#/components/schemas/payment'
'401':
$ref: '#/components/responses/invalid-api-key'
'403':
description: Forbidden
content:
application/json:
schema:
type: object
properties:
error:
type: string
'404':
$ref: '#/components/responses/not-found'
'422':
$ref: '#/components/responses/unprocessable-entity'
summary: Update order payment
description: Updates an order's payment.
description: 'Updates a checkout''s payment. Please note that this action can be done by users with the admin permissions on Payments (eg. users with the admin role). Only pending payment can be updated. '
operationId: update-order-payment
tags:
- Payments
security:
- api-key: []
- order-token: []
requestBody:
$ref: '#/components/requestBodies/payment-input'
content:
application/json:
schema:
type: object
properties:
payment:
$ref: '#/components/schemas/payment-input'
examples:
Example:
value:
payment:
amount: '12.10'
'/orders/{order_number}/return_authorizations':
get:
responses:
Expand Down Expand Up @@ -5075,11 +5153,6 @@ components:
application/json:
schema:
$ref: '#/components/schemas/line-item-input'
payment-input:
content:
application/json:
schema:
$ref: '#/components/schemas/payment-input'
zone-input:
content:
application/json:
Expand Down Expand Up @@ -6279,10 +6352,9 @@ components:
type: string
payment_method_id:
type: integer
payment_method:
type: string
source_attributes:
type: object
description: This field is required for Payment Method that has source_required? returning true.
properties:
number:
type: string
Expand Down