Merge branch 'master' into develop
This commit is contained in:
+838
-66
File diff suppressed because it is too large
Load Diff
+838
-66
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.currencies.list()
|
||||
.then(({ currencies, count, offset, limit }) => {
|
||||
console.log(currencies.length);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.currencies.update(code, {
|
||||
includes_tax: true
|
||||
})
|
||||
.then(({ currency }) => {
|
||||
console.log(currency.id);
|
||||
});
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, {
|
||||
resources: [{ id: item_id }]
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, {
|
||||
resources: [{ id: item_id }]
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdits.list()
|
||||
.then(({ order_edits, count, limit, offset }) => {
|
||||
console.log(order_edits.length)
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdit.create({ order_id, internal_note })
|
||||
medusa.admin.orderEdits.create({ order_id })
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdits.delete(edit_id)
|
||||
medusa.admin.orderEdits.delete(order_edit_id)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdit.retrieve(orderEditId)
|
||||
medusa.admin.orderEdits.retrieve(orderEditId)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
const params = {internal_note: "internal reason XY"}
|
||||
medusa.admin.orderEdit.update(orderEditId, params)
|
||||
medusa.admin.orderEdits.update(order_edit_id, {
|
||||
internal_note: "internal reason XY"
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdit.cancel(orderEditId)
|
||||
medusa.admin.orderEdits.cancel(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdits.deleteItemChange(item_change_id, order_edit_id)
|
||||
medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdit.confirm(orderEditId)
|
||||
medusa.admin.orderEdits.confirm(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdit.addLineItem(order_edit_id, { variant_id, quantity })
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
medusa.admin.orderEdits.addLineItem(order_edit_id, {
|
||||
variant_id,
|
||||
quantity
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id)
|
||||
medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, {
|
||||
quantity: 5
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.orderEdits.requestConfirmation(edit_id)
|
||||
medusa.admin.orderEdits.requestConfirmation(order_edit_id)
|
||||
.then({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -9,6 +9,6 @@ medusa.admin.returns.receive(return_id, {
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ return }) => {
|
||||
console.log(return.id);
|
||||
.then((data) => {
|
||||
console.log(data.return.id);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.uploads.createProtected(file)
|
||||
.then(({ uploads }) => {
|
||||
console.log(uploads.length);
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/currencies' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"includes_tax": true
|
||||
}'
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"resources": [{ "id": "item_id" }]
|
||||
}'
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"resources": [{ "id": "item_id" }]
|
||||
}'
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/order-edits' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -1,3 +1,4 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }'
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"internal_note": "internal reason XY"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/:id/cancel' \
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/:id/confirm' \
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "variant_id": "some_variant_id", "quantity": 3 }'
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "quantity": 5 }'
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{ "quantity": 5 }'
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: image/jpeg' \
|
||||
--form 'files=@"<FILE_PATH_1>"' \
|
||||
--form 'files=@"<FILE_PATH_1>"'
|
||||
@@ -16,11 +16,11 @@ properties:
|
||||
description: The ID of the order that is edited
|
||||
example: order_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order:
|
||||
description: Order object
|
||||
description: Available if the relation `order` is expanded.
|
||||
$ref: ./order.yaml
|
||||
changes:
|
||||
type: array
|
||||
description: Line item changes array.
|
||||
description: Available if the relation `changes` is expanded.
|
||||
items:
|
||||
$ref: ./order_item_change.yaml
|
||||
internal_note:
|
||||
@@ -92,8 +92,32 @@ properties:
|
||||
The difference between the total amount of the order and total amount of
|
||||
edited order.
|
||||
example: 8200
|
||||
status:
|
||||
type: string
|
||||
description: The status of the order edit.
|
||||
enum:
|
||||
- confirmed
|
||||
- declined
|
||||
- requested
|
||||
- created
|
||||
- canceled
|
||||
items:
|
||||
type: array
|
||||
description: Computed line items from the changes.
|
||||
description: Available if the relation `items` is expanded.
|
||||
items:
|
||||
$ref: ./line_item.yaml
|
||||
payment_collection_id:
|
||||
type: string
|
||||
description: The ID of the payment collection
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
payment_collection:
|
||||
description: Available if the relation `payment_collection` is expanded.
|
||||
$ref: ./payment_collection.yaml
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
|
||||
@@ -11,7 +11,7 @@ properties:
|
||||
example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The order's status
|
||||
description: The order item change's status
|
||||
enum:
|
||||
- item_add
|
||||
- item_remove
|
||||
@@ -21,19 +21,36 @@ properties:
|
||||
description: The ID of the order edit
|
||||
example: oe_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order_edit:
|
||||
description: Order edit object
|
||||
description: Available if the relation `order_edit` is expanded.
|
||||
$ref: ./order_edit.yaml
|
||||
original_line_item_id:
|
||||
type: string
|
||||
description: The ID of the original line item in the order
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
original_line_item:
|
||||
description: Original line item object.
|
||||
description: Available if the relation `original_line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
line_item_id:
|
||||
type: string
|
||||
description: The ID of the cloned line item.
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
line_item:
|
||||
description: Line item object.
|
||||
description: Available if the relation `line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
title: Payment Collection
|
||||
description: Payment Collection
|
||||
x-resourceId: payment_collection
|
||||
required:
|
||||
- type
|
||||
- status
|
||||
- amount
|
||||
- region_id
|
||||
- currency_code
|
||||
- created_by
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The payment collection's ID
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- order_edit
|
||||
status:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- not_paid
|
||||
- awaiting
|
||||
- authorized
|
||||
- partially_authorized
|
||||
- captured
|
||||
- partially_captured
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- canceled
|
||||
- requires_action
|
||||
description:
|
||||
type: string
|
||||
description: Description of the payment collection
|
||||
amount:
|
||||
type: number
|
||||
description: Amount of the payment collection.
|
||||
authorized_amount:
|
||||
type: number
|
||||
description: Authorized amount of the payment collection.
|
||||
captured_amount:
|
||||
type: number
|
||||
description: Captured amount of the payment collection.
|
||||
refunded_amount:
|
||||
type: number
|
||||
description: Refunded amount of the payment collection.
|
||||
region_id:
|
||||
type: string
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
region:
|
||||
description: Available if the relation `region` is expanded.
|
||||
$ref: ./region.yaml
|
||||
currency_code:
|
||||
description: The 3 character ISO code for the currency.
|
||||
type: string
|
||||
example: usd
|
||||
externalDocs:
|
||||
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
||||
description: See a list of codes.
|
||||
currency:
|
||||
description: Available if the relation `currency` is expanded.
|
||||
$ref: ./currency.yaml
|
||||
payment_sessions:
|
||||
type: array
|
||||
description: Available if the relation `payment_sessions` is expanded.
|
||||
items:
|
||||
$ref: ./payment_session.yaml
|
||||
payments:
|
||||
type: array
|
||||
description: Available if the relation `payments` is expanded.
|
||||
items:
|
||||
$ref: ./payment.yaml
|
||||
created_by:
|
||||
type: string
|
||||
description: The ID of the user that created the payment collection.
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
@@ -12,7 +12,7 @@ required:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The cart's ID
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
name:
|
||||
description: >-
|
||||
|
||||
@@ -240,6 +240,8 @@ paths:
|
||||
$ref: paths/customers_{id}.yaml
|
||||
/discounts/{id}/regions/{region_id}:
|
||||
$ref: paths/discounts_{id}_regions_{region_id}.yaml
|
||||
/discounts/{discount_id}/conditions/{condition_id}/batch:
|
||||
$ref: paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml
|
||||
/discounts/{discount_id}/conditions:
|
||||
$ref: paths/discounts_{discount_id}_conditions.yaml
|
||||
/discounts:
|
||||
@@ -450,6 +452,8 @@ paths:
|
||||
$ref: paths/tax-rates.yaml
|
||||
/tax-rates/{id}:
|
||||
$ref: paths/tax-rates_{id}.yaml
|
||||
/uploads/protected:
|
||||
$ref: paths/uploads_protected.yaml
|
||||
/uploads:
|
||||
$ref: paths/uploads.yaml
|
||||
/users:
|
||||
|
||||
@@ -31,10 +31,14 @@ post:
|
||||
format: email
|
||||
billing_address:
|
||||
description: The Address to be used for billing purposes.
|
||||
$ref: ../components/schemas/address_fields.yaml
|
||||
anyOf:
|
||||
- $ref: ../components/schemas/address_fields.yaml
|
||||
- type: string
|
||||
shipping_address:
|
||||
description: The Address to be used for shipping.
|
||||
$ref: ../components/schemas/address_fields.yaml
|
||||
anyOf:
|
||||
- $ref: ../components/schemas/address_fields.yaml
|
||||
- type: string
|
||||
discounts:
|
||||
description: An array of Discount codes to add to the Draft Order.
|
||||
type: array
|
||||
|
||||
@@ -91,6 +91,11 @@ get:
|
||||
description: a search term to search titles and handles.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: discount_condition_id
|
||||
description: The discount condition id on which to filter the product collections.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting collections were created.
|
||||
|
||||
@@ -16,19 +16,30 @@ get:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: order
|
||||
description: to retrieve products in.
|
||||
description: order to retrieve products in.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: offset
|
||||
description: How many products to skip in the result.
|
||||
schema:
|
||||
type: string
|
||||
type: number
|
||||
default: '0'
|
||||
- in: query
|
||||
name: limit
|
||||
description: Limit the number of products returned.
|
||||
schema:
|
||||
type: string
|
||||
type: number
|
||||
default: '20'
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: ../code_samples/JavaScript/currencies/getundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: ../code_samples/Shell/currencies/getundefined
|
||||
tags:
|
||||
- Currency
|
||||
responses:
|
||||
@@ -38,16 +49,16 @@ get:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
count:
|
||||
description: The number of Currency.
|
||||
type: integer
|
||||
offset:
|
||||
description: The offset of the Currency query.
|
||||
type: integer
|
||||
limit:
|
||||
description: The limit of the currency query.
|
||||
type: integer
|
||||
currencies:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../components/schemas/currency.yaml
|
||||
count:
|
||||
type: integer
|
||||
description: The total number of items available
|
||||
offset:
|
||||
type: integer
|
||||
description: The number of items skipped before these items
|
||||
limit:
|
||||
type: integer
|
||||
description: The number of items per page
|
||||
|
||||
@@ -18,6 +18,15 @@ post:
|
||||
includes_tax:
|
||||
type: boolean
|
||||
description: '[EXPERIMENTAL] Tax included in prices of currency.'
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: ../code_samples/JavaScript/currencies_{code}/postundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: ../code_samples/Shell/currencies_{code}/postundefined
|
||||
tags:
|
||||
- Currency
|
||||
responses:
|
||||
|
||||
@@ -75,6 +75,11 @@ get:
|
||||
description: the field used to order the customer groups.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: discount_condition_id
|
||||
description: The discount condition id on which to filter the customer groups.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: id
|
||||
style: form
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
post:
|
||||
operationId: PostDiscountsDiscountConditionsConditionBatch
|
||||
summary: Add a batch of resources to a discount condition
|
||||
description: Add a batch of resources to a discount condition.
|
||||
x-authenticated: true
|
||||
parameters:
|
||||
- in: path
|
||||
name: discount_id
|
||||
required: true
|
||||
description: The ID of the Product.
|
||||
schema:
|
||||
type: string
|
||||
- in: path
|
||||
name: condition_id
|
||||
required: true
|
||||
description: The ID of the condition on which to add the item.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: expand
|
||||
description: >-
|
||||
(Comma separated) Which relations should be expanded in each discount of
|
||||
the result.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: >-
|
||||
(Comma separated) Which fields should be included in each discount of
|
||||
the result.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
required:
|
||||
- resources
|
||||
properties:
|
||||
resources:
|
||||
description: The resources to be added to the discount condition
|
||||
type: array
|
||||
items:
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
description: The id of the item
|
||||
type: string
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: >-
|
||||
../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: >-
|
||||
../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
tags:
|
||||
- Discount Condition
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
discount:
|
||||
$ref: ../components/schemas/discount.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
|
||||
delete:
|
||||
operationId: DeleteDiscountsDiscountConditionsConditionBatch
|
||||
summary: Delete a batch of resources from a discount condition
|
||||
description: Delete a batch of resources from a discount condition.
|
||||
x-authenticated: true
|
||||
parameters:
|
||||
- in: path
|
||||
name: discount_id
|
||||
required: true
|
||||
description: The ID of the Product.
|
||||
schema:
|
||||
type: string
|
||||
- in: path
|
||||
name: condition_id
|
||||
required: true
|
||||
description: The ID of the condition on which to add the item.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: expand
|
||||
description: >-
|
||||
(Comma separated) Which relations should be expanded in each discount of
|
||||
the result.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: >-
|
||||
(Comma separated) Which fields should be included in each discount of
|
||||
the result.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
required:
|
||||
- resources
|
||||
properties:
|
||||
resources:
|
||||
description: The resources to be deleted from the discount condition
|
||||
type: array
|
||||
items:
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
description: The id of the item
|
||||
type: string
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: >-
|
||||
../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: >-
|
||||
../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
tags:
|
||||
- Discount Condition
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
discount:
|
||||
$ref: ../components/schemas/discount.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
|
||||
@@ -25,10 +25,14 @@ post:
|
||||
format: email
|
||||
billing_address:
|
||||
description: The Address to be used for billing purposes.
|
||||
$ref: ../components/schemas/address_fields.yaml
|
||||
anyOf:
|
||||
- $ref: ../components/schemas/address_fields.yaml
|
||||
- type: string
|
||||
shipping_address:
|
||||
description: The Address to be used for shipping.
|
||||
$ref: ../components/schemas/address_fields.yaml
|
||||
anyOf:
|
||||
- $ref: ../components/schemas/address_fields.yaml
|
||||
- type: string
|
||||
items:
|
||||
description: The Line Items that have been received.
|
||||
type: array
|
||||
|
||||
@@ -2,6 +2,19 @@ post:
|
||||
operationId: PostOrderEdits
|
||||
summary: Create an OrderEdit
|
||||
description: Creates an OrderEdit.
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
required:
|
||||
- order_id
|
||||
properties:
|
||||
order_id:
|
||||
description: The ID of the order to create the edit for.
|
||||
type: string
|
||||
internal_note:
|
||||
description: An optional note to create for the order edit.
|
||||
type: string
|
||||
x-authenticated: true
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
@@ -38,3 +51,86 @@ post:
|
||||
$ref: ../components/responses/invalid_request_error.yaml
|
||||
'500':
|
||||
$ref: ../components/responses/500_error.yaml
|
||||
get:
|
||||
operationId: GetOrderEdits
|
||||
summary: List an OrderEdit
|
||||
description: List a OrderEdit.
|
||||
x-authenticated: true
|
||||
parameters:
|
||||
- in: query
|
||||
name: q
|
||||
description: Query used for searching order edit internal note.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: order_id
|
||||
description: List order edits by order id.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: limit
|
||||
description: The number of items in the response
|
||||
schema:
|
||||
type: number
|
||||
default: '20'
|
||||
- in: query
|
||||
name: offset
|
||||
description: The offset of items in response
|
||||
schema:
|
||||
type: number
|
||||
default: '0'
|
||||
- in: query
|
||||
name: expand
|
||||
description: Comma separated list of relations to include in the results.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: Comma separated list of fields to include in the results.
|
||||
schema:
|
||||
type: string
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: ../code_samples/JavaScript/order-edits/getundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: ../code_samples/Shell/order-edits/getundefined
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
tags:
|
||||
- OrderEdit
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
order_edits:
|
||||
type: array
|
||||
$ref: ../components/schemas/order_edit.yaml
|
||||
count:
|
||||
type: integer
|
||||
description: The total number of items available
|
||||
offset:
|
||||
type: integer
|
||||
description: The number of items skipped before these items
|
||||
limit:
|
||||
type: integer
|
||||
description: The number of items per page
|
||||
'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
|
||||
|
||||
@@ -56,6 +56,16 @@ get:
|
||||
description: The ID of the OrderEdit.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: expand
|
||||
description: Comma separated list of relations to include in the results.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: Comma separated list of fields to include in the results.
|
||||
schema:
|
||||
type: string
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
@@ -103,6 +113,14 @@ post:
|
||||
description: The ID of the OrderEdit.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
internal_note:
|
||||
description: An optional note to create or update for the order edit.
|
||||
type: string
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
|
||||
@@ -9,6 +9,25 @@ post:
|
||||
description: The ID of the Order Edit.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
required:
|
||||
- variant_id
|
||||
- quantity
|
||||
properties:
|
||||
variant_id:
|
||||
description: The ID of the variant ID to add
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity to add
|
||||
type: number
|
||||
metadata:
|
||||
description: >-
|
||||
An optional set of key-value pairs to hold additional
|
||||
information.
|
||||
type: object
|
||||
x-authenticated: true
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
|
||||
@@ -70,6 +70,16 @@ post:
|
||||
description: The ID of the order edit item to update.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
required:
|
||||
- quantity
|
||||
properties:
|
||||
quantity:
|
||||
description: The quantity to update
|
||||
type: number
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
|
||||
@@ -21,6 +21,11 @@ get:
|
||||
description: The field to sort items by.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: discount_condition_id
|
||||
description: The discount condition id on which to filter the tags.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: value
|
||||
style: form
|
||||
|
||||
@@ -21,6 +21,11 @@ get:
|
||||
description: The field to sort items by.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: discount_condition_id
|
||||
description: The discount condition id on which to filter the product types.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: value
|
||||
style: form
|
||||
|
||||
@@ -289,6 +289,11 @@ get:
|
||||
and sku, and collection title.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: discount_condition_id
|
||||
description: The discount condition id on which to filter the product.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: id
|
||||
style: form
|
||||
@@ -352,6 +357,15 @@ get:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: type_id
|
||||
style: form
|
||||
explode: false
|
||||
description: Type IDs to filter products by
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: title
|
||||
description: title to search for.
|
||||
@@ -372,11 +386,6 @@ get:
|
||||
description: Search for giftcards using is_giftcard=true.
|
||||
schema:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: type
|
||||
description: type ID to search for.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting products were created.
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
post:
|
||||
operationId: PostUploadsProtected
|
||||
summary: Upload files with acl or in a non-public bucket
|
||||
description: >-
|
||||
Uploads at least one file to the specific fileservice that is installed in
|
||||
Medusa.
|
||||
x-authenticated: true
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
files:
|
||||
type: string
|
||||
format: binary
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
source:
|
||||
$ref: ../code_samples/JavaScript/uploads_protected/postundefined
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
source:
|
||||
$ref: ../code_samples/Shell/uploads_protected/postundefined
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
tags:
|
||||
- Upload
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
uploads:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
description: The URL of the uploaded file.
|
||||
format: uri
|
||||
'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
|
||||
@@ -5,22 +5,94 @@ get:
|
||||
x-authenticated: true
|
||||
parameters:
|
||||
- in: query
|
||||
name: q
|
||||
description: Query used for searching variants.
|
||||
name: id
|
||||
description: A Product Variant id to filter by.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: ids
|
||||
description: A comma separated list of Product Variant ids to filter by.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: expand
|
||||
description: A comma separated list of Product Variant relations to load.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: A comma separated list of Product Variant fields to include.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: offset
|
||||
description: How many variants to skip in the result.
|
||||
description: How many product variants to skip in the result.
|
||||
schema:
|
||||
type: integer
|
||||
default: 0
|
||||
type: number
|
||||
default: '0'
|
||||
- in: query
|
||||
name: limit
|
||||
description: Limit the number of variants returned.
|
||||
description: Maximum number of Product Variants to return.
|
||||
schema:
|
||||
type: integer
|
||||
default: 20
|
||||
type: number
|
||||
default: '100'
|
||||
- in: query
|
||||
name: cart_id
|
||||
description: The id of the cart to use for price selection.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: region_id
|
||||
description: The id of the region to use for price selection.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: currency_code
|
||||
description: The currency code to use for price selection.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: customer_id
|
||||
description: The id of the customer to use for price selection.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: title
|
||||
style: form
|
||||
explode: false
|
||||
description: product variant title to search for.
|
||||
schema:
|
||||
oneOf:
|
||||
- type: string
|
||||
description: a single title to search by
|
||||
- type: array
|
||||
description: multiple titles to search by
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: inventory_quantity
|
||||
description: Filter by available inventory quantity
|
||||
schema:
|
||||
oneOf:
|
||||
- type: number
|
||||
description: a specific number to search by.
|
||||
- type: object
|
||||
description: search using less and greater than comparisons.
|
||||
properties:
|
||||
lt:
|
||||
type: number
|
||||
description: filter by inventory quantity less than this number
|
||||
gt:
|
||||
type: number
|
||||
description: filter by inventory quantity greater than this number
|
||||
lte:
|
||||
type: number
|
||||
description: filter by inventory quantity less than or equal to this number
|
||||
gte:
|
||||
type: number
|
||||
description: >-
|
||||
filter by inventory quantity greater than or equal to this
|
||||
number
|
||||
x-codeSamples:
|
||||
- lang: JavaScript
|
||||
label: JS Client
|
||||
|
||||
+169
-18
@@ -2617,7 +2617,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.complete(orderEditId)
|
||||
medusa.orderEdits.complete(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
@@ -2674,7 +2674,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.decline(orderEditId)
|
||||
medusa.orderEdits.decline(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
})
|
||||
@@ -2723,7 +2723,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.retrieve(orderEditId)
|
||||
medusa.orderEdits.retrieve(order_edit_id)
|
||||
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
@@ -3047,6 +3047,15 @@ paths:
|
||||
- type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: sales_channel_id
|
||||
style: form
|
||||
explode: false
|
||||
description: an array of sales channel IDs to filter the retrieved products by.
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: collection_id
|
||||
style: form
|
||||
@@ -3056,6 +3065,15 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: type_id
|
||||
style: form
|
||||
explode: false
|
||||
description: Type IDs to search for
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: tags
|
||||
style: form
|
||||
@@ -3085,11 +3103,6 @@ paths:
|
||||
description: Search for giftcards using is_giftcard=true.
|
||||
schema:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: type
|
||||
description: type to search for.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting products were created.
|
||||
@@ -3613,8 +3626,8 @@ paths:
|
||||
]
|
||||
})
|
||||
|
||||
.then(({ return }) => {
|
||||
console.log(return.id);
|
||||
.then((data) => {
|
||||
console.log(data.return.id);
|
||||
});
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
@@ -6871,11 +6884,11 @@ components:
|
||||
description: The ID of the order that is edited
|
||||
example: order_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order:
|
||||
description: Order object
|
||||
description: Available if the relation `order` is expanded.
|
||||
$ref: '#/components/schemas/order'
|
||||
changes:
|
||||
type: array
|
||||
description: Line item changes array.
|
||||
description: Available if the relation `changes` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/order_item_change'
|
||||
internal_note:
|
||||
@@ -6951,11 +6964,35 @@ components:
|
||||
The difference between the total amount of the order and total
|
||||
amount of edited order.
|
||||
example: 8200
|
||||
status:
|
||||
type: string
|
||||
description: The status of the order edit.
|
||||
enum:
|
||||
- confirmed
|
||||
- declined
|
||||
- requested
|
||||
- created
|
||||
- canceled
|
||||
items:
|
||||
type: array
|
||||
description: Computed line items from the changes.
|
||||
description: Available if the relation `items` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/line_item'
|
||||
payment_collection_id:
|
||||
type: string
|
||||
description: The ID of the payment collection
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
payment_collection:
|
||||
description: Available if the relation `payment_collection` is expanded.
|
||||
$ref: '#/components/schemas/payment_collection'
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
order_item_change:
|
||||
title: Order Item Change
|
||||
description: Represents an order edit item change
|
||||
@@ -6970,7 +7007,7 @@ components:
|
||||
example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The order's status
|
||||
description: The order item change's status
|
||||
enum:
|
||||
- item_add
|
||||
- item_remove
|
||||
@@ -6980,22 +7017,39 @@ components:
|
||||
description: The ID of the order edit
|
||||
example: oe_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order_edit:
|
||||
description: Order edit object
|
||||
description: Available if the relation `order_edit` is expanded.
|
||||
$ref: '#/components/schemas/order_edit'
|
||||
original_line_item_id:
|
||||
type: string
|
||||
description: The ID of the original line item in the order
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
original_line_item:
|
||||
description: Original line item object.
|
||||
description: Available if the relation `original_line_item` is expanded.
|
||||
$ref: '#/components/schemas/line_item'
|
||||
line_item_id:
|
||||
type: string
|
||||
description: The ID of the cloned line item.
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
line_item:
|
||||
description: Line item object.
|
||||
description: Available if the relation `line_item` is expanded.
|
||||
$ref: '#/components/schemas/line_item'
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
order:
|
||||
title: Order
|
||||
description: Represents an order
|
||||
@@ -7274,6 +7328,103 @@ components:
|
||||
type: integer
|
||||
description: The total of gift cards with taxes
|
||||
example: 0
|
||||
payment_collection:
|
||||
title: Payment Collection
|
||||
description: Payment Collection
|
||||
x-resourceId: payment_collection
|
||||
required:
|
||||
- type
|
||||
- status
|
||||
- amount
|
||||
- region_id
|
||||
- currency_code
|
||||
- created_by
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The payment collection's ID
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- order_edit
|
||||
status:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- not_paid
|
||||
- awaiting
|
||||
- authorized
|
||||
- partially_authorized
|
||||
- captured
|
||||
- partially_captured
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- canceled
|
||||
- requires_action
|
||||
description:
|
||||
type: string
|
||||
description: Description of the payment collection
|
||||
amount:
|
||||
type: number
|
||||
description: Amount of the payment collection.
|
||||
authorized_amount:
|
||||
type: number
|
||||
description: Authorized amount of the payment collection.
|
||||
captured_amount:
|
||||
type: number
|
||||
description: Captured amount of the payment collection.
|
||||
refunded_amount:
|
||||
type: number
|
||||
description: Refunded amount of the payment collection.
|
||||
region_id:
|
||||
type: string
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
region:
|
||||
description: Available if the relation `region` is expanded.
|
||||
$ref: '#/components/schemas/region'
|
||||
currency_code:
|
||||
description: The 3 character ISO code for the currency.
|
||||
type: string
|
||||
example: usd
|
||||
externalDocs:
|
||||
url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes'
|
||||
description: See a list of codes.
|
||||
currency:
|
||||
description: Available if the relation `currency` is expanded.
|
||||
$ref: '#/components/schemas/currency'
|
||||
payment_sessions:
|
||||
type: array
|
||||
description: Available if the relation `payment_sessions` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/payment_session'
|
||||
payments:
|
||||
type: array
|
||||
description: Available if the relation `payments` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/payment'
|
||||
created_by:
|
||||
type: string
|
||||
description: The ID of the user that created the payment collection.
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
payment_provider:
|
||||
title: Payment Provider
|
||||
description: Represents a Payment Provider plugin and holds its installation status.
|
||||
@@ -8312,7 +8463,7 @@ components:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The cart's ID
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
name:
|
||||
description: >-
|
||||
|
||||
+169
-18
@@ -2617,7 +2617,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.complete(orderEditId)
|
||||
medusa.orderEdits.complete(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
@@ -2674,7 +2674,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.decline(orderEditId)
|
||||
medusa.orderEdits.decline(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
})
|
||||
@@ -2723,7 +2723,7 @@ paths:
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||
3 })
|
||||
|
||||
medusa.orderEdit.retrieve(orderEditId)
|
||||
medusa.orderEdits.retrieve(order_edit_id)
|
||||
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
@@ -3047,6 +3047,15 @@ paths:
|
||||
- type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: sales_channel_id
|
||||
style: form
|
||||
explode: false
|
||||
description: an array of sales channel IDs to filter the retrieved products by.
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: collection_id
|
||||
style: form
|
||||
@@ -3056,6 +3065,15 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: type_id
|
||||
style: form
|
||||
explode: false
|
||||
description: Type IDs to search for
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: tags
|
||||
style: form
|
||||
@@ -3085,11 +3103,6 @@ paths:
|
||||
description: Search for giftcards using is_giftcard=true.
|
||||
schema:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: type
|
||||
description: type to search for.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting products were created.
|
||||
@@ -3613,8 +3626,8 @@ paths:
|
||||
]
|
||||
})
|
||||
|
||||
.then(({ return }) => {
|
||||
console.log(return.id);
|
||||
.then((data) => {
|
||||
console.log(data.return.id);
|
||||
});
|
||||
- lang: Shell
|
||||
label: cURL
|
||||
@@ -6871,11 +6884,11 @@ components:
|
||||
description: The ID of the order that is edited
|
||||
example: order_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order:
|
||||
description: Order object
|
||||
description: Available if the relation `order` is expanded.
|
||||
$ref: '#/components/schemas/order'
|
||||
changes:
|
||||
type: array
|
||||
description: Line item changes array.
|
||||
description: Available if the relation `changes` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/order_item_change'
|
||||
internal_note:
|
||||
@@ -6951,11 +6964,35 @@ components:
|
||||
The difference between the total amount of the order and total
|
||||
amount of edited order.
|
||||
example: 8200
|
||||
status:
|
||||
type: string
|
||||
description: The status of the order edit.
|
||||
enum:
|
||||
- confirmed
|
||||
- declined
|
||||
- requested
|
||||
- created
|
||||
- canceled
|
||||
items:
|
||||
type: array
|
||||
description: Computed line items from the changes.
|
||||
description: Available if the relation `items` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/line_item'
|
||||
payment_collection_id:
|
||||
type: string
|
||||
description: The ID of the payment collection
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
payment_collection:
|
||||
description: Available if the relation `payment_collection` is expanded.
|
||||
$ref: '#/components/schemas/payment_collection'
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
order_item_change:
|
||||
title: Order Item Change
|
||||
description: Represents an order edit item change
|
||||
@@ -6970,7 +7007,7 @@ components:
|
||||
example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The order's status
|
||||
description: The order item change's status
|
||||
enum:
|
||||
- item_add
|
||||
- item_remove
|
||||
@@ -6980,22 +7017,39 @@ components:
|
||||
description: The ID of the order edit
|
||||
example: oe_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order_edit:
|
||||
description: Order edit object
|
||||
description: Available if the relation `order_edit` is expanded.
|
||||
$ref: '#/components/schemas/order_edit'
|
||||
original_line_item_id:
|
||||
type: string
|
||||
description: The ID of the original line item in the order
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
original_line_item:
|
||||
description: Original line item object.
|
||||
description: Available if the relation `original_line_item` is expanded.
|
||||
$ref: '#/components/schemas/line_item'
|
||||
line_item_id:
|
||||
type: string
|
||||
description: The ID of the cloned line item.
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
line_item:
|
||||
description: Line item object.
|
||||
description: Available if the relation `line_item` is expanded.
|
||||
$ref: '#/components/schemas/line_item'
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
order:
|
||||
title: Order
|
||||
description: Represents an order
|
||||
@@ -7274,6 +7328,103 @@ components:
|
||||
type: integer
|
||||
description: The total of gift cards with taxes
|
||||
example: 0
|
||||
payment_collection:
|
||||
title: Payment Collection
|
||||
description: Payment Collection
|
||||
x-resourceId: payment_collection
|
||||
required:
|
||||
- type
|
||||
- status
|
||||
- amount
|
||||
- region_id
|
||||
- currency_code
|
||||
- created_by
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The payment collection's ID
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- order_edit
|
||||
status:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- not_paid
|
||||
- awaiting
|
||||
- authorized
|
||||
- partially_authorized
|
||||
- captured
|
||||
- partially_captured
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- canceled
|
||||
- requires_action
|
||||
description:
|
||||
type: string
|
||||
description: Description of the payment collection
|
||||
amount:
|
||||
type: number
|
||||
description: Amount of the payment collection.
|
||||
authorized_amount:
|
||||
type: number
|
||||
description: Authorized amount of the payment collection.
|
||||
captured_amount:
|
||||
type: number
|
||||
description: Captured amount of the payment collection.
|
||||
refunded_amount:
|
||||
type: number
|
||||
description: Refunded amount of the payment collection.
|
||||
region_id:
|
||||
type: string
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
region:
|
||||
description: Available if the relation `region` is expanded.
|
||||
$ref: '#/components/schemas/region'
|
||||
currency_code:
|
||||
description: The 3 character ISO code for the currency.
|
||||
type: string
|
||||
example: usd
|
||||
externalDocs:
|
||||
url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes'
|
||||
description: See a list of codes.
|
||||
currency:
|
||||
description: Available if the relation `currency` is expanded.
|
||||
$ref: '#/components/schemas/currency'
|
||||
payment_sessions:
|
||||
type: array
|
||||
description: Available if the relation `payment_sessions` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/payment_session'
|
||||
payments:
|
||||
type: array
|
||||
description: Available if the relation `payments` is expanded.
|
||||
items:
|
||||
$ref: '#/components/schemas/payment'
|
||||
created_by:
|
||||
type: string
|
||||
description: The ID of the user that created the payment collection.
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
payment_provider:
|
||||
title: Payment Provider
|
||||
description: Represents a Payment Provider plugin and holds its installation status.
|
||||
@@ -8312,7 +8463,7 @@ components:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The cart's ID
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
name:
|
||||
description: >-
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.retrieve(orderEditId)
|
||||
medusa.orderEdits.retrieve(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.complete(orderEditId)
|
||||
medusa.orderEdits.complete(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.decline(orderEditId)
|
||||
medusa.orderEdits.decline(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
})
|
||||
|
||||
@@ -9,6 +9,6 @@ medusa.returns.create({
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ return }) => {
|
||||
console.log(return.id);
|
||||
.then((data) => {
|
||||
console.log(data.return.id);
|
||||
});
|
||||
|
||||
@@ -16,11 +16,11 @@ properties:
|
||||
description: The ID of the order that is edited
|
||||
example: order_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order:
|
||||
description: Order object
|
||||
description: Available if the relation `order` is expanded.
|
||||
$ref: ./order.yaml
|
||||
changes:
|
||||
type: array
|
||||
description: Line item changes array.
|
||||
description: Available if the relation `changes` is expanded.
|
||||
items:
|
||||
$ref: ./order_item_change.yaml
|
||||
internal_note:
|
||||
@@ -92,8 +92,32 @@ properties:
|
||||
The difference between the total amount of the order and total amount of
|
||||
edited order.
|
||||
example: 8200
|
||||
status:
|
||||
type: string
|
||||
description: The status of the order edit.
|
||||
enum:
|
||||
- confirmed
|
||||
- declined
|
||||
- requested
|
||||
- created
|
||||
- canceled
|
||||
items:
|
||||
type: array
|
||||
description: Computed line items from the changes.
|
||||
description: Available if the relation `items` is expanded.
|
||||
items:
|
||||
$ref: ./line_item.yaml
|
||||
payment_collection_id:
|
||||
type: string
|
||||
description: The ID of the payment collection
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
payment_collection:
|
||||
description: Available if the relation `payment_collection` is expanded.
|
||||
$ref: ./payment_collection.yaml
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
|
||||
@@ -11,7 +11,7 @@ properties:
|
||||
example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The order's status
|
||||
description: The order item change's status
|
||||
enum:
|
||||
- item_add
|
||||
- item_remove
|
||||
@@ -21,19 +21,36 @@ properties:
|
||||
description: The ID of the order edit
|
||||
example: oe_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order_edit:
|
||||
description: Order edit object
|
||||
description: Available if the relation `order_edit` is expanded.
|
||||
$ref: ./order_edit.yaml
|
||||
original_line_item_id:
|
||||
type: string
|
||||
description: The ID of the original line item in the order
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
original_line_item:
|
||||
description: Original line item object.
|
||||
description: Available if the relation `original_line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
line_item_id:
|
||||
type: string
|
||||
description: The ID of the cloned line item.
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
line_item:
|
||||
description: Line item object.
|
||||
description: Available if the relation `line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
title: Payment Collection
|
||||
description: Payment Collection
|
||||
x-resourceId: payment_collection
|
||||
required:
|
||||
- type
|
||||
- status
|
||||
- amount
|
||||
- region_id
|
||||
- currency_code
|
||||
- created_by
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The payment collection's ID
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- order_edit
|
||||
status:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- not_paid
|
||||
- awaiting
|
||||
- authorized
|
||||
- partially_authorized
|
||||
- captured
|
||||
- partially_captured
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- canceled
|
||||
- requires_action
|
||||
description:
|
||||
type: string
|
||||
description: Description of the payment collection
|
||||
amount:
|
||||
type: number
|
||||
description: Amount of the payment collection.
|
||||
authorized_amount:
|
||||
type: number
|
||||
description: Authorized amount of the payment collection.
|
||||
captured_amount:
|
||||
type: number
|
||||
description: Captured amount of the payment collection.
|
||||
refunded_amount:
|
||||
type: number
|
||||
description: Refunded amount of the payment collection.
|
||||
region_id:
|
||||
type: string
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
region:
|
||||
description: Available if the relation `region` is expanded.
|
||||
$ref: ./region.yaml
|
||||
currency_code:
|
||||
description: The 3 character ISO code for the currency.
|
||||
type: string
|
||||
example: usd
|
||||
externalDocs:
|
||||
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
||||
description: See a list of codes.
|
||||
currency:
|
||||
description: Available if the relation `currency` is expanded.
|
||||
$ref: ./currency.yaml
|
||||
payment_sessions:
|
||||
type: array
|
||||
description: Available if the relation `payment_sessions` is expanded.
|
||||
items:
|
||||
$ref: ./payment_session.yaml
|
||||
payments:
|
||||
type: array
|
||||
description: Available if the relation `payments` is expanded.
|
||||
items:
|
||||
$ref: ./payment.yaml
|
||||
created_by:
|
||||
type: string
|
||||
description: The ID of the user that created the payment collection.
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
@@ -12,7 +12,7 @@ required:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The cart's ID
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
name:
|
||||
description: >-
|
||||
|
||||
@@ -21,6 +21,15 @@ get:
|
||||
- type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: sales_channel_id
|
||||
style: form
|
||||
explode: false
|
||||
description: an array of sales channel IDs to filter the retrieved products by.
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: collection_id
|
||||
style: form
|
||||
@@ -30,6 +39,15 @@ get:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: type_id
|
||||
style: form
|
||||
explode: false
|
||||
description: Type IDs to search for
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: tags
|
||||
style: form
|
||||
@@ -59,11 +77,6 @@ get:
|
||||
description: Search for giftcards using is_giftcard=true.
|
||||
schema:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: type
|
||||
description: type to search for.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting products were created.
|
||||
|
||||
@@ -34,27 +34,27 @@ The first step is to create an Algolia app for your Medusa server. To create one
|
||||
|
||||
On the Applications page, click on the New application button at the top right.
|
||||
|
||||

|
||||

|
||||
|
||||
In the new page that opens, optionally enter a name for the application and choose a subscription plan. You can choose the Free plan for now, but it’s recommended to switch to the Pay-as-you-go plan as your business grows.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click on the Next Step button. If you picked Pay as you go service, you’ll need to enter billing details before you proceed.
|
||||
|
||||
Then, you’ll be asked to pick a region for your application. Once you’re done, click on Review Application Details.
|
||||
|
||||

|
||||

|
||||
|
||||
In the last step, you’ll see a summary of your order. If all looks good, check the checkboxes at the end of the form to indicate that you agree to the terms and conditions. Then, click on the Create Application button.
|
||||
|
||||

|
||||

|
||||
|
||||
## Retrieve API Keys
|
||||
|
||||
To retrieve the API keys that you’ll use in the next sections, go to Settings, then choose API Keys in the Team and Access section.
|
||||
|
||||

|
||||

|
||||
|
||||
On this page, you’ll find the Application ID, Search-Only API Key, and Admin API Key. You’ll need the Application ID and Admin API Key for the Medusa server. As for the storefront, you’ll need the Application ID and Search-Only API Key.
|
||||
|
||||
@@ -64,7 +64,7 @@ If you have more than one application in your Algolia account, make sure you’r
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
## Install the Algolia Plugin
|
||||
|
||||
@@ -128,7 +128,7 @@ npm run start
|
||||
|
||||
The quickest way to test that the integration is working is by sending a `POST` request to `/store/products/search`. This endpoint accepts a `q` body parameter of the query to search for and returns in the result the products that match this query.
|
||||
|
||||

|
||||

|
||||
|
||||
You can also check that the products are properly indexed by opening your Algolia dashboard and choosing Search from the left sidebar. You’ll find your products that are on your Medusa server added there.
|
||||
|
||||
@@ -138,7 +138,7 @@ If you have more than one application on your Algolia account, make sure you’r
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
### Add or Update Products
|
||||
|
||||
@@ -211,7 +211,7 @@ To make sure the Next.js storefront properly displays the products in the search
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
## Add to Gatsby and React-Based Storefronts
|
||||
|
||||
@@ -325,7 +325,7 @@ And add the `Search` component in the returned JSX before `RegionPopover`:
|
||||
|
||||
If you run your Gatsby storefront while the Medusa server is running, you should find a search bar in the header of the page. Try entering a query to search through the products in your store.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -118,31 +118,31 @@ This runs the Contentful migration in that file and makes the necessary changes
|
||||
|
||||
To check if the above migration worked, in your Contentful Space dashboard go to Content Models from the navigation bar. You should see the new content model Rich Text.
|
||||
|
||||

|
||||

|
||||
|
||||
The above migration also allows you to add Rich Text content to pages. To test this out, go to Content from the navigation bar and choose Page in the select field next to the search bar. This shows the available pages in your Contentful Space.
|
||||
|
||||

|
||||

|
||||
|
||||
Choose one of the pages. For example, the About page. Then, scroll down to the Add content button. If you click on it, you should be able to choose Rich Text under New Content.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on Rich Text and a new form will open to create new Rich Text content. It has the same fields that you defined in the migration file.
|
||||
|
||||

|
||||

|
||||
|
||||
After adding the content you want, click on the Publish button on the right then go back to the About page editor.
|
||||
|
||||

|
||||

|
||||
|
||||
Similarly, in the About page editor, click on the Publish Changes button on the right to view these changes later in the storefront.
|
||||
|
||||

|
||||

|
||||
|
||||
Similarly, you can add Rich Text content to any product page.
|
||||
|
||||

|
||||

|
||||
|
||||
## Render New Content Models in the Storefront
|
||||
|
||||
@@ -238,7 +238,7 @@ npm run start
|
||||
|
||||
This runs the Gatsby storefront on `localhost:8000`. Go to the storefront in your browser and open the About page. You should see the Rich Text content you added.
|
||||
|
||||

|
||||

|
||||
|
||||
### Render Component in a Product Page
|
||||
|
||||
@@ -306,7 +306,7 @@ This loops over `contentModules` and if the type of the content is Rich Text, it
|
||||
|
||||
Restart the Gatsby storefront then open a product that you added Rich Text content to. You should see the Rich Text component at the end of the page.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@ Set the value for `CONTENTFUL_ENV` to `master`.
|
||||
|
||||
To retrieve the value of `CONTENTFUL_SPACE_ID`, go to your [Contentful Space dashboard](https://app.contentful.com/). Then, choose Settings in the navigation bar and select API keys from the dropdown.
|
||||
|
||||

|
||||

|
||||
|
||||
On the APIs page, click Add API Key.
|
||||
|
||||

|
||||

|
||||
|
||||
In the form, enter a name for the API key and click Save.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, copy the value of Space ID and set it as the value of `CONTENTFUL_SPACE_ID`.
|
||||
|
||||
@@ -68,11 +68,11 @@ Then, copy the value of Space ID and set it as the value of `CONTENTFUL_SPACE_ID
|
||||
|
||||
Go back to the API Keys page and click on the Content management tokens tab.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on Generate personal token. A pop-up will open where you have to enter a name for the token.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you click Generate, a personal access token will be generated. Use it to set the value of `CONTENTFUL_ACCESS_TOKEN`.
|
||||
|
||||
@@ -141,7 +141,7 @@ npm run migrate:contentful
|
||||
|
||||
Once this command finishes executing, in your Contentful Space dashboard click on Content Model in the navigation bar. You should see a list of new content models added.
|
||||
|
||||

|
||||

|
||||
|
||||
### Seed Content to Contentful
|
||||
|
||||
@@ -155,7 +155,7 @@ npm run seed:contentful
|
||||
|
||||
After this command finishes running, in your Contentful Space dashboard click on Content in the navigation bar. You should see a list of new content added.
|
||||
|
||||

|
||||

|
||||
|
||||
### (Optional) Seed Medusa Database
|
||||
|
||||
@@ -177,7 +177,7 @@ npm run start
|
||||
|
||||
If you seeded the database with demo data, you should see that events related to the products are triggered.
|
||||
|
||||

|
||||

|
||||
|
||||
The Contentful integration ensures a two-way sync between the Medusa server and Contentful. So, when new products are added to Medusa, these products will be added to your Contentful Space as well.
|
||||
|
||||
@@ -195,7 +195,7 @@ To do that, open your Contentful Space Dashboard and click on Content in the Nav
|
||||
|
||||
Click on the checkbox at the top of the table to select all products then click Publish to publish these products.
|
||||
|
||||

|
||||

|
||||
|
||||
### Added Featured Products
|
||||
|
||||
@@ -203,19 +203,19 @@ On the homepage of the storefront, there’s a featured products tile that shows
|
||||
|
||||
To do that, open your Contentful Space Dashboard and click on Content in the Navigation bar. Make sure the select field next to the search bar is set to Any and search for Featured Products. You should find one content of the type Tile Section.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on it. You should find on the page an empty Tiles section where you can add tiles and products.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on Add content then on Add existing content and pick some of the products you want to show on the homepage.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done adding products, click on Publish changes in the right sidebar.
|
||||
|
||||

|
||||

|
||||
|
||||
## Setup Gatsby Storefront
|
||||
|
||||
@@ -250,7 +250,7 @@ To retrieve the value of `CONTENTFUL_ACCESS_TOKEN`, on your Contentful Space das
|
||||
|
||||
You should find the field "Content Delivery API - access token”. Copy its value and set it as the value of `CONTENTFUL_ACCESS_TOKEN`.
|
||||
|
||||

|
||||

|
||||
|
||||
### Start Storefront
|
||||
|
||||
@@ -262,7 +262,7 @@ npm run start
|
||||
|
||||
This starts the storefront at `localhost:8000`. Open it in your browser and you should see on the homepage the Featured Product section with the products you chose on Contentful.
|
||||
|
||||

|
||||

|
||||
|
||||
## Make Changes to Content
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
# Klarna (Documentation coming soon)
|
||||
---
|
||||
hide_footer: true
|
||||
---
|
||||
|
||||
[View plugin here](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-klarna)
|
||||
# Klarna
|
||||
|
||||
:::note
|
||||
|
||||
This guide is coming soon.
|
||||
|
||||
:::
|
||||
|
||||
[View plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-klarna)
|
||||
@@ -61,7 +61,7 @@ const plugins = [
|
||||
newsletter_list_id: process.env.MAILCHIMP_NEWSLETTER_LIST_ID
|
||||
}
|
||||
}
|
||||
};
|
||||
];
|
||||
```
|
||||
|
||||
## Test it Out
|
||||
@@ -72,7 +72,7 @@ This plugin adds a new `POST` endpoint at `/mailchimp/subscribe`. This endpoint
|
||||
|
||||
Try sending a `POST` request to `/mailchimp/subscribe` with the following JSON body:
|
||||
|
||||
```json
|
||||
```json noHeader
|
||||
{
|
||||
"email": "example@gmail.com"
|
||||
}
|
||||
@@ -80,17 +80,17 @@ Try sending a `POST` request to `/mailchimp/subscribe` with the following JSON b
|
||||
|
||||
If the subscription is successful, a `200` response code will be returned with `OK` message.
|
||||
|
||||

|
||||

|
||||
|
||||
If you check your Mailchimp dashboard, you should find the email added to your Audience list.
|
||||
|
||||

|
||||

|
||||
|
||||
### With Additional Data
|
||||
|
||||
Here’s an example of sending additional data with the subscription:
|
||||
|
||||
```json
|
||||
```json noHeader
|
||||
{
|
||||
"email": "example@gmail.com",
|
||||
"data": {
|
||||
@@ -173,7 +173,7 @@ export default function NewsletterForm() {
|
||||
|
||||
This will result in a subscription form similar to the following:
|
||||
|
||||

|
||||

|
||||
|
||||
If you try entering an email and clicking Subscribe, the email will be subscribed to your Mailchimp newsletter successfully.
|
||||
|
||||
|
||||
@@ -89,11 +89,11 @@ npm run start
|
||||
|
||||
The quickest way to test that the integration is working is by sending a `POST` request to `/store/products/search`. This endpoint accepts a `q` body parameter of the query to search for and returns in the result the products that match this query.
|
||||
|
||||

|
||||

|
||||
|
||||
You can also check that the products are properly indexed by opening the MeiliSearch host URL in your browser, which is `http://127.0.0.1:7700/` by default. You’ll find your products that are on your Medusa server added there.
|
||||
|
||||

|
||||

|
||||
|
||||
### Add or Update Products
|
||||
|
||||
@@ -170,7 +170,7 @@ To make sure the Next.js storefront properly displays the products in the search
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
### Add to Gatsby and React-Based Storefronts
|
||||
|
||||
@@ -284,7 +284,7 @@ And add the `Search` component in the returned JSX before `RegionPopover`:
|
||||
|
||||
If you run your Gatsby storefront while the Medusa server and the MeiliSearch instance are running, you should find a search bar in the header of the page. Try entering a query to search through the products in your store.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -32,19 +32,19 @@ minio server ~/minio --console-address :9090 --address :9001
|
||||
|
||||
After installing MinIO and logging into the Console, click on “Create Bucket” to create a new bucket that will store the files of your Medusa server.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, in the form, enter a name for the bucket and click on Create Bucket. By MinIO’s requirement, the name can only consist of lower case characters, numbers, dots (`.`), and hyphens (`-`).
|
||||
|
||||

|
||||

|
||||
|
||||
After creating the bucket, click on the cog icon at the top right to configure the bucket.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, click on the edit icon next to Access Policy. This will open a pop-up.
|
||||
|
||||

|
||||

|
||||
|
||||
In the pop-up, change the selected value to “public” and click Set.
|
||||
|
||||
@@ -58,15 +58,15 @@ Changing the Access Policy to public will allow anyone to access your bucket. Av
|
||||
|
||||
From the sidebar of your MinIO console, click on Identity then Service Accounts.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, click on Create Service Account.
|
||||
|
||||

|
||||

|
||||
|
||||
This will generate a random Access Key and Secret Key for you.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on Create. A pop-up will then show the value for your Access Key and Secret Key. Copy them to use in the next section.
|
||||
|
||||
@@ -119,7 +119,7 @@ If you have multiple storage plugins configured, the last plugin declared in the
|
||||
|
||||
Run your Medusa server alongside the [Medusa Admin](../admin/quickstart.md) to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in a MinIO server.
|
||||
|
||||

|
||||

|
||||
|
||||
## Private Buckets
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ Make sure to replace `<YOUR_CLIENT_ID>` with your PayPal Client ID.
|
||||
|
||||
Now, if you run your Medusa server and your storefront, on checkout you’ll be able to use PayPal].
|
||||
|
||||

|
||||

|
||||
|
||||
You can test out the payment with PayPal using your sandbox account.
|
||||
|
||||
@@ -276,7 +276,7 @@ That’s all you need to integrate PayPal into the Gatsby storefront.
|
||||
|
||||
Now, start the Medusa server and the Gatsby storefront server. Try adding an item into the cart and proceeding to checkout. When you reach the payment step, you should see the PayPal button.
|
||||
|
||||

|
||||

|
||||
|
||||
You can test out the payment with PayPal using your sandbox account.
|
||||
|
||||
@@ -382,13 +382,13 @@ You can then import this component where you want to show it in your storefront.
|
||||
|
||||
If you run the Medusa server and the storefront server, you should see the PayPal button on checkout.
|
||||
|
||||

|
||||

|
||||
|
||||
## Capture Payments
|
||||
|
||||
After the customer places an order, you can see the order on the admin panel. In the payment information under the “Payment” section, you should see a “Capture” button.
|
||||
|
||||

|
||||

|
||||
|
||||
Clicking this button lets you capture the payment for an order. You can also refund payments if an order has captured payments.
|
||||
|
||||
|
||||
@@ -22,23 +22,23 @@ You need to [create an AWS account](https://console.aws.amazon.com/console/home?
|
||||
|
||||
On your AWS Console, search for S3 in the search box at the top. Then, choose the first result you see which should be S3 under the Services category.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, on the new page that opens, click on Create Bucket button at the top right of the Buckets table.
|
||||
|
||||

|
||||

|
||||
|
||||
The Create Bucket form will open. In the General Configuration section enter a name for the bucket and choose a region for the bucket. Both of the values of these fields are important as you’ll use them throughout the documentation.
|
||||
|
||||

|
||||

|
||||
|
||||
Next, in the Object Ownership section, choose ACLs enabled. Then, two radio buttons will show below it. Choose Bucket owner preferred.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, in the “Block Public Access settings for this bucket” section, uncheck the “Block all public access” checkbox. This shows a warning message at the bottom of the section with another checkbox. Check the checkbox to ensure you understand that objects in the bucket are publicly accessible.
|
||||
|
||||

|
||||

|
||||
|
||||
You can leave the rest of the fields in the form as is and scroll down to the end of the page. Then, click on the Create Bucket button.
|
||||
|
||||
@@ -46,7 +46,7 @@ You can leave the rest of the fields in the form as is and scroll down to the en
|
||||
|
||||
On the page of the bucket you just created, click on the Permissions tab. Then, scroll down until you find the Bucket policy section. Click on Edit in that section.
|
||||
|
||||

|
||||

|
||||
|
||||
In the Edit Bucket Policy page, enter the following in the field:
|
||||
|
||||
@@ -142,11 +142,11 @@ Then, you can either test the plugin using the [REST APIs](https://docs.medusajs
|
||||
|
||||
On the Medusa Admin, create a new product and, in the Images section, upload an image then click Save. If the integration was successful, the product image will be uploaded successfully.
|
||||
|
||||

|
||||

|
||||
|
||||
You can also check that the image was uploaded on the S3 bucket’s page.
|
||||
|
||||

|
||||

|
||||
|
||||
## Next.js Storefront Configuration
|
||||
|
||||
|
||||
@@ -52,23 +52,23 @@ You need to [create a Segment account](https://app.segment.com/signup/) to follo
|
||||
|
||||
On your Segment dashboard, choose Catalog from the sidebar under Connections.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, in the catalog list find the Server category and choose Node.js from the list.
|
||||
|
||||

|
||||

|
||||
|
||||
This opens a new side menu. In the side menu, click on Add Source.
|
||||
|
||||

|
||||

|
||||
|
||||
This opens a new page to create a Node.js source. Enter the name of the source then click Add Source.
|
||||
|
||||

|
||||

|
||||
|
||||
On the new source dashboard, you should find a Write Key. You’ll use this key in the next section after you install the Segment plugin on your Medusa server.
|
||||
|
||||

|
||||

|
||||
|
||||
### Optional: Add Destination
|
||||
|
||||
@@ -76,11 +76,11 @@ After you create the Segment source, you can add destinations. This is where the
|
||||
|
||||
To add a destination, on the same Segment source page, click on Add Destination in the Destinations section.
|
||||
|
||||

|
||||

|
||||
|
||||
You can then choose from a list of destinations such as Google Universal Analytics or Facebook Pixel.
|
||||
|
||||

|
||||

|
||||
|
||||
The process of integrating each destination is different, so you must follow the steps detailed in Segment for each destination you choose.
|
||||
|
||||
@@ -126,7 +126,7 @@ Then, try triggering one of the [mentioned events earlier in this document](#eve
|
||||
|
||||
After you place an order, on the Segment source that you created, click on the Debugger tab. You should see at least one event triggered for each order you place. If you click on the event, you can see the order details are passed to the event.
|
||||
|
||||

|
||||

|
||||
|
||||
If you added a destination, you can also check your destination to make sure the data is reflected there.
|
||||
|
||||
@@ -183,7 +183,7 @@ The `SegmentServer` also provides the method `identify` to tie a user to their a
|
||||
|
||||
After adding the above subscriber, run your server again if it isn’t running and create a customer using the REST APIs or one of the Medusa storefronts. If you check the Debugger in your Segment source, you should see a new event “Customer Created” tracked. If you click on it, you’ll see the data you passed to the `track` method.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"beforeInsert": [Function],
|
||||
"billing_address": null,
|
||||
@@ -306,7 +306,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"beforeInsert": [Function],
|
||||
"billing_address": null,
|
||||
@@ -537,7 +537,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"date": Any<String>,
|
||||
"email": "test@testson.com",
|
||||
@@ -819,7 +819,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"date": Any<String>,
|
||||
"email": "test@testson.com",
|
||||
@@ -1261,7 +1261,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"date": Any<String>,
|
||||
"email": "test@testson.com",
|
||||
@@ -1703,7 +1703,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"claim": Object {
|
||||
"canceled_at": null,
|
||||
@@ -2000,7 +2000,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"locale": null,
|
||||
"swap": Object {
|
||||
@@ -2509,7 +2509,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
Object {
|
||||
"additional_total": "16.88 USD",
|
||||
"date": Any<String>,
|
||||
@@ -3089,7 +3089,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
{
|
||||
"locale": null,
|
||||
"swap": Object {
|
||||
@@ -3599,7 +3599,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
Object {
|
||||
"code": Any<String>,
|
||||
"value": 4,
|
||||
@@ -3766,7 +3766,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
Object {
|
||||
"id": Any<String>,
|
||||
"email": "test@testson.com",
|
||||
@@ -3786,7 +3786,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
Object {
|
||||
"email": "test@testson.com",
|
||||
"token": Any<String>,
|
||||
@@ -3803,7 +3803,7 @@ You don’t have to create a template for every type in the reference. You can s
|
||||
<details>
|
||||
<summary>Example Data</summary>
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
Object {
|
||||
"product": Object {
|
||||
"collection_id": null,
|
||||
@@ -3959,7 +3959,7 @@ If you don’t have a storefront installed, check out the [Gatsby](../starters/g
|
||||
|
||||
You can also track analytics related to emails sent from the SendGrid dashboard.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ The first step is to create a Slack app. This app will be connected to your work
|
||||
|
||||
Go to [Slack API](https://api.slack.com/) and click Create app. This will take you to a new page with a pop-up. In the pop-up, choose From scratch.
|
||||
|
||||

|
||||

|
||||
|
||||
You’ll then need to enter some info like the App name and the workspace it will be connected to. Once you’re done, the app will be created.
|
||||
|
||||
@@ -49,17 +49,17 @@ You’ll then need to enter some info like the App name and the workspace it wil
|
||||
|
||||
To activate Incoming Webhooks, choose Features > Incoming Webhooks from the sidebar. At first, it will be disabled so make sure to enable it by switching the toggle.
|
||||
|
||||

|
||||

|
||||
|
||||
### Add New Webhook
|
||||
|
||||
After activating Incoming Webhooks, on the same page scroll down and click on the Add New Webhook to Workspace button.
|
||||
|
||||

|
||||

|
||||
|
||||
After that, choose the channel to send the notifications to. You can also choose a DM to send the notifications to. Once you’re done click Allow.
|
||||
|
||||

|
||||

|
||||
|
||||
This will create a new Webhook with a URL which you can see in the table at the end of the Incoming Webhooks page. Copy the URL as you’ll use it in the next section.
|
||||
|
||||
|
||||
@@ -28,15 +28,15 @@ You need to [create a DigitalOcean account](https://cloud.digitalocean.com/regi
|
||||
|
||||
In your DigitalOcean account, click on the Create button at the top right, then choose Spaces from the dropdown.
|
||||
|
||||

|
||||

|
||||
|
||||
In the Create a Space form, you can choose any of the regions listed. You can alternatively leave all settings as they are and scroll down to the Finalize and Create section.
|
||||
|
||||

|
||||

|
||||
|
||||
In the Finalize and Create section, enter a name for the field “Choose a unique name”. You’ll use this name later in the integration with Medusa. Also, select the project you want to add the new Space to.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click on the Create a Space button. This creates the Space and redirects you to the Space’s page.
|
||||
|
||||
@@ -44,15 +44,15 @@ Once you’re done, click on the Create a Space button. This creates the Space a
|
||||
|
||||
Choose API from the bottom of the sidebar.
|
||||
|
||||

|
||||

|
||||
|
||||
This opens the Application & API page. Scroll down to Spaces Access Keys and click the Generate New Key button.
|
||||
|
||||

|
||||

|
||||
|
||||
This shows a table with the Name field editable. Enter a name for the Access Keys and click on the checkmark button to save and generate the Spaces access keys.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, two keys will be available under the Key column of the table. The first one is the Access Key ID and the second is the Secret Access Key. Copy both as you’ll use them later.
|
||||
|
||||
@@ -84,12 +84,12 @@ Where:
|
||||
|
||||
1. `<YOUR_SPACE_URL>` is the URL of your Space which you can find on the Space’s page below the Space’s name.
|
||||
|
||||

|
||||

|
||||
|
||||
2. `<YOUR_SPACE_NAME>` is the name of your Space.
|
||||
3. `<YOUR_SPACE_ENDPOINT>` is your Space’s endpoint which can be found by going to your Space’s page, clicking on the Settings tab, and scrolling to the Endpoint section.
|
||||
|
||||

|
||||

|
||||
|
||||
4. `<YOUR_ACCESS_KEY_ID>` and `<YOUR_SECRET_ACCESS_KEY>` are the keys you created in the previous section.
|
||||
|
||||
@@ -129,11 +129,11 @@ Then, you can either test the plugin using the [REST APIs](https://docs.medusaj
|
||||
|
||||
On the Medusa Admin, create a new product and, in the Images section, upload an image then click Save. If the integration was successful, the product image will be uploaded successfully.
|
||||
|
||||

|
||||

|
||||
|
||||
You can also check that the image was uploaded on the Space’s page.
|
||||
|
||||

|
||||

|
||||
|
||||
## Next.js Storefront Configuration
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ This creates the Strapi project in the directory `strapi-medusa`.
|
||||
|
||||
Once the installation is finished, the Strapi development server will run on `localhost:1337`. A new page will also open in your default browser to create a new admin user and log in.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you log in, you can access the Strapi dashboard.
|
||||
|
||||
@@ -44,11 +44,11 @@ Once you log in, you can access the Strapi dashboard.
|
||||
|
||||
The Strapi plugin in Medusa requires the credentials of a Strapi user. To create a new user, go to Content Manager, then choose User under Collection Types.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on the Create new entry button at the top right. This opens a new form to enter the user’s details.
|
||||
|
||||

|
||||

|
||||
|
||||
Enter the user’s username, email, and password. Once you’re done, click on the Save button at the top right.
|
||||
|
||||
@@ -58,7 +58,7 @@ By default, created users have the “Authenticated” role. Before you start us
|
||||
|
||||
On your Strapi dashboard, go to Settings → Roles → Authenticated. Then, under the Permissions section, expand the accordion of each content model type and check the Select All checkbox.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click the Save button at the top right.
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ Make sure to replace `<YOUR_PUBLISHABLE_KEY>` with your Stripe Publishable Key.
|
||||
|
||||
Now, if you run your Medusa server and your storefront, on checkout you’ll be able to use Stripe.
|
||||
|
||||

|
||||

|
||||
|
||||
### Add to Gatsby Storefront
|
||||
|
||||
@@ -151,7 +151,7 @@ You might find this environment variable already available so you can just repla
|
||||
|
||||
Now, if you run your Medusa server and your storefront, on checkout you’ll be able to use Stripe.
|
||||
|
||||

|
||||

|
||||
|
||||
### Add to Custom Storefront
|
||||
|
||||
@@ -344,13 +344,13 @@ Once the promise resolves you can handle the errors, if there are any. If not, y
|
||||
|
||||
If you run your server and storefront now, you’ll see the Stripe UI element and you’ll be able to make orders.
|
||||
|
||||

|
||||

|
||||
|
||||
## Capture Payments
|
||||
|
||||
After the customer places an order, you’ll be able to see the order on the admin panel. In the payment information under the “Payment” section, you should see a “Capture” button.
|
||||
|
||||

|
||||

|
||||
|
||||
Clicking this button allows you to capture the payment for an order. You can also refund payments if an order has captured payments.
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ If you’re on a Twilio trial make sure that the phone number you entered on che
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Before running your Medusa admin, make sure that your Medusa server is running.
|
||||
|
||||
To run your Medusa server, go to the directory holding the server and run:
|
||||
|
||||
```bash npm2yarn
|
||||
```bash npm2yarn noHeader
|
||||
npm run start
|
||||
```
|
||||
|
||||
@@ -57,7 +57,7 @@ npm run start
|
||||
|
||||
By default, the admin runs on port 7000. So, in your browser, go to `localhost:7000` to view your admin.
|
||||
|
||||

|
||||

|
||||
|
||||
Use your Medusa admin’s user credentials to log in.
|
||||
|
||||
@@ -65,7 +65,7 @@ Use your Medusa admin’s user credentials to log in.
|
||||
|
||||
If you installed the demo data when you installed the Medusa server by using the `--seed` option or running:
|
||||
|
||||
```bash npm2yarn
|
||||
```bash npm2yarn noHeader
|
||||
npm run seed
|
||||
```
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ If the batch job has been pre-processed, the status of the batch job will be `pr
|
||||
|
||||
Here’s an example of the `result` property:
|
||||
|
||||
```json
|
||||
```json noHeader
|
||||
"result": {
|
||||
"count": 5, // Total number of prices to be added
|
||||
"stat_descriptors": [ //details about the prices to be added
|
||||
|
||||
@@ -223,14 +223,14 @@ If the batch job has been pre-processed, the status of the batch job will be `pr
|
||||
|
||||
Here’s an example of the `result` property:
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
"result": {
|
||||
"count": 5, // Total number of products to be created or updated
|
||||
"stat_descriptors": [ //details about the products to be created/updated
|
||||
{
|
||||
"key": "product-import-count",
|
||||
"name": "Products/variants to import",
|
||||
"message": "There will be 2 products created (0 updated).\n 3 variants will be created and 0 updated"
|
||||
"message": "There will be 2 products created (0 updated).\n 3 variants will be created and 0 updated"
|
||||
}
|
||||
],
|
||||
"advancement_count": 0 //number of products processed so far. Will be 0 before the import is confirmed.
|
||||
|
||||
@@ -349,7 +349,7 @@ curl --location --request GET '<YOUR_SERVER>/admin/batch-jobs/<BATCH_JOB_ID>' \
|
||||
|
||||
Based on the batch job strategy implemented in this documentation, the `result` property could be something like this:
|
||||
|
||||
```jsx
|
||||
```json noHeader
|
||||
"result": {
|
||||
"count": 1,
|
||||
"stat_descriptors": [
|
||||
|
||||
@@ -54,7 +54,7 @@ If the batch job fails at any point in this flow, its status is changed to `fail
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ Once it is time to run your cron job based on the cron job expression pattern, t
|
||||
|
||||
For example, the above cron job will run at 12 AM and, when it runs, you can see the following logged on your Medusa server:
|
||||
|
||||
```bash
|
||||
```bash noHeader
|
||||
info: Processing cron job: publish-products
|
||||
```
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ A customer group is stored in the database as a [CustomerGroup](../../../refere
|
||||
|
||||
Similar to all entities in Medusa, you can use the `metadata` object attribute to store any custom data you want. For example, you can add some flag or tag to the customer group for a custom use case:
|
||||
|
||||
```jsx
|
||||
```jsx noHeader
|
||||
metadata: {
|
||||
is_seller: true
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ Be careful with your file names as it can cause unclear errors in Typeorm. Make
|
||||
|
||||
Before trying this step make sure that you’ve created and run your migrations. You also need to re-build your code using:
|
||||
|
||||
```bash npm2yarn
|
||||
```bash npm2yarn noHeader
|
||||
npm run build
|
||||
```
|
||||
|
||||
|
||||
@@ -267,11 +267,11 @@ You must be authenticated as an admin user before sending this request. You can
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
Then, send a request to the [Resend Notification](https://docs.medusajs.com/api/admin/#tag/Notification/operation/PostNotificationsNotificationResend) endpoint using the ID retrieved from the previous request. You can pass the `to` parameter in the body to change the receiver of the notification. You should see the message “Notification Resent” in your console and if you implemented your own logic for resending the notification it will be resent.
|
||||
|
||||

|
||||

|
||||
|
||||
This request returns the same notification object as the List Notifications endpoint, but it now has a new object in the `resends` array. This is the resent notification. If you supplied a `to` parameter in the request body, you should see its value in the `to` property of the resent notification object.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ All these methods must be declared async in the Payment Provider Service.
|
||||
|
||||
These methods are used at different points in the Checkout flow as well as when processing the order after it’s placed.
|
||||
|
||||

|
||||

|
||||
|
||||
## Create a Payment Provider
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ If files and directories aren't placed in the root of your plugin, the Medusa se
|
||||
|
||||
An example of a plugin's directory before testing or publishing:
|
||||
|
||||
```
|
||||
```bash noHeader
|
||||
medusa-plugin-custom
|
||||
|
|
||||
|_ _ _ api
|
||||
|
||||
@@ -37,7 +37,7 @@ When you create a price list, you can specify different conditions to control wh
|
||||
|
||||
In the body of your request, aside from the required fields, you can send the following fields to apply different conditions:
|
||||
|
||||
```js
|
||||
```js noHeader
|
||||
{
|
||||
prices: [
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ This method accepts the variant ID as a first parameter and the [context](./inde
|
||||
|
||||
This method must return an object having the following fields:
|
||||
|
||||
```typescript
|
||||
```typescript noHeader
|
||||
{
|
||||
originalPrice, //number | null
|
||||
calculatedPrice, //number | null
|
||||
|
||||
@@ -54,7 +54,7 @@ In this section, you'll learn how to use services throughout your Medusa server.
|
||||
|
||||
Before using your service, make sure you run the `build` command:
|
||||
|
||||
```bash npm2yarn
|
||||
```bash npm2yarn noHeader
|
||||
npm run build
|
||||
```
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ It’s also constructed to support multiple regions, provide different shipment
|
||||
- **Shipping Options:** created by the admin and belong to a shipping profile. They are specific to certain regions and can have cart conditions. They use an underlying fulfillment provider. Once a customer checks out, they can choose the shipping option that’s available and most relevant to them.
|
||||
- **Shipping Method:** created when the customer chooses a shipping option on checkout. The shipping method is basically a copy of the shipping option, but with values specific to the customer and the cart it’s associated with. When the order is placed, the shipping method will then be associated with the order and fulfilled based on the integration with the fulfillment provider.
|
||||
|
||||

|
||||

|
||||
|
||||
## Fulfillment Provider
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ The `ShippingMethod` entity also has the `includes_tax` attribute. Its value is
|
||||
|
||||
When a price is tax-inclusive, the tax amount is calculated using the following formula:
|
||||
|
||||
```jsx
|
||||
```jsx noHeader
|
||||
const taxAmount = (taxRate * taxInclusivePrice) / (1 + taxRate)
|
||||
```
|
||||
|
||||
@@ -110,7 +110,7 @@ Price lists include a list of prices that can be used to override the original p
|
||||
|
||||
Each variant’s price in the price list is compared to the variant’s original price using the following condition:
|
||||
|
||||
```jsx
|
||||
```jsx noHeader
|
||||
amount < (1 + taxRate) * calculatedPrice
|
||||
```
|
||||
|
||||
@@ -120,7 +120,7 @@ Where `amount` is the amount of the variant’s price in the price list, `taxRat
|
||||
|
||||
Here is an example of these fields when tax inclusivity is enabled for both the currency and the price list:
|
||||
|
||||
```jsx
|
||||
```jsx noHeader
|
||||
{
|
||||
original_price: 110,
|
||||
calculated_price: 100,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
description: 'Actions Required for v.1.6.1'
|
||||
---
|
||||
|
||||
# v1.6.1
|
||||
|
||||
Updating your medusa server to version `1.6.1` requires running migrations on your server.
|
||||
|
||||
## Overview
|
||||
|
||||
As the new version `1.6.1` make changes to the database schema, it is required to run new migrations before you start your server.
|
||||
|
||||
Without running the migrations, you might have trouble accessing and using the Medusa admin.
|
||||
|
||||
## Actions Required
|
||||
|
||||
After updating your server, run migrations with the following command:
|
||||
|
||||
```bash
|
||||
medusa migrations run
|
||||
```
|
||||
@@ -93,6 +93,33 @@ If the admonition does not match any of the mentioned criteria, always default t
|
||||
|
||||
If you are adding images to a documentation page, you can host the image on [Imgur](https://imgur.com) for free.
|
||||
|
||||
## Code Block Types
|
||||
|
||||
In the Medusa documentation, there are two code block types: code blocks with headers and code blocks without headers.
|
||||
|
||||
Code blocks without headers should be used when:
|
||||
|
||||
- The code block is used inside an Admonition.
|
||||
- The content of the code block can't be reported (for example, if the code block contains only a text of the expected output).
|
||||
|
||||
In all other cases, code blocks with headers should be used.
|
||||
|
||||
### Code Blocks with Headers
|
||||
|
||||
By default, all code blocks have headers and no additional actions are required to add the header.
|
||||
|
||||
### Code Blocks without Headers
|
||||
|
||||
To add a code block without a header, simply add `noHeader` after the beginning backticks of the code block. For example:
|
||||
|
||||
~~~md
|
||||
```bash noHeader
|
||||
this code block does not have a header
|
||||
```
|
||||
~~~
|
||||
|
||||
`noHeader` should be added after the language of the code block (which is `bash` in the above example). If you used `npm2yarn` as well, `noHeader` should be after it.
|
||||
|
||||
## NPM and Yarn Code Blocks
|
||||
|
||||
If you’re adding code blocks that use NPM and Yarn, you must use the [npm2yarn syntax](https://docusaurus.io/docs/markdown-features/code-blocks#npm2yarn-remark-plugin).
|
||||
|
||||
@@ -41,11 +41,11 @@ Before you can deploy your Medusa Admin you need to create a GitHub repository a
|
||||
|
||||
On GitHub, click the plus icon at the top right, then click New Repository.
|
||||
|
||||

|
||||

|
||||
|
||||
You’ll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
|
||||
|
||||

|
||||

|
||||
|
||||
### Push Code to GitHub Repository
|
||||
|
||||
@@ -53,7 +53,7 @@ The next step is to push the code to the GitHub repository you just created.
|
||||
|
||||
After creating the repository, you’ll be redirected to the repository’s page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
|
||||
|
||||

|
||||

|
||||
|
||||
Copy the link. Then, open your terminal in the directory that holds your Medusa Admin codebase and run the following commands:
|
||||
|
||||
@@ -88,21 +88,21 @@ Alternatively, if you don’t have any other websites, you’ll see a big button
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
You’ll then be asked to connect to a Git provider.
|
||||
|
||||

|
||||

|
||||
|
||||
Choose GitHub. You’ll then be redirected to GitHub’s website to give Netlify permissions if you haven’t done that before.
|
||||
|
||||
After you authorize Netlify to use GitHub, you’ll be asked to pick the repository you want to deploy. Pick the repository you just created.
|
||||
|
||||

|
||||

|
||||
|
||||
In the form that shows, keep all fields the same and click on the “Show advanced” button before the “Deploy site” button.
|
||||
|
||||

|
||||

|
||||
|
||||
Under the “Advanced build settings” section click on the “New variable” button. This will show two inputs for the key and value of the environment variable.
|
||||
|
||||
@@ -114,23 +114,23 @@ If you haven’t deployed your Medusa server yet, you can leave the value blank
|
||||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, scroll down and click on Deploy site.
|
||||
|
||||
You’ll be then redirected to the dashboard of the new website. Netlify will build your website in the background. You should see “Site deploy in progress” on the top card.
|
||||
|
||||

|
||||

|
||||
|
||||
The deployment can take a few minutes.
|
||||
|
||||
Once the deployment is done, you’ll find the URL in the place of the “Site deploy in progress” message you saw earlier.
|
||||
|
||||

|
||||

|
||||
|
||||
If you click on it, you’ll be redirected to the deployed admin website.
|
||||
|
||||

|
||||

|
||||
|
||||
:::note
|
||||
|
||||
@@ -160,11 +160,11 @@ netlify login
|
||||
|
||||
This opens a page to log in on your browser. You’ll be asked to authorize the Netlify CLI tool.
|
||||
|
||||

|
||||

|
||||
|
||||
Click on Authorize. Then, you can go back to your terminal and see that you’ve successfully logged in.
|
||||
|
||||

|
||||

|
||||
|
||||
#### Initialize Netlify Website
|
||||
|
||||
@@ -180,7 +180,7 @@ You’ll have to follow five steps for the initialization:
|
||||
|
||||
You’ll be asked to either connect to an existing Netlify website or create a new one. Choose the second option to create a new site:
|
||||
|
||||
```bash
|
||||
```bash noHeader
|
||||
? What would you like to do?
|
||||
⇄ Connect this directory to an existing Netlify site
|
||||
❯ + Create & configure a new site
|
||||
@@ -198,7 +198,7 @@ You’ll be asked to optionally enter a site name.
|
||||
|
||||
At this point, the website is created on Netlify. However, Netlify needs to configure Webhooks and deployment keys. You’ll be asked to either authorize GitHub through Netlify’s website or through a personal access token. You’re free to choose either:
|
||||
|
||||
```bash
|
||||
```bash noHeader
|
||||
? Netlify CLI needs access to your GitHub account to configure Webhooks and Depl
|
||||
oy Keys. What would you like to do? (Use arrow keys)
|
||||
❯ Authorize with GitHub through app.netlify.com
|
||||
@@ -251,7 +251,7 @@ netlify open:site
|
||||
|
||||
The Medusa Admin will then open in your browser.
|
||||
|
||||

|
||||

|
||||
|
||||
Before you can use Medusa Admin, you must add the URL as an environment variable on your deployed Medusa server.
|
||||
|
||||
|
||||
@@ -74,11 +74,11 @@ Before you can deploy your Medusa server you need to create a GitHub repository
|
||||
|
||||
On GitHub, click the plus icon at the top right, then click New Repository.
|
||||
|
||||

|
||||

|
||||
|
||||
You’ll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
|
||||
|
||||

|
||||

|
||||
|
||||
### Push Code to GitHub Repository
|
||||
|
||||
@@ -86,7 +86,7 @@ The next step is to push the code to the GitHub repository you just created.
|
||||
|
||||
After creating the repository, you’ll be redirected to the repository’s page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
|
||||
|
||||

|
||||

|
||||
|
||||
Copy the link. Then, open your terminal in the directory that holds your Medusa server codebase and run the following commands:
|
||||
|
||||
@@ -111,13 +111,13 @@ After pushing the changes, you can find the files in your GitHub repository.
|
||||
|
||||
After logging into your account, click on the Create button at the top right, then choose App.
|
||||
|
||||

|
||||

|
||||
|
||||
### Choose Repository
|
||||
|
||||
In the Create App page, choose GitHub from the Service Provider list.
|
||||
|
||||

|
||||

|
||||
|
||||
If you haven’t given DigitalOcean access before, click on Manage Access under Source Code. You’ll then be redirected to GitHub to give DigitalOcean access.
|
||||
|
||||
@@ -125,7 +125,7 @@ Once DigitalOcean have access to your GitHub account, you should see a Repositor
|
||||
|
||||
Additional inputs will show up to choose the Branch, Source Directory, and Autodeploy options.
|
||||
|
||||

|
||||

|
||||
|
||||
If you host your Medusa server in a monorepo, you should change the Source Directory to the directory the server is available in the repository. Otherwise, it can be left as is.
|
||||
|
||||
@@ -135,7 +135,7 @@ Once you’re done, click Next to move on to the next step.
|
||||
|
||||
In the next step, you’ll see the resources to create.
|
||||
|
||||

|
||||

|
||||
|
||||
If you have a Dockerfile available in the server’s codebase (which is available by default), you’ll have two resources showing. You can remove it by clicking on the trash icon at the right of the resource.
|
||||
|
||||
@@ -143,7 +143,7 @@ By default, DigitalOcean hosts the web service in a sub-path of the domain name
|
||||
|
||||
Then, scroll to HTTP Request Routes and expand it by clicking on Edit at its right. Change the value of the Routes input to `/`.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done click Save. You’ll be taken back to the Resources page.
|
||||
|
||||
@@ -151,15 +151,15 @@ Once you’re done click Save. You’ll be taken back to the Resources page.
|
||||
|
||||
On the same page, expand the Add Resources section, choose Database, then click Add.
|
||||
|
||||

|
||||

|
||||
|
||||
In the new page, you’ll be shown a PostgreSQL database to be created. Notice that it’s important to choose a name that you’ll remember as you’ll need the name in next steps. You can leave the name as is if it’s not necessary to change it.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click Create and Attach. You’ll be redirected back to the previous page with the database added to the resources.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click Next to move on to the next step.
|
||||
|
||||
@@ -169,7 +169,7 @@ In this section, you’ll add environment variables that are essential to your M
|
||||
|
||||
You should see two ways to add environment variables: Global or specific to the Web Service.
|
||||
|
||||

|
||||

|
||||
|
||||
Click Edit on the second row to add environment variables specific to the Web Service. Add the following environment variables:
|
||||
|
||||
@@ -202,7 +202,7 @@ Once you’re done click Save.
|
||||
|
||||
In the next section, you’ll be shown the app info and the region it will be deployed to. You can leave it all as is or make changes if you find it necessary.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click Next to go to the next step.
|
||||
|
||||
@@ -214,15 +214,15 @@ While the server is being deployed, you can create the Redis resource.
|
||||
|
||||
Click the Create button at the top right and choose Database from the dropdown.
|
||||
|
||||

|
||||

|
||||
|
||||
In the new page under Choose a database engine, choose Redis.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, scroll down to the “Choose a name” input. Since you used the name `redis` in the `REDIS_URL` environment variables, change the value to `redis` here.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done, click on Create Database Cluster.
|
||||
|
||||
@@ -232,11 +232,11 @@ Once the Redis database is created go back to the App you created earlier by cho
|
||||
|
||||
Click at the white Create button at the top right and choose Create/Attach Database.
|
||||
|
||||

|
||||

|
||||
|
||||
In the new page, click on the Previously Created DigitalOcean Database radio button. Then, under Database Cluster select the Redis database you just created.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you’re done click Attach Database. This will add the Redis database to the list of resources of your App and will trigger a redeploy of the App.
|
||||
|
||||
@@ -244,11 +244,11 @@ Once you’re done click Attach Database. This will add the Redis database to th
|
||||
|
||||
Once the redeployment is complete, copy the URL of the App which can be found under the App’s name.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, go to `<YOUR_APP_URL>/store/products`. If the deployment was successful, you should receive a JSON response.
|
||||
|
||||

|
||||

|
||||
|
||||
## Run Commands on Your Server
|
||||
|
||||
@@ -263,7 +263,7 @@ medusa user --email <EMAIL> --password <PASSWORD>
|
||||
|
||||
Make sure to replace `<EMAIL>` and `<PASSWORD>` with the credentials you want to give the user.
|
||||
|
||||

|
||||

|
||||
|
||||
## Add Environment Variables
|
||||
|
||||
@@ -271,11 +271,11 @@ You’ll likely need to add environment variables later such as Admin Cross-Orig
|
||||
|
||||
To add environment variables, on the App’s page click on Settings and choose the Web Service component.
|
||||
|
||||

|
||||

|
||||
|
||||
Then, scroll down and find Environment Variables. You can expand the environment variables by clicking Edit on the right. Here, you can edit, add, and remove environment variables.
|
||||
|
||||

|
||||

|
||||
|
||||
Once you click Save, the environment variables will be saved and a redeployment will be triggered.
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ Before you can deploy your Medusa server you need to create a GitHub repository
|
||||
|
||||
On GitHub, click the plus icon at the top right, then click New Repository.
|
||||
|
||||

|
||||

|
||||
|
||||
You’ll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
|
||||
|
||||

|
||||

|
||||
|
||||
### Push Code to GitHub Repository
|
||||
|
||||
@@ -60,7 +60,7 @@ The next step is to push the code to the GitHub repository you just created.
|
||||
|
||||
After creating the repository, you’ll be redirected to the repository’s page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
|
||||
|
||||

|
||||

|
||||
|
||||
Copy the link. Then, open your terminal in the directory that holds your Medusa server codebase and run the following commands:
|
||||
|
||||
@@ -477,7 +477,7 @@ If you run into any errors while running this command, you can just re-run it af
|
||||
|
||||
Once the command finishes and the deployment is successful, you can access your server in the [Qovery Console](https://console.qovery.com/). Go to the project, environment, then the app that you created using Terraform and Qovery. In the app, click the Open button at the top right to open your website in a new tab.
|
||||
|
||||

|
||||

|
||||
|
||||
You can access any of the endpoints on your server using the server URL. For example, you can get the list of products using the endpoint `/store/products`.
|
||||
|
||||
@@ -504,7 +504,7 @@ You’ll likely need to add environment variables later such as Admin Cross-Orig
|
||||
|
||||
To add environment variables, in your [Qovery Console](https://console.qovery.com/) go to the Medusa app and choose Environment Variables from the sidebar. You can add environment variables here at any point later on.
|
||||
|
||||

|
||||

|
||||
|
||||
## What’s Next
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user