import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.campaign.delete("procamp_123")
.then(({ deleted }) => {
console.log(deleted)
})
{
"id": "<string>",
"object": "campaign",
"deleted": true
}
Delete a campaign by its ID. This doesn’t delete promotions that belong to this campaign.
import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.campaign.delete("procamp_123")
.then(({ deleted }) => {
console.log(deleted)
})
{
"id": "<string>",
"object": "campaign",
"deleted": true
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
The campaign's ID.
OK
The deletion's details.