docs: add clarification for set cart's customer API route (#13506)
This commit is contained in:
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to set the cart's customer
|
||||
sdk.store.cart.transferCart("cart_123")
|
||||
.then(({ cart }) => {
|
||||
console.log(cart)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to retrieve their details
|
||||
sdk.store.customer.retrieve()
|
||||
.then(({ customer }) => {
|
||||
console.log(customer)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to update their details
|
||||
sdk.store.customer.update({
|
||||
first_name: "John"
|
||||
})
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to list their addresses
|
||||
sdk.store.customer.listAddress()
|
||||
.then(({ addresses, count, offset, limit }) => {
|
||||
console.log(addresses)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to create an address
|
||||
sdk.store.customer.createAddress({
|
||||
country_code: "us"
|
||||
})
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to delete their address
|
||||
sdk.store.customer.deleteAddress("caddr_123")
|
||||
.then(({ deleted, parent: customer }) => {
|
||||
console.log(customer)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to retrieve their address
|
||||
sdk.store.customer.retrieveAddress(
|
||||
"caddr_123"
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to update their address
|
||||
sdk.store.customer.updateAddress(
|
||||
"caddr_123",
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to list their orders
|
||||
sdk.store.order.list()
|
||||
.then(({ orders, count, offset, limit }) => {
|
||||
console.log(orders)
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to cancel the order transfer
|
||||
sdk.store.order.cancelTransfer(
|
||||
"order_123",
|
||||
{},
|
||||
|
||||
@@ -12,6 +12,7 @@ export const sdk = new Medusa({
|
||||
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
|
||||
})
|
||||
|
||||
// TODO must be authenticated as the customer to request the order transfer
|
||||
sdk.store.order.requestTransfer(
|
||||
"order_123",
|
||||
{
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
curl -X POST '{backend_url}/store/carts/{id}/customer' \
|
||||
-H 'Authorization: Bearer {access_token}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
@@ -1,3 +1,3 @@
|
||||
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}' \
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
-H 'Authorization: Bearer {access_token}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
@@ -1,2 +1,3 @@
|
||||
curl '{backend_url}/store/orders' \
|
||||
-H 'Authorization: Bearer {access_token}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
@@ -1,2 +1,3 @@
|
||||
curl -X POST '{backend_url}/store/orders/{id}/transfer/cancel' \
|
||||
-H 'Authorization: Bearer {access_token}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
@@ -1,2 +1,3 @@
|
||||
curl -X POST '{backend_url}/store/orders/{id}/transfer/request' \
|
||||
-H 'Authorization: Bearer {access_token}' \
|
||||
-H 'x-publishable-api-key: {your_publishable_api_key}'
|
||||
Reference in New Issue
Block a user