# Run a past export or bulk fulfill again

`POST /order-jobs/{id}/rerun`

OMS API, Orders.

Starts a new job with a new record from a past one, and returns that record with `status` `pending`. An export is run again from its `parameters` against the current orders, exactly as posting them to `POST /order-exports` would — its file can differ from the original. A bulk fulfill is run again on the very rows it was given, which are stored for 90 days after it was started; once they are gone the request is refused and the file has to be uploaded again. Every shipment the original recorded is skipped as a duplicate, so re-running a bulk fulfill only records what it did not get to. Takes the permission that starting the kind takes. One job of each kind runs at a time per merchant account; a re-run while one is running is refused.

**Authentication:** Send `Authorization: Bearer <token>`. Either an identity token issued by the auth service (dashboard flow; requires the selected merchant account id in the `X-Odus-Merchant` header), or a merchant secret key (`sk_...`) for server-to-server calls. Both are sent as `Authorization: Bearer <token>`.

## Parameters

### Path parameters

- `id` (string, required)

## Responses

### `201`

Type: object or object.

- When the value is variant 1:
  - `createdAt` (string (date-time), required): The date and time when the entity was created. Example: `2024-02-18T12:00:00Z`.
  - `updatedAt` (string (date-time), required, nullable): The date and time when the entity was last updated. Example: `2024-02-21T12:15:00Z`.
  - `metadata` (map of string to string, required, nullable): Metadata used by merchants to store additional information about the entity.
  - `id` (string, required): Identifier of the record. Example: `ojb_2c9NxQ3jSVWpaAqEbTORrivRV20`.
  - `jobId` (string, required): Identifier of the background job doing the work. Poll `GET /async-jobs/{id}` with it for live progress while `status` is `pending`. The job record expires after a few days; this record does not. Example: `order-export_2bYqQx7ZkK9mW3nP1sR4tU6vX8y`.
  - `status` (string, required): `pending` until the job ends, then `completed` when it did its work or `failed` when it did not. A job that failed stays in the list. One of `pending`, `completed`, `failed`. Example: `completed`.
  - `requesterKind` (string, required): Which kind of credential started the job: `user` for a dashboard user, `api` for a secret key. One of `user`, `api`. Example: `user`.
  - `requesterId` (string, required, nullable): The requesting user id, or the id of the secret key used. Null when unknown. Example: `user_01J8ZK3Q9V2M4N6P8R0T2W4Y6A`.
  - `error` (string, required, nullable): Why the job failed, once it has; null otherwise. Example: `The export has more rows than an XLSX file may hold. Narrow the filters and try again.`.
  - `finishedAt` (string (date-time), required, nullable): When the job completed or failed. Null until then. Example: `2026-09-03T10:42:10.004Z`.
  - `kind` (string, required): An order export: a file produced from the orders matching `parameters`. Started by `POST /order-exports`. One of `export`. Example: `export`.
  - `parameters` (object, required): The export request exactly as it was submitted. Post it back to `POST /order-exports` to run the same export again against the current orders — with one exception: a record made before a filter operator was withdrawn still shows that operator, and posting it back is answered with `400` naming the field. Replace that condition and post it again.
    - `type` (string): What each row of the file is: an order, or a shippable order item. Default `orders`. Ignored when `integrationType` is set. One of `orders`, `order-items`. Example: `orders`.
    - `columns` (array of string): The column keys to include, from `GET /orders/export/columns`. Required columns are always written. Default: the required columns only. Ignored when `integrationType` is set.
    - `integrationType` (string): Format the file for this integration's bulk-import template instead (CSV, XLSX or a ZIP of XLSX files, as `GET /orders/export/integration-formats` reports). The merchant account must have an active integration of this type. One of `shipbob`, `nextsmartship`. Example: `shipbob`.
    - `sortBy` (string): Field the rows are ordered by. Default `createdAt`. One of `id`, `createdAt`, `updatedAt`, `status`, `paymentId`, `amount`, `paymentAuthorizedAt`. Example: `createdAt`.
    - `sortDirection` (string): Sort direction. Default `desc`. One of `asc`, `desc`. Example: `desc`.
    - `filters` (object): Which orders the export selected, in the shape the `GET /orders` query string carries filters. A record made before an operator was withdrawn still shows that operator, so a record is not always accepted unchanged by `POST /order-exports` — see the operators it lists. Absent when the export covered every order.
      - `$or` (array of map of string to object): Minimum items 1.
        - Each value:
          - `eq` (string or number or boolean or null or array of (string or number or boolean or null))
          - `ne` (string or number or boolean or null or array of (string or number or boolean or null))
          - `gt` (string or number or boolean or array of (string or number or boolean))
          - `gte` (string or number or boolean or array of (string or number or boolean))
          - `lt` (string or number or boolean or array of (string or number or boolean))
          - `lte` (string or number or boolean or array of (string or number or boolean))
          - `like` (string or number or boolean or array of (string or number or boolean))
          - `in` (string or number or boolean or array of (string or number or boolean))
          - `nin` (string or number or boolean or array of (string or number or boolean))
          - `contains` (string or number or boolean or array of (string or number or boolean))
      - `$and` (array of map of string to object): Minimum items 1.
        - Each value:
          - `eq` (string or number or boolean or null or array of (string or number or boolean or null))
          - `ne` (string or number or boolean or null or array of (string or number or boolean or null))
          - `gt` (string or number or boolean or array of (string or number or boolean))
          - `gte` (string or number or boolean or array of (string or number or boolean))
          - `lt` (string or number or boolean or array of (string or number or boolean))
          - `lte` (string or number or boolean or array of (string or number or boolean))
          - `like` (string or number or boolean or array of (string or number or boolean))
          - `in` (string or number or boolean or array of (string or number or boolean))
          - `nin` (string or number or boolean or array of (string or number or boolean))
          - `contains` (string or number or boolean or array of (string or number or boolean))
  - `rowCount` (integer, required, nullable): Data rows written to the file, not counting header rows. Null until the export has completed. Minimum -9007199254740991. Maximum 9007199254740991. Example: `1842`.
  - `artifact` (object, required, nullable): The file, as `{ type, name }` — the two path segments of `GET /async-jobs/artifacts/{type}/{name}`. Null until the export has completed. Check `artifactAvailable` before offering the download: the file is kept for 90 days, the record for longer.
    - `type` (string, required)
    - `name` (string, required)
  - `artifactExpiresAt` (string (date-time), required, nullable): When the file stops being available for download: 90 days after the export completed. Null while there is no file. Example: `2026-12-02T10:42:10.004Z`.
  - `artifactAvailable` (boolean, required): Whether the file can be downloaded right now — true only for a completed export whose file has not yet expired. Once false, the export can still be run again from `parameters`. Example: `true`.
- When the value is variant 2:
  - `createdAt` (string (date-time), required): The date and time when the entity was created. Example: `2024-02-18T12:00:00Z`.
  - `updatedAt` (string (date-time), required, nullable): The date and time when the entity was last updated. Example: `2024-02-21T12:15:00Z`.
  - `metadata` (map of string to string, required, nullable): Metadata used by merchants to store additional information about the entity.
  - `id` (string, required): Identifier of the record. Example: `ojb_2c9NxQ3jSVWpaAqEbTORrivRV20`.
  - `jobId` (string, required): Identifier of the background job doing the work. Poll `GET /async-jobs/{id}` with it for live progress while `status` is `pending`. The job record expires after a few days; this record does not. Example: `bulk-fulfill_2bYqQx7ZkK9mW3nP1sR4tU6vX8y`.
  - `status` (string, required): `pending` until the job ends, then `completed` when it did its work or `failed` when it did not. A job that failed stays in the list. One of `pending`, `completed`, `failed`. Example: `completed`.
  - `requesterKind` (string, required): Which kind of credential started the job: `user` for a dashboard user, `api` for a secret key. One of `user`, `api`. Example: `user`.
  - `requesterId` (string, required, nullable): The requesting user id, or the id of the secret key used. Null when unknown. Example: `user_01J8ZK3Q9V2M4N6P8R0T2W4Y6A`.
  - `error` (string, required, nullable): Why the job failed, once it has; null otherwise. Example: `The export has more rows than an XLSX file may hold. Narrow the filters and try again.`.
  - `finishedAt` (string (date-time), required, nullable): When the job completed or failed. Null until then. Example: `2026-09-03T10:42:10.004Z`.
  - `kind` (string, required): A bulk fulfill: shipments recorded from uploaded rows. Started by `POST /orders/bulk-fulfill/jobs` or `POST /orders/bulk-fulfill/integration/{type}/jobs`. One of `bulk-fulfill`. Example: `bulk-fulfill`.
  - `parameters` (object, required): How the rows were read: the integration whose shipment report they came from, or none for a Standard upload. The rows themselves are stored for a fixed window and are not returned.
    - `integrationType` (string): The integration whose shipment report the rows were read with (`shipbob`, `nextsmartship`). Absent for a Standard upload, whose rows are the entries `POST /orders/bulk-fulfill` takes. One of `shipbob`, `nextsmartship`. Example: `shipbob`.
  - `rowCount` (integer, required): Rows the bulk fulfill was given, known from the start. Minimum -9007199254740991. Maximum 9007199254740991. Example: `128`.
  - `inputExpiresAt` (string (date-time), required, nullable): When the uploaded rows stop being stored: 90 days after the bulk fulfill was started. A failed bulk fulfill can be run again until then. Example: `2026-12-02T10:41:53.915Z`.
  - `inputAvailable` (boolean, required): Whether the uploaded rows are still stored, and so whether `POST /order-jobs/{id}/rerun` can run this bulk fulfill again. Re-running a completed one records nothing new: every shipment it already recorded is skipped as a duplicate. Example: `true`.

### `202`

The merchant is entitled but its OMS environment is not provisioned yet. Provisioning has been kicked off (exactly once) and is in progress; retry the request — it succeeds once the environment is ready. Returned only for identity-token (dashboard) requests bound to an active-entitled merchant, not for secret-key API calls; any such endpoint can return it while provisioning is underway.

Type: object (ProvisioningInProgress).

- `status` (string, required): Signals the merchant OMS environment is still being provisioned. One of `provisioning`.
- `merchantAccountId` (string, required): The merchant account whose OMS environment is being provisioned. Example: `dAI3aa87ROOeupeBCjNSKCOBOisBCYjB`.

### `400`

The request was rejected. `type` is `invalid_request_error`; when the failure is a validation failure `code` is `validation_failed` and `errors` lists every problem found, with field-attributable entries prefixed by the field’s path.

Type: object (ValidationErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): The first error message from the validation errors. Example: `note must be a string`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.
- `errors` (array of string): Complete list of validation errors.

### `401`

No credentials were supplied, or the identity token / secret key is not valid for the target merchant. `type` is `authentication_error`.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `403`

The credentials are valid but lack the permission this operation requires. `type` is `permission_error`.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `404`

No resource exists with the requested identifier. `type` is `not_found_error`.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `429`

Too many requests. The rate limit is applied per client across all operations. `type` is `rate_limit_error`.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `500`

The request could not be completed because of an unexpected error. `type` is `api_error`.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `503`

A dependency needed to serve the request is temporarily unavailable — for every operation the auth service that verifies credentials and resolves entitlement, and on the provisioning routes also the ODUS API the OMS reconciles against. `type` is `api_error`. Unlike a plain 500 the condition is transient rather than a fault in the request, so it is worth retrying with backoff.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

### `504`

The request exceeded the processing time limit and was abandoned. `type` is `api_error` and `code` is `timeout` — unlike a plain 500 the request may still have taken effect.

Type: object (ErrorResponse).

- `statusCode` (number, required): HTTP status code. Example: `400`.
- `requestId` (string, required): Unique identifier for the request. Example: `dfc10de3-36bb-4bcc-b081-316216194033`.
- `message` (string, required): Human-readable description of the failure. Example: `An error occurred`.
- `type` (string, required): Coarse, stable classifier for the failure. Present on every error response including 5xx. This is the field to branch on: `statusCode` is too coarse and `message` is human prose that may be reworded. The set is closed and every member is permanent, so it is safe to handle exhaustively. One of `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `invalid_state_error`, `conflict_error`, `rate_limit_error`, `payment_error`, `api_error`. Example: `invalid_request_error`.
- `code` (string): Fine-grained identifier for the failure, present only where it adds something `type` does not — for example separating a replayed idempotency key from a held lock, or naming the reason a payment was declined. The set is open and grows over time, so treat an unrecognised value as absent and fall back to `type`. Example: `validation_failed`.

---

Generated from the OMS API OpenAPI document, https://sandbox-oms-api.odus.com/openapi.json. Interactive page: https://docs.odus.com/docs/api/oms/order-job-controller-rerun
