/** * @oas [post] /orders/{id}/fulfillment * operationId: "PostOrdersOrderFulfillments" * summary: "Create a Fulfillment" * description: "Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. * requestBody: * content: * application/json: * schema: * required: * - items * properties: * items: * description: The Line Items to include in the Fulfillment. * type: array * items: * required: * - item_id * - quantity * properties: * item_id: * description: The ID of Line Item to fulfill. * type: string * quantity: * description: The quantity of the Line Item to fulfill. * type: integer * no_notification: * description: If set to true no notification will be send related to this Swap. * type: boolean * metadata: * description: An optional set of key-value pairs to hold additional information. * type: object * x-codeSamples: * - lang: JavaScript * label: JS Client * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.orders.createFulfillment(order_id, { * items: [ * { * item_id, * quantity: 1 * } * ] * }) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ * --header 'Authorization: Bearer {api_token}' \ * --header 'Content-Type: application/json' \ * --data-raw '{ * "items": [ * { * "item_id": "{item_id}", * "quantity": 1 * } * ] * }' * security: * - api_token: [] * - cookie_auth: [] * tags: * - Fulfillment * responses: * 200: * description: OK * content: * application/json: * schema: * properties: * order: * $ref: "#/components/schemas/order" * "400": * $ref: "#/components/responses/400_error" * "401": * $ref: "#/components/responses/unauthorized" * "404": * $ref: "#/components/responses/not_found_error" * "409": * $ref: "#/components/responses/invalid_state_error" * "422": * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" */ declare const _default: (req: any, res: any) => Promise; export default _default; export declare class AdminPostOrdersOrderFulfillmentsReq { items: Item[]; no_notification?: boolean; metadata?: Record; } declare class Item { item_id: string; quantity: number; }