Skip to content

Commit

Permalink
Add StorefrontPostSubscriptionReactivation (#1830)
Browse files Browse the repository at this point in the history
* Add StorefrontPostSubscriptionReactivation

* Update openapi/openapi.yaml

Co-authored-by: Adam Altman <[email protected]>

* Update openapi/openapi.yaml

Co-authored-by: Adam Altman <[email protected]>

* Add request body

* Fix file name

* Update resource and request body

* Add subscriptionId example

* Add orderId to properties

---------

Co-authored-by: Adam Altman <[email protected]>
  • Loading branch information
lucasxciv and adamaltman authored Mar 27, 2024
1 parent 9a9248c commit 51aee11
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type: object
description: Reactivate customer subscription.
required:
- orderId
properties:
orderId:
type: string
description: ID of the order associated with the reactivation quote.
example: ord_01HRF27SATGE4Z6PBJE6PD8328
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 the quote must be previewed before it is created.
Subscriptions cannot be reactivated in the preview.
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 @@ -1361,6 +1361,8 @@ paths:
$ref: paths/storefront/orders@{id}@pause.yaml
'/storefront/subscriptions/{id}/change-items':
$ref: paths/storefront/subscriptions@{id}@change-items.yaml
'/storefront/subscription-reactivations':
$ref: paths/storefront/subscription-reactivations.yaml
'/storefront/payment':
$ref: paths/storefront/payment.yaml
'/storefront/payment-instruments':
Expand Down
38 changes: 38 additions & 0 deletions openapi/paths/storefront/subscription-reactivations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
post:
x-badge: Experimental
x-products:
- Storefront
tags:
- Storefront orders
summary: Reactivate a subscription
operationId: StorefrontPostSubscriptionReactivation
x-sdk-operation-name: reactivation
security:
- CustomerJWT: []
description: |-
Creates a quote for requested reactivation.
This operation applies the requested reactivation to the subscription when the quote invoice is paid.
requestBody:
content:
application/json:
schema:
$ref: ../../components/requestBodies/storefront/PostSubscriptionReactivation.yaml
description: Change items request.
responses:
'201':
description: Quote for requested reactivation is created and issued.
headers:
Location:
$ref: ../../components/headers/Location.yaml
content:
application/json:
schema:
$ref: ../../components/schemas/StorefrontQuoteReactivateOrder.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

0 comments on commit 51aee11

Please sign in to comment.