Skip to main content
Version: 2019-05-29 (Current)

Monitor bulk creation progress

Retrieve the current status of a bulk charge schedule creation job. Use this endpoint to track progress, check completion status, and determine when the status report is ready for download.

Request Parametersโ€‹

Required - 1 fieldPath Parameters
โ–ผ
`recurring_id`STRING(required)
The recurring export ID returned from the bulk create endpoint. IDs start with recr_.
Example:"recr_test_5xuy4w91xqz7d1w9u0t"

Responsesโ€‹

200

Job status retrieved

Returns the current status of the bulk creation job with progress details.

Response includes:
  • object - Always "recurring_export"
  • id - Recurring export ID (recr_*)
  • livemode - Whether this is a live mode operation
  • location - API path to this resource
  • state - Current job state (pending, processing, completed, failed)
  • total_rows - Total number of rows in the CSV
  • processed_rows - Number of rows processed so far
  • successful_rows - Number of schedules created successfully
  • failed_rows - Number of rows that failed to create
  • progress_percentage - Completion percentage (0-100)
  • download_uri - URI to download status report (available when completed)
  • created_at - Job creation timestamp
  • completed_at - Job completion timestamp (null if not completed)

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid recurring_id format
  • Missing recurring_id parameter

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Bulk creation job not found.

Common causes:
  • Invalid recurring_id
  • Job belongs to different account
  • Mixing test and live mode keys
  • Job has expired (older than 30 days)

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

# Check bulk creation job status
curl https://api.omise.co/recurring_exports/recr_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Polling for Completionโ€‹

Here's an example of polling the endpoint until the job completes:

const axios = require('axios');

async function waitForCompletion(recurringId, maxAttempts = 60, intervalMs = 5000) {
for (let i = 0; i < maxAttempts; i++) {
const response = await axios.get(
`https://api.omise.co/recurring_exports/${recurringId}`,
{
auth: { username: 'skey_test_5xuy4w91xqz7d1w9u0t', password: '' }
}
);

const { state, progress_percentage, successful_rows, failed_rows, total_rows } = response.data;

console.log(`Progress: ${progress_percentage}% (${successful_rows + failed_rows}/${total_rows})`);

if (state === 'completed') {
console.log(`Completed! Success: ${successful_rows}, Failed: ${failed_rows}`);
return response.data;
}

if (state === 'failed') {
throw new Error('Bulk creation job failed');
}

await new Promise(resolve => setTimeout(resolve, intervalMs));
}

throw new Error('Timeout waiting for job completion');
}

// Usage
const result = await waitForCompletion('recr_test_5xuy4w91xqz7d1w9u0t');

Error and result codesโ€‹

Job Statesโ€‹

StateDescriptionNext Steps
pendingJob is queuedWait and poll again
processingJob is actively runningWait and poll again
completedJob finishedDownload status report
failedJob encountered fatal errorCheck error message, retry upload

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your secret key is correct
not_foundJob not foundCheck recurring_id is correct
job_expiredJob data expiredJobs are retained for 30 days

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 1 fields
โ–ผ
Your IP: ...Loading...