Merge branch 'master' into develop

This commit is contained in:
olivermrbl
2022-11-09 19:32:30 +01:00
303 changed files with 5651 additions and 1907 deletions
+838 -66
View File
File diff suppressed because it is too large Load Diff
+838 -66
View File
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);
});
@@ -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);
});
@@ -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,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)
})
@@ -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
}'
@@ -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" }]
}'
@@ -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: >-
+4
View File
@@ -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
+5
View File
@@ -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.
+23 -12
View File
@@ -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
+6 -2
View File
@@ -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
+96
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+14 -5
View File
@@ -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
+80 -8
View File
@@ -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
View File
@@ -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
View File
@@ -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: >-
+18 -5
View File
@@ -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.
+10 -10
View File
@@ -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.
![Click on New application button at the top right](https://i.imgur.com/WxckgS2.png)
![Click on New application button at the top right](https://res.cloudinary.com/dza7lstvk/image/upload/v1667999820/Medusa%20Docs/Algolia/WxckgS2_eygl8l.png)
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 its recommended to switch to the Pay-as-you-go plan as your business grows.
![Optionally enter a name for the application and choose a subscription plan](https://i.imgur.com/jpM2EBU.png)
![Optionally enter a name for the application and choose a subscription plan](https://res.cloudinary.com/dza7lstvk/image/upload/v1667999980/Medusa%20Docs/Algolia/jpM2EBU_fui1lg.png)
Once youre done, click on the Next Step button. If you picked Pay as you go service, youll need to enter billing details before you proceed.
Then, youll be asked to pick a region for your application. Once youre done, click on Review Application Details.
![Select a region then click on Review Application Details at the bottom right](https://i.imgur.com/fahf2J2.png)
![Select a region then click on Review Application Details at the bottom right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000005/Medusa%20Docs/Algolia/fahf2J2_qgm7sa.png)
In the last step, youll 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.
![Summary of your application's order with the terms and agreement checkboxes checked](https://i.imgur.com/PTI2Swq.png)
![Summary of your application's order with the terms and agreement checkboxes checked](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000019/Medusa%20Docs/Algolia/PTI2Swq_a1qbi5.png)
## Retrieve API Keys
To retrieve the API keys that youll use in the next sections, go to Settings, then choose API Keys in the Team and Access section.
![Click on API Keys in the Team and Access section of your settings](https://i.imgur.com/gnORibC.png)
![Click on API Keys in the Team and Access section of your settings](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000028/Medusa%20Docs/Algolia/gnORibC_msuur5.png)
On this page, youll find the Application ID, Search-Only API Key, and Admin API Key. Youll need the Application ID and Admin API Key for the Medusa server. As for the storefront, youll 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 your
:::
![Application ID, Search-Only API Key, and Admin API Key can be found in the API Keys page](https://i.imgur.com/i50Irki.png)
![Application ID, Search-Only API Key, and Admin API Key can be found in the API Keys page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000037/Medusa%20Docs/Algolia/i50Irki_jmtyk6.png)
## 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.
![Postman request send to the search endpoint that retrieves products using Algolia](https://i.imgur.com/IHeTsi7.png)
![Postman request send to the search endpoint that retrieves products using Algolia](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000054/Medusa%20Docs/Algolia/IHeTsi7_ymhb2p.png)
You can also check that the products are properly indexed by opening your Algolia dashboard and choosing Search from the left sidebar. Youll 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 your
:::
![Products from the Medusa server can be seen on the Algolia dashboard](https://i.imgur.com/wkXzUH0.png)
![Products from the Medusa server can be seen on the Algolia dashboard](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000071/Medusa%20Docs/Algolia/wkXzUH0_dowyxj.png)
### Add or Update Products
@@ -211,7 +211,7 @@ To make sure the Next.js storefront properly displays the products in the search
:::
![Search pop up in the Next.js storefront](https://i.imgur.com/1f9qqK6.png)
![Search pop up in the Next.js storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000082/Medusa%20Docs/Algolia/1f9qqK6_c0z8zi.png)
## 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.
![Search bar in the Gatsby storefront](https://i.imgur.com/INtlcIo.png)
![Search bar in the Gatsby storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000097/Medusa%20Docs/Algolia/INtlcIo_jlh16x.png)
## Whats 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.
![Rich Text can be found among content models](https://i.imgur.com/W5WzcTG.png)
![Rich Text can be found among content models](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001241/Medusa%20Docs/Contentful/W5WzcTG_vau6c9.png)
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.
![Filter content to only show pages by choosing Page in the Content Type select field](https://i.imgur.com/ht87z4e.png)
![Filter content to only show pages by choosing Page in the Content Type select field](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001251/Medusa%20Docs/Contentful/ht87z4e_gmbk6c.png)
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 add content and choose from the dropdown Rich Text](https://i.imgur.com/pJ5yM0m.png)
![Click on add content and choose from the dropdown Rich Text](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001261/Medusa%20Docs/Contentful/pJ5yM0m_dfb7vp.png)
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.
![The Rich Text form is filled with data](https://i.imgur.com/lAglhc9.png)
![The Rich Text form is filled with data](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001271/Medusa%20Docs/Contentful/lAglhc9_ejfs2i.png)
After adding the content you want, click on the Publish button on the right then go back to the About page editor.
![Click on the Publish button at the right](https://i.imgur.com/oYpQKsc.png)
![Click on the Publish button at the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001281/Medusa%20Docs/Contentful/oYpQKsc_piobfk.png)
Similarly, in the About page editor, click on the Publish Changes button on the right to view these changes later in the storefront.
![Click on the Publish changes button at the right](https://i.imgur.com/DIMo3hd.png)
![Click on the Publish changes button at the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001296/Medusa%20Docs/Contentful/DIMo3hd_ylxkr3.png)
Similarly, you can add Rich Text content to any product page.
![A rich text content is added to a product](https://i.imgur.com/wgI8mEB.png)
![A rich text content is added to a product](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001305/Medusa%20Docs/Contentful/wgI8mEB_wbukpd.png)
## 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.
![Rich Text content you added to the about page should be visible now](https://i.imgur.com/aQAY9Vz.png)
![Rich Text content you added to the about page should be visible now](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001320/Medusa%20Docs/Contentful/aQAY9Vz_yw4eop.png)
### 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.
![Rich Text content you added to the product should be visible at the end of the page](https://i.imgur.com/LGiVMxx.png)
![Rich Text content you added to the product should be visible at the end of the page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001342/Medusa%20Docs/Contentful/LGiVMxx_rqsr2l.png)
## Whats Next
+15 -15
View File
@@ -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.
![Click on Settings then select API keys from the dropdown](https://i.imgur.com/hvp6zo5.png)
![Click on Settings then select API keys from the dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001360/Medusa%20Docs/Contentful/hvp6zo5_uaqtmi.png)
On the APIs page, click Add API Key.
![Click on the Add API Key button](https://i.imgur.com/KlH2BDg.png)
![Click on the Add API Key button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001375/Medusa%20Docs/Contentful/KlH2BDg_fiqd80.png)
In the form, enter a name for the API key and click Save.
![A form with the name of API key entered](https://i.imgur.com/hOG1RqM.png)
![A form with the name of API key entered](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001385/Medusa%20Docs/Contentful/hOG1RqM_tmctae.png)
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.
![API Keys page with Content management tokens tab opened](https://i.imgur.com/7nWx1xk.png)
![API Keys page with Content management tokens tab opened](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001394/Medusa%20Docs/Contentful/7nWx1xk_co8ykw.png)
Click on Generate personal token. A pop-up will open where you have to enter a name for the token.
![Pop up model for Personal Access Token with token name entered](https://i.imgur.com/y6R81pH.png)
![Pop up model for Personal Access Token with token name entered](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001403/Medusa%20Docs/Contentful/y6R81pH_yhbg1u.png)
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.
![Content Model page filled with new content models](https://i.imgur.com/ZDJPNkr.png)
![Content Model page filled with new content models](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001419/Medusa%20Docs/Contentful/ZDJPNkr_avr7gy.png)
### 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.
![Content page filled with new content](https://i.imgur.com/bfgFxPg.png)
![Content page filled with new content](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001429/Medusa%20Docs/Contentful/bfgFxPg_jb4zok.png)
### (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.
![Seed the database](https://i.imgur.com/ci4accp.png)
![Seed the database](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001440/Medusa%20Docs/Contentful/ci4accp_okaro3.png)
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.
![Select all products' checkboxes and click the publish button](https://i.imgur.com/3NrH5tJ.png)
![Select all products' checkboxes and click the publish button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001452/Medusa%20Docs/Contentful/3NrH5tJ_f16iym.png)
### Added Featured Products
@@ -203,19 +203,19 @@ On the homepage of the storefront, theres 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.
![Search for the featured products tile section](https://i.imgur.com/2gS0ozY.png)
![Search for the featured products tile section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001462/Medusa%20Docs/Contentful/2gS0ozY_b2tpsb.png)
Click on it. You should find on the page an empty Tiles section where you can add tiles and products.
![On the content's page find the empty tiles section](https://i.imgur.com/inuN1OB.png)
![On the content's page find the empty tiles section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001472/Medusa%20Docs/Contentful/inuN1OB_ipiszl.png)
Click on Add content then on Add existing content and pick some of the products you want to show on the homepage.
![Add at least 1 product as a tile](https://i.imgur.com/N5m4LbF.png)
![Add at least 1 product as a tile](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001500/Medusa%20Docs/Contentful/N5m4LbF_fb97tm.png)
Once youre done adding products, click on Publish changes in the right sidebar.
![Click on the publish changes button on the right](https://i.imgur.com/URNpkXq.png)
![Click on the publish changes button on the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001508/Medusa%20Docs/Contentful/URNpkXq_cb5ppp.png)
## 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`.
![Copy the value of the Content Delivery API access token](https://i.imgur.com/a7dl7DI.png)
![Copy the value of the Content Delivery API access token](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001522/Medusa%20Docs/Contentful/a7dl7DI_mziogm.png)
### 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.
![The storefront with the featured products section](https://i.imgur.com/f6xwYbS.png)
![The storefront with the featured products section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001537/Medusa%20Docs/Contentful/f6xwYbS_w1v993.png)
## Make Changes to Content
+12 -2
View File
@@ -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)
+6 -6
View File
@@ -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.
![Postman](https://i.imgur.com/tpr7uCF.png)
![Postman](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000185/Medusa%20Docs/Mailchimp/tpr7uCF_g4rymn.png)
If you check your Mailchimp dashboard, you should find the email added to your Audience list.
![Email Added](https://i.imgur.com/ALz6WUq.png)
![Email Added](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000199/Medusa%20Docs/Mailchimp/ALz6WUq_e4mkcs.png)
### With Additional Data
Heres 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:
![Subscription Form](https://i.imgur.com/JHIFEwe.png)
![Subscription Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000210/Medusa%20Docs/Mailchimp/JHIFEwe_fu4rkv.png)
If you try entering an email and clicking Subscribe, the email will be subscribed to your Mailchimp newsletter successfully.
+4 -4
View File
@@ -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.
![Postman request to search endpoint that shows results returned from the search engine](https://i.imgur.com/RCGquxU.png)
![Postman request to search endpoint that shows results returned from the search engine](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000265/Medusa%20Docs/MeiliSearch/RCGquxU_um3dvn.png)
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. Youll find your products that are on your Medusa server added there.
![MeiliSearch dashboard showing products from the Medusa server indexed](https://i.imgur.com/5sk3jyP.png)
![MeiliSearch dashboard showing products from the Medusa server indexed](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000277/Medusa%20Docs/MeiliSearch/5sk3jyP_i3swkn.png)
### Add or Update Products
@@ -170,7 +170,7 @@ To make sure the Next.js storefront properly displays the products in the search
:::
![Search Result on Next.js storefront](https://i.imgur.com/gQVWvH2.png)
![Search Result on Next.js storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000298/Medusa%20Docs/MeiliSearch/gQVWvH2_datei5.png)
### 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.
![Search box in the header of the storefront](https://i.imgur.com/ZkRgF2h.png)
![Search box in the header of the storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000317/Medusa%20Docs/MeiliSearch/ZkRgF2h_ytnpv9.png)
## Whats Next
+8 -8
View File
@@ -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.
![Create Bucket](https://i.imgur.com/PwLldKt.png)
![Create Bucket](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000345/Medusa%20Docs/MinIO/PwLldKt_vm4r6d.png)
Then, in the form, enter a name for the bucket and click on Create Bucket. By MinIOs requirement, the name can only consist of lower case characters, numbers, dots (`.`), and hyphens (`-`).
![Bucket Info](https://i.imgur.com/UB477rl.png)
![Bucket Info](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000356/Medusa%20Docs/MinIO/UB477rl_opdmzj.png)
After creating the bucket, click on the cog icon at the top right to configure the bucket.
![Configure Bucket](https://i.imgur.com/0pB8RIM.png)
![Configure Bucket](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000369/Medusa%20Docs/MinIO/0pB8RIM_bxo20d.png)
Then, click on the edit icon next to Access Policy. This will open a pop-up.
![Access Policy](https://i.imgur.com/qo3QQz4.png)
![Access Policy](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000379/Medusa%20Docs/MinIO/qo3QQz4_asdtgb.png)
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.
![Service Accounts Sidebar](https://i.imgur.com/CkTbrEc.png)
![Service Accounts Sidebar](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000392/Medusa%20Docs/MinIO/CkTbrEc_ni2hlz.png)
Then, click on Create Service Account.
![Create Service Account](https://i.imgur.com/a000HQf.png)
![Create Service Account](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000403/Medusa%20Docs/MinIO/a000HQf_noszz2.png)
This will generate a random Access Key and Secret Key for you.
![Generated Keys](https://i.imgur.com/my4c7zU.png)
![Generated Keys](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000415/Medusa%20Docs/MinIO/my4c7zU_yyw6fw.png)
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.
![Image Uploaded on Admin](https://i.imgur.com/alabX2i.png)
![Image Uploaded on Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000429/Medusa%20Docs/MinIO/alabX2i_dzg2mh.png)
## Private Buckets
+4 -4
View File
@@ -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 youll be able to use PayPal].
![PayPal Button](https://i.imgur.com/F8OvsOJ.png)
![PayPal Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000463/Medusa%20Docs/PayPal/F8OvsOJ_v3ctol.png)
You can test out the payment with PayPal using your sandbox account.
@@ -276,7 +276,7 @@ Thats 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.
![PayPal Button](https://i.imgur.com/SMLrptP.png)
![PayPal Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000477/Medusa%20Docs/PayPal/SMLrptP_g6b22m.png)
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.
![PayPal Button](https://i.imgur.com/PsibgPY.png)
![PayPal Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000492/Medusa%20Docs/PayPal/PsibgPY_xtqdli.png)
## 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.
![Capture Payment](https://i.imgur.com/Mx357yY.png)
![Capture Payment](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000502/Medusa%20Docs/PayPal/Mx357yY_xsandw.png)
Clicking this button lets you capture the payment for an order. You can also refund payments if an order has captured payments.
+8 -8
View File
@@ -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.
![Enter S3 in the search box and choose S3 from the result in the Services category](https://i.imgur.com/wuPTfQ8.png)
![Enter S3 in the search box and choose S3 from the result in the Services category](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000547/Medusa%20Docs/S3/wuPTfQ8_bzbm8n.png)
Then, on the new page that opens, click on Create Bucket button at the top right of the Buckets table.
![Click on the Create bucket button](https://i.imgur.com/h95D38T.png)
![Click on the Create bucket button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000527/Medusa%20Docs/S3/h95D38T_gptwpr.png)
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 youll use them throughout the documentation.
![Enter bucket name and choose region in the General Configuration section](https://i.imgur.com/wlxUU8I.png)
![Enter bucket name and choose region in the General Configuration section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000559/Medusa%20Docs/S3/wlxUU8I_m4ngqd.png)
Next, in the Object Ownership section, choose ACLs enabled. Then, two radio buttons will show below it. Choose Bucket owner preferred.
![In the Object Ownership section choose ACLs enabled, then choose Bucket owner preferred for the Object ownership field](https://i.imgur.com/ChUXQPt.png)
![In the Object Ownership section choose ACLs enabled, then choose Bucket owner preferred for the Object ownership field](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000572/Medusa%20Docs/S3/ChUXQPt_eg8mn1.png)
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.
![Uncheck Block all public access and all fields under it, and check the checkbox field "I acknowledge that the current settings might result in this bucket and the objects within becoming public"](https://i.imgur.com/abHquFh.png)
![Uncheck Block all public access and all fields under it, and check the checkbox field "I acknowledge that the current settings might result in this bucket and the objects within becoming public"](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000586/Medusa%20Docs/S3/abHquFh_wypfbx.png)
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.
![Find the bucket policy section which should be empty and click on the Edit button](https://i.imgur.com/I6BBLwv.png)
![Find the bucket policy section which should be empty and click on the Edit button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000607/Medusa%20Docs/S3/I6BBLwv_zoknft.png)
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.
![An image is successfully uploaded on the Medusa Admin](https://i.imgur.com/zPC9qFH.png)
![An image is successfully uploaded on the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000619/Medusa%20Docs/S3/zPC9qFH_dgqf76.png)
You can also check that the image was uploaded on the S3 buckets page.
![Image is now available in the S3 Bucket](https://i.imgur.com/NJZ5bP8.png)
![Image is now available in the S3 Bucket](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000630/Medusa%20Docs/S3/NJZ5bP8_ovv9rc.png)
## Next.js Storefront Configuration
+9 -9
View File
@@ -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.
![Under Connections in the sidebar choose Catalog](https://i.imgur.com/rAeJkP3.png)
![Under Connections in the sidebar choose Catalog](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000661/Medusa%20Docs/Segment/rAeJkP3_ybyutz.png)
Then, in the catalog list find the Server category and choose Node.js from the list.
![Choose Node.js under the Server category](https://i.imgur.com/6RxQbW6.png)
![Choose Node.js under the Server category](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000672/Medusa%20Docs/Segment/6RxQbW6_wjphte.png)
This opens a new side menu. In the side menu, click on Add Source.
![Click on Add Source in the side menu showing information about the Node.js source](https://i.imgur.com/0VZJnpd.png)
![Click on Add Source in the side menu showing information about the Node.js source](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000683/Medusa%20Docs/Segment/0VZJnpd_ehagat.png)
This opens a new page to create a Node.js source. Enter the name of the source then click Add Source.
![Enter a name under the Name field then click on the Add Source button](https://i.imgur.com/u2hzkB5.png)
![Enter a name under the Name field then click on the Add Source button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000693/Medusa%20Docs/Segment/u2hzkB5_t59yhj.png)
On the new source dashboard, you should find a Write Key. Youll use this key in the next section after you install the Segment plugin on your Medusa server.
![The Write Key is available on the new source's page](https://i.imgur.com/OTJVsz7.png)
![The Write Key is available on the new source's page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000708/Medusa%20Docs/Segment/OTJVsz7_v95qla.png)
### 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.
![Click on the Add Destination button on the source page](https://i.imgur.com/FrKlUxh.png)
![Click on the Add Destination button on the source page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000718/Medusa%20Docs/Segment/FrKlUxh_zlnkww.png)
You can then choose from a list of destinations such as Google Universal Analytics or Facebook Pixel.
![List of some of the available destinations in Segment's catalog](https://i.imgur.com/y2YnPUh.png)
![List of some of the available destinations in Segment's catalog](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000730/Medusa%20Docs/Segment/y2YnPUh_mgfqdo.png)
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.
![The order completed event is recorded on the Segment source](https://i.imgur.com/LQVJTGg.png)
![The order completed event is recorded on the Segment source](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000743/Medusa%20Docs/Segment/LQVJTGg_i5jyge.png)
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 isnt 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, youll see the data you passed to the `track` method.
![The customer created event is recoreded on the Segment source](https://i.imgur.com/4LD41xE.png)
![The customer created event is recoreded on the Segment source](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000759/Medusa%20Docs/Segment/4LD41xE_qungdw.png)
## Whats Next
+14 -14
View File
@@ -79,7 +79,7 @@ You dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont 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 dont have a storefront installed, check out the [Gatsby](../starters/g
You can also track analytics related to emails sent from the SendGrid dashboard.
![SendGrid Analytics](https://i.imgur.com/X01LigH.png)
![SendGrid Analytics](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000788/Medusa%20Docs/SendGrid/X01LigH_mxmtbn.png)
## Whats Next
+4 -4
View File
@@ -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.
![Create Slack App](https://i.imgur.com/liVfwF8.png)
![Create Slack App](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000844/Medusa%20Docs/Slack/liVfwF8_ryzly3.png)
Youll then need to enter some info like the App name and the workspace it will be connected to. Once youre done, the app will be created.
@@ -49,17 +49,17 @@ Youll 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.
![Incoming Webhooks](https://i.imgur.com/5Y0nv4p.png)
![Incoming Webhooks](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000856/Medusa%20Docs/Slack/5Y0nv4p_mugzkb.png)
### Add New Webhook
After activating Incoming Webhooks, on the same page scroll down and click on the Add New Webhook to Workspace button.
![Add New Webhook](https://i.imgur.com/sejdIqH.png)
![Add New Webhook](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000867/Medusa%20Docs/Slack/sejdIqH_wyqgs5.png)
After that, choose the channel to send the notifications to. You can also choose a DM to send the notifications to. Once youre done click Allow.
![Choose channel or DM](https://i.imgur.com/Zw3f5uF.png)
![Choose channel or DM](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000882/Medusa%20Docs/Slack/Zw3f5uF_hljfpr.png)
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 youll use it in the next section.
+10 -10
View File
@@ -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.
![Click on the green Create button at the top right, then choose Spaces in the dropdown](https://i.imgur.com/AQqMRoJ.png)
![Click on the green Create button at the top right, then choose Spaces in the dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000907/Medusa%20Docs/Spaces/AQqMRoJ_uhkywh.png)
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.
![The Space form can be left as is and move towards the Finalize and Create section](https://i.imgur.com/ipsIqoA.png)
![The Space form can be left as is and move towards the Finalize and Create section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000929/Medusa%20Docs/Spaces/ipsIqoA_zeyfkf.png)
In the Finalize and Create section, enter a name for the field “Choose a unique name”. Youll use this name later in the integration with Medusa. Also, select the project you want to add the new Space to.
![Enter a name for the Space in the Choose a unique name field](https://i.imgur.com/NhlRX0h.png)
![Enter a name for the Space in the Choose a unique name field](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000949/Medusa%20Docs/Spaces/NhlRX0h_ptdhpk.png)
Once youre done, click on the Create a Space button. This creates the Space and redirects you to the Spaces page.
@@ -44,15 +44,15 @@ Once youre done, click on the Create a Space button. This creates the Space a
Choose API from the bottom of the sidebar.
![Choose API from the bottom of the sidebar.](https://i.imgur.com/6zNoDOW.png)
![Choose API from the bottom of the sidebar.](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000964/Medusa%20Docs/Spaces/6zNoDOW_tqbeqv.png)
This opens the Application & API page. Scroll down to Spaces Access Keys and click the Generate New Key button.
![In the Spaces access keys section, click the Generate New Key button](https://i.imgur.com/NUocdgh.png)
![In the Spaces access keys section, click the Generate New Key button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000977/Medusa%20Docs/Spaces/NUocdgh_doi0dq.png)
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.
![Enter a name for the Space access key in the field under the Name column](https://i.imgur.com/ihJBx0T.png)
![Enter a name for the Space access key in the field under the Name column](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000987/Medusa%20Docs/Spaces/ihJBx0T_xfe4rh.png)
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 youll use them later.
@@ -84,12 +84,12 @@ Where:
1. `<YOUR_SPACE_URL>` is the URL of your Space which you can find on the Spaces page below the Spaces name.
![The URL is available under the Space's name on the Space's page](https://i.imgur.com/cA3vkvh.png)
![The URL is available under the Space's name on the Space's page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001004/Medusa%20Docs/Spaces/cA3vkvh_maixr0.png)
2. `<YOUR_SPACE_NAME>` is the name of your Space.
3. `<YOUR_SPACE_ENDPOINT>` is your Spaces endpoint which can be found by going to your Spaces page, clicking on the Settings tab, and scrolling to the Endpoint section.
![Endpoint can be found on the Settings tab in the Space's page](https://i.imgur.com/CnvLr6R.png)
![Endpoint can be found on the Settings tab in the Space's page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001017/Medusa%20Docs/Spaces/CnvLr6R_tudlhu.png)
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.
![Image successfully uploaded on Medusa's admin](https://i.imgur.com/oTi4jIw.png)
![Image successfully uploaded on Medusa's admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001039/Medusa%20Docs/Spaces/oTi4jIw_c6vefa.png)
You can also check that the image was uploaded on the Spaces page.
![Image can be seen on the Space's page on DigitalOcean](https://i.imgur.com/BexmRkg.png)
![Image can be seen on the Space's page on DigitalOcean](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001050/Medusa%20Docs/Spaces/BexmRkg_gimk1d.png)
## Next.js Storefront Configuration
+4 -4
View File
@@ -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.
![Create User Form in Strapi](https://i.imgur.com/9pFE1Ij.png)
![Create User Form in Strapi](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001083/Medusa%20Docs/Strapi/9pFE1Ij_h2dicv.png)
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.
![Showing the users under Content Manager](https://i.imgur.com/YyGJPUf.png)
![Showing the users under Content Manager](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001096/Medusa%20Docs/Strapi/YyGJPUf_mr5sx7.png)
Click on the Create new entry button at the top right. This opens a new form to enter the users details.
![Create User Form on Strapi](https://i.imgur.com/mdMhSlV.png)
![Create User Form on Strapi](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001105/Medusa%20Docs/Strapi/mdMhSlV_vy7ygv.png)
Enter the users username, email, and password. Once youre 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.
![An example of modifying permissions on the Product content type](https://i.imgur.com/QgckXqS.png)
![An example of modifying permissions on the Product content type](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001116/Medusa%20Docs/Strapi/QgckXqS_wlyxe8.png)
Once youre done, click the Save button at the top right.
+4 -4
View File
@@ -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 youll be able to use Stripe.
![Next.js Stripe Form](https://i.imgur.com/h5mWdJT.png)
![Next.js Stripe Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001145/Medusa%20Docs/Stripe/h5mWdJT_n1bktt.png)
### 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 youll be able to use Stripe.
![Gatsby Stripe Form](https://i.imgur.com/1XvW776.png)
![Gatsby Stripe Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001172/Medusa%20Docs/Stripe/1XvW776_omosuz.png)
### 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, youll see the Stripe UI element and youll be able to make orders.
![Stripe Form](https://i.imgur.com/NOi8THw.png)
![Stripe Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001190/Medusa%20Docs/Stripe/NOi8THw_xv3zsx.png)
## Capture Payments
After the customer places an order, youll be able to see the order on the admin panel. In the payment information under the “Payment” section, you should see a “Capture” button.
![Capture Payment](https://i.imgur.com/Iz55PVZ.png)
![Capture Payment](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001205/Medusa%20Docs/Stripe/Iz55PVZ_p6hiz6.png)
Clicking this button allows you to capture the payment for an order. You can also refund payments if an order has captured payments.
+1 -1
View File
@@ -120,7 +120,7 @@ If youre on a Twilio trial make sure that the phone number you entered on che
:::
![Twilio Dashboard](https://i.imgur.com/MXtQMiL.png)
![Twilio Dashboard](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001219/Medusa%20Docs/Stripe/MXtQMiL_kb7kxe.png)
## Whats Next
+3 -3
View File
@@ -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.
![Admin Log In](https://i.imgur.com/XYqMCo9.png)
![Admin Log In](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001604/Medusa%20Docs/Screenshots/XYqMCo9_hq1fsv.png)
Use your Medusa admins user credentials to log in.
@@ -65,7 +65,7 @@ Use your Medusa admins 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
Heres 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
Heres 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
:::
![Flowchart summarizing the batch job's flow from creation to completion](https://i.imgur.com/Qja0kAz.png)
![Flowchart summarizing the batch job's flow from creation to completion](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001632/Medusa%20Docs/Diagrams/Qja0kAz_ns4vm8.png)
## Whats 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 youve 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
:::
![List Notifications Request](https://i.imgur.com/iF1rZX1.png)
![List Notifications Request](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001650/Medusa%20Docs/Screenshots/iF1rZX1_msps2t.png)
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.
![Resend Notifications Request](https://i.imgur.com/0zFfPed.png)
![Resend Notifications Request](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001659/Medusa%20Docs/Screenshots/0zFfPed_og7one.png)
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 its placed.
![Payment Flows.jpg](https://i.imgur.com/WeDr0ph.jpg)
![Checkout Flow - Payment](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001750/Medusa%20Docs/Diagrams/WeDr0ph_idcrir.jpg)
## 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 @@ Its 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 thats 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 its 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.
![Shipping Architecture](https://i.imgur.com/QII2Hvn.png)
![Shipping Architecture](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001762/Medusa%20Docs/Diagrams/QII2Hvn_vjkrdy.png)
## 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 variants price in the price list is compared to the variants original price using the following condition:
```jsx
```jsx noHeader
amount < (1 + taxRate) * calculatedPrice
```
@@ -120,7 +120,7 @@ Where `amount` is the amount of the variants 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
```
+27
View File
@@ -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 youre 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.
![Create Repository](https://i.imgur.com/0YlxBRi.png)
![Create Repository](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![Repository Form](https://i.imgur.com/YPYXAF2.png)
![Repository Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### 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, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![GitHub Repository URL](https://i.imgur.com/pHfSTuT.png)
![GitHub Repository URL](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
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 dont have any other websites, youll see a big button
:::
![Create a new website](https://i.imgur.com/IUUOzoW.png)
![Create a new website](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001840/Medusa%20Docs/Netlify/IUUOzoW_mw9u5w.png)
Youll then be asked to connect to a Git provider.
![Connect Git Provider](https://i.imgur.com/T6lZPDi.png)
![Connect Git Provider](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001855/Medusa%20Docs/Netlify/T6lZPDi_rvcuyf.png)
Choose GitHub. Youll then be redirected to GitHubs website to give Netlify permissions if you havent done that before.
After you authorize Netlify to use GitHub, youll be asked to pick the repository you want to deploy. Pick the repository you just created.
![Choose Repository](https://i.imgur.com/D0r6Q1e.png)
![Choose Repository](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001871/Medusa%20Docs/Netlify/D0r6Q1e_th5uei.png)
In the form that shows, keep all fields the same and click on the “Show advanced” button before the “Deploy site” button.
![Show advanced Button](https://i.imgur.com/nUdwRbq.png)
![Show advanced Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001884/Medusa%20Docs/Netlify/nUdwRbq_d2kmo6.png)
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 havent deployed your Medusa server yet, you can leave the value blank
:::
![Environment Variable](https://i.imgur.com/DnutZfT.png)
![Environment Variable](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001898/Medusa%20Docs/Netlify/DnutZfT_rv8iel.png)
Once youre done, scroll down and click on Deploy site.
Youll 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.
![Site Deployment Progress](https://i.imgur.com/BCnLPw7.png)
![Site Deployment Progress](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001914/Medusa%20Docs/Netlify/BCnLPw7_uo9odf.png)
The deployment can take a few minutes.
Once the deployment is done, youll find the URL in the place of the “Site deploy in progress” message you saw earlier.
![Deployment Complete](https://i.imgur.com/fNBxCG2.png)
![Deployment Complete](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001929/Medusa%20Docs/Netlify/fNBxCG2_jlq0q9.png)
If you click on it, youll be redirected to the deployed admin website.
![Medusa Admin Login](https://i.imgur.com/6t4ODe4.png)
![Medusa Admin Login](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001604/Medusa%20Docs/Screenshots/XYqMCo9_hq1fsv.png)
:::note
@@ -160,11 +160,11 @@ netlify login
This opens a page to log in on your browser. Youll be asked to authorize the Netlify CLI tool.
![Authorize Application](https://i.imgur.com/JDUdqSE.png)
![Authorize Application](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001985/Medusa%20Docs/Netlify/JDUdqSE_dzveww.png)
Click on Authorize. Then, you can go back to your terminal and see that youve successfully logged in.
![Authorized Message](https://i.imgur.com/L13Yqhp.png)
![Authorized Message](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001998/Medusa%20Docs/Netlify/L13Yqhp_e2ejpx.png)
#### Initialize Netlify Website
@@ -180,7 +180,7 @@ Youll have to follow five steps for the initialization:
Youll 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 @@ Youll 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. Youll be asked to either authorize GitHub through Netlifys website or through a personal access token. Youre 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.
![Medusa Admin Login](https://i.imgur.com/6t4ODe4.png)
![Medusa Admin Login](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001604/Medusa%20Docs/Screenshots/XYqMCo9_hq1fsv.png)
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.
![Click plus then choose new repository from dropdown](https://i.imgur.com/0YlxBRi.png)
![Click plus then choose new repository from dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![New repository form](https://i.imgur.com/YPYXAF2.png)
![New repository form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### 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, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![GitHub repository's URL](https://i.imgur.com/pHfSTuT.png)
![GitHub repository's URL](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
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.
![Click Create button then choose Apps](https://i.imgur.com/PQgPZ0q.png)
![Click Create button then choose Apps](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002030/Medusa%20Docs/Digital%20Ocean/PQgPZ0q_xntr2i.png)
### Choose Repository
In the Create App page, choose GitHub from the Service Provider list.
![Choose GitHub from list of providers](https://i.imgur.com/nBY9wGE.png)
![Choose GitHub from list of providers](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002043/Medusa%20Docs/Digital%20Ocean/nBY9wGE_zyy1e6.png)
If you havent given DigitalOcean access before, click on Manage Access under Source Code. Youll 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.
![Enter master for Branch input, backslash for Source Directory, and check Autodeploy](https://i.imgur.com/kjk9E2B.png)
![Enter master for Branch input, backslash for Source Directory, and check Autodeploy](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002055/Medusa%20Docs/Digital%20Ocean/kjk9E2B_qpwrx4.png)
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 youre done, click Next to move on to the next step.
In the next step, youll see the resources to create.
![List of resources showing a docker resource and web service resource](https://i.imgur.com/6TlpWB9.png)
![List of resources showing a docker resource and web service resource](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002067/Medusa%20Docs/Digital%20Ocean/6TlpWB9_wfppc7.png)
If you have a Dockerfile available in the servers codebase (which is available by default), youll 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 `/`.
![Enter backslash for Routes](https://i.imgur.com/ta0jHh4.png)
![Enter backslash for Routes](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002076/Medusa%20Docs/Digital%20Ocean/ta0jHh4_ddcz3r.png)
Once youre done click Save. Youll be taken back to the Resources page.
@@ -151,15 +151,15 @@ Once youre done click Save. Youll be taken back to the Resources page.
On the same page, expand the Add Resources section, choose Database, then click Add.
![Choose Database](https://i.imgur.com/MfK9E8o.png)
![Choose Database](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002090/Medusa%20Docs/Digital%20Ocean/MfK9E8o_ensfu0.png)
In the new page, youll be shown a PostgreSQL database to be created. Notice that its important to choose a name that youll remember as youll need the name in next steps. You can leave the name as is if its not necessary to change it.
![Enter db for Choose Name input](https://i.imgur.com/jYxENhr.png)
![Enter db for Choose Name input](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002099/Medusa%20Docs/Digital%20Ocean/jYxENhr_wxkspz.png)
Once youre done, click Create and Attach. Youll be redirected back to the previous page with the database added to the resources.
![Database showing in the list of resources with web service](https://i.imgur.com/jNZ7rxg.png)
![Database showing in the list of resources with web service](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002109/Medusa%20Docs/Digital%20Ocean/jNZ7rxg_msmgbz.png)
Once youre done, click Next to move on to the next step.
@@ -169,7 +169,7 @@ In this section, youll 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.
![Global environment variables and web service environment variables](https://i.imgur.com/VOYykPT.png)
![Global environment variables and web service environment variables](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002118/Medusa%20Docs/Digital%20Ocean/VOYykPT_qoili6.png)
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 youre done click Save.
In the next section, youll 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.
![App info and region details](https://i.imgur.com/XVS0yej.png)
![App info and region details](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002128/Medusa%20Docs/Digital%20Ocean/XVS0yej_kwmaim.png)
Once youre 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.
![Click Create then choose Databases](https://i.imgur.com/8BzUzuO.png)
![Click Create then choose Databases](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002138/Medusa%20Docs/Digital%20Ocean/8BzUzuO_bhwcpd.png)
In the new page under Choose a database engine, choose Redis.
![For the Choose a database engine input choose Redis](https://i.imgur.com/lninWzJ.png)
![For the Choose a database engine input choose Redis](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002149/Medusa%20Docs/Digital%20Ocean/lninWzJ_joycrd.png)
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.
![For the choose a name input set the value to redis](https://i.imgur.com/E81Qc4l.png)
![For the choose a name input set the value to redis](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002158/Medusa%20Docs/Digital%20Ocean/E81Qc4l_gid9qa.png)
Once youre 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.
![Click at the create button and choose create/attach database](https://i.imgur.com/jdh702G.png)
![Click at the create button and choose create/attach database](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002168/Medusa%20Docs/Digital%20Ocean/jdh702G_fjssat.png)
In the new page, click on the Previously Created DigitalOcean Database radio button. Then, under Database Cluster select the Redis database you just created.
![Choose Previously Created DigitalOcean Database then under Database Cluster choose redis](https://i.imgur.com/aBJ2z0B.png)
![Choose Previously Created DigitalOcean Database then under Database Cluster choose redis](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002177/Medusa%20Docs/Digital%20Ocean/aBJ2z0B_yzwpym.png)
Once youre 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 youre 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 Apps name.
![Copy URL under the app name](https://i.imgur.com/i3ws777.png)
![Copy URL under the app name](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002186/Medusa%20Docs/Digital%20Ocean/i3ws777_ooknst.png)
Then, go to `<YOUR_APP_URL>/store/products`. If the deployment was successful, you should receive a JSON response.
![JSON response with list of products](https://i.imgur.com/5xTdMbY.png)
![JSON response with list of products](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002196/Medusa%20Docs/Digital%20Ocean/5xTdMbY_pqwyzy.png)
## 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.
![Console in the DigitalOcean App](https://i.imgur.com/9RMfD4C.png)
![Console in the DigitalOcean App](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002204/Medusa%20Docs/Digital%20Ocean/9RMfD4C_u0mdqs.png)
## Add Environment Variables
@@ -271,11 +271,11 @@ Youll likely need to add environment variables later such as Admin Cross-Orig
To add environment variables, on the Apps page click on Settings and choose the Web Service component.
![Choose the Settings tab then choose the web service container](https://i.imgur.com/qLPARaV.png)
![Choose the Settings tab then choose the web service container](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002217/Medusa%20Docs/Digital%20Ocean/qLPARaV_ocit6w.png)
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.
![Expand the Environment Variables section by clicking edit](https://i.imgur.com/4x6JGjX.png)
![Expand the Environment Variables section by clicking edit](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002227/Medusa%20Docs/Digital%20Ocean/4x6JGjX_wzltiq.png)
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.
![Click plus icon at the top right](https://i.imgur.com/0YlxBRi.png)
![Click plus icon at the top right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![An image of the Create Repository form](https://i.imgur.com/YPYXAF2.png)
![An image of the Create Repository form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### 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, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![An image of the GitHub URL in a new repository](https://i.imgur.com/pHfSTuT.png)
![An image of the GitHub URL in a new repository](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
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.
![open button at the top right](https://i.imgur.com/Ji59ZSJ.png)
![open button at the top right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002245/Medusa%20Docs/Qovery/Ji59ZSJ_nrkpvb.png)
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 @@ Youll 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.
![Environment Variables in the sidebar](https://i.imgur.com/aQl7zdz.png)
![Environment Variables in the sidebar](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002258/Medusa%20Docs/Qovery/aQl7zdz_tjs0eb.png)
## Whats Next

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