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

Add Storefront change-items endpoint #1769

Merged
merged 12 commits into from
Feb 15, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
type: object
description: Change customer subscription items.
properties:
effectiveTime:
type: string
description: Effective time when changes are applied.
default: now
enum:
- now
- next-service-period
x-enumDescriptions:
now: Apply changes immediately.
next-service-period: Apply changes at the beginning of next service period.
items:
type: array
description: Details of items in the subscription.
minItems: 1
items:
type: object
required:
- planId
properties:
planId:
type: string
description: ID of the plan.
maxLength: 50
example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X
quantity:
description: Number of units of the product on the given plan.
type: integer
minimum: 0
preview:
description: |-
Specifies if changes to the subscription must be previewed.
Subscription is not changed in preview.
lucasxciv marked this conversation as resolved.
Show resolved Hide resolved
type: boolean
default: false
example: true
2 changes: 2 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ paths:
$ref: paths/storefront/orders@{id}@cancellation.yaml
'/storefront/orders/{id}/pause':
$ref: paths/storefront/orders@{id}@pause.yaml
'/storefront/subscriptions/{id}/change-items':
$ref: paths/storefront/subscriptions@{id}@change-items.yaml
'/storefront/payment':
$ref: paths/storefront/payment.yaml
'/storefront/payment-instruments':
Expand Down
41 changes: 41 additions & 0 deletions openapi/paths/storefront/subscriptions@{id}@change-items.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
parameters:
- $ref: ../../components/parameters/resourceId.yaml
post:
x-badge: Experimental
x-products:
- Storefront
tags:
- Storefront orders
summary: Change subscription items
operationId: StorefrontPostSubscriptionItemsChange
x-sdk-operation-name: changeItems
security:
- CustomerJWT: []
description: |-
Creates a quote for change items and quantities.
Applies the update to subscription when the quote is accepted.
lucasxciv marked this conversation as resolved.
Show resolved Hide resolved
requestBody:
content:
application/json:
schema:
$ref: ../../components/requestBodies/storefront/PostSubscriptionItemsChange.yaml
description: Change items request.
required: true
responses:
'200':
description: Quote for change items created and issued.
lucasxciv marked this conversation as resolved.
Show resolved Hide resolved
headers:
Location:
$ref: ../../components/headers/Location.yaml
content:
application/json:
schema:
$ref: ../../components/schemas/StorefrontQuoteChangeOrder.yaml
'401':
$ref: ../../components/responses/Unauthorized.yaml
'403':
$ref: ../../components/responses/Forbidden.yaml
'404':
$ref: ../../components/responses/NotFound.yaml
'422':
$ref: ../../components/responses/ValidationError.yaml