{"record":{"id":"1ce39bce3f26703a","repo":"medusajs/medusa","slug":"trying-to-register-a-fulfillment-provider-without","errorCode":null,"errorMessage":"Trying to register a fulfillment provider without an identifier.","messagePattern":"Trying to register a fulfillment provider without an identifier\\.","errorType":"exception","errorClass":"MedusaError","httpStatus":400,"severity":"error","filePath":"packages/modules/fulfillment/src/services/fulfillment-provider.ts","lineNumber":51,"sourceCode":") {\n  protected readonly fulfillmentProviderRepository_: DAL.RepositoryService\n  #logger: Logger\n\n  constructor(container: InjectedDependencies) {\n    super(container)\n    this.fulfillmentProviderRepository_ =\n      container.fulfillmentProviderRepository\n    this.#logger = container[\"logger\"]\n      ? container.logger\n      : (console as unknown as Logger)\n  }\n\n  static getRegistrationIdentifier(\n    providerClass: Constructor<IFulfillmentProvider>,\n    optionName?: string\n  ) {\n    if (!(providerClass as any).identifier) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_ARGUMENT,\n        `Trying to register a fulfillment provider without an identifier.`\n      )\n    }\n    return `${(providerClass as any).identifier}_${optionName}`\n  }\n\n  protected retrieveProviderRegistration(\n    providerId: string\n  ): FulfillmentTypes.IFulfillmentProvider {\n    try {\n      return this.__container__[`fp_${providerId}`]\n    } catch (err) {\n      if (err.name === \"AwilixResolutionError\") {\n        const errMessage = `\nUnable to retrieve the fulfillment provider with id: ${providerId}\nPlease make sure that the provider is registered in the container and it is configured correctly in your project configuration file.`\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/fulfillment/src/services/fulfillment-provider.ts#L33-L69","documentation":"Static validator used when registering fulfillment provider plugin classes. A provider class must declare a static `identifier` property; without it the registration key (`identifier_optionName`) cannot be built and an INVALID_ARGUMENT error is thrown.","triggerScenarios":"Registering a custom fulfillment provider class that lacks `static identifier = 'my-provider'`, or where identifier is set only on instances/prototype instead of the class.","commonSituations":"Writing a first custom provider and forgetting the static field; refactoring a provider from an object to a class and losing the static.","solutions":["Add `static identifier = \"...\"` to the provider class","If it also has options, also set `static identifier` plus option registration via provider loader conventions","Ensure you export the class itself, not an instance"],"exampleFix":"// before\nclass MyFulfillmentProvider extends AbstractFulfillmentService { ... }\n// after\nclass MyFulfillmentProvider extends AbstractFulfillmentService {\n  static identifier = 'my-fulfillment'\n  // ...\n}","handlingStrategy":"validation","validationCode":"import { FulfillmentProvider } from '@medusajs/fulfillment'\n// before registration\nif (!(MyProvider as any).identifier) throw new Error('Provider missing static identifier')","typeGuard":"const hasIdentifier = (cls: any): boolean => typeof cls?.identifier === 'string' && cls.identifier.length > 0","tryCatchPattern":null,"preventionTips":["Always declare `static identifier` on custom providers","Write a unit test asserting the static exists for each provider"],"tags":["fulfillment","provider","plugin-registration","startup"],"backgroundTag":"provider-missing-identifier","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}