docs: update OAS for loyalty plugin (#12836)
* updates * cleanup * generate OAS * update links
This commit is contained in:
@@ -65,20 +65,6 @@ tags:
|
||||
url: https://docs.medusajs.com/resources/storefront-development/customers
|
||||
x-associatedSchema:
|
||||
$ref: "#/components/schemas/StoreCustomer"
|
||||
- name: Gift Card Invitations
|
||||
description: >
|
||||
A gift card invitation is a way to send a gift card to a customer. They
|
||||
can be sent from one customer to another.
|
||||
|
||||
These API routes allow logged-in customers to create and manage gift card invitations.
|
||||
|
||||
<Note>
|
||||
|
||||
Gift Card Invitations are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
|
||||
</Note>
|
||||
x-associatedSchema:
|
||||
$ref: "#/components/schemas/StoreGiftCardInvitation"
|
||||
- name: Gift Cards
|
||||
description: >
|
||||
A gift card is a prepaid card that customers can use to purchase products
|
||||
|
||||
@@ -366,8 +366,9 @@
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -58,8 +58,9 @@
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* @oas [post] /admin/gift-cards/{id}/transfer
|
||||
* operationId: PostGiftCardsIdTransfer
|
||||
* summary: Transfer Gift Card
|
||||
* description: Transfer a gift card to another customer.
|
||||
* @oas [get] /admin/gift-cards/{id}/orders
|
||||
* operationId: GetGiftCardsIdOrders
|
||||
* summary: List Gift Card's Orders
|
||||
* x-sidebar-summary: List Orders
|
||||
* description: Retrieve the list of orders that a gift card was used in.
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
@@ -16,8 +17,8 @@
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
@@ -30,30 +31,17 @@
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/AdminTransferGiftCard"
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl -X POST '{backend_url}/admin/gift-cards/{id}/transfer' \
|
||||
* -H 'Authorization: Bearer {access_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "customer_id": "{value}"
|
||||
* }'
|
||||
* curl '{backend_url}/admin/gift-cards/{id}/orders' \
|
||||
* -H 'Authorization: Bearer {access_token}'
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/AdminGiftCardResponse"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
@@ -66,10 +54,9 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*/
|
||||
|
||||
@@ -404,10 +404,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -410,10 +410,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -379,10 +379,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -365,10 +365,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -61,10 +61,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
/**
|
||||
* @oas [get] /store/gift-cards
|
||||
* operationId: GetGiftCards
|
||||
* summary: List Customer's Gift Cards
|
||||
* x-sidebar-summary: List Gift Cards
|
||||
* description: Retrieve a customer's gift cards. The gift cards can be filtered by fields such as `id`. The gift cards can also be sorted or paginated.
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: x-publishable-api-key
|
||||
* in: header
|
||||
* description: Publishable API Key created in the Medusa Admin.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* externalDocs:
|
||||
* url: https://docs.medusajs.com/api/store#publishable-api-key
|
||||
* - name: id
|
||||
* in: query
|
||||
* required: false
|
||||
* schema:
|
||||
* oneOf:
|
||||
* - type: string
|
||||
* title: id
|
||||
* description: Filter by a gift card ID.
|
||||
* - type: array
|
||||
* description: Filter by gift card IDs.
|
||||
* items:
|
||||
* type: string
|
||||
* title: id
|
||||
* description: A gift card's ID.
|
||||
* - name: limit
|
||||
* in: query
|
||||
* description: Limit the number of items returned in the list.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: number
|
||||
* title: limit
|
||||
* description: Limit the number of items returned in the list.
|
||||
* externalDocs:
|
||||
* url: "#pagination"
|
||||
* - name: offset
|
||||
* in: query
|
||||
* description: The number of items to skip when retrieving a list.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: number
|
||||
* title: offset
|
||||
* description: The number of items to skip when retrieving a list.
|
||||
* externalDocs:
|
||||
* url: "#pagination"
|
||||
* - name: order
|
||||
* in: query
|
||||
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
* title: order
|
||||
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
|
||||
* externalDocs:
|
||||
* url: "#pagination"
|
||||
* - name: fields
|
||||
* in: query
|
||||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
* title: fields
|
||||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* externalDocs:
|
||||
* url: "#select-fields-and-relations"
|
||||
* - name: $and
|
||||
* in: query
|
||||
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: array
|
||||
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
|
||||
* items:
|
||||
* type: object
|
||||
* title: $and
|
||||
* - name: $or
|
||||
* in: query
|
||||
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: array
|
||||
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
|
||||
* items:
|
||||
* type: object
|
||||
* title: $or
|
||||
* - name: status
|
||||
* in: query
|
||||
* required: false
|
||||
* schema:
|
||||
* oneOf:
|
||||
* - type: string
|
||||
* description: Filter by a gift card's status.
|
||||
* enum:
|
||||
* - pending
|
||||
* - redeemed
|
||||
* - type: array
|
||||
* description: Filter by gift card statuses.
|
||||
* items:
|
||||
* type: string
|
||||
* description: A gift card status.
|
||||
* enum:
|
||||
* - pending
|
||||
* - redeemed
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl '{backend_url}/store/gift-cards' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
* $ref: "#/components/responses/unauthorized"
|
||||
* "404":
|
||||
* $ref: "#/components/responses/not_found_error"
|
||||
* "409":
|
||||
* $ref: "#/components/responses/invalid_state_error"
|
||||
* "422":
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* @oas [get] /store/gift-cards/{id}
|
||||
* operationId: GetGiftCardsId
|
||||
* summary: Get Customer's Gift Card
|
||||
* @oas [get] /store/gift-cards/{idOrCode}
|
||||
* operationId: GetGiftCardsIdorcode
|
||||
* summary: Get a Gift Card
|
||||
* x-sidebar-summary: Get Gift Card
|
||||
* description: Retrieve the logged-in customer's gift card by its ID. You can expand the gift card's relations or select the fields that should be returned.
|
||||
* x-authenticated: true
|
||||
* description: Retrieve a gift card by its ID or code. You can expand the gift card's relations or select the fields that should be returned.
|
||||
* x-authenticated: false
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: id
|
||||
* - name: idOrCode
|
||||
* in: path
|
||||
* description: The gift card's ID.
|
||||
* description: The gift card's ID or code.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
@@ -25,8 +25,8 @@
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
@@ -39,7 +39,8 @@
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl '{backend_url}/store/gift-cards/{id}' \
|
||||
* curl '{backend_url}/store/gift-cards/{idOrCode}' \
|
||||
* -H 'Authorization: Bearer {access_token}' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
@@ -58,13 +59,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -354,10 +354,10 @@
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -65,10 +65,10 @@
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* @oas [post] /store/gift-card-invitations/{code}/accept
|
||||
* operationId: PostGiftCardInvitationsCodeAccept
|
||||
* summary: Accept Customer's Gift Card Invitation
|
||||
* x-sidebar-summary: Accept Invitation
|
||||
* description: Accept the logged-in customer's gift card invitation
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: code
|
||||
* in: path
|
||||
* description: The gift card invitation's code.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* - name: x-publishable-api-key
|
||||
* in: header
|
||||
* description: Publishable API Key created in the Medusa Admin.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* externalDocs:
|
||||
* url: https://docs.medusajs.com/api/store#publishable-api-key
|
||||
* - name: fields
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
* title: fields
|
||||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* externalDocs:
|
||||
* url: "#select-fields-and-relations"
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl -X POST '{backend_url}/store/gift-card-invitations/{code}/accept' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
* tags:
|
||||
* - Gift Card Invitations
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/StoreGiftCardInvitationResponse"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
* $ref: "#/components/responses/unauthorized"
|
||||
* "404":
|
||||
* $ref: "#/components/responses/not_found_error"
|
||||
* "409":
|
||||
* $ref: "#/components/responses/invalid_state_error"
|
||||
* "422":
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*/
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* @oas [post] /store/gift-card-invitations/{code}/reject
|
||||
* operationId: PostGiftCardInvitationsCodeReject
|
||||
* summary: Reject Customer's Gift Card Invitation
|
||||
* x-sidebar-summary: Reject Invitation
|
||||
* description: Reject the logged-in customer's gift card invitation
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: code
|
||||
* in: path
|
||||
* description: The gift card invitation's code.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* - name: x-publishable-api-key
|
||||
* in: header
|
||||
* description: Publishable API Key created in the Medusa Admin.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* externalDocs:
|
||||
* url: https://docs.medusajs.com/api/store#publishable-api-key
|
||||
* - name: fields
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
* title: fields
|
||||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* externalDocs:
|
||||
* url: "#select-fields-and-relations"
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl -X POST '{backend_url}/store/gift-card-invitations/{code}/reject' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
* tags:
|
||||
* - Gift Card Invitations
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/StoreGiftCardInvitationResponse"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
* $ref: "#/components/responses/unauthorized"
|
||||
* "404":
|
||||
* $ref: "#/components/responses/not_found_error"
|
||||
* "409":
|
||||
* $ref: "#/components/responses/invalid_state_error"
|
||||
* "422":
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* @oas [post] /store/gift-cards/{id}/redeem
|
||||
* operationId: PostGiftCardsIdRedeem
|
||||
* summary: Redeem Customer's Gift Card
|
||||
* @oas [post] /store/gift-cards/{idOrCode}/redeem
|
||||
* operationId: PostGiftCardsIdorcodeRedeem
|
||||
* summary: Redeem a Gift Card
|
||||
* x-sidebar-summary: Redeem Gift Card
|
||||
* description: Redeem the logged-in customer's gift card
|
||||
* description: Redeem a gift card by its ID or code. The gift card will be added to the logged-in customer's store credit account.
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: id
|
||||
* - name: idOrCode
|
||||
* in: path
|
||||
* description: The gift card's ID.
|
||||
* description: The gift card's ID or code.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
@@ -25,8 +25,8 @@
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
@@ -35,11 +35,15 @@
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* externalDocs:
|
||||
* url: "#select-fields-and-relations"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl -X POST '{backend_url}/store/gift-cards/{id}/redeem' \
|
||||
* curl -X POST '{backend_url}/store/gift-cards/{idOrCode}/redeem' \
|
||||
* -H 'Authorization: Bearer {access_token}' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
@@ -62,13 +66,10 @@
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
* - text: Cloud
|
||||
* description: |
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/**
|
||||
* @oas [post] /store/gift-cards/{id}/invitation
|
||||
* operationId: PostGiftCardsIdInvitation
|
||||
* summary: Send Gift Card Invitation
|
||||
* x-sidebar-summary: Send Invitation
|
||||
* description: Send a gift card invitation to a customer's email address. The gift card must belong to the logged-in customer, and it must not have been redeemed yet.
|
||||
* x-authenticated: true
|
||||
* x-ignoreCleanup: true
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* description: The gift card's ID.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* - name: x-publishable-api-key
|
||||
* in: header
|
||||
* description: Publishable API Key created in the Medusa Admin.
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* externalDocs:
|
||||
* url: https://docs.medusajs.com/api/store#publishable-api-key
|
||||
* - name: fields
|
||||
* in: query
|
||||
* description: |-
|
||||
* Comma-separated fields that should be included in the returned data.
|
||||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
|
||||
* without prefix it will replace the entire default fields.
|
||||
* required: false
|
||||
* schema:
|
||||
* type: string
|
||||
* title: fields
|
||||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
|
||||
* fields. Without prefix it will replace the entire default fields.
|
||||
* externalDocs:
|
||||
* url: "#select-fields-and-relations"
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/StoreCreateGiftCardInvitation"
|
||||
* x-codeSamples:
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: |-
|
||||
* curl -X POST '{backend_url}/store/gift-cards/{id}/invitation' \
|
||||
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "email": "Morton61@hotmail.com"
|
||||
* }'
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: "#/components/schemas/StoreGiftCardResponse"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
* $ref: "#/components/responses/unauthorized"
|
||||
* "404":
|
||||
* $ref: "#/components/responses/not_found_error"
|
||||
* "409":
|
||||
* $ref: "#/components/responses/invalid_state_error"
|
||||
* "422":
|
||||
* $ref: "#/components/responses/invalid_request_error"
|
||||
* "500":
|
||||
* $ref: "#/components/responses/500_error"
|
||||
* security:
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
*
|
||||
* x-badges:
|
||||
* - text: "Cloud"
|
||||
* description: >
|
||||
* This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin).
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* required:
|
||||
* - line_item
|
||||
* - customer
|
||||
* - invitation
|
||||
* - id
|
||||
* - code
|
||||
* - status
|
||||
@@ -67,8 +66,6 @@
|
||||
* type: string
|
||||
* title: expires_at
|
||||
* description: The date the gift card expires at.
|
||||
* invitation:
|
||||
* $ref: "#/components/schemas/AdminGiftCardInvitation"
|
||||
* created_at:
|
||||
* type: string
|
||||
* format: date-time
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* @schema AdminGiftCardInvitation
|
||||
* type: object
|
||||
* description: The gift card invitation details.
|
||||
* required:
|
||||
* - gift_card
|
||||
* - id
|
||||
* - code
|
||||
* - status
|
||||
* - expires_at
|
||||
* - email
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* title: id
|
||||
* description: The invitation's ID.
|
||||
* email:
|
||||
* type: string
|
||||
* title: email
|
||||
* description: The invitation's email.
|
||||
* format: email
|
||||
* code:
|
||||
* type: string
|
||||
* title: code
|
||||
* description: The invitation's code.
|
||||
* status:
|
||||
* type: string
|
||||
* description: The invitation's status.
|
||||
* enum:
|
||||
* - pending
|
||||
* - accepted
|
||||
* - rejected
|
||||
* expires_at:
|
||||
* type: string
|
||||
* title: expires_at
|
||||
* description: The date the invitation expires at.
|
||||
* gift_card:
|
||||
* $ref: "#/components/schemas/AdminGiftCard"
|
||||
* x-schemaName: AdminGiftCardInvitation
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
* description: The list of gift cards.
|
||||
* items:
|
||||
* $ref: "#/components/schemas/AdminGiftCard"
|
||||
* estimate_count:
|
||||
* type: number
|
||||
* title: estimate_count
|
||||
* description: The gift card's estimate count.
|
||||
* x-featureFlag: index_engine
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
* description: The list of store credit accounts.
|
||||
* items:
|
||||
* $ref: "#/components/schemas/AdminStoreCreditAccount"
|
||||
* estimate_count:
|
||||
* type: number
|
||||
* title: estimate_count
|
||||
* description: The store credit account's estimate count.
|
||||
* x-featureFlag: index_engine
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
* description: The list of transaction groups.
|
||||
* items:
|
||||
* $ref: "#/components/schemas/AdminTransactionGroup"
|
||||
* estimate_count:
|
||||
* type: number
|
||||
* title: estimate_count
|
||||
* description: The transaction group's estimate count.
|
||||
* x-featureFlag: index_engine
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
* description: The list of transactions.
|
||||
* items:
|
||||
* $ref: "#/components/schemas/AdminTransaction"
|
||||
* estimate_count:
|
||||
* type: number
|
||||
* title: estimate_count
|
||||
* description: The store credit account's estimate count.
|
||||
* x-featureFlag: index_engine
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* @schema AdminTransferGiftCard
|
||||
* type: object
|
||||
* description: The details of the gift card transfer request.
|
||||
* x-schemaName: AdminTransferGiftCard
|
||||
* required:
|
||||
* - customer_id
|
||||
* properties:
|
||||
* customer_id:
|
||||
* type: string
|
||||
* title: customer_id
|
||||
* description: The ID of the customer to transfer the gift card to.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* @schema StoreCreateGiftCardInvitation
|
||||
* type: object
|
||||
* description: The details to create a gift card invitation.
|
||||
* x-schemaName: StoreCreateGiftCardInvitation
|
||||
* required:
|
||||
* - email
|
||||
* properties:
|
||||
* email:
|
||||
* type: string
|
||||
* title: email
|
||||
* description: The email address to send the gift card invitation to.
|
||||
* format: email
|
||||
* expires_at:
|
||||
* type: string
|
||||
* title: expires_at
|
||||
* description: The date the gift card invitation expires.
|
||||
* format: date-time
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* required:
|
||||
* - customer
|
||||
* - line_item
|
||||
* - invitation
|
||||
* - id
|
||||
* - code
|
||||
* - status
|
||||
@@ -22,6 +21,12 @@
|
||||
* properties:
|
||||
* customer:
|
||||
* $ref: "#/components/schemas/StoreCustomer"
|
||||
* line_item:
|
||||
* $ref: "#/components/schemas/StoreOrderLineItem"
|
||||
* id:
|
||||
* type: string
|
||||
* title: id
|
||||
* description: The gift card's ID.
|
||||
* code:
|
||||
* type: string
|
||||
* title: code
|
||||
@@ -36,22 +41,32 @@
|
||||
* type: number
|
||||
* title: value
|
||||
* description: The gift card's amount.
|
||||
* currency_code:
|
||||
* type: string
|
||||
* title: currency_code
|
||||
* description: The gift card's currency code.
|
||||
* example: usd
|
||||
* customer_id:
|
||||
* type: string
|
||||
* title: customer_id
|
||||
* description: The ID of the customer that the gift card belongs to.
|
||||
* id:
|
||||
* type: string
|
||||
* title: id
|
||||
* description: The gift card's ID.
|
||||
* reference_id:
|
||||
* type: string
|
||||
* title: reference_id
|
||||
* description: The gift card's reference ID.
|
||||
* note:
|
||||
* type: string
|
||||
* title: note
|
||||
* description: A note with more information about the gift card.
|
||||
* reference:
|
||||
* type: string
|
||||
* title: reference
|
||||
* description: The gift card's reference.
|
||||
* expires_at:
|
||||
* type: string
|
||||
* title: expires_at
|
||||
* description: The date the gift card expires.
|
||||
* format: date-time
|
||||
* created_at:
|
||||
* type: string
|
||||
* format: date-time
|
||||
@@ -62,23 +77,6 @@
|
||||
* format: date-time
|
||||
* title: updated_at
|
||||
* description: The date the gift card was updated.
|
||||
* currency_code:
|
||||
* type: string
|
||||
* title: currency_code
|
||||
* description: The gift card's currency code.
|
||||
* example: usd
|
||||
* note:
|
||||
* type: string
|
||||
* title: note
|
||||
* description: The gift card's note.
|
||||
* expires_at:
|
||||
* type: string
|
||||
* title: expires_at
|
||||
* description: The date the gift card expires.
|
||||
* invitation:
|
||||
* $ref: "#/components/schemas/StoreGiftCardInvitation"
|
||||
* line_item:
|
||||
* $ref: "#/components/schemas/StoreOrderLineItem"
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* @schema StoreGiftCardInvitationResponse
|
||||
* type: object
|
||||
* description: The gift card invitation's details.
|
||||
* x-schemaName: StoreGiftCardInvitationResponse
|
||||
* required:
|
||||
* - gift_card_invitation
|
||||
* properties:
|
||||
* gift_card_invitation:
|
||||
* $ref: "#/components/schemas/StoreGiftCardInvitation"
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
* description: The list of store credit accounts.
|
||||
* items:
|
||||
* $ref: "#/components/schemas/StoreStoreCreditAccount"
|
||||
* estimate_count:
|
||||
* type: number
|
||||
* title: estimate_count
|
||||
* description: The store credit account's estimate count.
|
||||
* x-featureFlag: index_engine
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class OasKindGenerator extends FunctionKindGenerator {
|
||||
allowedAuthTypes: ["cookie_auth", "jwt_token"],
|
||||
},
|
||||
{
|
||||
startsWith: "store/gift-card",
|
||||
exact: "store/gift-cards/[idOrCode]/redeem",
|
||||
requiresAuthentication: true,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user