docs: add loyalty plugin routes to OAS (#12811)

* generated OAS

* remove unused schemas

* generated specs

* add cloud badge for routes

* add to loyalty plugin page

* allow clicking the tooltip
This commit is contained in:
Shahed Nasser
2025-06-24 19:17:55 +03:00
committed by GitHub
parent 3826bde591
commit 93cf79cb0f
164 changed files with 16001 additions and 88 deletions

View File

@@ -141,6 +141,14 @@ decorators:
- Order
AdminProductVariantInventoryItemLink:
- AdminProductVariant
AdminGiftCardInvitation:
- AdminGiftCard
AdminTransactionGroup:
- AdminStoreCreditAccount
StoreGiftCard:
- StoreGiftCardInvitation
StoreTransactionGroup:
- StoreStoreCreditAccount
theme:
openapi:
theme:

View File

@@ -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 = ({
</Badge>
</Tooltip>
)}
{operation["x-badges"]?.map((badge, index) => (
<Tooltip
key={index}
tooltipChildren={
<MarkdownContent
allowedElements={["a", "strong", "em", "br"]}
unwrapDisallowed={true}
>
{badge.description}
</MarkdownContent>
}
clickable={true}
>
<Badge variant={badge.variant || "neutral"} className="ml-0.5">
{badge.text}
</Badge>
</Tooltip>
))}
</H2>
<div className="my-1">
<MDXContentClient content={operation.description} />

View File

@@ -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",

View File

@@ -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"

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/gift-cards' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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": {}
}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/gift-cards/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/gift-cards/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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}"
}'

View File

@@ -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}"
}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/store-credit-accounts' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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}"
}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/store-credit-accounts/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/store-credit-accounts/{id}/transactions' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/transaction-groups' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -0,0 +1,8 @@
type: object
description: The gift card's details.
x-schemaName: AdminGiftCardResponse
required:
- gift_card
properties:
gift_card:
$ref: ./AdminGiftCard.yaml

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,8 @@
type: object
description: The gift card's details.
x-schemaName: StoreGiftCardResponse
required:
- gift_card
properties:
gift_card:
$ref: ./StoreGiftCard.yaml

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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.
<Note>
Gift Card routes are only available for Cloud users using the [Loyalty
Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
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.
<Note>
Store Credit Account routes are only available for Cloud users using the
[Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
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.
<Note>
Transaction Group routes are only available for Cloud users using the
[Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
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}:

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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}"
}'

View File

@@ -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}"
}'

View File

@@ -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
}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/store/gift-card-invitations/{code}/accept' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/store/gift-card-invitations/{code}/reject' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/store/gift-cards' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/store/gift-cards/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -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"
}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/store/gift-cards/{id}/redeem' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/store/store-credit-accounts' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/store/store-credit-accounts/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -0,0 +1,8 @@
type: object
description: The gift card's details.
x-schemaName: AdminGiftCardResponse
required:
- gift_card
properties:
gift_card:
$ref: ./AdminGiftCard.yaml

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,8 @@
type: object
description: The gift card's details.
x-schemaName: StoreGiftCardResponse
required:
- gift_card
properties:
gift_card:
$ref: ./StoreGiftCard.yaml

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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.
<Note>
Gift Card Invitations are only available for Cloud users using the
[Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
x-associatedSchema:
$ref: ./components/schemas/StoreGiftCardInvitation.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.
<Note>
Gift Cards are only available for Cloud users using the [Loyalty
Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
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.
<Note>
Store Credit Accounts are only available for Cloud users using the
[Loyalty Plugin](https://docs.medusajs.com/cloud/loyalty-plugin).
</Note>
$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:

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

View File

@@ -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).

Some files were not shown because too many files have changed in this diff Show More