docs: added how-to documentation for the PriceList API (#2260)

* docs: added price list how-to

* added links to price list conceptual docs

* added link to the how-to guide

* fixed typo in file extension
This commit is contained in:
Shahed Nasser
2022-09-28 17:06:21 +03:00
committed by GitHub
parent d03ff07a48
commit a58955bdba
4 changed files with 477 additions and 12 deletions
@@ -58,7 +58,6 @@ You can do that by sending the following request to the [Upload Files](https://d
<TabItem value="client" label="Medusa JS Client" default>
```jsx
// using JS Client
medusa.admin.uploads.create(file) //file is an instance of File
.then(({ uploads }) => {
const key = uploads[0].key;
@@ -69,7 +68,6 @@ medusa.admin.uploads.create(file) //file is an instance of File
<TabItem value="fetch" label="Fetch API">
```jsx
// using Fetch API
const formData = new FormData();
formData.append('files', file); //file is an instance of File
@@ -90,7 +88,6 @@ fetch(`<YOUR_SERVER>/admin/uploads`, {
<TabItem value="curl" label="cURL">
```bash
# using cURL
curl --location --request POST '<YOUR_SERVER>/admin/uploads' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: text/csv' \
@@ -112,7 +109,6 @@ You can do that by sending the following request to the [Create a Batch Job](htt
<TabItem value="client" label="Medusa JS Client" default>
```jsx
// using JS Client
medusa.admin.batchJobs.create({
type: 'product-import',
context: {
@@ -129,7 +125,6 @@ medusa.admin.batchJobs.create({
<TabItem value="fetch" label="Fetch API">
```jsx
// using Fetch API
fetch(`<YOUR_SERVER>/admin/batch-jobs`, {
method: 'POST',
headers: {
@@ -153,7 +148,6 @@ fetch(`<YOUR_SERVER>/admin/batch-jobs`, {
<TabItem value="curl" label="cURL">
```bash
# using cURL
curl --location --request POST '<YOUR_SERVER>/admin/batch-jobs' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
@@ -194,7 +188,6 @@ You can retrieve all the details of the batch job, including its status and the
<TabItem value="client" label="Medusa JS Client" default>
```jsx
// using JS Client
medusa.admin.batchJobs.retrieve(batchJobId)
.then(( batch_job ) => {
console.log(batch_job.status, batch_job.result);
@@ -205,7 +198,6 @@ medusa.admin.batchJobs.retrieve(batchJobId)
<TabItem value="fetch" label="Fetch API">
```jsx
// using Fetch API
fetch(`<YOUR_SERVER>/admin/batch-jobs/${batchJobId}`)
.then((response) => response.json())
.then(({ batch_job }) => {
@@ -217,7 +209,6 @@ fetch(`<YOUR_SERVER>/admin/batch-jobs/${batchJobId}`)
<TabItem value="curl" label="cURL">
```bash
# using cURL
curl --location --request GET '<YOUR_SERVER>/admin/batch-jobs/<BATCH_JOB_ID>' \
--header 'Authorization: Bearer {api_token}'
# <BATCH_JOB_ID> is the ID of the batch job
@@ -256,7 +247,6 @@ To confirm a batch job send the following request:
<TabItem value="client" label="Medusa JS Client" default>
```jsx
// using JS Client
medusa.admin.batchJobs.confirm(batchJobId)
.then(( batch_job ) => {
console.log(batch_job.status);
@@ -267,7 +257,6 @@ medusa.admin.batchJobs.confirm(batchJobId)
<TabItem value="fetch" label="Fetch API">
```jsx
// using Fetch API
fetch(`<YOUR_SERVER>/admin/batch-jobs/${batchJobId}/confirm`, {
method: 'POST'
})
@@ -281,7 +270,6 @@ fetch(`<YOUR_SERVER>/admin/batch-jobs/${batchJobId}/confirm`, {
<TabItem value="curl" label="cURL">
```bash
# using cURL
curl --location --request POST '<YOUR_SERVER>/admin/batch-jobs/<BATCH_JOB_ID>/confirm' \
--header 'Authorization: Bearer {api_token}'
# <BATCH_JOB_ID> is the ID of the batch job