api-ref: custom API reference (#4770)
* initialized next.js project * finished markdown sections * added operation schema component * change page metadata * eslint fixes * fixes related to deployment * added response schema * resolve max stack issue * support for different property types * added support for property types * added loading for components * added more loading * type fixes * added oneOf type * removed console * fix replace with push * refactored everything * use static content for description * fixes and improvements * added code examples section * fix path name * optimizations * fixed tag navigation * add support for admin and store references * general enhancements * optimizations and fixes * fixes and enhancements * added search bar * loading enhancements * added loading * added code blocks * added margin top * add empty response text * fixed oneOf parameters * added path and query parameters * general fixes * added base path env variable * small fix for arrays * enhancements * design enhancements * general enhancements * fix isRequired * added enum values * enhancements * general fixes * general fixes * changed oas generation script * additions to the introduction section * added copy button for code + other enhancements * fix response code block * fix metadata * formatted store introduction * move sidebar logic to Tags component * added test env variables * fix code block bug * added loading animation * added expand param + loading * enhance operation loading * made responsive + improvements * added loading provider * fixed loading * adjustments for small devices * added sidebar label for endpoints * added feedback component * fixed analytics * general fixes * listen to scroll for other headings * added sample env file * update api ref files + support new fields * fix for external docs link * added new sections * fix last item in sidebar not showing * move docs content to www/docs * change redirect url * revert change * resolve build errors * configure rewrites * changed to environment variable url * revert changing environment variable name * add environment variable for API path * fix links * fix tailwind settings * remove vercel file * reconfigured api route * move api page under api * fix page metadata * fix external link in navigation bar * update api spec * updated api specs * fixed google lint error * add max-height on request samples * add padding before loading * fix for one of name * fix undefined types * general fixes * remove response schema example * redesigned navigation bar * redesigned sidebar * fixed up paddings * added feedback component + report issue * fixed up typography, padding, and general styling * redesigned code blocks * optimization * added error timeout * fixes * added indexing with algolia + fixes * fix errors with algolia script * redesign operation sections * fix heading scroll * design fixes * fix padding * fix padding + scroll issues * fix scroll issues * improve scroll performance * fixes for safari * optimization and fixes * fixes to docs + details animation * padding fixes for code block * added tab animation * fixed incorrect link * added selection styling * fix lint errors * redesigned details component * added detailed feedback form * api reference fixes * fix tabs * upgrade + fixes * updated documentation links * optimizations to sidebar items * fix spacing in sidebar item * optimizations and fixes * fix endpoint path styling * remove margin * final fixes * change margin on small devices * generated OAS * fixes for mobile * added feedback modal * optimize dark mode button * fixed color mode useeffect * minimize dom size * use new style system * radius and spacing design system * design fixes * fix eslint errors * added meta files * change cron schedule * fix docusaurus configurations * added operating system to feedback data * change content directory name * fixes to contribution guidelines * revert renaming content * added api-reference to documentation workflow * fixes for search * added dark mode + fixes * oas fixes * handle bugs * added code examples for clients * changed tooltip text * change authentication to card * change page title based on selected section * redesigned mobile navbar * fix icon colors * fix key colors * fix medusa-js installation command * change external regex in algolia * change changeset * fix padding on mobile * fix hydration error * update depedencies
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"position": 7,
|
||||
"collapsed": false,
|
||||
"link": null,
|
||||
"label": "Gift Cards",
|
||||
"customProps": {
|
||||
"sidebar_is_group_headline": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
description: 'This user guide explains how to manage custom gift cards on the Medusa admin. Learn how to create and edit custom gift cards.'
|
||||
addHowToData: true
|
||||
---
|
||||
|
||||
import UiIcon from '@site/src/components/UiIcon';
|
||||
|
||||
# Manage Custom Gift Cards
|
||||
|
||||
In this document, you’ll learn how to manage custom gift cards, including how to create and update them.
|
||||
|
||||
## Create Custom Gift Card
|
||||
|
||||
To create a custom gift card:
|
||||
|
||||
1. Go to Gift Cards from the sidebar.
|
||||
2. Click on the Custom Gift Card button at the top right of the History section.
|
||||
3. In the new form that opens:
|
||||
1. Select in the Region field the region this gift card works in. You can only pick one region. Based on the region you pick, the currency of the gift card will automatically change.
|
||||
2. Enter in the Amount field the amount of the gift card.
|
||||
3. Enter in the Email field the email of the customer that will receive this gift card.
|
||||
4. You can optionally enter in the Personal Message field any message you want the customer to receive with this gift card.
|
||||
4. Once done, click on Create & Send.
|
||||
|
||||
The gift card will be created with a random code. The customer will then receive an email with details about their gift card.
|
||||
|
||||
:::note
|
||||
|
||||
If the customer doesn’t receive an email, please get in touch with your technical team to ensure an email service is set up correctly.
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## View a Custom Gift Card’s Details
|
||||
|
||||
To view a custom gift card’s details:
|
||||
|
||||
1. Go to Gift Cards from the sidebar.
|
||||
2. In the History section, find the custom gift card and click on it.
|
||||
|
||||
This opens the gift card’s details page.
|
||||
|
||||
---
|
||||
|
||||
## Edit a Custom Gift Card
|
||||
|
||||
### Change Region of Custom Gift Card
|
||||
|
||||
:::info
|
||||
|
||||
Changing the region of a custom gift card will change the currency of the gift card to the new region’s currency.
|
||||
|
||||
:::
|
||||
|
||||
To change the region of a custom gift card:
|
||||
|
||||
1. Go to the custom gift card’s details page.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the first section.
|
||||
3. Click on Edit from the dropdown.
|
||||
4. In the new window that opens:
|
||||
1. Select in the Region field the region you want this gift card to work in.
|
||||
5. Once done, click on the Save button.
|
||||
|
||||
### Update Balance of Custom Gift Card
|
||||
|
||||
To update the balance of a custom gift card:
|
||||
|
||||
1. Go to the custom gift card’s details page.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the first section.
|
||||
3. Click on “Update balance” from the dropdown.
|
||||
4. In the new window that opens:
|
||||
1. Enter in the Price field the new balance.
|
||||
5. Once done, click on the Save button.
|
||||
|
||||
### Change Custom Gift Card Status
|
||||
|
||||
You can disable or activate a custom gift card. If you disable a gift card, customers can’t use it during checkout.
|
||||
|
||||
To change a custom gift card’s status:
|
||||
|
||||
1. Go to the custom gift card’s details page.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the first section.
|
||||
3. Click on Disable or Activate from the dropdown based on the current status.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
description: 'Medusa admin allows merchants to manage gift cards. Merchants can manage main and custom gift cards.'
|
||||
---
|
||||
|
||||
# Gift Cards Overview
|
||||
|
||||
In this document, you’ll learn about how Gift Cards in Medusa work.
|
||||
|
||||
## Overview
|
||||
|
||||
In Medusa, there’s one main gift card. A gift card can have multiple denominations. For example, a Gift Card can have the amounts of $20 and $50, and customers can buy one of these denominations.
|
||||
|
||||
---
|
||||
|
||||
## Custom Gift Cards
|
||||
|
||||
You can also create custom gift cards in Medusa. These cards can be created and sent directly to a customer’s email.
|
||||
|
||||
To view the list of available custom gift cards, from the sidebar go to Gift Cards. You can find all custom gift cards in the History section.
|
||||
|
||||
---
|
||||
|
||||
## Learn More About Gift Cards
|
||||
|
||||
- [Manage Gift Cards](./manage.mdx)
|
||||
- [Manage Custom Gift Cards](./custom.mdx)
|
||||
@@ -0,0 +1,211 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
description: 'This user guide explains how to manage the main gift card on the Medusa admin. Learn how to create, edit, and delete a gift card.'
|
||||
addHowToData: true
|
||||
---
|
||||
|
||||
import UiIcon from '@site/src/components/UiIcon';
|
||||
|
||||
# Manage a Gift Card
|
||||
|
||||
In this document, you’ll learn about managing gift cards, including how to create, edit, and delete them.
|
||||
|
||||
## Create Gift Card
|
||||
|
||||
:::info
|
||||
|
||||
You can only create one gift card per store.
|
||||
|
||||
:::
|
||||
|
||||
Click on Gift Cards in the sidebar menu. If you don’t have any gift cards you should see a prompt to create your first gift card.
|
||||
|
||||
To create a Gift Card:
|
||||
|
||||
1. Click on Create Gift Card.
|
||||
2. In the new window that opens:
|
||||
- Enter a name for the gift card
|
||||
- You can optionally enter a description and a thumbnail.
|
||||
- Click on Add Denomination. You must at least add one denomination
|
||||
- For each denomination, choose the currency and amount.
|
||||
- If you want to delete a denomination, you can click the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999273/Medusa%20Docs/UI%20Icons/7hztVhj_mj6mxu.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999290/Medusa%20Docs/UI%20Icons/1yp4PNt_vzwnhf.png" alt="trash" /> icon.
|
||||
3. Once you’re done, click Create & Publish.
|
||||
|
||||
:::tip
|
||||
|
||||
If you want to add more than one currency value for a denomination, you can do that when you [edit a denomination](#edit-a-denomination).
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Edit Gift Card
|
||||
|
||||
To edit a Gift Card:
|
||||
|
||||
1. Go to the Gift Cards page from the sidebar menu.
|
||||
2. Next to the main gift card, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon.
|
||||
3. Choose Edit from the dropdown.
|
||||
|
||||
This opens a form to edit the gift card details and denominations.
|
||||
|
||||
### Edit Gift Card Information
|
||||
|
||||
You can edit the name, subtitle, and description of a Gift card.
|
||||
|
||||
You can also click on “Show additional details”. Here, you can change the handle of the gift card, tags, and product type.
|
||||
|
||||
After making the edits, click Save at the bottom right of the page.
|
||||
|
||||
:::info
|
||||
|
||||
The handle is the URL used on the storefront to view the Gift Card.
|
||||
|
||||
:::
|
||||
|
||||
### Add a Denomination
|
||||
|
||||
On the Denominations section, click on Add Denomination at the top right of the section.
|
||||
|
||||
In the window that opens:
|
||||
|
||||
1. Choose the currency of the denomination
|
||||
2. Enter the amount of the denomination
|
||||
3. Optionally, you can enter other values for the denominations. This is useful if you want to enter an amount in another currency. To do that:
|
||||
- Click on “Add a price” under Other Values.
|
||||
- Choose the currency and amount.
|
||||
- To delete a price under Other Values, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999273/Medusa%20Docs/UI%20Icons/7hztVhj_mj6mxu.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999290/Medusa%20Docs/UI%20Icons/1yp4PNt_vzwnhf.png" alt="trash" /> icon.
|
||||
4. Once you’re done, click Save.
|
||||
|
||||
### Edit a Denomination
|
||||
|
||||
To edit a denomination:
|
||||
|
||||
1. In the Denominations section, find the denomination you want to edit.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon in the same row as the denomination you want to edit.
|
||||
3. Click on Edit Denomination from the dropdown.
|
||||
4. This opens a new window to edit the denomination. You can then:
|
||||
- Edit the currency or amount of existing prices of the denomination.
|
||||
- Add prices for other currencies by clicking “Add a price”
|
||||
- Delete prices by clicking the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999273/Medusa%20Docs/UI%20Icons/7hztVhj_mj6mxu.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999290/Medusa%20Docs/UI%20Icons/1yp4PNt_vzwnhf.png" alt="trash" /> icon.
|
||||
5. Once you’re done, click Save.
|
||||
|
||||
### Delete a Denomination
|
||||
|
||||
:::warning
|
||||
|
||||
If you delete a denomination, customers won’t be able to find it in the storefront, purchase it, or use it.
|
||||
|
||||
:::
|
||||
|
||||
To delete a denomination:
|
||||
|
||||
1. In the Denominations section, find the denomination you want to edit.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon in the same row as the denomination you want to delete.
|
||||
3. Click on Delete Denomination from the dropdown.
|
||||
4. Confirm deleting the denomination by clicking the “Yes, delete” button in the pop-up.
|
||||
|
||||
### Add Images
|
||||
|
||||
:::info
|
||||
|
||||
You can add up to ten images for a Gift Card.
|
||||
|
||||
:::
|
||||
|
||||
To add images to the Gift Card:
|
||||
|
||||
1. Go to the Images section.
|
||||
2. Either drag and drop your image to the dashed box or click on the box and choose the image you want to add.
|
||||
3. Click Save at the bottom right of the page.
|
||||
|
||||
:::note
|
||||
|
||||
If you face any errors or difficulties while uploading an image, please contact your technical support team as this could be an issue in the storage integration used.
|
||||
|
||||
:::
|
||||
|
||||
### Change Thumbnail Image
|
||||
|
||||
:::info
|
||||
|
||||
You must have more than one image for a gift card to change the thumbnail image.
|
||||
|
||||
:::
|
||||
|
||||
To change the thumbnail image:
|
||||
|
||||
1. Go to the Images section.
|
||||
2. Check the radio button under the Thumbnail column for the image you want to make the thumbnail.
|
||||
3. Click Save at the bottom right of the page.
|
||||
|
||||
### Delete Gift Card Image
|
||||
|
||||
:::caution
|
||||
|
||||
If you delete an image, you won’t be able to restore it.
|
||||
|
||||
:::
|
||||
|
||||
To delete a gift card image:
|
||||
|
||||
1. Go to the Images section.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999273/Medusa%20Docs/UI%20Icons/7hztVhj_mj6mxu.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999290/Medusa%20Docs/UI%20Icons/1yp4PNt_vzwnhf.png" alt="trash" /> icon at the right of the image you want to delete.
|
||||
3. Click Save at the bottom right of the page.
|
||||
|
||||
---
|
||||
|
||||
## Unpublish Gift Card
|
||||
|
||||
:::caution
|
||||
|
||||
Unpublishing a gift card prevents customers from seeing the gift card in the storefront, purchasing it, or using it.
|
||||
|
||||
:::
|
||||
|
||||
### On Gift Cards Page
|
||||
|
||||
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the main gift card.
|
||||
2. Choose Unpublish.
|
||||
|
||||
### On Edit Gift Card Page
|
||||
|
||||
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the Product Information section.
|
||||
2. Choose Unpublish Gift Card from the dropdown.
|
||||
|
||||
---
|
||||
|
||||
## Publish Gift Card
|
||||
|
||||
:::note
|
||||
|
||||
Publishing a gift card allows customers to see the gift card on the storefront, purchase it, and use it.
|
||||
|
||||
:::
|
||||
|
||||
### On Gift Cards Page
|
||||
|
||||
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the main gift card.
|
||||
2. Choose Publish.
|
||||
|
||||
### On Edit Gift Card Page
|
||||
|
||||
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the Product Information section.
|
||||
2. Choose Publish Gift Card from the dropdown.
|
||||
|
||||
---
|
||||
|
||||
## Delete Gift Card
|
||||
|
||||
:::warning
|
||||
|
||||
If you delete a gift card, you can’t restore it or its settings. Customers also can’t use the gift card if they had previously purchased it.
|
||||
|
||||
:::
|
||||
|
||||
To delete a gift card:
|
||||
|
||||
1. Go to the Gift Cards page from the sidebar menu.
|
||||
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the main gift card.
|
||||
3. Choose Delete from the dropdown.
|
||||
4. Confirm deleting the gift card by clicking the “Yes, delete” button in the pop-up.
|
||||
Reference in New Issue
Block a user