diff --git a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml index 8ff0403871..52b4a059dd 100644 --- a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml +++ b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml @@ -141,6 +141,14 @@ decorators: - Order AdminProductVariantInventoryItemLink: - AdminProductVariant + AdminGiftCardInvitation: + - AdminGiftCard + AdminTransactionGroup: + - AdminStoreCreditAccount + StoreGiftCard: + - StoreGiftCardInvitation + StoreTransactionGroup: + - StoreStoreCreditAccount theme: openapi: theme: diff --git a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx index 1106b05ae4..7715a766b0 100644 --- a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx +++ b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx @@ -8,7 +8,15 @@ import dynamic from "next/dynamic" import TagsOperationDescriptionSectionParameters from "./Parameters" import MDXContentClient from "@/components/MDXContent/Client" import { useArea } from "../../../../providers/area" -import { Feedback, Badge, Link, FeatureFlagNotice, H2, Tooltip } from "docs-ui" +import { + Feedback, + Badge, + Link, + FeatureFlagNotice, + H2, + Tooltip, + MarkdownContent, +} from "docs-ui" import { usePathname } from "next/navigation" import { TagsOperationDescriptionSectionWorkflowBadgeProps } from "./WorkflowBadge" import { TagsOperationDescriptionSectionEventsProps } from "./Events" @@ -79,6 +87,24 @@ const TagsOperationDescriptionSection = ({ )} + {operation["x-badges"]?.map((badge, index) => ( + + {badge.description} + + } + clickable={true} + > + + {badge.text} + + + ))}
diff --git a/www/apps/api-reference/generated/generated-admin-sidebar.mjs b/www/apps/api-reference/generated/generated-admin-sidebar.mjs index 3f67e18252..6b668773db 100644 --- a/www/apps/api-reference/generated/generated-admin-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-admin-sidebar.mjs @@ -270,6 +270,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Gift Cards", + "children": [ + { + "type": "link", + "path": "gift-cards_giftcard_schema", + "title": "GiftCard Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Inventory Items", @@ -709,6 +727,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Store Credit Accounts", + "children": [ + { + "type": "link", + "path": "store-credit-accounts_storecreditaccount_schema", + "title": "StoreCreditAccount Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Stores", @@ -781,6 +817,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Transaction Groups", + "children": [ + { + "type": "link", + "path": "transaction-groups_transactiongroup_schema", + "title": "TransactionGroup Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Uploads", diff --git a/www/apps/api-reference/generated/generated-store-sidebar.mjs b/www/apps/api-reference/generated/generated-store-sidebar.mjs index 361d9829a0..6252f3f9ea 100644 --- a/www/apps/api-reference/generated/generated-store-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-store-sidebar.mjs @@ -132,6 +132,42 @@ const generatedgeneratedStoreSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Gift Card Invitations", + "children": [ + { + "type": "link", + "path": "gift-card-invitations_giftcardinvitation_schema", + "title": "GiftCardInvitation Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, + { + "type": "category", + "title": "Gift Cards", + "children": [ + { + "type": "link", + "path": "gift-cards_giftcard_schema", + "title": "GiftCard Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Orders", @@ -278,12 +314,12 @@ const generatedgeneratedStoreSidebarSidebar = { }, { "type": "category", - "title": "Returns", + "title": "Return Reasons", "children": [ { "type": "link", - "path": "returns_return_schema", - "title": "Return Object", + "path": "return-reasons_returnreason_schema", + "title": "ReturnReason Object", "loaded": true, "badge": { "variant": "neutral", @@ -296,12 +332,12 @@ const generatedgeneratedStoreSidebarSidebar = { }, { "type": "category", - "title": "Return Reasons", + "title": "Returns", "children": [ { "type": "link", - "path": "return-reasons_returnreason_schema", - "title": "ReturnReason Object", + "path": "returns_return_schema", + "title": "Return Object", "loaded": true, "badge": { "variant": "neutral", @@ -329,6 +365,24 @@ const generatedgeneratedStoreSidebarSidebar = { ], "loaded": false, "showLoadingIfEmpty": true + }, + { + "type": "category", + "title": "Store Credit Accounts", + "children": [ + { + "type": "link", + "path": "store-credit-accounts_storecreditaccount_schema", + "title": "StoreCreditAccount Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true } ], "custom_autogenerate": "api-ref" diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/get.sh new file mode 100644 index 0000000000..ffea446cf2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/gift-cards' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/post.sh new file mode 100644 index 0000000000..cedd0e2fe1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards/post.sh @@ -0,0 +1,14 @@ +curl -X POST '{backend_url}/admin/gift-cards' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "code": "{value}", + "value": 19, + "currency_code": "bwp", + "expires_at": "2025-07-20T15:47:23.951Z", + "reference_id": "{value}", + "reference": "{value}", + "line_item_id": "{value}", + "customer_id": "{value}", + "metadata": {} +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/get.sh new file mode 100644 index 0000000000..be1e4aec27 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/gift-cards/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/post.sh new file mode 100644 index 0000000000..539126602e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/gift-cards/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_redeem/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_redeem/post.sh new file mode 100644 index 0000000000..c73cfdb6cf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_redeem/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/gift-cards/{id}/redeem' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "customer_id": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_transfer/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_transfer/post.sh new file mode 100644 index 0000000000..0a581c9a48 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_gift-cards_{id}_transfer/post.sh @@ -0,0 +1,6 @@ +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}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/get.sh new file mode 100644 index 0000000000..c38e0ca0e2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/store-credit-accounts' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/post.sh new file mode 100644 index 0000000000..7b050e779e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts/post.sh @@ -0,0 +1,7 @@ +curl -X POST '{backend_url}/admin/store-credit-accounts' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "currency_code": "nzd", + "customer_id": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}/get.sh new file mode 100644 index 0000000000..7f961af225 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/store-credit-accounts/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}_transactions/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}_transactions/get.sh new file mode 100644 index 0000000000..042efdc379 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_store-credit-accounts_{id}_transactions/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/store-credit-accounts/{id}/transactions' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_transaction-groups/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_transaction-groups/get.sh new file mode 100644 index 0000000000..299d8c39a7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_transaction-groups/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/transaction-groups' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateGiftCardParams.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateGiftCardParams.yaml new file mode 100644 index 0000000000..98f5b3fc78 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateGiftCardParams.yaml @@ -0,0 +1,51 @@ +type: object +description: The details of the gift card to create. +x-schemaName: AdminCreateGiftCardParams +required: + - code + - value + - currency_code + - expires_at + - reference_id + - reference + - line_item_id + - customer_id + - metadata +properties: + code: + type: string + title: code + description: The gift card's code. + value: + type: number + title: value + description: The gift card's amount. + example: 20 + currency_code: + type: string + title: currency_code + description: The gift card's currency code. + example: usd + expires_at: + type: string + title: expires_at + description: The date the gift card expires at. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + reference: + type: string + title: reference + description: The gift card's reference. + line_item_id: + type: string + title: line_item_id + description: The ID of the line item associated with the gift card. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the gift card. + metadata: + type: object + description: The gift card's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStoreCreditAccount.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStoreCreditAccount.yaml new file mode 100644 index 0000000000..56c12f0536 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStoreCreditAccount.yaml @@ -0,0 +1,19 @@ +type: object +description: The details of the store credit account to create. +x-schemaName: AdminCreateStoreCreditAccount +required: + - currency_code + - customer_id +properties: + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCard.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCard.yaml new file mode 100644 index 0000000000..8841c09e93 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCard.yaml @@ -0,0 +1,79 @@ +type: object +description: The gift card's details. +x-schemaName: AdminGiftCard +required: + - line_item + - customer + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at +properties: + line_item: + $ref: ./AdminOrderLineItem.yaml + customer: + $ref: ./AdminCustomer.yaml + id: + type: string + title: id + description: The gift card's ID. + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + 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 associated with the gift card. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + note: + type: string + title: note + description: The gift card's note. + 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 at. + invitation: + $ref: ./AdminGiftCardInvitation.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the gift card was updated at. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardInvitation.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardInvitation.yaml new file mode 100644 index 0000000000..221cdc59ad --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardInvitation.yaml @@ -0,0 +1,37 @@ +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: + type: object +x-schemaName: AdminGiftCardInvitation diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardResponse.yaml new file mode 100644 index 0000000000..1ae5cd8172 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card's details. +x-schemaName: AdminGiftCardResponse +required: + - gift_card +properties: + gift_card: + $ref: ./AdminGiftCard.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardsResponse.yaml new file mode 100644 index 0000000000..eda7affe60 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminGiftCardsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of gift cards. +x-schemaName: AdminGiftCardsResponse +required: + - limit + - offset + - count + - gift_cards +properties: + limit: + type: number + title: limit + description: The maximum number of gift cards to return. + offset: + type: number + title: offset + description: The number of gift cards to skip before retrieving the results. + count: + type: number + title: count + description: The total number of gift cards available. + gift_cards: + type: array + description: The list of gift cards. + items: + $ref: ./AdminGiftCard.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminRedeemGiftCard.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminRedeemGiftCard.yaml new file mode 100644 index 0000000000..09dd9d4c41 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminRedeemGiftCard.yaml @@ -0,0 +1,12 @@ +type: object +description: The details of the gift card to redeem. +x-schemaName: AdminRedeemGiftCard +required: + - customer_id +properties: + customer_id: + type: string + title: customer_id + description: >- + The ID of the customer that the gift card belongs to. The gift card's + value will be added to the customer's store credit account. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccount.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccount.yaml new file mode 100644 index 0000000000..0e54b944b4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccount.yaml @@ -0,0 +1,61 @@ +type: object +description: The store credit account's details. +x-schemaName: AdminStoreCreditAccount +required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at +properties: + customer: + $ref: ./AdminCustomer.yaml + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: ./AdminTransactionGroup.yaml + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated at. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountResponse.yaml new file mode 100644 index 0000000000..2c5e7b1f03 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The store credit account's details. +x-schemaName: AdminStoreCreditAccountResponse +required: + - store_credit_account +properties: + store_credit_account: + $ref: ./AdminStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountsResponse.yaml new file mode 100644 index 0000000000..7f93a469e6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreCreditAccountsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of store credit accounts. +x-schemaName: AdminStoreCreditAccountsResponse +required: + - limit + - offset + - count + - store_credit_accounts +properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: ./AdminStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransaction.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransaction.yaml new file mode 100644 index 0000000000..0a488a5fd2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransaction.yaml @@ -0,0 +1,63 @@ +type: object +description: The transaction's details. +x-schemaName: AdminTransaction +required: + - account + - id + - account_id + - transaction_group_id + - type + - amount + - metadata + - created_at + - updated_at +properties: + id: + type: string + title: id + description: The transaction's ID. + account_id: + type: string + title: account_id + description: The ID of the store credit account that the transaction belongs to. + transaction_group_id: + type: string + title: transaction_group_id + description: The ID of the transaction group that the transaction belongs to. + type: + type: string + description: The transaction's type. + enum: + - credit + - debit + amount: + type: number + title: amount + description: The transaction's amount. + account: + $ref: ./AdminStoreCreditAccount.yaml + note: + type: string + title: note + description: The transaction's note. + reference: + type: string + title: reference + description: The transaction's reference. + reference_id: + type: string + title: reference_id + description: The transaction's reference ID. + metadata: + type: object + description: The transaction's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the transaction was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the transaction was updated at. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroup.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroup.yaml new file mode 100644 index 0000000000..bf509bb167 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroup.yaml @@ -0,0 +1,37 @@ +type: object +description: The transaction group's details. +x-schemaName: AdminTransactionGroup +required: + - account + - id + - code + - credits + - debits + - balance + - metadata +properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroupsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroupsResponse.yaml new file mode 100644 index 0000000000..b97a557331 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionGroupsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of transaction groups. +x-schemaName: AdminTransactionGroupsResponse +required: + - limit + - offset + - count + - transaction_groups +properties: + limit: + type: number + title: limit + description: The maximum number of transaction groups to return. + offset: + type: number + title: offset + description: The number of transaction groups to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transaction groups available. + transaction_groups: + type: array + description: The list of transaction groups. + items: + $ref: ./AdminTransactionGroup.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionsResponse.yaml new file mode 100644 index 0000000000..0d55e47604 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransactionsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of transactions. +x-schemaName: AdminTransactionsResponse +required: + - limit + - offset + - count + - transactions +properties: + limit: + type: number + title: limit + description: The maximum number of transactions to return. + offset: + type: number + title: offset + description: The number of transactions to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transactions available. + transactions: + type: array + description: The list of transactions. + items: + $ref: ./AdminTransaction.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransferGiftCard.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransferGiftCard.yaml new file mode 100644 index 0000000000..9a445317ce --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransferGiftCard.yaml @@ -0,0 +1,10 @@ +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. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateGiftCardParams.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateGiftCardParams.yaml new file mode 100644 index 0000000000..f53e7e9728 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateGiftCardParams.yaml @@ -0,0 +1,34 @@ +type: object +description: The details to update in the gift card. +x-schemaName: AdminUpdateGiftCardParams +properties: + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. + 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 at. + metadata: + type: object + description: The gift card's metadata. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreAddGiftCardToCart.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreAddGiftCardToCart.yaml new file mode 100644 index 0000000000..75b7389dbb --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreAddGiftCardToCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to add a gift card to the cart. +x-schemaName: StoreAddGiftCardToCart +required: + - code +properties: + code: + type: string + title: code + description: The gift card's code. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreAddStoreCreditsToCart.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreAddStoreCreditsToCart.yaml new file mode 100644 index 0000000000..21af98b5c3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreAddStoreCreditsToCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to add store credits to the cart. +x-schemaName: StoreAddStoreCreditsToCart +required: + - amount +properties: + amount: + type: number + title: amount + description: The amount of store credits to add to the cart. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCreateGiftCardInvitation.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCreateGiftCardInvitation.yaml new file mode 100644 index 0000000000..f953a5e531 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCreateGiftCardInvitation.yaml @@ -0,0 +1,16 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCard.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCard.yaml new file mode 100644 index 0000000000..7235e9ee70 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCard.yaml @@ -0,0 +1,79 @@ +type: object +description: The gift card's details. +x-schemaName: StoreGiftCard +required: + - customer + - line_item + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at +properties: + customer: + $ref: ./StoreCustomer.yaml + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + 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. + reference: + type: string + title: reference + description: The gift card's reference. + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created. + updated_at: + type: string + 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: + type: object + line_item: + $ref: ./StoreOrderLineItem.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitation.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitation.yaml new file mode 100644 index 0000000000..8ad2557f70 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitation.yaml @@ -0,0 +1,24 @@ +type: object +description: The gift card invitation's details. +x-schemaName: StoreGiftCardInvitation +required: + - id + - email + - status + - gift_card +properties: + id: + type: string + title: id + description: The gift card invitation's ID. + email: + type: string + title: email + description: The gift card invitation's email. + format: email + status: + type: string + title: status + description: The gift card invitation's status. + gift_card: + $ref: ./StoreGiftCard.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitationResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitationResponse.yaml new file mode 100644 index 0000000000..178bc96d8d --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardInvitationResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card invitation's details. +x-schemaName: StoreGiftCardInvitationResponse +required: + - gift_card_invitation +properties: + gift_card_invitation: + $ref: ./StoreGiftCardInvitation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardResponse.yaml new file mode 100644 index 0000000000..a8c3a1936f --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreGiftCardResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card's details. +x-schemaName: StoreGiftCardResponse +required: + - gift_card +properties: + gift_card: + $ref: ./StoreGiftCard.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreRemoveGiftCardFromCart.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreRemoveGiftCardFromCart.yaml new file mode 100644 index 0000000000..748bc5fd7e --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreRemoveGiftCardFromCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to remove a gift card from the cart. +x-schemaName: StoreRemoveGiftCardFromCart +required: + - code +properties: + code: + type: string + title: code + description: The gift card code to remove from the cart. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccount.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccount.yaml new file mode 100644 index 0000000000..26cf2ddc5b --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccount.yaml @@ -0,0 +1,61 @@ +type: object +description: The store credit account's details. +x-schemaName: StoreStoreCreditAccount +required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at +properties: + customer: + $ref: ./StoreCustomer.yaml + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The store credit account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: ./StoreTransactionGroup.yaml + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountResponse.yaml new file mode 100644 index 0000000000..bf39e4f214 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The store credit account's details. +x-schemaName: StoreStoreCreditAccountResponse +required: + - store_credit_account +properties: + store_credit_account: + $ref: ./StoreStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountsResponse.yaml new file mode 100644 index 0000000000..3ba7a0059e --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreStoreCreditAccountsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of store credit accounts. +x-schemaName: StoreStoreCreditAccountsResponse +required: + - limit + - offset + - count + - store_credit_accounts +properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: ./StoreStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreTransactionGroup.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreTransactionGroup.yaml new file mode 100644 index 0000000000..0a7fe807c1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreTransactionGroup.yaml @@ -0,0 +1,37 @@ +type: object +description: The transaction group's details. +required: + - account + - id + - code + - credits + - debits + - balance + - metadata +properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. +x-schemaName: StoreTransactionGroup diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index b3be9d4051..eec376a010 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -135,6 +135,16 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: '#/components/schemas/AdminFulfillment' + - name: Gift Cards + description: | + A gift card is a prepaid card that can be used to pay for items during checkout. + Gift cards can be purchased by customers, or created by admin users. When a gift card is redeemed, its amount is added to the customer's store credit account, which can then be used to pay for items during checkout. + These API routes allow admin users to manage gift cards, transfer gift cards between customers, and more. + + Gift Card routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + x-associatedSchema: + $ref: '#/components/schemas/AdminGiftCard' - name: Inventory Items description: | An inventory item is a stock-kept product whose inventory is managed. @@ -418,6 +428,16 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: '#/components/schemas/AdminStockLocation' + - name: Store Credit Accounts + description: | + A store credit account is a ledger of store credit transactions for a customer. They hold the customer's store credit balance, including their credit and debit amounts. + Store credit accounts allow you to build features that let customers pay for items using their store credit balance, such as gift cards or loyalty points. + These API routes allow admin users to manage store credit accounts, their transactions, and more. + + Store Credit Account routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + x-associatedSchema: + $ref: '#/components/schemas/AdminStoreCreditAccount' - name: Stores description: | A store holds the main configuration and information of your commerce store, such as supported currencies or default sales channel. @@ -463,6 +483,15 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: '#/components/schemas/AdminTaxRegion' + - name: Transaction Groups + description: | + A transaction group is a group of transactions that belong to a store credit account. It allows you to group transactions together, such as all transactions related to a specific gift card. + These API routes allow admin users to list transaction groups. + + Transaction Group routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + x-associatedSchema: + $ref: '#/components/schemas/AdminTransactionGroup' - name: Uploads description: | Use these API routes to upload files to your Medusa application using the installed file module provider. @@ -19437,6 +19466,717 @@ paths: $ref: '#/components/responses/500_error' x-workflow: createShipmentWorkflow x-events: [] + /admin/gift-cards: + get: + operationId: GetGiftCards + summary: List Gift Cards + description: Retrieve a list of 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: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: The gift card's ID. + - type: array + description: The gift card's ID. + items: + type: string + title: id + description: The id's ID. + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their gift cards. + - type: array + description: Filter by customer IDs to retrieve their gift cards. + items: + type: string + title: customer_id + description: A customer ID. + - name: created_at + in: query + description: Filter by a gift card's creation date. + required: false + schema: + type: object + description: Filter by a gift card's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a gift card's update date. + required: false + schema: + type: object + description: Filter by a gift card's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/gift-cards' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + post: + operationId: PostGiftCards + summary: Create Gift Card + description: Create a gift card. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateGiftCardParams' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/gift-cards' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "code": "{value}", + "value": 19, + "currency_code": "bwp", + "expires_at": "2025-07-20T15:47:23.951Z", + "reference_id": "{value}", + "reference": "{value}", + "line_item_id": "{value}", + "customer_id": "{value}", + "metadata": {} + }' + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/gift-cards/{id}: + get: + operationId: GetGiftCardsId + summary: Get a Gift Card + description: Retrieve a gift card by its ID. You can expand the gift card's relations or select the fields that should be returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/gift-cards/{id}' \ + -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': + $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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + post: + operationId: PostGiftCardsId + summary: Update a Gift Card + description: Update a gift card's details. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateGiftCardParams' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/gift-cards/{id}' \ + -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': + $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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/gift-cards/{id}/redeem: + post: + operationId: PostGiftCardsIdRedeem + summary: Redeem a Gift Card + description: Redeem a gift card and add it to the customer's store credit account. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRedeemGiftCard' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/gift-cards/{id}/redeem' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "customer_id": "{value}" + }' + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/gift-cards/{id}/transfer: + post: + operationId: PostGiftCardsIdTransfer + summary: Transfer Gift Card + description: Transfer a gift card to another customer. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - 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}" + }' + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). /admin/inventory-items: get: operationId: GetInventoryItems @@ -46599,6 +47339,1278 @@ paths: $ref: '#/components/responses/500_error' x-workflow: linkSalesChannelsToStockLocationWorkflow x-events: [] + /admin/store-credit-accounts: + get: + operationId: GetStoreCreditAccounts + summary: List Store Credit Accounts + description: Retrieve a list of store credit accounts. The store credit accounts can be filtered by fields such as `id`. The store credit accounts can also be sorted or paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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. + The fields and relations to retrieve separated by commas. + + Learn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + 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: id + in: query + description: Filter by the store credit account's ID. + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a store credit account ID. + - type: array + description: Filter by store credit account IDs. + items: + type: string + title: id + description: A store credit account ID. + - name: customer_id + in: query + description: Filter by customer ID(s) to retrieve their store credit accounts. + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their store credit accounts. + - type: array + description: Filter by customer ID(s) to retrieve their store credit accounts. + items: + type: string + title: customer_id + description: A customer ID. + - name: transaction_group_id + in: query + description: Filter by the associated transaction group's ID. + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by the associated transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: currency_code + in: query + description: Filter by currency code(s) to retrieve store credit accounts in specific currencies. + required: false + schema: + oneOf: + - type: string + title: currency_code + description: Filter by a currency code to retrieve store credit accounts in that currency. + example: usd + - type: array + description: Filter by currency codes to retrieve store credit accounts in specific currencies. + items: + type: string + title: currency_code + description: Filter by a currency code to retrieve store credit accounts in that currency. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: An array of filters to apply on the entity, where each item in the array is joined with an "and" condition. + 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: An array of filters to apply on the entity, where each item in the array is joined with an "or" condition. + 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: 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/store-credit-accounts' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoreCreditAccountsResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + post: + operationId: PostStoreCreditAccounts + summary: Create Store Credit Account + description: Create a store credit account. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateStoreCreditAccount' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/store-credit-accounts' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "currency_code": "nzd", + "customer_id": "{value}" + }' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoreCreditAccountResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/store-credit-accounts/{id}: + get: + operationId: GetStoreCreditAccountsId + summary: Get a Store Credit Account + description: Retrieve a store credit account by its ID. You can expand the store credit account's relations or select the fields that should be returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account's ID. + required: true + schema: + type: string + - 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. + The fields and relations to retrieve separated by commas. + + Learn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + 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: id + in: query + description: Filter by the store credit account's ID. + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a store credit account ID. + - type: array + description: Filter by store credit account IDs. + items: + type: string + title: id + description: A store credit account ID. + - name: customer_id + in: query + description: Filter by customer ID(s) to retrieve their store credit accounts. + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their store credit accounts. + - type: array + description: Filter by customer ID(s) to retrieve their store credit accounts. + items: + type: string + title: customer_id + description: A customer ID. + - name: transaction_group_id + in: query + description: Filter by the associated transaction group's ID. + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by the associated transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: currency_code + in: query + description: Filter by currency code(s) to retrieve store credit accounts in specific currencies. + required: false + schema: + oneOf: + - type: string + title: currency_code + description: Filter by a currency code to retrieve store credit accounts in that currency. + example: usd + - type: array + description: Filter by currency codes to retrieve store credit accounts in specific currencies. + items: + type: string + title: currency_code + description: Filter by a currency code to retrieve store credit accounts in that currency. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: An array of filters to apply on the entity, where each item in the array is joined with an "and" condition. + 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: An array of filters to apply on the entity, where each item in the array is joined with an "or" condition. + 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: 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/store-credit-accounts/{id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoreCreditAccountResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/store-credit-accounts/{id}/transactions: + get: + operationId: GetStoreCreditAccountsIdTransactions + summary: List Transactions + description: Retrieve a list of transactions in a store credit account. The transactions can be filtered by fields like FILTER FIELDS. The transactions can also be paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account's ID. + required: true + schema: + type: string + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a transaction ID. + - type: array + description: Filter by transaction IDs. + items: + type: string + title: id + description: A transaction ID. + - name: transaction_group_id + in: query + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by a transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: created_at + in: query + description: Filter by a transaction's creation date. + required: false + schema: + type: object + description: Filter by a transaction's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a transaction's update date. + required: false + schema: + type: object + description: Filter by a transaction's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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: q + in: query + description: Search query to filter the transactions by their searchable fields. + required: false + schema: + type: string + title: q + description: Search query to filter the transactions by their searchable fields. + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/store-credit-accounts/{id}/transactions' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTransactionsResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). /admin/stores: get: operationId: GetStores @@ -49529,6 +51541,375 @@ paths: $ref: '#/components/responses/500_error' x-workflow: deleteTaxRegionsWorkflow x-events: [] + /admin/transaction-groups: + get: + operationId: GetTransactionGroups + summary: List Transaction Groups + description: Retrieve a list of transaction groups. The transaction groups can be filtered by fields such as `id`. The transaction groups can also be sorted or paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by the transaction group's ID. + - type: array + description: Filter by the transaction group IDs. + items: + type: string + title: id + description: A transaction group's ID. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter by the transaction group's code. + - type: array + description: Filter by the transaction group codes. + items: + type: string + title: code + description: A transaction group's code. + - name: created_at + in: query + description: Filter by a transaction group's creation date. + required: false + schema: + type: object + description: Filter by a transaction group's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a transaction group's update date. + required: false + schema: + type: object + description: Filter by a transaction group's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/transaction-groups' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Transaction Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTransactionGroupsResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). /admin/uploads: post: operationId: PostUploads @@ -53220,6 +55601,58 @@ components: metadata: type: object description: The fulfillment's metadata, used to store custom key-value pairs. + AdminCreateGiftCardParams: + type: object + description: The details of the gift card to create. + x-schemaName: AdminCreateGiftCardParams + required: + - code + - value + - currency_code + - expires_at + - reference_id + - reference + - line_item_id + - customer_id + - metadata + properties: + code: + type: string + title: code + description: The gift card's code. + value: + type: number + title: value + description: The gift card's amount. + example: 20 + currency_code: + type: string + title: currency_code + description: The gift card's currency code. + example: usd + expires_at: + type: string + title: expires_at + description: The date the gift card expires at. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + reference: + type: string + title: reference + description: The gift card's reference. + line_item_id: + type: string + title: line_item_id + description: The ID of the line item associated with the gift card. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the gift card. + metadata: + type: object + description: The gift card's metadata, can hold custom key-value pairs. AdminCreateInventoryItem: type: object description: The inventory item's details. @@ -54182,6 +56615,26 @@ components: metadata: type: object description: The stock location's metadata, used to store custom key-value pairs. + AdminCreateStoreCreditAccount: + type: object + description: The details of the store credit account to create. + x-schemaName: AdminCreateStoreCreditAccount + required: + - currency_code + - customer_id + properties: + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. AdminCreateTaxRate: type: object description: The tax rate's details. @@ -56985,6 +59438,160 @@ components: format: date-time title: deleted_at description: The geo zone's deleted at. + AdminGiftCard: + type: object + description: The gift card's details. + x-schemaName: AdminGiftCard + required: + - line_item + - customer + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at + properties: + line_item: + $ref: '#/components/schemas/AdminOrderLineItem' + customer: + $ref: '#/components/schemas/AdminCustomer' + id: + type: string + title: id + description: The gift card's ID. + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + 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 associated with the gift card. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + note: + type: string + title: note + description: The gift card's note. + 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 at. + invitation: + $ref: '#/components/schemas/AdminGiftCardInvitation' + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the gift card was updated at. + 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: + type: object + x-schemaName: AdminGiftCardInvitation + AdminGiftCardResponse: + type: object + description: The gift card's details. + x-schemaName: AdminGiftCardResponse + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/AdminGiftCard' + AdminGiftCardsResponse: + type: object + description: The paginated list of gift cards. + x-schemaName: AdminGiftCardsResponse + required: + - limit + - offset + - count + - gift_cards + properties: + limit: + type: number + title: limit + description: The maximum number of gift cards to return. + offset: + type: number + title: offset + description: The number of gift cards to skip before retrieving the results. + count: + type: number + title: count + description: The total number of gift cards available. + gift_cards: + type: array + description: The list of gift cards. + items: + $ref: '#/components/schemas/AdminGiftCard' AdminImportProductRequest: type: object description: The import's details. @@ -61669,6 +64276,17 @@ components: - cusgroup_123 items: $ref: '#/components/schemas/BasePromotionRuleValue' + AdminRedeemGiftCard: + type: object + description: The details of the gift card to redeem. + x-schemaName: AdminRedeemGiftCard + required: + - customer_id + properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. The gift card's value will be added to the customer's store credit account. AdminRefund: type: object description: The refund's details. @@ -63053,6 +65671,104 @@ components: format: date-time title: updated_at description: The date the store was updated. + AdminStoreCreditAccount: + type: object + description: The store credit account's details. + x-schemaName: AdminStoreCreditAccount + required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/AdminCustomer' + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: '#/components/schemas/AdminTransactionGroup' + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated at. + AdminStoreCreditAccountResponse: + type: object + description: The store credit account's details. + x-schemaName: AdminStoreCreditAccountResponse + required: + - store_credit_account + properties: + store_credit_account: + $ref: '#/components/schemas/AdminStoreCreditAccount' + AdminStoreCreditAccountsResponse: + type: object + description: The paginated list of store credit accounts. + x-schemaName: AdminStoreCreditAccountsResponse + required: + - limit + - offset + - count + - store_credit_accounts + properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: '#/components/schemas/AdminStoreCreditAccount' AdminStoreCurrency: type: object description: The details of a store's currency. @@ -63392,6 +66108,173 @@ components: properties: tax_region: $ref: '#/components/schemas/AdminTaxRegion' + AdminTransaction: + type: object + description: The transaction's details. + x-schemaName: AdminTransaction + required: + - account + - id + - account_id + - transaction_group_id + - type + - amount + - metadata + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The transaction's ID. + account_id: + type: string + title: account_id + description: The ID of the store credit account that the transaction belongs to. + transaction_group_id: + type: string + title: transaction_group_id + description: The ID of the transaction group that the transaction belongs to. + type: + type: string + description: The transaction's type. + enum: + - credit + - debit + amount: + type: number + title: amount + description: The transaction's amount. + account: + $ref: '#/components/schemas/AdminStoreCreditAccount' + note: + type: string + title: note + description: The transaction's note. + reference: + type: string + title: reference + description: The transaction's reference. + reference_id: + type: string + title: reference_id + description: The transaction's reference ID. + metadata: + type: object + description: The transaction's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the transaction was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the transaction was updated at. + AdminTransactionGroup: + type: object + description: The transaction group's details. + x-schemaName: AdminTransactionGroup + required: + - account + - id + - code + - credits + - debits + - balance + - metadata + properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. + AdminTransactionGroupsResponse: + type: object + description: The paginated list of transaction groups. + x-schemaName: AdminTransactionGroupsResponse + required: + - limit + - offset + - count + - transaction_groups + properties: + limit: + type: number + title: limit + description: The maximum number of transaction groups to return. + offset: + type: number + title: offset + description: The number of transaction groups to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transaction groups available. + transaction_groups: + type: array + description: The list of transaction groups. + items: + $ref: '#/components/schemas/AdminTransactionGroup' + AdminTransactionsResponse: + type: object + description: The paginated list of transactions. + x-schemaName: AdminTransactionsResponse + required: + - limit + - offset + - count + - transactions + properties: + limit: + type: number + title: limit + description: The maximum number of transactions to return. + offset: + type: number + title: offset + description: The number of transactions to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transactions available. + transactions: + type: array + description: The list of transactions. + items: + $ref: '#/components/schemas/AdminTransaction' + 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. AdminTransferOrder: type: object description: The details of the request to transfer the order. @@ -63625,6 +66508,41 @@ components: type: string title: internal_note description: A note viewed only by admin users about the shipping method. + AdminUpdateGiftCardParams: + type: object + description: The details to update in the gift card. + x-schemaName: AdminUpdateGiftCardParams + properties: + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. + 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 at. + metadata: + type: object + description: The gift card's metadata. AdminUpdateOrder: type: object description: The details to update in the order. @@ -70418,6 +73336,28 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + StoreAddGiftCardToCart: + type: object + description: The details to add a gift card to the cart. + x-schemaName: StoreAddGiftCardToCart + required: + - code + properties: + code: + type: string + title: code + description: The gift card's code. + StoreAddStoreCreditsToCart: + type: object + description: The details to add store credits to the cart. + x-schemaName: StoreAddStoreCreditsToCart + required: + - amount + properties: + amount: + type: number + title: amount + description: The amount of store credits to add to the cart. StoreCalculatedPrice: type: object description: The shipping option's calculated price. @@ -71690,6 +74630,23 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 StoreCreatePaymentCollection: type: object description: The details of the payment collection to create. @@ -72101,6 +75058,129 @@ components: type: string title: token description: The order transfer's token issued when the transfer was requested. + StoreGiftCard: + type: object + description: The gift card's details. + x-schemaName: StoreGiftCard + required: + - customer + - line_item + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/StoreCustomer' + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + 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. + reference: + type: string + title: reference + description: The gift card's reference. + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created. + updated_at: + type: string + 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: + type: object + line_item: + $ref: '#/components/schemas/StoreOrderLineItem' + StoreGiftCardInvitation: + type: object + description: The gift card invitation's details. + x-schemaName: StoreGiftCardInvitation + required: + - id + - email + - status + - gift_card + properties: + id: + type: string + title: id + description: The gift card invitation's ID. + email: + type: string + title: email + description: The gift card invitation's email. + format: email + status: + type: string + title: status + description: The gift card invitation's status. + gift_card: + $ref: '#/components/schemas/StoreGiftCard' + 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' + StoreGiftCardResponse: + type: object + description: The gift card's details. + x-schemaName: StoreGiftCardResponse + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/StoreGiftCard' StoreInitializePaymentSession: type: object description: The payment session's details. @@ -79252,6 +82332,17 @@ components: type: string title: display_name description: The country's display name. + StoreRemoveGiftCardFromCart: + type: object + description: The details to remove a gift card from the cart. + x-schemaName: StoreRemoveGiftCardFromCart + required: + - code + properties: + code: + type: string + title: code + description: The gift card code to remove from the cart. StoreRequestOrderTransfer: type: object description: The details of requesting the order transfer. @@ -79573,6 +82664,142 @@ components: format: date-time title: deleted_at description: The date the type was deleted. + StoreStoreCreditAccount: + type: object + description: The store credit account's details. + x-schemaName: StoreStoreCreditAccount + required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/StoreCustomer' + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The store credit account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: '#/components/schemas/StoreTransactionGroup' + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated. + StoreStoreCreditAccountResponse: + type: object + description: The store credit account's details. + x-schemaName: StoreStoreCreditAccountResponse + required: + - store_credit_account + properties: + store_credit_account: + $ref: '#/components/schemas/StoreStoreCreditAccount' + StoreStoreCreditAccountsResponse: + type: object + description: The paginated list of store credit accounts. + x-schemaName: StoreStoreCreditAccountsResponse + required: + - limit + - offset + - count + - store_credit_accounts + properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: '#/components/schemas/StoreStoreCreditAccount' + StoreTransactionGroup: + type: object + description: The transaction group's details. + required: + - account + - id + - code + - credits + - debits + - balance + - metadata + properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. + x-schemaName: StoreTransactionGroup StoreUpdateCartLineItem: type: object description: The details to update in the line item. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 0d17a4191e..919ab32008 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -175,6 +175,26 @@ tags: https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: ./components/schemas/AdminFulfillment.yaml + - name: Gift Cards + description: > + A gift card is a prepaid card that can be used to pay for items during + checkout. + + Gift cards can be purchased by customers, or created by admin users. When + a gift card is redeemed, its amount is added to the customer's store + credit account, which can then be used to pay for items during checkout. + + These API routes allow admin users to manage gift cards, transfer gift + cards between customers, and more. + + + + Gift Card routes are only available for Cloud users using the [Loyalty + Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: ./components/schemas/AdminGiftCard.yaml - name: Inventory Items description: | An inventory item is a stock-kept product whose inventory is managed. @@ -551,6 +571,27 @@ tags: https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: ./components/schemas/AdminStockLocation.yaml + - name: Store Credit Accounts + description: > + A store credit account is a ledger of store credit transactions for a + customer. They hold the customer's store credit balance, including their + credit and debit amounts. + + Store credit accounts allow you to build features that let customers pay + for items using their store credit balance, such as gift cards or loyalty + points. + + These API routes allow admin users to manage store credit accounts, their + transactions, and more. + + + + Store Credit Account routes are only available for Cloud users using the + [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: ./components/schemas/AdminStoreCreditAccount.yaml - name: Stores description: > A store holds the main configuration and information of your commerce @@ -612,6 +653,22 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: ./components/schemas/AdminTaxRegion.yaml + - name: Transaction Groups + description: > + A transaction group is a group of transactions that belong to a store + credit account. It allows you to group transactions together, such as all + transactions related to a specific gift card. + + These API routes allow admin users to list transaction groups. + + + + Transaction Group routes are only available for Cloud users using the + [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: ./components/schemas/AdminTransactionGroup.yaml - name: Uploads description: > Use these API routes to upload files to your Medusa application using the @@ -787,6 +844,14 @@ paths: $ref: paths/admin_fulfillments_{id}_cancel.yaml /admin/fulfillments/{id}/shipment: $ref: paths/admin_fulfillments_{id}_shipment.yaml + /admin/gift-cards: + $ref: paths/admin_gift-cards.yaml + /admin/gift-cards/{id}: + $ref: paths/admin_gift-cards_{id}.yaml + /admin/gift-cards/{id}/redeem: + $ref: paths/admin_gift-cards_{id}_redeem.yaml + /admin/gift-cards/{id}/transfer: + $ref: paths/admin_gift-cards_{id}_transfer.yaml /admin/inventory-items: $ref: paths/admin_inventory-items.yaml /admin/inventory-items/location-levels/batch: @@ -1022,6 +1087,12 @@ paths: $ref: paths/admin_stock-locations_{id}_fulfillment-sets.yaml /admin/stock-locations/{id}/sales-channels: $ref: paths/admin_stock-locations_{id}_sales-channels.yaml + /admin/store-credit-accounts: + $ref: paths/admin_store-credit-accounts.yaml + /admin/store-credit-accounts/{id}: + $ref: paths/admin_store-credit-accounts_{id}.yaml + /admin/store-credit-accounts/{id}/transactions: + $ref: paths/admin_store-credit-accounts_{id}_transactions.yaml /admin/stores: $ref: paths/admin_stores.yaml /admin/stores/{id}: @@ -1040,6 +1111,8 @@ paths: $ref: paths/admin_tax-regions.yaml /admin/tax-regions/{id}: $ref: paths/admin_tax-regions_{id}.yaml + /admin/transaction-groups: + $ref: paths/admin_transaction-groups.yaml /admin/uploads: $ref: paths/admin_uploads.yaml /admin/uploads/{id}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_gift-cards.yaml b/www/apps/api-reference/specs/admin/paths/admin_gift-cards.yaml new file mode 100644 index 0000000000..9aed58c53c --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_gift-cards.yaml @@ -0,0 +1,498 @@ +get: + operationId: GetGiftCards + summary: List Gift Cards + description: >- + Retrieve a list of 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: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: The gift card's ID. + - type: array + description: The gift card's ID. + items: + type: string + title: id + description: The id's ID. + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their gift cards. + - type: array + description: Filter by customer IDs to retrieve their gift cards. + items: + type: string + title: customer_id + description: A customer ID. + - name: created_at + in: query + description: Filter by a gift card's creation date. + required: false + schema: + type: object + description: Filter by a gift card's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a gift card's update date. + required: false + schema: + type: object + description: Filter by a gift card's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards/get.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +post: + operationId: PostGiftCards + summary: Create Gift Card + description: Create a gift card. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminCreateGiftCardParams.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}.yaml new file mode 100644 index 0000000000..cc8a1dde2d --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}.yaml @@ -0,0 +1,143 @@ +get: + operationId: GetGiftCardsId + summary: Get a Gift Card + description: >- + Retrieve a gift card by its ID. You can expand the gift card's relations or + select the fields that should be returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards_{id}/get.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +post: + operationId: PostGiftCardsId + summary: Update a Gift Card + description: Update a gift card's details. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateGiftCardParams.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards_{id}/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_redeem.yaml b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_redeem.yaml new file mode 100644 index 0000000000..eba1e3ca51 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_redeem.yaml @@ -0,0 +1,73 @@ +post: + operationId: PostGiftCardsIdRedeem + summary: Redeem a Gift Card + description: Redeem a gift card and add it to the customer's store credit account. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminRedeemGiftCard.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards_{id}_redeem/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_transfer.yaml b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_transfer.yaml new file mode 100644 index 0000000000..4febb955d4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_gift-cards_{id}_transfer.yaml @@ -0,0 +1,73 @@ +post: + operationId: PostGiftCardsIdTransfer + summary: Transfer Gift Card + description: Transfer a gift card to another customer. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The gift card's ID. + required: true + schema: + type: string + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminTransferGiftCard.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards_{id}_transfer/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts.yaml b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts.yaml new file mode 100644 index 0000000000..3a236ae950 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts.yaml @@ -0,0 +1,549 @@ +get: + operationId: GetStoreCreditAccounts + summary: List Store Credit Accounts + description: >- + Retrieve a list of store credit accounts. The store credit accounts can be + filtered by fields such as `id`. The store credit accounts can also be + sorted or paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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. + + The fields and relations to retrieve separated by commas. + + + Learn more in the [API + reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + 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: id + in: query + description: Filter by the store credit account's ID. + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a store credit account ID. + - type: array + description: Filter by store credit account IDs. + items: + type: string + title: id + description: A store credit account ID. + - name: customer_id + in: query + description: Filter by customer ID(s) to retrieve their store credit accounts. + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their store credit accounts. + - type: array + description: Filter by customer ID(s) to retrieve their store credit accounts. + items: + type: string + title: customer_id + description: A customer ID. + - name: transaction_group_id + in: query + description: Filter by the associated transaction group's ID. + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by the associated transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: currency_code + in: query + description: >- + Filter by currency code(s) to retrieve store credit accounts in specific + currencies. + required: false + schema: + oneOf: + - type: string + title: currency_code + description: >- + Filter by a currency code to retrieve store credit accounts in + that currency. + example: usd + - type: array + description: >- + Filter by currency codes to retrieve store credit accounts in + specific currencies. + items: + type: string + title: currency_code + description: >- + Filter by a currency code to retrieve store credit accounts in + that currency. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: >- + An array of filters to apply on the entity, where each item in the array + is joined with an "and" condition. + 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: >- + An array of filters to apply on the entity, where each item in the array + is joined with an "or" condition. + 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: 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_store-credit-accounts/get.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminStoreCreditAccountsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +post: + operationId: PostStoreCreditAccounts + summary: Create Store Credit Account + description: Create a store credit account. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminCreateStoreCreditAccount.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_store-credit-accounts/post.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminStoreCreditAccountResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}.yaml new file mode 100644 index 0000000000..942012e355 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}.yaml @@ -0,0 +1,487 @@ +get: + operationId: GetStoreCreditAccountsId + summary: Get a Store Credit Account + description: >- + Retrieve a store credit account by its ID. You can expand the store credit + account's relations or select the fields that should be returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account's ID. + required: true + schema: + type: string + - 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. + + The fields and relations to retrieve separated by commas. + + + Learn more in the [API + reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + 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: id + in: query + description: Filter by the store credit account's ID. + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a store credit account ID. + - type: array + description: Filter by store credit account IDs. + items: + type: string + title: id + description: A store credit account ID. + - name: customer_id + in: query + description: Filter by customer ID(s) to retrieve their store credit accounts. + required: false + schema: + oneOf: + - type: string + title: customer_id + description: Filter by a customer ID to retrieve their store credit accounts. + - type: array + description: Filter by customer ID(s) to retrieve their store credit accounts. + items: + type: string + title: customer_id + description: A customer ID. + - name: transaction_group_id + in: query + description: Filter by the associated transaction group's ID. + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by the associated transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: currency_code + in: query + description: >- + Filter by currency code(s) to retrieve store credit accounts in specific + currencies. + required: false + schema: + oneOf: + - type: string + title: currency_code + description: >- + Filter by a currency code to retrieve store credit accounts in + that currency. + example: usd + - type: array + description: >- + Filter by currency codes to retrieve store credit accounts in + specific currencies. + items: + type: string + title: currency_code + description: >- + Filter by a currency code to retrieve store credit accounts in + that currency. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: >- + An array of filters to apply on the entity, where each item in the array + is joined with an "and" condition. + 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: >- + An array of filters to apply on the entity, where each item in the array + is joined with an "or" condition. + 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: 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_store-credit-accounts_{id}/get.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminStoreCreditAccountResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}_transactions.yaml b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}_transactions.yaml new file mode 100644 index 0000000000..7dcef8f70d --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_store-credit-accounts_{id}_transactions.yaml @@ -0,0 +1,447 @@ +get: + operationId: GetStoreCreditAccountsIdTransactions + summary: List Transactions + description: >- + Retrieve a list of transactions in a store credit account. The transactions + can be filtered by fields like FILTER FIELDS. The transactions can also be + paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account's ID. + required: true + schema: + type: string + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a transaction ID. + - type: array + description: Filter by transaction IDs. + items: + type: string + title: id + description: A transaction ID. + - name: transaction_group_id + in: query + required: false + schema: + oneOf: + - type: string + title: transaction_group_id + description: Filter by a transaction group ID. + - type: array + description: Filter by transaction group IDs. + items: + type: string + title: transaction_group_id + description: A transaction group ID. + - name: created_at + in: query + description: Filter by a transaction's creation date. + required: false + schema: + type: object + description: Filter by a transaction's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a transaction's update date. + required: false + schema: + type: object + description: Filter by a transaction's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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: q + in: query + description: Search query to filter the transactions by their searchable fields. + required: false + schema: + type: string + title: q + description: Search query to filter the transactions by their searchable fields. + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_store-credit-accounts_{id}_transactions/get.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTransactionsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/admin/paths/admin_transaction-groups.yaml b/www/apps/api-reference/specs/admin/paths/admin_transaction-groups.yaml new file mode 100644 index 0000000000..a2ff5b485a --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_transaction-groups.yaml @@ -0,0 +1,432 @@ +get: + operationId: GetTransactionGroups + summary: List Transaction Groups + description: >- + Retrieve a list of transaction groups. The transaction groups can be + filtered by fields such as `id`. The transaction groups can also be sorted + or paginated. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by the transaction group's ID. + - type: array + description: Filter by the transaction group IDs. + items: + type: string + title: id + description: A transaction group's ID. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter by the transaction group's code. + - type: array + description: Filter by the transaction group codes. + items: + type: string + title: code + description: A transaction group's code. + - name: created_at + in: query + description: Filter by a transaction group's creation date. + required: false + schema: + type: object + description: Filter by a transaction group's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a transaction group's update date. + required: false + schema: + type: object + description: Filter by a transaction group's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_transaction-groups/get.sh + tags: + - Transaction Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTransactionGroupsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/delete.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/delete.sh new file mode 100644 index 0000000000..89fa8d9288 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/delete.sh @@ -0,0 +1,6 @@ +curl -X DELETE '{backend_url}/store/carts/{id}/gift-cards' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "code": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/post.sh new file mode 100644 index 0000000000..10b4cf6411 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_gift-cards/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/store/carts/{id}/gift-cards' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "code": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_store-credits/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_store-credits/post.sh new file mode 100644 index 0000000000..213d267a64 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_store-credits/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/store/carts/{id}/store-credits' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "amount": 48 +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_accept/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_accept/post.sh new file mode 100644 index 0000000000..cb670e327f --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_accept/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/gift-card-invitations/{code}/accept' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_reject/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_reject/post.sh new file mode 100644 index 0000000000..3a98a80831 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-card-invitations_{code}_reject/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/gift-card-invitations/{code}/reject' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards/get.sh new file mode 100644 index 0000000000..cc9652c544 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/store/gift-cards' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}/get.sh new file mode 100644 index 0000000000..0c1325eb31 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/store/gift-cards/{id}' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_invitation/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_invitation/post.sh new file mode 100644 index 0000000000..db0211b1ce --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_invitation/post.sh @@ -0,0 +1,6 @@ +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" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_redeem/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_redeem/post.sh new file mode 100644 index 0000000000..b15d828ab7 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_gift-cards_{id}_redeem/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/gift-cards/{id}/redeem' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts/get.sh new file mode 100644 index 0000000000..213aed7332 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/store/store-credit-accounts' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts_{id}/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts_{id}/get.sh new file mode 100644 index 0000000000..141ad93cff --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_store-credit-accounts_{id}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/store/store-credit-accounts/{id}' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateGiftCardParams.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateGiftCardParams.yaml new file mode 100644 index 0000000000..98f5b3fc78 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateGiftCardParams.yaml @@ -0,0 +1,51 @@ +type: object +description: The details of the gift card to create. +x-schemaName: AdminCreateGiftCardParams +required: + - code + - value + - currency_code + - expires_at + - reference_id + - reference + - line_item_id + - customer_id + - metadata +properties: + code: + type: string + title: code + description: The gift card's code. + value: + type: number + title: value + description: The gift card's amount. + example: 20 + currency_code: + type: string + title: currency_code + description: The gift card's currency code. + example: usd + expires_at: + type: string + title: expires_at + description: The date the gift card expires at. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + reference: + type: string + title: reference + description: The gift card's reference. + line_item_id: + type: string + title: line_item_id + description: The ID of the line item associated with the gift card. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the gift card. + metadata: + type: object + description: The gift card's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateStoreCreditAccount.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateStoreCreditAccount.yaml new file mode 100644 index 0000000000..56c12f0536 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateStoreCreditAccount.yaml @@ -0,0 +1,19 @@ +type: object +description: The details of the store credit account to create. +x-schemaName: AdminCreateStoreCreditAccount +required: + - currency_code + - customer_id +properties: + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminGiftCard.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCard.yaml new file mode 100644 index 0000000000..8841c09e93 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCard.yaml @@ -0,0 +1,79 @@ +type: object +description: The gift card's details. +x-schemaName: AdminGiftCard +required: + - line_item + - customer + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at +properties: + line_item: + $ref: ./AdminOrderLineItem.yaml + customer: + $ref: ./AdminCustomer.yaml + id: + type: string + title: id + description: The gift card's ID. + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + 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 associated with the gift card. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + note: + type: string + title: note + description: The gift card's note. + 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 at. + invitation: + $ref: ./AdminGiftCardInvitation.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the gift card was updated at. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardInvitation.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardInvitation.yaml new file mode 100644 index 0000000000..221cdc59ad --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardInvitation.yaml @@ -0,0 +1,37 @@ +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: + type: object +x-schemaName: AdminGiftCardInvitation diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardResponse.yaml new file mode 100644 index 0000000000..1ae5cd8172 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card's details. +x-schemaName: AdminGiftCardResponse +required: + - gift_card +properties: + gift_card: + $ref: ./AdminGiftCard.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardsResponse.yaml new file mode 100644 index 0000000000..eda7affe60 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminGiftCardsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of gift cards. +x-schemaName: AdminGiftCardsResponse +required: + - limit + - offset + - count + - gift_cards +properties: + limit: + type: number + title: limit + description: The maximum number of gift cards to return. + offset: + type: number + title: offset + description: The number of gift cards to skip before retrieving the results. + count: + type: number + title: count + description: The total number of gift cards available. + gift_cards: + type: array + description: The list of gift cards. + items: + $ref: ./AdminGiftCard.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminRedeemGiftCard.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminRedeemGiftCard.yaml new file mode 100644 index 0000000000..09dd9d4c41 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminRedeemGiftCard.yaml @@ -0,0 +1,12 @@ +type: object +description: The details of the gift card to redeem. +x-schemaName: AdminRedeemGiftCard +required: + - customer_id +properties: + customer_id: + type: string + title: customer_id + description: >- + The ID of the customer that the gift card belongs to. The gift card's + value will be added to the customer's store credit account. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccount.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccount.yaml new file mode 100644 index 0000000000..0e54b944b4 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccount.yaml @@ -0,0 +1,61 @@ +type: object +description: The store credit account's details. +x-schemaName: AdminStoreCreditAccount +required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at +properties: + customer: + $ref: ./AdminCustomer.yaml + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: ./AdminTransactionGroup.yaml + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated at. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountResponse.yaml new file mode 100644 index 0000000000..2c5e7b1f03 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The store credit account's details. +x-schemaName: AdminStoreCreditAccountResponse +required: + - store_credit_account +properties: + store_credit_account: + $ref: ./AdminStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountsResponse.yaml new file mode 100644 index 0000000000..7f93a469e6 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminStoreCreditAccountsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of store credit accounts. +x-schemaName: AdminStoreCreditAccountsResponse +required: + - limit + - offset + - count + - store_credit_accounts +properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: ./AdminStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransaction.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransaction.yaml new file mode 100644 index 0000000000..0a488a5fd2 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransaction.yaml @@ -0,0 +1,63 @@ +type: object +description: The transaction's details. +x-schemaName: AdminTransaction +required: + - account + - id + - account_id + - transaction_group_id + - type + - amount + - metadata + - created_at + - updated_at +properties: + id: + type: string + title: id + description: The transaction's ID. + account_id: + type: string + title: account_id + description: The ID of the store credit account that the transaction belongs to. + transaction_group_id: + type: string + title: transaction_group_id + description: The ID of the transaction group that the transaction belongs to. + type: + type: string + description: The transaction's type. + enum: + - credit + - debit + amount: + type: number + title: amount + description: The transaction's amount. + account: + $ref: ./AdminStoreCreditAccount.yaml + note: + type: string + title: note + description: The transaction's note. + reference: + type: string + title: reference + description: The transaction's reference. + reference_id: + type: string + title: reference_id + description: The transaction's reference ID. + metadata: + type: object + description: The transaction's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the transaction was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the transaction was updated at. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroup.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroup.yaml new file mode 100644 index 0000000000..bf509bb167 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroup.yaml @@ -0,0 +1,37 @@ +type: object +description: The transaction group's details. +x-schemaName: AdminTransactionGroup +required: + - account + - id + - code + - credits + - debits + - balance + - metadata +properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroupsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroupsResponse.yaml new file mode 100644 index 0000000000..b97a557331 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionGroupsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of transaction groups. +x-schemaName: AdminTransactionGroupsResponse +required: + - limit + - offset + - count + - transaction_groups +properties: + limit: + type: number + title: limit + description: The maximum number of transaction groups to return. + offset: + type: number + title: offset + description: The number of transaction groups to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transaction groups available. + transaction_groups: + type: array + description: The list of transaction groups. + items: + $ref: ./AdminTransactionGroup.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransactionsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionsResponse.yaml new file mode 100644 index 0000000000..0d55e47604 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransactionsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of transactions. +x-schemaName: AdminTransactionsResponse +required: + - limit + - offset + - count + - transactions +properties: + limit: + type: number + title: limit + description: The maximum number of transactions to return. + offset: + type: number + title: offset + description: The number of transactions to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transactions available. + transactions: + type: array + description: The list of transactions. + items: + $ref: ./AdminTransaction.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransferGiftCard.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransferGiftCard.yaml new file mode 100644 index 0000000000..9a445317ce --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransferGiftCard.yaml @@ -0,0 +1,10 @@ +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. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateGiftCardParams.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateGiftCardParams.yaml new file mode 100644 index 0000000000..f53e7e9728 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateGiftCardParams.yaml @@ -0,0 +1,34 @@ +type: object +description: The details to update in the gift card. +x-schemaName: AdminUpdateGiftCardParams +properties: + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. + 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 at. + metadata: + type: object + description: The gift card's metadata. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreAddGiftCardToCart.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreAddGiftCardToCart.yaml new file mode 100644 index 0000000000..75b7389dbb --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreAddGiftCardToCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to add a gift card to the cart. +x-schemaName: StoreAddGiftCardToCart +required: + - code +properties: + code: + type: string + title: code + description: The gift card's code. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreAddStoreCreditsToCart.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreAddStoreCreditsToCart.yaml new file mode 100644 index 0000000000..21af98b5c3 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreAddStoreCreditsToCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to add store credits to the cart. +x-schemaName: StoreAddStoreCreditsToCart +required: + - amount +properties: + amount: + type: number + title: amount + description: The amount of store credits to add to the cart. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCreateGiftCardInvitation.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCreateGiftCardInvitation.yaml new file mode 100644 index 0000000000..f953a5e531 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCreateGiftCardInvitation.yaml @@ -0,0 +1,16 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreGiftCard.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCard.yaml new file mode 100644 index 0000000000..7235e9ee70 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCard.yaml @@ -0,0 +1,79 @@ +type: object +description: The gift card's details. +x-schemaName: StoreGiftCard +required: + - customer + - line_item + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at +properties: + customer: + $ref: ./StoreCustomer.yaml + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + 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. + reference: + type: string + title: reference + description: The gift card's reference. + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created. + updated_at: + type: string + 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: + type: object + line_item: + $ref: ./StoreOrderLineItem.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitation.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitation.yaml new file mode 100644 index 0000000000..8ad2557f70 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitation.yaml @@ -0,0 +1,24 @@ +type: object +description: The gift card invitation's details. +x-schemaName: StoreGiftCardInvitation +required: + - id + - email + - status + - gift_card +properties: + id: + type: string + title: id + description: The gift card invitation's ID. + email: + type: string + title: email + description: The gift card invitation's email. + format: email + status: + type: string + title: status + description: The gift card invitation's status. + gift_card: + $ref: ./StoreGiftCard.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitationResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitationResponse.yaml new file mode 100644 index 0000000000..178bc96d8d --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardInvitationResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card invitation's details. +x-schemaName: StoreGiftCardInvitationResponse +required: + - gift_card_invitation +properties: + gift_card_invitation: + $ref: ./StoreGiftCardInvitation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardResponse.yaml new file mode 100644 index 0000000000..a8c3a1936f --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreGiftCardResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The gift card's details. +x-schemaName: StoreGiftCardResponse +required: + - gift_card +properties: + gift_card: + $ref: ./StoreGiftCard.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreRemoveGiftCardFromCart.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreRemoveGiftCardFromCart.yaml new file mode 100644 index 0000000000..748bc5fd7e --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreRemoveGiftCardFromCart.yaml @@ -0,0 +1,10 @@ +type: object +description: The details to remove a gift card from the cart. +x-schemaName: StoreRemoveGiftCardFromCart +required: + - code +properties: + code: + type: string + title: code + description: The gift card code to remove from the cart. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccount.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccount.yaml new file mode 100644 index 0000000000..26cf2ddc5b --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccount.yaml @@ -0,0 +1,61 @@ +type: object +description: The store credit account's details. +x-schemaName: StoreStoreCreditAccount +required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at +properties: + customer: + $ref: ./StoreCustomer.yaml + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The store credit account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: ./StoreTransactionGroup.yaml + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountResponse.yaml new file mode 100644 index 0000000000..bf39e4f214 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The store credit account's details. +x-schemaName: StoreStoreCreditAccountResponse +required: + - store_credit_account +properties: + store_credit_account: + $ref: ./StoreStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountsResponse.yaml new file mode 100644 index 0000000000..3ba7a0059e --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreStoreCreditAccountsResponse.yaml @@ -0,0 +1,26 @@ +type: object +description: The paginated list of store credit accounts. +x-schemaName: StoreStoreCreditAccountsResponse +required: + - limit + - offset + - count + - store_credit_accounts +properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: ./StoreStoreCreditAccount.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreTransactionGroup.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreTransactionGroup.yaml new file mode 100644 index 0000000000..0a7fe807c1 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreTransactionGroup.yaml @@ -0,0 +1,37 @@ +type: object +description: The transaction group's details. +required: + - account + - id + - code + - credits + - debits + - balance + - metadata +properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. +x-schemaName: StoreTransactionGroup diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index e75e55dd27..32d14d99d8 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -58,6 +58,25 @@ 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. + + Gift Card Invitations are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + x-associatedSchema: + $ref: '#/components/schemas/StoreGiftCardInvitation' + - name: Gift Cards + description: | + A gift card is a prepaid card that customers can use to purchase products in the store. + Customers can purchase gift cards for themselves or others, and then use them to pay for their orders. + These API routes allow logged-in customers to create and manage their gift cards. + + Gift Cards are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + x-associatedSchema: + $ref: '#/components/schemas/StoreGiftCard' - name: Orders description: | Guest and registered customers can view orders they placed. @@ -127,13 +146,6 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: '#/components/schemas/StoreRegion' - - name: Returns - description: | - Customers can request to return items in their order. The admin user then receives and handles the return. - - These API routes allows customers to create a return. - x-associatedSchema: - $ref: '#/components/schemas/StoreReturn' - name: Return Reasons description: | A return reason is a possible reason a customer wants to return an item. @@ -141,6 +153,13 @@ tags: Use these API routes when implementing return creation flow in your storefront to allow customers to select their return reason. x-associatedSchema: $ref: '#/components/schemas/StoreReturnReason' + - name: Returns + description: | + Customers can request to return items in their order. The admin user then receives and handles the return. + + These API routes allows customers to create a return. + x-associatedSchema: + $ref: '#/components/schemas/StoreReturn' - name: Shipping Options description: | A shipping option is a way of shipping an item to or from the customer. @@ -153,6 +172,15 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: '#/components/schemas/StoreShippingOption' + - name: Store Credit Accounts + x-associatedSchema: + description: | + A store credit account is a way for customers to manage their store credit balance. Customers can use their store credit to pay for orders, and view their store credit balance. + These API routes allow customers to view their store credit accounts. + + Store Credit Accounts are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + $ref: '#/components/schemas/StoreStoreCreditAccount' paths: /auth/customer/{auth_provider}: post: @@ -1342,6 +1370,157 @@ paths: description: Emitted when the customer in the cart is transferred. deprecated: false version: 2.8.0 + /store/carts/{id}/gift-cards: + post: + operationId: PostCartsIdGiftCards + summary: Add Gift Card to Cart + x-sidebar-summary: Add Gift Card + description: Add a Gift Card to a cart + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreAddGiftCardToCart' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/carts/{id}/gift-cards' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "code": "{value}" + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + delete: + operationId: DeleteCartsIdGiftCards + summary: Remove Gift Card from Cart + x-sidebar-summary: Remove Gift Card + description: Remove a Gift Card from a cart. + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreRemoveGiftCardFromCart' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/store/carts/{id}/gift-cards' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "code": "{value}" + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). /store/carts/{id}/line-items: post: operationId: PostCartsIdLineItems @@ -1950,6 +2129,82 @@ paths: ``` description: Emitted when a cart's details are updated. deprecated: false + /store/carts/{id}/store-credits: + post: + operationId: PostCartsIdStoreCredits + summary: Add Store Credit to Cart + x-sidebar-summary: Add Store Credit + description: Add a Store Credit to a cart + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreAddStoreCreditsToCart' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/carts/{id}/store-credits' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "amount": 48 + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartResponse' + '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' + x-badges: + - text: Cloud + description: | + This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). /store/carts/{id}/taxes: post: operationId: PostCartsIdTaxes @@ -3917,6 +4172,500 @@ paths: $ref: '#/components/responses/500_error' x-workflow: deleteCustomerAddressesWorkflow x-events: [] + /store/gift-card-invitations/{code}/accept: + post: + 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). + /store/gift-card-invitations/{code}/reject: + post: + 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). + /store/gift-cards: + get: + 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). + /store/gift-cards/{id}: + get: + operationId: GetGiftCardsId + summary: Get Customer's 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 + 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' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/store/gift-cards/{id}' \ + -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). + /store/gift-cards/{id}/invitation: + post: + 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). + /store/gift-cards/{id}/redeem: + post: + operationId: PostGiftCardsIdRedeem + summary: Redeem Customer's Gift Card + x-sidebar-summary: Redeem Gift Card + description: Redeem the logged-in customer's gift card + 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' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/gift-cards/{id}/redeem' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + 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). /store/orders: get: operationId: GetOrders @@ -8772,6 +9521,434 @@ paths: $ref: '#/components/responses/500_error' x-workflow: calculateShippingOptionsPricesWorkflow x-events: [] + /store/store-credit-accounts: + get: + operationId: GetStoreCreditAccounts + summary: List Customer's Store Credit Accounts + x-sidebar-summary: List Store Credit Accounts + description: Retrieve the logged-in customer's store credit accounts. The store credit accounts can be filtered by fields such as `id`. The store credit accounts 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: currency_code + in: query + description: Filter by the store credit account's currency code. + required: false + schema: + type: string + title: currency_code + description: Filter by the store credit account's currency code. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/store/store-credit-accounts' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreStoreCreditAccountsResponse' + '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). + /store/store-credit-accounts/{id}: + get: + operationId: GetStoreCreditAccountsId + summary: Get Customer's Store Credit Account + x-sidebar-summary: Get Store Credit Account + description: Retrieve logged-in customer's store credit account by its ID. You can expand the store credit account's relations or select the fields that should be returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account'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' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/store/store-credit-accounts/{id}' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreStoreCreditAccountResponse' + '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). components: schemas: AdminAddDraftOrderItems: @@ -10184,6 +11361,58 @@ components: metadata: type: object description: The fulfillment's metadata, used to store custom key-value pairs. + AdminCreateGiftCardParams: + type: object + description: The details of the gift card to create. + x-schemaName: AdminCreateGiftCardParams + required: + - code + - value + - currency_code + - expires_at + - reference_id + - reference + - line_item_id + - customer_id + - metadata + properties: + code: + type: string + title: code + description: The gift card's code. + value: + type: number + title: value + description: The gift card's amount. + example: 20 + currency_code: + type: string + title: currency_code + description: The gift card's currency code. + example: usd + expires_at: + type: string + title: expires_at + description: The date the gift card expires at. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + reference: + type: string + title: reference + description: The gift card's reference. + line_item_id: + type: string + title: line_item_id + description: The ID of the line item associated with the gift card. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the gift card. + metadata: + type: object + description: The gift card's metadata, can hold custom key-value pairs. AdminCreateInventoryItem: type: object description: The inventory item's details. @@ -11146,6 +12375,26 @@ components: metadata: type: object description: The stock location's metadata, used to store custom key-value pairs. + AdminCreateStoreCreditAccount: + type: object + description: The details of the store credit account to create. + x-schemaName: AdminCreateStoreCreditAccount + required: + - currency_code + - customer_id + properties: + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. AdminCreateTaxRate: type: object description: The tax rate's details. @@ -13949,6 +15198,160 @@ components: format: date-time title: deleted_at description: The geo zone's deleted at. + AdminGiftCard: + type: object + description: The gift card's details. + x-schemaName: AdminGiftCard + required: + - line_item + - customer + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at + properties: + line_item: + $ref: '#/components/schemas/AdminOrderLineItem' + customer: + $ref: '#/components/schemas/AdminCustomer' + id: + type: string + title: id + description: The gift card's ID. + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + 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 associated with the gift card. + reference_id: + type: string + title: reference_id + description: The gift card's reference ID. + note: + type: string + title: note + description: The gift card's note. + 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 at. + invitation: + $ref: '#/components/schemas/AdminGiftCardInvitation' + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the gift card was updated at. + 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: + type: object + x-schemaName: AdminGiftCardInvitation + AdminGiftCardResponse: + type: object + description: The gift card's details. + x-schemaName: AdminGiftCardResponse + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/AdminGiftCard' + AdminGiftCardsResponse: + type: object + description: The paginated list of gift cards. + x-schemaName: AdminGiftCardsResponse + required: + - limit + - offset + - count + - gift_cards + properties: + limit: + type: number + title: limit + description: The maximum number of gift cards to return. + offset: + type: number + title: offset + description: The number of gift cards to skip before retrieving the results. + count: + type: number + title: count + description: The total number of gift cards available. + gift_cards: + type: array + description: The list of gift cards. + items: + $ref: '#/components/schemas/AdminGiftCard' AdminImportProductRequest: type: object description: The import's details. @@ -18633,6 +20036,17 @@ components: - cusgroup_123 items: $ref: '#/components/schemas/BasePromotionRuleValue' + AdminRedeemGiftCard: + type: object + description: The details of the gift card to redeem. + x-schemaName: AdminRedeemGiftCard + required: + - customer_id + properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. The gift card's value will be added to the customer's store credit account. AdminRefund: type: object description: The refund's details. @@ -20017,6 +21431,104 @@ components: format: date-time title: updated_at description: The date the store was updated. + AdminStoreCreditAccount: + type: object + description: The store credit account's details. + x-schemaName: AdminStoreCreditAccount + required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/AdminCustomer' + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: '#/components/schemas/AdminTransactionGroup' + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated at. + AdminStoreCreditAccountResponse: + type: object + description: The store credit account's details. + x-schemaName: AdminStoreCreditAccountResponse + required: + - store_credit_account + properties: + store_credit_account: + $ref: '#/components/schemas/AdminStoreCreditAccount' + AdminStoreCreditAccountsResponse: + type: object + description: The paginated list of store credit accounts. + x-schemaName: AdminStoreCreditAccountsResponse + required: + - limit + - offset + - count + - store_credit_accounts + properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: '#/components/schemas/AdminStoreCreditAccount' AdminStoreCurrency: type: object description: The details of a store's currency. @@ -20356,6 +21868,173 @@ components: properties: tax_region: $ref: '#/components/schemas/AdminTaxRegion' + AdminTransaction: + type: object + description: The transaction's details. + x-schemaName: AdminTransaction + required: + - account + - id + - account_id + - transaction_group_id + - type + - amount + - metadata + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The transaction's ID. + account_id: + type: string + title: account_id + description: The ID of the store credit account that the transaction belongs to. + transaction_group_id: + type: string + title: transaction_group_id + description: The ID of the transaction group that the transaction belongs to. + type: + type: string + description: The transaction's type. + enum: + - credit + - debit + amount: + type: number + title: amount + description: The transaction's amount. + account: + $ref: '#/components/schemas/AdminStoreCreditAccount' + note: + type: string + title: note + description: The transaction's note. + reference: + type: string + title: reference + description: The transaction's reference. + reference_id: + type: string + title: reference_id + description: The transaction's reference ID. + metadata: + type: object + description: The transaction's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the transaction was created at. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the transaction was updated at. + AdminTransactionGroup: + type: object + description: The transaction group's details. + x-schemaName: AdminTransactionGroup + required: + - account + - id + - code + - credits + - debits + - balance + - metadata + properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. + AdminTransactionGroupsResponse: + type: object + description: The paginated list of transaction groups. + x-schemaName: AdminTransactionGroupsResponse + required: + - limit + - offset + - count + - transaction_groups + properties: + limit: + type: number + title: limit + description: The maximum number of transaction groups to return. + offset: + type: number + title: offset + description: The number of transaction groups to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transaction groups available. + transaction_groups: + type: array + description: The list of transaction groups. + items: + $ref: '#/components/schemas/AdminTransactionGroup' + AdminTransactionsResponse: + type: object + description: The paginated list of transactions. + x-schemaName: AdminTransactionsResponse + required: + - limit + - offset + - count + - transactions + properties: + limit: + type: number + title: limit + description: The maximum number of transactions to return. + offset: + type: number + title: offset + description: The number of transactions to skip before retrieving the results. + count: + type: number + title: count + description: The total number of transactions available. + transactions: + type: array + description: The list of transactions. + items: + $ref: '#/components/schemas/AdminTransaction' + 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. AdminTransferOrder: type: object description: The details of the request to transfer the order. @@ -20589,6 +22268,41 @@ components: type: string title: internal_note description: A note viewed only by admin users about the shipping method. + AdminUpdateGiftCardParams: + type: object + description: The details to update in the gift card. + x-schemaName: AdminUpdateGiftCardParams + properties: + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the gift card belongs to. + 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 at. + metadata: + type: object + description: The gift card's metadata. AdminUpdateOrder: type: object description: The details to update in the order. @@ -27382,6 +29096,28 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + StoreAddGiftCardToCart: + type: object + description: The details to add a gift card to the cart. + x-schemaName: StoreAddGiftCardToCart + required: + - code + properties: + code: + type: string + title: code + description: The gift card's code. + StoreAddStoreCreditsToCart: + type: object + description: The details to add store credits to the cart. + x-schemaName: StoreAddStoreCreditsToCart + required: + - amount + properties: + amount: + type: number + title: amount + description: The amount of store credits to add to the cart. StoreCalculatedPrice: type: object description: The shipping option's calculated price. @@ -28654,6 +30390,23 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 StoreCreatePaymentCollection: type: object description: The details of the payment collection to create. @@ -29065,6 +30818,129 @@ components: type: string title: token description: The order transfer's token issued when the transfer was requested. + StoreGiftCard: + type: object + description: The gift card's details. + x-schemaName: StoreGiftCard + required: + - customer + - line_item + - invitation + - id + - code + - status + - value + - currency_code + - customer_id + - reference_id + - note + - reference + - expires_at + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/StoreCustomer' + code: + type: string + title: code + description: The gift card's code. + status: + type: string + description: The gift card's status. + enum: + - pending + - redeemed + value: + type: number + title: value + description: The gift card's amount. + 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. + reference: + type: string + title: reference + description: The gift card's reference. + created_at: + type: string + format: date-time + title: created_at + description: The date the gift card was created. + updated_at: + type: string + 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: + type: object + line_item: + $ref: '#/components/schemas/StoreOrderLineItem' + StoreGiftCardInvitation: + type: object + description: The gift card invitation's details. + x-schemaName: StoreGiftCardInvitation + required: + - id + - email + - status + - gift_card + properties: + id: + type: string + title: id + description: The gift card invitation's ID. + email: + type: string + title: email + description: The gift card invitation's email. + format: email + status: + type: string + title: status + description: The gift card invitation's status. + gift_card: + $ref: '#/components/schemas/StoreGiftCard' + 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' + StoreGiftCardResponse: + type: object + description: The gift card's details. + x-schemaName: StoreGiftCardResponse + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/StoreGiftCard' StoreInitializePaymentSession: type: object description: The payment session's details. @@ -36216,6 +38092,17 @@ components: type: string title: display_name description: The country's display name. + StoreRemoveGiftCardFromCart: + type: object + description: The details to remove a gift card from the cart. + x-schemaName: StoreRemoveGiftCardFromCart + required: + - code + properties: + code: + type: string + title: code + description: The gift card code to remove from the cart. StoreRequestOrderTransfer: type: object description: The details of requesting the order transfer. @@ -36537,6 +38424,142 @@ components: format: date-time title: deleted_at description: The date the type was deleted. + StoreStoreCreditAccount: + type: object + description: The store credit account's details. + x-schemaName: StoreStoreCreditAccount + required: + - customer + - transaction_groups + - id + - customer_id + - currency_code + - credits + - debits + - balance + - metadata + - created_at + - updated_at + properties: + customer: + $ref: '#/components/schemas/StoreCustomer' + id: + type: string + title: id + description: The store credit account's ID. + customer_id: + type: string + title: customer_id + description: The ID of the customer that the store credit account belongs to. + currency_code: + type: string + title: currency_code + description: The store credit account's currency code. + example: usd + credits: + type: number + title: credits + description: The account's credits. + debits: + type: number + title: debits + description: The account's debits. + balance: + type: number + title: balance + description: The store credit account's balance. + transaction_groups: + type: array + description: The store credit account's transaction groups. + items: + $ref: '#/components/schemas/StoreTransactionGroup' + metadata: + type: object + description: The store credit account's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the store credit account was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the store credit account was updated. + StoreStoreCreditAccountResponse: + type: object + description: The store credit account's details. + x-schemaName: StoreStoreCreditAccountResponse + required: + - store_credit_account + properties: + store_credit_account: + $ref: '#/components/schemas/StoreStoreCreditAccount' + StoreStoreCreditAccountsResponse: + type: object + description: The paginated list of store credit accounts. + x-schemaName: StoreStoreCreditAccountsResponse + required: + - limit + - offset + - count + - store_credit_accounts + properties: + limit: + type: number + title: limit + description: The maximum number of store credit accounts to return. + offset: + type: number + title: offset + description: The number of store credit accounts to skip before retrieving the results. + count: + type: number + title: count + description: The total number of store credit accounts available. + store_credit_accounts: + type: array + description: The list of store credit accounts. + items: + $ref: '#/components/schemas/StoreStoreCreditAccount' + StoreTransactionGroup: + type: object + description: The transaction group's details. + required: + - account + - id + - code + - credits + - debits + - balance + - metadata + properties: + id: + type: string + title: id + description: The transaction group's ID. + code: + type: string + title: code + description: The transaction group's code. + credits: + type: number + title: credits + description: The transaction group's credits. + debits: + type: number + title: debits + description: The transaction group's debits. + balance: + type: number + title: balance + description: The transaction group's balance. + account: + type: object + metadata: + type: object + description: The transaction group's metadata, can hold custom key-value pairs. + x-schemaName: StoreTransactionGroup StoreUpdateCartLineItem: type: object description: The details to update in the line item. diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index 6dae8d2e49..517bebc234 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -73,6 +73,41 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/customers x-associatedSchema: $ref: ./components/schemas/StoreCustomer.yaml + - 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. + + + + Gift Card Invitations are only available for Cloud users using the + [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: ./components/schemas/StoreGiftCardInvitation.yaml + - name: Gift Cards + description: > + A gift card is a prepaid card that customers can use to purchase products + in the store. + + Customers can purchase gift cards for themselves or others, and then use + them to pay for their orders. + + These API routes allow logged-in customers to create and manage their gift + cards. + + + + Gift Cards are only available for Cloud users using the [Loyalty + Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: ./components/schemas/StoreGiftCard.yaml - name: Orders description: | Guest and registered customers can view orders they placed. @@ -159,15 +194,6 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: ./components/schemas/StoreRegion.yaml - - name: Returns - description: > - Customers can request to return items in their order. The admin user then - receives and handles the return. - - - These API routes allows customers to create a return. - x-associatedSchema: - $ref: ./components/schemas/StoreReturn.yaml - name: Return Reasons description: > A return reason is a possible reason a customer wants to return an item. @@ -177,6 +203,15 @@ tags: storefront to allow customers to select their return reason. x-associatedSchema: $ref: ./components/schemas/StoreReturnReason.yaml + - name: Returns + description: > + Customers can request to return items in their order. The admin user then + receives and handles the return. + + + These API routes allows customers to create a return. + x-associatedSchema: + $ref: ./components/schemas/StoreReturn.yaml - name: Shipping Options description: > A shipping option is a way of shipping an item to or from the customer. @@ -194,6 +229,22 @@ tags: https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: ./components/schemas/StoreShippingOption.yaml + - name: Store Credit Accounts + x-associatedSchema: + description: > + A store credit account is a way for customers to manage their store + credit balance. Customers can use their store credit to pay for orders, + and view their store credit balance. + + These API routes allow customers to view their store credit accounts. + + + + Store Credit Accounts are only available for Cloud users using the + [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + $ref: ./components/schemas/StoreStoreCreditAccount.yaml paths: /auth/customer/{auth_provider}: $ref: paths/auth_customer_{auth_provider}.yaml @@ -217,6 +268,8 @@ paths: $ref: paths/store_carts_{id}_complete.yaml /store/carts/{id}/customer: $ref: paths/store_carts_{id}_customer.yaml + /store/carts/{id}/gift-cards: + $ref: paths/store_carts_{id}_gift-cards.yaml /store/carts/{id}/line-items: $ref: paths/store_carts_{id}_line-items.yaml /store/carts/{id}/line-items/{line_id}: @@ -225,6 +278,8 @@ paths: $ref: paths/store_carts_{id}_promotions.yaml /store/carts/{id}/shipping-methods: $ref: paths/store_carts_{id}_shipping-methods.yaml + /store/carts/{id}/store-credits: + $ref: paths/store_carts_{id}_store-credits.yaml /store/carts/{id}/taxes: $ref: paths/store_carts_{id}_taxes.yaml /store/collections: @@ -243,6 +298,18 @@ paths: $ref: paths/store_customers_me_addresses.yaml /store/customers/me/addresses/{address_id}: $ref: paths/store_customers_me_addresses_{address_id}.yaml + /store/gift-card-invitations/{code}/accept: + $ref: paths/store_gift-card-invitations_{code}_accept.yaml + /store/gift-card-invitations/{code}/reject: + $ref: paths/store_gift-card-invitations_{code}_reject.yaml + /store/gift-cards: + $ref: paths/store_gift-cards.yaml + /store/gift-cards/{id}: + $ref: paths/store_gift-cards_{id}.yaml + /store/gift-cards/{id}/invitation: + $ref: paths/store_gift-cards_{id}_invitation.yaml + /store/gift-cards/{id}/redeem: + $ref: paths/store_gift-cards_{id}_redeem.yaml /store/orders: $ref: paths/store_orders.yaml /store/orders/{id}: @@ -291,6 +358,10 @@ paths: $ref: paths/store_shipping-options.yaml /store/shipping-options/{id}/calculate: $ref: paths/store_shipping-options_{id}_calculate.yaml + /store/store-credit-accounts: + $ref: paths/store_store-credit-accounts.yaml + /store/store-credit-accounts/{id}: + $ref: paths/store_store-credit-accounts_{id}.yaml components: securitySchemes: jwt_token: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_gift-cards.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_gift-cards.yaml new file mode 100644 index 0000000000..beda739210 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_gift-cards.yaml @@ -0,0 +1,156 @@ +post: + operationId: PostCartsIdGiftCards + summary: Add Gift Card to Cart + x-sidebar-summary: Add Gift Card + description: Add a Gift Card to a cart + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreAddGiftCardToCart.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_carts_{id}_gift-cards/post.sh + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +delete: + operationId: DeleteCartsIdGiftCards + summary: Remove Gift Card from Cart + x-sidebar-summary: Remove Gift Card + description: Remove a Gift Card from a cart. + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreRemoveGiftCardFromCart.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_carts_{id}_gift-cards/delete.sh + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_store-credits.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_store-credits.yaml new file mode 100644 index 0000000000..cedc13b1be --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_store-credits.yaml @@ -0,0 +1,78 @@ +post: + operationId: PostCartsIdStoreCredits + summary: Add Store Credit to Cart + x-sidebar-summary: Add Store Credit + description: Add a Store Credit to a cart + x-authenticated: false + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The cart'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/StoreAddStoreCreditsToCart.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_carts_{id}_store-credits/post.sh + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-badges: + - text: Cloud + description: > + This API route is only available in [Medusa + Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_accept.yaml b/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_accept.yaml new file mode 100644 index 0000000000..75160ef3a6 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_accept.yaml @@ -0,0 +1,77 @@ +post: + 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: + $ref: >- + ../code_samples/Shell/store_gift-card-invitations_{code}_accept/post.sh + tags: + - Gift Card Invitations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreGiftCardInvitationResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_reject.yaml b/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_reject.yaml new file mode 100644 index 0000000000..fa9253f843 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-card-invitations_{code}_reject.yaml @@ -0,0 +1,77 @@ +post: + 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: + $ref: >- + ../code_samples/Shell/store_gift-card-invitations_{code}_reject/post.sh + tags: + - Gift Card Invitations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreGiftCardInvitationResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-cards.yaml b/www/apps/api-reference/specs/store/paths/store_gift-cards.yaml new file mode 100644 index 0000000000..75ef1749a9 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-cards.yaml @@ -0,0 +1,161 @@ +get: + 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: + $ref: ../code_samples/Shell/store_gift-cards/get.sh + tags: + - Gift Cards + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}.yaml new file mode 100644 index 0000000000..426eef46ef --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}.yaml @@ -0,0 +1,74 @@ +get: + operationId: GetGiftCardsId + summary: Get Customer's 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 + 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' + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_gift-cards_{id}/get.sh + tags: + - Gift Cards + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_invitation.yaml b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_invitation.yaml new file mode 100644 index 0000000000..f82c015346 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_invitation.yaml @@ -0,0 +1,84 @@ +post: + 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.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_gift-cards_{id}_invitation/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_redeem.yaml b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_redeem.yaml new file mode 100644 index 0000000000..43581a88b7 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_gift-cards_{id}_redeem.yaml @@ -0,0 +1,76 @@ +post: + operationId: PostGiftCardsIdRedeem + summary: Redeem Customer's Gift Card + x-sidebar-summary: Redeem Gift Card + description: Redeem the logged-in customer's gift card + 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' + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_gift-cards_{id}_redeem/post.sh + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreGiftCardResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_store-credit-accounts.yaml b/www/apps/api-reference/specs/store/paths/store_store-credit-accounts.yaml new file mode 100644 index 0000000000..0a5e80e303 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_store-credit-accounts.yaml @@ -0,0 +1,421 @@ +get: + operationId: GetStoreCreditAccounts + summary: List Customer's Store Credit Accounts + x-sidebar-summary: List Store Credit Accounts + description: >- + Retrieve the logged-in customer's store credit accounts. The store credit + accounts can be filtered by fields such as `id`. The store credit accounts + 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: currency_code + in: query + description: Filter by the store credit account's currency code. + required: false + schema: + type: string + title: currency_code + description: Filter by the store credit account's currency code. + example: usd + - name: created_at + in: query + description: Filter by a store credit account's creation date. + required: false + schema: + type: object + description: Filter by a store credit account's creation date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a store credit account's update date. + required: false + schema: + type: object + description: Filter by a store credit account's update date. + properties: + $and: + 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 + $or: + 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 + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - 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 + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_store-credit-accounts/get.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreStoreCreditAccountsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/api-reference/specs/store/paths/store_store-credit-accounts_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_store-credit-accounts_{id}.yaml new file mode 100644 index 0000000000..198b1eaccc --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_store-credit-accounts_{id}.yaml @@ -0,0 +1,79 @@ +get: + operationId: GetStoreCreditAccountsId + summary: Get Customer's Store Credit Account + x-sidebar-summary: Get Store Credit Account + description: >- + Retrieve logged-in customer's store credit account by its ID. You can expand + the store credit account's relations or select the fields that should be + returned. + x-authenticated: true + x-ignoreCleanup: true + parameters: + - name: id + in: path + description: The store credit account'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' + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_store-credit-accounts_{id}/get.sh + tags: + - Store Credit Accounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreStoreCreditAccountResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + 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). diff --git a/www/apps/cloud/app/loyalty-plugin/page.mdx b/www/apps/cloud/app/loyalty-plugin/page.mdx index b3dd765b98..e03bf74c72 100644 --- a/www/apps/cloud/app/loyalty-plugin/page.mdx +++ b/www/apps/cloud/app/loyalty-plugin/page.mdx @@ -36,4 +36,17 @@ The Loyalty Plugin provides the following features: The Loyalty Plugin is currently only available for Cloud users. If you're not a Cloud user, [learn how to get started](../page.mdx#sign-up-for-cloud). -Then, you can [contact support](../support/page.mdx) for assistance in installing the Loyalty Plugin in your deployed Medusa application. \ No newline at end of file +Then, you can [contact support](../support/page.mdx) for assistance in installing the Loyalty Plugin in your deployed Medusa application. + +### Loyalty Plugin API Routes + +You can find the API routes for the Loyalty Plugin within the API reference: + +- Store API routes: + - [Gift Card Invitations](!api!/store#gift-card-invitations) + - [Gift Cards](!api!/store#gift-cards) + - [Store Credit Accounts](!api!/store#store-credit-accounts) +- Admin API routes: + - [Gift Cards](!api!/admin#gift-cards) + - [Store Credit Accounts](!api!/admin#store-credit-accounts) + - [Transaction Groups](!api!/admin#transaction-groups) diff --git a/www/apps/cloud/generated/edit-dates.mjs b/www/apps/cloud/generated/edit-dates.mjs index 1bd11ebd91..2cedf6bbdf 100644 --- a/www/apps/cloud/generated/edit-dates.mjs +++ b/www/apps/cloud/generated/edit-dates.mjs @@ -10,7 +10,7 @@ export const generatedEditDates = { "app/redis/page.mdx": "2025-06-19T14:16:06.488Z", "app/s3/page.mdx": "2025-06-19T14:16:11.227Z", "app/draft-order-plugin/page.mdx": "2025-06-19T14:14:49.500Z", - "app/loyalty-plugin/page.mdx": "2025-06-19T14:15:04.352Z", + "app/loyalty-plugin/page.mdx": "2025-06-24T13:00:52.953Z", "app/billing-usage/page.mdx": "2025-06-19T14:13:29.533Z", "app/logs/page.mdx": "2025-06-19T07:44:38.336Z", "app/support/page.mdx": "2025-06-19T11:18:37.253Z", diff --git a/www/packages/types/src/openapi.ts b/www/packages/types/src/openapi.ts index 7690873f72..0721516c89 100644 --- a/www/packages/types/src/openapi.ts +++ b/www/packages/types/src/openapi.ts @@ -25,6 +25,11 @@ export type Operation = OpenAPIV3.OperationObject<{ "x-events"?: OasEvents[] "x-version"?: string "x-deprecated_message"?: string + "x-badges"?: { + text: string + description: string + variant?: "purple" | "orange" | "green" | "blue" | "red" | "neutral" + }[] }> export type RequestObject = OpenAPIV3.RequestBodyObject & { diff --git a/www/utils/generated/oas-output/base/admin.oas.base.yaml b/www/utils/generated/oas-output/base/admin.oas.base.yaml index 3acc1e19aa..f80a441e74 100644 --- a/www/utils/generated/oas-output/base/admin.oas.base.yaml +++ b/www/utils/generated/oas-output/base/admin.oas.base.yaml @@ -159,6 +159,22 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: "#/components/schemas/AdminFulfillment" + - name: Gift Cards + description: > + A gift card is a prepaid card that can be used to pay for items during checkout. + + Gift cards can be purchased by customers, or created by admin users. When a gift card is redeemed, its amount + is added to the customer's store credit account, which can then be used to pay for items during checkout. + + These API routes allow admin users to manage gift cards, transfer gift cards between customers, and more. + + + + Gift Card routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: "#/components/schemas/AdminGiftCard" - name: Inventory Items description: | An inventory item is a stock-kept product whose inventory is managed. @@ -502,6 +518,22 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: "#/components/schemas/AdminStockLocation" + - name: Store Credit Accounts + description: > + A store credit account is a ledger of store credit transactions for a customer. They hold the customer's store credit balance, + including their credit and debit amounts. + + Store credit accounts allow you to build features that let customers pay for items using their store credit balance, such as gift cards or loyalty points. + + These API routes allow admin users to manage store credit accounts, their transactions, and more. + + + + Store Credit Account routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: "#/components/schemas/AdminStoreCreditAccount" - name: Stores description: > A store holds the main configuration and information of your commerce @@ -558,6 +590,20 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: "#/components/schemas/AdminTaxRegion" + - name: Transaction Groups + description: > + A transaction group is a group of transactions that belong to a store credit account. + It allows you to group transactions together, such as all transactions related to a specific gift card. + + These API routes allow admin users to list transaction groups. + + + + Transaction Group routes are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: "#/components/schemas/AdminTransactionGroup" - name: Uploads description: > Use these API routes to upload files to your Medusa application using the diff --git a/www/utils/generated/oas-output/base/store.oas.base.yaml b/www/utils/generated/oas-output/base/store.oas.base.yaml index b549a3bc01..e55c5a5062 100644 --- a/www/utils/generated/oas-output/base/store.oas.base.yaml +++ b/www/utils/generated/oas-output/base/store.oas.base.yaml @@ -65,6 +65,36 @@ 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. + + + + Gift Card Invitations are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: "#/components/schemas/StoreGiftCardInvitation" + - name: Gift Cards + description: > + A gift card is a prepaid card that customers can use to purchase products + in the store. + + Customers can purchase gift cards for themselves or others, and then use them to pay for their orders. + + These API routes allow logged-in customers to create and manage their gift cards. + + + + Gift Cards are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + x-associatedSchema: + $ref: "#/components/schemas/StoreGiftCard" - name: Orders description: | Guest and registered customers can view orders they placed. @@ -142,6 +172,14 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: "#/components/schemas/StoreRegion" + - name: Return Reasons + description: > + A return reason is a possible reason a customer wants to return an item. + + + Use these API routes when implementing return creation flow in your storefront to allow customers to select their return reason. + x-associatedSchema: + $ref: "#/components/schemas/StoreReturnReason" - name: Returns description: > Customers can request to return items in their order. The admin user then @@ -151,14 +189,6 @@ tags: These API routes allows customers to create a return. x-associatedSchema: $ref: "#/components/schemas/StoreReturn" - - name: Return Reasons - description: > - A return reason is a possible reason a customer wants to return an item. - - - Use these API routes when implementing return creation flow in your storefront to allow customers to select their return reason. - x-associatedSchema: - $ref: "#/components/schemas/StoreReturnReason" - name: Shipping Options description: > A shipping option is a way of shipping an item to or from the customer. @@ -173,6 +203,20 @@ tags: url: https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: "#/components/schemas/StoreShippingOption" + - name: Store Credit Accounts + x-associatedSchema: + description: > + A store credit account is a way for customers to manage their store credit balance. + Customers can use their store credit to pay for orders, and view their store credit balance. + + These API routes allow customers to view their store credit accounts. + + + + Store Credit Accounts are only available for Cloud users using the [Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin). + + + $ref: "#/components/schemas/StoreStoreCreditAccount" servers: - url: http://localhost:9000 - url: https://api.medusajs.com diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards.ts b/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards.ts new file mode 100644 index 0000000000..68b423c37f --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards.ts @@ -0,0 +1,373 @@ +/** + * @oas [get] /admin/gift-cards + * operationId: GetGiftCards + * summary: List Gift Cards + * description: Retrieve a list of 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: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: The gift card's ID. + * - type: array + * description: The gift card's ID. + * items: + * type: string + * title: id + * description: The id's ID. + * - name: customer_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: Filter by a customer ID to retrieve their gift cards. + * - type: array + * description: Filter by customer IDs to retrieve their gift cards. + * items: + * type: string + * title: customer_id + * description: A customer ID. + * - name: created_at + * in: query + * description: Filter by a gift card's creation date. + * required: false + * schema: + * type: object + * description: Filter by a gift card's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a gift card's update date. + * required: false + * schema: + * type: object + * description: Filter by a gift card's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - 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 + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/gift-cards' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Gift Cards + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminGiftCardsResponse" + * "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" + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards_[id].ts new file mode 100644 index 0000000000..b7e7ac15e0 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_gift-cards_[id].ts @@ -0,0 +1,65 @@ +/** + * @oas [get] /admin/gift-cards/{id} + * operationId: GetGiftCardsId + * summary: Get a Gift Card + * description: Retrieve a gift card by its ID. You can expand the gift card's relations or select the fields that should be returned. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The gift card's ID. + * required: true + * schema: + * type: string + * - 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/gift-cards/{id}' \ + * -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": + * $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" + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts.ts b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts.ts new file mode 100644 index 0000000000..7b4d005f07 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts.ts @@ -0,0 +1,413 @@ +/** + * @oas [get] /admin/store-credit-accounts + * operationId: GetStoreCreditAccounts + * summary: List Store Credit Accounts + * description: Retrieve a list of store credit accounts. The store credit accounts can be filtered by fields such as `id`. The store credit accounts can also be sorted or paginated. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - 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. + * The fields and relations to retrieve separated by commas. + * + * Learn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + * 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: id + * in: query + * description: Filter by the store credit account's ID. + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by a store credit account ID. + * - type: array + * description: Filter by store credit account IDs. + * items: + * type: string + * title: id + * description: A store credit account ID. + * - name: customer_id + * in: query + * description: Filter by customer ID(s) to retrieve their store credit accounts. + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: Filter by a customer ID to retrieve their store credit accounts. + * - type: array + * description: Filter by customer ID(s) to retrieve their store credit accounts. + * items: + * type: string + * title: customer_id + * description: A customer ID. + * - name: transaction_group_id + * in: query + * description: Filter by the associated transaction group's ID. + * required: false + * schema: + * oneOf: + * - type: string + * title: transaction_group_id + * description: Filter by the associated transaction group ID. + * - type: array + * description: Filter by transaction group IDs. + * items: + * type: string + * title: transaction_group_id + * description: A transaction group ID. + * - name: currency_code + * in: query + * description: Filter by currency code(s) to retrieve store credit accounts in specific currencies. + * required: false + * schema: + * oneOf: + * - type: string + * title: currency_code + * description: Filter by a currency code to retrieve store credit accounts in that currency. + * example: usd + * - type: array + * description: Filter by currency codes to retrieve store credit accounts in specific currencies. + * items: + * type: string + * title: currency_code + * description: Filter by a currency code to retrieve store credit accounts in that currency. + * example: usd + * - name: created_at + * in: query + * description: Filter by a store credit account's creation date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a store credit account's update date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: $and + * in: query + * description: An array of filters to apply on the entity, where each item in the array is joined with an "and" condition. + * 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: An array of filters to apply on the entity, where each item in the array is joined with an "or" condition. + * 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: 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/store-credit-accounts' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminStoreCreditAccountsResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id].ts new file mode 100644 index 0000000000..f80d8999bc --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id].ts @@ -0,0 +1,419 @@ +/** + * @oas [get] /admin/store-credit-accounts/{id} + * operationId: GetStoreCreditAccountsId + * summary: Get a Store Credit Account + * description: Retrieve a store credit account by its ID. You can expand the store credit account's relations or select the fields that should be returned. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The store credit account's ID. + * required: true + * schema: + * type: string + * - 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. + * The fields and relations to retrieve separated by commas. + * + * Learn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations). + * 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: id + * in: query + * description: Filter by the store credit account's ID. + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by a store credit account ID. + * - type: array + * description: Filter by store credit account IDs. + * items: + * type: string + * title: id + * description: A store credit account ID. + * - name: customer_id + * in: query + * description: Filter by customer ID(s) to retrieve their store credit accounts. + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: Filter by a customer ID to retrieve their store credit accounts. + * - type: array + * description: Filter by customer ID(s) to retrieve their store credit accounts. + * items: + * type: string + * title: customer_id + * description: A customer ID. + * - name: transaction_group_id + * in: query + * description: Filter by the associated transaction group's ID. + * required: false + * schema: + * oneOf: + * - type: string + * title: transaction_group_id + * description: Filter by the associated transaction group ID. + * - type: array + * description: Filter by transaction group IDs. + * items: + * type: string + * title: transaction_group_id + * description: A transaction group ID. + * - name: currency_code + * in: query + * description: Filter by currency code(s) to retrieve store credit accounts in specific currencies. + * required: false + * schema: + * oneOf: + * - type: string + * title: currency_code + * description: Filter by a currency code to retrieve store credit accounts in that currency. + * example: usd + * - type: array + * description: Filter by currency codes to retrieve store credit accounts in specific currencies. + * items: + * type: string + * title: currency_code + * description: Filter by a currency code to retrieve store credit accounts in that currency. + * example: usd + * - name: created_at + * in: query + * description: Filter by a store credit account's creation date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a store credit account's update date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: $and + * in: query + * description: An array of filters to apply on the entity, where each item in the array is joined with an "and" condition. + * 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: An array of filters to apply on the entity, where each item in the array is joined with an "or" condition. + * 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: 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/store-credit-accounts/{id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminStoreCreditAccountResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id]_transactions.ts b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id]_transactions.ts new file mode 100644 index 0000000000..a15c2e7b67 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_store-credit-accounts_[id]_transactions.ts @@ -0,0 +1,388 @@ +/** + * @oas [get] /admin/store-credit-accounts/{id}/transactions + * operationId: GetStoreCreditAccountsIdTransactions + * summary: List Transactions + * description: Retrieve a list of transactions in a store credit account. The transactions can be filtered by fields like FILTER FIELDS. The transactions can also be paginated. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The store credit account's ID. + * required: true + * schema: + * type: string + * - name: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by a transaction ID. + * - type: array + * description: Filter by transaction IDs. + * items: + * type: string + * title: id + * description: A transaction ID. + * - name: transaction_group_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: transaction_group_id + * description: Filter by a transaction group ID. + * - type: array + * description: Filter by transaction group IDs. + * items: + * type: string + * title: transaction_group_id + * description: A transaction group ID. + * - name: created_at + * in: query + * description: Filter by a transaction's creation date. + * required: false + * schema: + * type: object + * description: Filter by a transaction's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a transaction's update date. + * required: false + * schema: + * type: object + * description: Filter by a transaction's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - 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: q + * in: query + * description: Search query to filter the transactions by their searchable fields. + * required: false + * schema: + * type: string + * title: q + * description: Search query to filter the transactions by their searchable fields. + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/store-credit-accounts/{id}/transactions' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminTransactionsResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_transaction-groups.ts b/www/utils/generated/oas-output/operations/admin/get_admin_transaction-groups.ts new file mode 100644 index 0000000000..4857c0c8bf --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_transaction-groups.ts @@ -0,0 +1,374 @@ +/** + * @oas [get] /admin/transaction-groups + * operationId: GetTransactionGroups + * summary: List Transaction Groups + * description: Retrieve a list of transaction groups. The transaction groups can be filtered by fields such as `id`. The transaction groups can also be sorted or paginated. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by the transaction group's ID. + * - type: array + * description: Filter by the transaction group IDs. + * items: + * type: string + * title: id + * description: A transaction group's ID. + * - name: code + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: code + * description: Filter by the transaction group's code. + * - type: array + * description: Filter by the transaction group codes. + * items: + * type: string + * title: code + * description: A transaction group's code. + * - name: created_at + * in: query + * description: Filter by a transaction group's creation date. + * required: false + * schema: + * type: object + * description: Filter by a transaction group's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a transaction group's update date. + * required: false + * schema: + * type: object + * description: Filter by a transaction group's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - 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 + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/transaction-groups' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Transaction Groups + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminTransactionGroupsResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards.ts b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards.ts new file mode 100644 index 0000000000..b41e60faa3 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards.ts @@ -0,0 +1,77 @@ +/** + * @oas [post] /admin/gift-cards + * operationId: PostGiftCards + * summary: Create Gift Card + * description: Create a gift card. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminCreateGiftCardParams" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/gift-cards' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "code": "{value}", + * "value": 19, + * "currency_code": "bwp", + * "expires_at": "2025-07-20T15:47:23.951Z", + * "reference_id": "{value}", + * "reference": "{value}", + * "line_item_id": "{value}", + * "customer_id": "{value}", + * "metadata": {} + * }' + * tags: + * - Gift Cards + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminGiftCardResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id].ts new file mode 100644 index 0000000000..699858d15b --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id].ts @@ -0,0 +1,71 @@ +/** + * @oas [post] /admin/gift-cards/{id} + * operationId: PostGiftCardsId + * summary: Update a Gift Card + * description: Update a gift card's details. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The gift card's ID. + * required: true + * schema: + * type: string + * - 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateGiftCardParams" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/gift-cards/{id}' \ + * -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": + * $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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_redeem.ts b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_redeem.ts new file mode 100644 index 0000000000..2776f41dd6 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_redeem.ts @@ -0,0 +1,75 @@ +/** + * @oas [post] /admin/gift-cards/{id}/redeem + * operationId: PostGiftCardsIdRedeem + * summary: Redeem a Gift Card + * description: Redeem a gift card and add it to the customer's store credit account. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The gift card's ID. + * required: true + * schema: + * type: string + * - 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminRedeemGiftCard" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/gift-cards/{id}/redeem' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "customer_id": "{value}" + * }' + * tags: + * - Gift Cards + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminGiftCardResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_transfer.ts b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_transfer.ts new file mode 100644 index 0000000000..a491410151 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_gift-cards_[id]_transfer.ts @@ -0,0 +1,75 @@ +/** + * @oas [post] /admin/gift-cards/{id}/transfer + * operationId: PostGiftCardsIdTransfer + * summary: Transfer Gift Card + * description: Transfer a gift card to another customer. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The gift card's ID. + * required: true + * schema: + * type: string + * - 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" + * security: + * - 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}" + * }' + * tags: + * - Gift Cards + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminGiftCardResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_store-credit-accounts.ts b/www/utils/generated/oas-output/operations/admin/post_admin_store-credit-accounts.ts new file mode 100644 index 0000000000..ec692d101a --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_store-credit-accounts.ts @@ -0,0 +1,70 @@ +/** + * @oas [post] /admin/store-credit-accounts + * operationId: PostStoreCreditAccounts + * summary: Create Store Credit Account + * description: Create a store credit account. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminCreateStoreCreditAccount" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/store-credit-accounts' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "currency_code": "nzd", + * "customer_id": "{value}" + * }' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminStoreCreditAccountResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_gift-cards.ts b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_gift-cards.ts new file mode 100644 index 0000000000..4783d683a9 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_gift-cards.ts @@ -0,0 +1,80 @@ +/** + * @oas [delete] /store/carts/{id}/gift-cards + * operationId: DeleteCartsIdGiftCards + * summary: Remove Gift Card from Cart + * x-sidebar-summary: Remove Gift Card + * description: Remove a Gift Card from a cart. + * x-authenticated: false + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The cart'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/StoreRemoveGiftCardFromCart" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/store/carts/{id}/gift-cards' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "code": "{value}" + * }' + * tags: + * - Carts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreCartResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/get_store_gift-cards.ts b/www/utils/generated/oas-output/operations/store/get_store_gift-cards.ts new file mode 100644 index 0000000000..d9017a0d9f --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/get_store_gift-cards.ts @@ -0,0 +1,144 @@ +/** + * @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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/get_store_gift-cards_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_gift-cards_[id].ts new file mode 100644 index 0000000000..fc3d919d1d --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/get_store_gift-cards_[id].ts @@ -0,0 +1,70 @@ +/** + * @oas [get] /store/gift-cards/{id} + * operationId: GetGiftCardsId + * summary: Get Customer's 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 + * 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" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/store/gift-cards/{id}' \ + * -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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts.ts b/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts.ts new file mode 100644 index 0000000000..b2a8bafbe5 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts.ts @@ -0,0 +1,363 @@ +/** + * @oas [get] /store/store-credit-accounts + * operationId: GetStoreCreditAccounts + * summary: List Customer's Store Credit Accounts + * x-sidebar-summary: List Store Credit Accounts + * description: Retrieve the logged-in customer's store credit accounts. The store credit accounts can be filtered by fields such as `id`. The store credit accounts 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: currency_code + * in: query + * description: Filter by the store credit account's currency code. + * required: false + * schema: + * type: string + * title: currency_code + * description: Filter by the store credit account's currency code. + * example: usd + * - name: created_at + * in: query + * description: Filter by a store credit account's creation date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's creation date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a store credit account's update date. + * required: false + * schema: + * type: object + * description: Filter by a store credit account's update date. + * properties: + * $and: + * 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 + * $or: + * 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 + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - 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 + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/store/store-credit-accounts' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreStoreCreditAccountsResponse" + * "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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts_[id].ts new file mode 100644 index 0000000000..5742782bbf --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/get_store_store-credit-accounts_[id].ts @@ -0,0 +1,74 @@ +/** + * @oas [get] /store/store-credit-accounts/{id} + * operationId: GetStoreCreditAccountsId + * summary: Get Customer's Store Credit Account + * x-sidebar-summary: Get Store Credit Account + * description: Retrieve logged-in customer's store credit account by its ID. You can expand the store credit account's relations or select the fields that should be returned. + * x-authenticated: true + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The store credit account'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" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/store/store-credit-accounts/{id}' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * tags: + * - Store Credit Accounts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreStoreCreditAccountResponse" + * "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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_gift-cards.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_gift-cards.ts new file mode 100644 index 0000000000..cbe0f115e2 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_gift-cards.ts @@ -0,0 +1,80 @@ +/** + * @oas [post] /store/carts/{id}/gift-cards + * operationId: PostCartsIdGiftCards + * summary: Add Gift Card to Cart + * x-sidebar-summary: Add Gift Card + * description: Add a Gift Card to a cart + * x-authenticated: false + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The cart'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/StoreAddGiftCardToCart" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/carts/{id}/gift-cards' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "code": "{value}" + * }' + * tags: + * - Carts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreCartResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_store-credits.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_store-credits.ts new file mode 100644 index 0000000000..2e675f0f24 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_store-credits.ts @@ -0,0 +1,80 @@ +/** + * @oas [post] /store/carts/{id}/store-credits + * operationId: PostCartsIdStoreCredits + * summary: Add Store Credit to Cart + * x-sidebar-summary: Add Store Credit + * description: Add a Store Credit to a cart + * x-authenticated: false + * x-ignoreCleanup: true + * parameters: + * - name: id + * in: path + * description: The cart'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/StoreAddStoreCreditsToCart" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/carts/{id}/store-credits' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "amount": 48 + * }' + * tags: + * - Carts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreCartResponse" + * "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" + * + * x-badges: + * - text: "Cloud" + * description: > + * This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_accept.ts b/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_accept.ts new file mode 100644 index 0000000000..53c0314af8 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_accept.ts @@ -0,0 +1,74 @@ +/** + * @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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_reject.ts b/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_reject.ts new file mode 100644 index 0000000000..e8b6056b9d --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_gift-card-invitations_[code]_reject.ts @@ -0,0 +1,74 @@ +/** + * @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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_invitation.ts b/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_invitation.ts new file mode 100644 index 0000000000..e54c0940f1 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_invitation.ts @@ -0,0 +1,83 @@ +/** + * @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). +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_redeem.ts b/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_redeem.ts new file mode 100644 index 0000000000..6d0a20be5c --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_gift-cards_[id]_redeem.ts @@ -0,0 +1,74 @@ +/** + * @oas [post] /store/gift-cards/{id}/redeem + * operationId: PostGiftCardsIdRedeem + * summary: Redeem Customer's Gift Card + * x-sidebar-summary: Redeem Gift Card + * description: Redeem the logged-in customer's gift card + * 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" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/gift-cards/{id}/redeem' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * 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). +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateGiftCardParams.ts b/www/utils/generated/oas-output/schemas/AdminCreateGiftCardParams.ts new file mode 100644 index 0000000000..971704a155 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateGiftCardParams.ts @@ -0,0 +1,56 @@ +/** + * @schema AdminCreateGiftCardParams + * type: object + * description: The details of the gift card to create. + * x-schemaName: AdminCreateGiftCardParams + * required: + * - code + * - value + * - currency_code + * - expires_at + * - reference_id + * - reference + * - line_item_id + * - customer_id + * - metadata + * properties: + * code: + * type: string + * title: code + * description: The gift card's code. + * value: + * type: number + * title: value + * description: The gift card's amount. + * example: 20 + * currency_code: + * type: string + * title: currency_code + * description: The gift card's currency code. + * example: usd + * expires_at: + * type: string + * title: expires_at + * description: The date the gift card expires at. + * reference_id: + * type: string + * title: reference_id + * description: The gift card's reference ID. + * reference: + * type: string + * title: reference + * description: The gift card's reference. + * line_item_id: + * type: string + * title: line_item_id + * description: The ID of the line item associated with the gift card. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer associated with the gift card. + * metadata: + * type: object + * description: The gift card's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateStoreCreditAccount.ts b/www/utils/generated/oas-output/schemas/AdminCreateStoreCreditAccount.ts new file mode 100644 index 0000000000..5a13545e6c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateStoreCreditAccount.ts @@ -0,0 +1,24 @@ +/** + * @schema AdminCreateStoreCreditAccount + * type: object + * description: The details of the store credit account to create. + * x-schemaName: AdminCreateStoreCreditAccount + * required: + * - currency_code + * - customer_id + * properties: + * currency_code: + * type: string + * title: currency_code + * description: The store credit account's currency code. + * example: usd + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that the store credit account belongs to. + * metadata: + * type: object + * description: The store credit account's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminGiftCard.ts b/www/utils/generated/oas-output/schemas/AdminGiftCard.ts new file mode 100644 index 0000000000..a71c0bed4f --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminGiftCard.ts @@ -0,0 +1,84 @@ +/** + * @schema AdminGiftCard + * type: object + * description: The gift card's details. + * x-schemaName: AdminGiftCard + * required: + * - line_item + * - customer + * - invitation + * - id + * - code + * - status + * - value + * - currency_code + * - customer_id + * - reference_id + * - note + * - reference + * - expires_at + * - created_at + * - updated_at + * properties: + * line_item: + * $ref: "#/components/schemas/AdminOrderLineItem" + * customer: + * $ref: "#/components/schemas/AdminCustomer" + * id: + * type: string + * title: id + * description: The gift card's ID. + * code: + * type: string + * title: code + * description: The gift card's code. + * status: + * type: string + * description: The gift card's status. + * enum: + * - pending + * - redeemed + * value: + * 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 associated with the gift card. + * reference_id: + * type: string + * title: reference_id + * description: The gift card's reference ID. + * note: + * type: string + * title: note + * description: The gift card's note. + * 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 at. + * invitation: + * $ref: "#/components/schemas/AdminGiftCardInvitation" + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the gift card was created at. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the gift card was updated at. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminGiftCardInvitation.ts b/www/utils/generated/oas-output/schemas/AdminGiftCardInvitation.ts new file mode 100644 index 0000000000..3e203b8dd7 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminGiftCardInvitation.ts @@ -0,0 +1,42 @@ +/** + * @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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminGiftCardResponse.ts b/www/utils/generated/oas-output/schemas/AdminGiftCardResponse.ts new file mode 100644 index 0000000000..5b6a5b2734 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminGiftCardResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema AdminGiftCardResponse + * type: object + * description: The gift card's details. + * x-schemaName: AdminGiftCardResponse + * required: + * - gift_card + * properties: + * gift_card: + * $ref: "#/components/schemas/AdminGiftCard" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminGiftCardsResponse.ts b/www/utils/generated/oas-output/schemas/AdminGiftCardsResponse.ts new file mode 100644 index 0000000000..560a955308 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminGiftCardsResponse.ts @@ -0,0 +1,31 @@ +/** + * @schema AdminGiftCardsResponse + * type: object + * description: The paginated list of gift cards. + * x-schemaName: AdminGiftCardsResponse + * required: + * - limit + * - offset + * - count + * - gift_cards + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of gift cards to return. + * offset: + * type: number + * title: offset + * description: The number of gift cards to skip before retrieving the results. + * count: + * type: number + * title: count + * description: The total number of gift cards available. + * gift_cards: + * type: array + * description: The list of gift cards. + * items: + * $ref: "#/components/schemas/AdminGiftCard" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminRedeemGiftCard.ts b/www/utils/generated/oas-output/schemas/AdminRedeemGiftCard.ts new file mode 100644 index 0000000000..651fdf6160 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminRedeemGiftCard.ts @@ -0,0 +1,15 @@ +/** + * @schema AdminRedeemGiftCard + * type: object + * description: The details of the gift card to redeem. + * x-schemaName: AdminRedeemGiftCard + * required: + * - customer_id + * properties: + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that the gift card belongs to. The gift card's value will be added to the customer's store credit account. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminStoreCreditAccount.ts b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccount.ts new file mode 100644 index 0000000000..be78e18b9b --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccount.ts @@ -0,0 +1,66 @@ +/** + * @schema AdminStoreCreditAccount + * type: object + * description: The store credit account's details. + * x-schemaName: AdminStoreCreditAccount + * required: + * - customer + * - transaction_groups + * - id + * - customer_id + * - currency_code + * - credits + * - debits + * - balance + * - metadata + * - created_at + * - updated_at + * properties: + * customer: + * $ref: "#/components/schemas/AdminCustomer" + * id: + * type: string + * title: id + * description: The store credit account's ID. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that the store credit account belongs to. + * currency_code: + * type: string + * title: currency_code + * description: The store credit account's currency code. + * example: usd + * credits: + * type: number + * title: credits + * description: The account's credits. + * debits: + * type: number + * title: debits + * description: The account's debits. + * balance: + * type: number + * title: balance + * description: The account's balance. + * transaction_groups: + * type: array + * description: The store credit account's transaction groups. + * items: + * $ref: "#/components/schemas/AdminTransactionGroup" + * metadata: + * type: object + * description: The store credit account's metadata, can hold custom key-value pairs. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the store credit account was created at. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the store credit account was updated at. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountResponse.ts b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountResponse.ts new file mode 100644 index 0000000000..4eae64063a --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema AdminStoreCreditAccountResponse + * type: object + * description: The store credit account's details. + * x-schemaName: AdminStoreCreditAccountResponse + * required: + * - store_credit_account + * properties: + * store_credit_account: + * $ref: "#/components/schemas/AdminStoreCreditAccount" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountsResponse.ts b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountsResponse.ts new file mode 100644 index 0000000000..5dbe156c0e --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminStoreCreditAccountsResponse.ts @@ -0,0 +1,31 @@ +/** + * @schema AdminStoreCreditAccountsResponse + * type: object + * description: The paginated list of store credit accounts. + * x-schemaName: AdminStoreCreditAccountsResponse + * required: + * - limit + * - offset + * - count + * - store_credit_accounts + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of store credit accounts to return. + * offset: + * type: number + * title: offset + * description: The number of store credit accounts to skip before retrieving the results. + * count: + * type: number + * title: count + * description: The total number of store credit accounts available. + * store_credit_accounts: + * type: array + * description: The list of store credit accounts. + * items: + * $ref: "#/components/schemas/AdminStoreCreditAccount" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminTransaction.ts b/www/utils/generated/oas-output/schemas/AdminTransaction.ts new file mode 100644 index 0000000000..19fb1b4d57 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransaction.ts @@ -0,0 +1,68 @@ +/** + * @schema AdminTransaction + * type: object + * description: The transaction's details. + * x-schemaName: AdminTransaction + * required: + * - account + * - id + * - account_id + * - transaction_group_id + * - type + * - amount + * - metadata + * - created_at + * - updated_at + * properties: + * id: + * type: string + * title: id + * description: The transaction's ID. + * account_id: + * type: string + * title: account_id + * description: The ID of the store credit account that the transaction belongs to. + * transaction_group_id: + * type: string + * title: transaction_group_id + * description: The ID of the transaction group that the transaction belongs to. + * type: + * type: string + * description: The transaction's type. + * enum: + * - credit + * - debit + * amount: + * type: number + * title: amount + * description: The transaction's amount. + * account: + * $ref: "#/components/schemas/AdminStoreCreditAccount" + * note: + * type: string + * title: note + * description: The transaction's note. + * reference: + * type: string + * title: reference + * description: The transaction's reference. + * reference_id: + * type: string + * title: reference_id + * description: The transaction's reference ID. + * metadata: + * type: object + * description: The transaction's metadata, can hold custom key-value pairs. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the transaction was created at. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the transaction was updated at. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminTransactionGroup.ts b/www/utils/generated/oas-output/schemas/AdminTransactionGroup.ts new file mode 100644 index 0000000000..0d38892253 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransactionGroup.ts @@ -0,0 +1,42 @@ +/** + * @schema AdminTransactionGroup + * type: object + * description: The transaction group's details. + * x-schemaName: AdminTransactionGroup + * required: + * - account + * - id + * - code + * - credits + * - debits + * - balance + * - metadata + * properties: + * id: + * type: string + * title: id + * description: The transaction group's ID. + * code: + * type: string + * title: code + * description: The transaction group's code. + * credits: + * type: number + * title: credits + * description: The transaction group's credits. + * debits: + * type: number + * title: debits + * description: The transaction group's debits. + * balance: + * type: number + * title: balance + * description: The transaction group's balance. + * account: + * $ref: "#/components/schemas/AdminStoreCreditAccount" + * metadata: + * type: object + * description: The transaction group's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminTransactionGroupsResponse.ts b/www/utils/generated/oas-output/schemas/AdminTransactionGroupsResponse.ts new file mode 100644 index 0000000000..350b528cab --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransactionGroupsResponse.ts @@ -0,0 +1,31 @@ +/** + * @schema AdminTransactionGroupsResponse + * type: object + * description: The paginated list of transaction groups. + * x-schemaName: AdminTransactionGroupsResponse + * required: + * - limit + * - offset + * - count + * - transaction_groups + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of transaction groups to return. + * offset: + * type: number + * title: offset + * description: The number of transaction groups to skip before retrieving the results. + * count: + * type: number + * title: count + * description: The total number of transaction groups available. + * transaction_groups: + * type: array + * description: The list of transaction groups. + * items: + * $ref: "#/components/schemas/AdminTransactionGroup" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminTransactionsResponse.ts b/www/utils/generated/oas-output/schemas/AdminTransactionsResponse.ts new file mode 100644 index 0000000000..99c035e1f5 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransactionsResponse.ts @@ -0,0 +1,31 @@ +/** + * @schema AdminTransactionsResponse + * type: object + * description: The paginated list of transactions. + * x-schemaName: AdminTransactionsResponse + * required: + * - limit + * - offset + * - count + * - transactions + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of transactions to return. + * offset: + * type: number + * title: offset + * description: The number of transactions to skip before retrieving the results. + * count: + * type: number + * title: count + * description: The total number of transactions available. + * transactions: + * type: array + * description: The list of transactions. + * items: + * $ref: "#/components/schemas/AdminTransaction" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminTransferGiftCard.ts b/www/utils/generated/oas-output/schemas/AdminTransferGiftCard.ts new file mode 100644 index 0000000000..9056ea7c08 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransferGiftCard.ts @@ -0,0 +1,15 @@ +/** + * @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. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateGiftCardParams.ts b/www/utils/generated/oas-output/schemas/AdminUpdateGiftCardParams.ts new file mode 100644 index 0000000000..c04a977d33 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateGiftCardParams.ts @@ -0,0 +1,39 @@ +/** + * @schema AdminUpdateGiftCardParams + * type: object + * description: The details to update in the gift card. + * x-schemaName: AdminUpdateGiftCardParams + * properties: + * status: + * type: string + * description: The gift card's status. + * enum: + * - pending + * - redeemed + * value: + * type: number + * title: value + * description: The gift card's amount. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that the gift card belongs to. + * 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 at. + * metadata: + * type: object + * description: The gift card's metadata. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreAddGiftCardToCart.ts b/www/utils/generated/oas-output/schemas/StoreAddGiftCardToCart.ts new file mode 100644 index 0000000000..24e7e1b5f8 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreAddGiftCardToCart.ts @@ -0,0 +1,15 @@ +/** + * @schema StoreAddGiftCardToCart + * type: object + * description: The details to add a gift card to the cart. + * x-schemaName: StoreAddGiftCardToCart + * required: + * - code + * properties: + * code: + * type: string + * title: code + * description: The gift card's code. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreAddStoreCreditsToCart.ts b/www/utils/generated/oas-output/schemas/StoreAddStoreCreditsToCart.ts new file mode 100644 index 0000000000..d2980f6afd --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreAddStoreCreditsToCart.ts @@ -0,0 +1,15 @@ +/** + * @schema StoreAddStoreCreditsToCart + * type: object + * description: The details to add store credits to the cart. + * x-schemaName: StoreAddStoreCreditsToCart + * required: + * - amount + * properties: + * amount: + * type: number + * title: amount + * description: The amount of store credits to add to the cart. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreCreateGiftCardInvitation.ts b/www/utils/generated/oas-output/schemas/StoreCreateGiftCardInvitation.ts new file mode 100644 index 0000000000..91a8d4b588 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCreateGiftCardInvitation.ts @@ -0,0 +1,21 @@ +/** + * @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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreGiftCard.ts b/www/utils/generated/oas-output/schemas/StoreGiftCard.ts new file mode 100644 index 0000000000..d3c8b1e66e --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreGiftCard.ts @@ -0,0 +1,84 @@ +/** + * @schema StoreGiftCard + * type: object + * description: The gift card's details. + * x-schemaName: StoreGiftCard + * required: + * - customer + * - line_item + * - invitation + * - id + * - code + * - status + * - value + * - currency_code + * - customer_id + * - reference_id + * - note + * - reference + * - expires_at + * - created_at + * - updated_at + * properties: + * customer: + * $ref: "#/components/schemas/StoreCustomer" + * code: + * type: string + * title: code + * description: The gift card's code. + * status: + * type: string + * description: The gift card's status. + * enum: + * - pending + * - redeemed + * value: + * type: number + * title: value + * description: The gift card's amount. + * 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. + * reference: + * type: string + * title: reference + * description: The gift card's reference. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the gift card was created. + * updated_at: + * type: string + * 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" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreGiftCardInvitation.ts b/www/utils/generated/oas-output/schemas/StoreGiftCardInvitation.ts new file mode 100644 index 0000000000..e5f5912ad4 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreGiftCardInvitation.ts @@ -0,0 +1,29 @@ +/** + * @schema StoreGiftCardInvitation + * type: object + * description: The gift card invitation's details. + * x-schemaName: StoreGiftCardInvitation + * required: + * - id + * - email + * - status + * - gift_card + * properties: + * id: + * type: string + * title: id + * description: The gift card invitation's ID. + * email: + * type: string + * title: email + * description: The gift card invitation's email. + * format: email + * status: + * type: string + * title: status + * description: The gift card invitation's status. + * gift_card: + * $ref: "#/components/schemas/StoreGiftCard" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreGiftCardInvitationResponse.ts b/www/utils/generated/oas-output/schemas/StoreGiftCardInvitationResponse.ts new file mode 100644 index 0000000000..367c1e3c07 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreGiftCardInvitationResponse.ts @@ -0,0 +1,13 @@ +/** + * @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" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreGiftCardResponse.ts b/www/utils/generated/oas-output/schemas/StoreGiftCardResponse.ts new file mode 100644 index 0000000000..6b0f674dfe --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreGiftCardResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema StoreGiftCardResponse + * type: object + * description: The gift card's details. + * x-schemaName: StoreGiftCardResponse + * required: + * - gift_card + * properties: + * gift_card: + * $ref: "#/components/schemas/StoreGiftCard" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreRemoveGiftCardFromCart.ts b/www/utils/generated/oas-output/schemas/StoreRemoveGiftCardFromCart.ts new file mode 100644 index 0000000000..05b2bb2e93 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreRemoveGiftCardFromCart.ts @@ -0,0 +1,15 @@ +/** + * @schema StoreRemoveGiftCardFromCart + * type: object + * description: The details to remove a gift card from the cart. + * x-schemaName: StoreRemoveGiftCardFromCart + * required: + * - code + * properties: + * code: + * type: string + * title: code + * description: The gift card code to remove from the cart. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreStoreCreditAccount.ts b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccount.ts new file mode 100644 index 0000000000..6d6b752231 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccount.ts @@ -0,0 +1,66 @@ +/** + * @schema StoreStoreCreditAccount + * type: object + * description: The store credit account's details. + * x-schemaName: StoreStoreCreditAccount + * required: + * - customer + * - transaction_groups + * - id + * - customer_id + * - currency_code + * - credits + * - debits + * - balance + * - metadata + * - created_at + * - updated_at + * properties: + * customer: + * $ref: "#/components/schemas/StoreCustomer" + * id: + * type: string + * title: id + * description: The store credit account's ID. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that the store credit account belongs to. + * currency_code: + * type: string + * title: currency_code + * description: The store credit account's currency code. + * example: usd + * credits: + * type: number + * title: credits + * description: The account's credits. + * debits: + * type: number + * title: debits + * description: The account's debits. + * balance: + * type: number + * title: balance + * description: The store credit account's balance. + * transaction_groups: + * type: array + * description: The store credit account's transaction groups. + * items: + * $ref: "#/components/schemas/StoreTransactionGroup" + * metadata: + * type: object + * description: The store credit account's metadata, can hold custom key-value pairs. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the store credit account was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the store credit account was updated. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountResponse.ts b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountResponse.ts new file mode 100644 index 0000000000..45124b395b --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema StoreStoreCreditAccountResponse + * type: object + * description: The store credit account's details. + * x-schemaName: StoreStoreCreditAccountResponse + * required: + * - store_credit_account + * properties: + * store_credit_account: + * $ref: "#/components/schemas/StoreStoreCreditAccount" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountsResponse.ts b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountsResponse.ts new file mode 100644 index 0000000000..d90ac31722 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreStoreCreditAccountsResponse.ts @@ -0,0 +1,31 @@ +/** + * @schema StoreStoreCreditAccountsResponse + * type: object + * description: The paginated list of store credit accounts. + * x-schemaName: StoreStoreCreditAccountsResponse + * required: + * - limit + * - offset + * - count + * - store_credit_accounts + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of store credit accounts to return. + * offset: + * type: number + * title: offset + * description: The number of store credit accounts to skip before retrieving the results. + * count: + * type: number + * title: count + * description: The total number of store credit accounts available. + * store_credit_accounts: + * type: array + * description: The list of store credit accounts. + * items: + * $ref: "#/components/schemas/StoreStoreCreditAccount" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreTransactionGroup.ts b/www/utils/generated/oas-output/schemas/StoreTransactionGroup.ts new file mode 100644 index 0000000000..6213a2faf2 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreTransactionGroup.ts @@ -0,0 +1,42 @@ +/** + * @schema StoreTransactionGroup + * type: object + * description: The transaction group's details. + * required: + * - account + * - id + * - code + * - credits + * - debits + * - balance + * - metadata + * properties: + * id: + * type: string + * title: id + * description: The transaction group's ID. + * code: + * type: string + * title: code + * description: The transaction group's code. + * credits: + * type: number + * title: credits + * description: The transaction group's credits. + * debits: + * type: number + * title: debits + * description: The transaction group's debits. + * balance: + * type: number + * title: balance + * description: The transaction group's balance. + * account: + * $ref: "#/components/schemas/StoreStoreCreditAccount" + * metadata: + * type: object + * description: The transaction group's metadata, can hold custom key-value pairs. + * x-schemaName: StoreTransactionGroup + * +*/ + diff --git a/www/utils/packages/docs-generator/src/classes/generators/oas.ts b/www/utils/packages/docs-generator/src/classes/generators/oas.ts index 9864bb837a..0b1f996b25 100644 --- a/www/utils/packages/docs-generator/src/classes/generators/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/generators/oas.ts @@ -83,7 +83,7 @@ class OasGenerator extends AbstractGenerator { isFileIncluded(fileName: string): boolean { return ( super.isFileIncluded(fileName) && - minimatch(getBasePath(fileName), "packages/medusa/**/api**/**", { + minimatch(getBasePath(fileName), "**/api**/**", { matchBase: true, }) ) diff --git a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts index 0919097520..e945d1cbe3 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts @@ -121,6 +121,14 @@ class OasKindGenerator extends FunctionKindGenerator { requiresAuthentication: true, allowedAuthTypes: ["cookie_auth", "jwt_token"], }, + { + startsWith: "store/gift-card", + requiresAuthentication: true, + }, + { + startsWith: "store/store-credit-accounts", + requiresAuthentication: true, + }, ] readonly RESPONSE_TYPE_NAMES = ["MedusaResponse"] readonly FIELD_QUERY_PARAMS = ["fields", "expand"] diff --git a/www/utils/packages/docs-generator/src/commands/clean-oas.ts b/www/utils/packages/docs-generator/src/commands/clean-oas.ts index 3e511ab44d..2007d77f1c 100644 --- a/www/utils/packages/docs-generator/src/commands/clean-oas.ts +++ b/www/utils/packages/docs-generator/src/commands/clean-oas.ts @@ -116,56 +116,58 @@ export default async function () { "route.ts" ) - // check if a route exists for the path - if (!existsSync(sourceFilePath)) { - // remove OAS file - rmSync(filePath, { - force: true, - }) - return - } - - // check if method exists in the file - let exists = false - const program = ts.createProgram([sourceFilePath], {}) - - const oasKindGenerator = new OasKindGenerator({ - checker: program.getTypeChecker(), - generatorEventManager: new GeneratorEventManager(), - additionalOptions: {}, - }) - const sourceFile = program.getSourceFile(sourceFilePath) - - if (!sourceFile) { - // remove file - rmSync(filePath, { - force: true, - }) - return - } - - const visitChildren = (node: ts.Node) => { - if ( - !exists && - oasKindGenerator.isAllowed(node) && - oasKindGenerator.canDocumentNode(node) && - oasKindGenerator.getHTTPMethodName(node) === - matchOasPrefix.groups!.method - ) { - exists = true - } else if (!exists) { - ts.forEachChild(node, visitChildren) + if (!oas["x-ignoreCleanup"]) { + // check if a route exists for the path + if (!existsSync(sourceFilePath)) { + // remove OAS file + rmSync(filePath, { + force: true, + }) + return } - } - ts.forEachChild(sourceFile, visitChildren) + // check if method exists in the file + let exists = false + const program = ts.createProgram([sourceFilePath], {}) - if (!exists) { - // remove OAS file - rmSync(filePath, { - force: true, + const oasKindGenerator = new OasKindGenerator({ + checker: program.getTypeChecker(), + generatorEventManager: new GeneratorEventManager(), + additionalOptions: {}, }) - return + const sourceFile = program.getSourceFile(sourceFilePath) + + if (!sourceFile) { + // remove file + rmSync(filePath, { + force: true, + }) + return + } + + const visitChildren = (node: ts.Node) => { + if ( + !exists && + oasKindGenerator.isAllowed(node) && + oasKindGenerator.canDocumentNode(node) && + oasKindGenerator.getHTTPMethodName(node) === + matchOasPrefix.groups!.method + ) { + exists = true + } else if (!exists) { + ts.forEachChild(node, visitChildren) + } + } + + ts.forEachChild(sourceFile, visitChildren) + + if (!exists) { + // remove OAS file + rmSync(filePath, { + force: true, + }) + return + } } // collect tags diff --git a/www/utils/packages/docs-generator/src/types/index.d.ts b/www/utils/packages/docs-generator/src/types/index.d.ts index 902c0d157e..207309b289 100644 --- a/www/utils/packages/docs-generator/src/types/index.d.ts +++ b/www/utils/packages/docs-generator/src/types/index.d.ts @@ -14,6 +14,7 @@ export declare type OpenApiOperation = Partial & { "x-deprecated_message"?: string "x-version"?: string "x-featureFlag"?: string + "x-ignoreCleanup"?: boolean } export declare type CommonCliOptions = { diff --git a/www/utils/packages/docs-generator/src/utils/get-base-path.ts b/www/utils/packages/docs-generator/src/utils/get-base-path.ts index e030a89802..ab85839c12 100644 --- a/www/utils/packages/docs-generator/src/utils/get-base-path.ts +++ b/www/utils/packages/docs-generator/src/utils/get-base-path.ts @@ -1,15 +1,9 @@ /** - * Retrieve the pathname of a file without the relative part before `packages/` + * Retrieve the pathname of a file without the relative part * * @param fileName - The file name/path * @returns The path without the relative part. */ export default function getBasePath(fileName: string) { - let basePath = fileName - const packageIndex = fileName.indexOf("packages/") - if (packageIndex) { - basePath = basePath.substring(packageIndex) - } - - return basePath + return fileName.substring(fileName.lastIndexOf("../") + 3) }