{"templateId":"markdown","versions":[{"version":"shipstation-v2","label":"ShipStation V2 API","link":"/apis/shipstation-v2/docs/elements/label-workflow/void-label","default":true,"active":false,"folderId":"58c9a61d"},{"version":"shipengine","label":"ShipStation API (formerly ShipEngine)","link":"/apis/shipengine/docs/elements/label-workflow/void-label","default":false,"active":true,"folderId":"58c9a61d"},{"version":"shipstation-v1","label":"ShipStation V1 API","link":"/apis/shipstation-v1/docs/elements/label-workflow/void-label","default":false,"active":false,"folderId":"58c9a61d"}],"sharedDataIds":{"sidebar":"sidebar-apis/@shipengine/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Void Label Element","keywords":"shipping, labels, shipstation, documentation, api","siteUrl":"https://docs.shipstation.com","lang":"en-US","llmstxt":{"hide":false,"title":"ShipStation API LLM Docs","description":"Find links and references to all markdown documentation for use with LLMs","excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"void-label-element","__idx":0},"children":["Void Label Element"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Void Label Element enables a user to void a specific shipping label."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"react-component","__idx":1},"children":["React Component"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"jsx","header":{"controls":{"copy":{}}},"source":"import { VoidLabel, ElementsProvider } from '@shipengine/elements';\nimport { themeConfig } from '../themeConfig';\n\nconst tokenPath = '/path/to/token/endpoint';\n\nconst Foo = ({ labelId }) => {\n  const getToken = useCallback(() => {\n    return fetch(tokenPath).then((res) => res.text());\n  }, []);\n\n  return (\n    <ElementsProvider\n      getToken={getToken}\n      themeConfig={themeConfig}\n      onError={handleError}\n    >\n      <VoidLabel.Element\n        labelId={labelId}\n        onComplete={() => {\n          console.log('Label Voided');\n        }}\n        onViewShipment={() => {\n          console.log('Go back to shipment');\n        }}\n      />\n    </ElementsProvider>\n  );\n};\n","lang":"jsx"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sdk","__idx":2},"children":["SDK"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"// Creates a new instance of the Elements SDK.\nconst elements = new ElementsSDK(getToken, {\n  onError: (err: Error) => console.error(err),\n  themeConfig: themeConfig,\n  locale: 'en-US',\n});\n\nconst voidLabel = elements.create('voidLabel', {\n  labelId: 'se-44356221134',\n  onComplete: () => console.log('Label Voided'),\n  onViewShipment: () => console.log('Go back to shipment'),\n});\n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Args/Props"},"children":["Args/Props"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required?"},"children":["Required?"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["labelId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["required"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},", The unique identifier for the label you wish to void."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["required"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["function"]}]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(request: SE.VoidRequest, shipment: SE.SalesOrderShipment) => void"]}," A callback function that will be invoked when the request to void a given shipping label is completed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["function"]}]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(label: SE.Label, shipment: SE.SalesOrderShipment) => void"]}," A callback function that will be invoked when the request to void a given shipping label is successful."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onViewShipment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["required"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["function"]}]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(shipment: SE.SalesOrderShipment) => void;"]},"A callback function that will be invoked when the user clicks the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["View Shipment"]}," button. ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["We recommend using this callback to render the"]}," ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/elements/label-workflow/shipment-summary"},"children":["Shipment Summary Element"]},"."]}]}]}]}]}]},"headings":[{"value":"Void Label Element","id":"void-label-element","depth":1},{"value":"React Component","id":"react-component","depth":2},{"value":"SDK","id":"sdk","depth":2}],"frontmatter":{"seo":{"title":"Void Label Element"}},"lastModified":"2026-04-08T10:47:45.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/apis/shipengine/docs/elements/label-workflow/void-label","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}