chore(docs): Generated API Reference (#2143)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4961aece1c
commit
a1350bfaec
20
docs/api/store/code_samples/JavaScript/swaps/postundefined
Normal file
20
docs/api/store/code_samples/JavaScript/swaps/postundefined
Normal file
@@ -0,0 +1,20 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.swaps.create({
|
||||
order_id,
|
||||
return_items: [
|
||||
{
|
||||
item_id,
|
||||
quantity: 1
|
||||
}
|
||||
],
|
||||
additional_items: [
|
||||
{
|
||||
variant_id,
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ swap }) => {
|
||||
console.log(swap.id);
|
||||
});
|
||||
Reference in New Issue
Block a user