Legacy Migration
Legacy Migration
The Legacy Migration object
Attributes
Job ID
{
"id": "mig_507f1f77bcf86cd799439011",
"legacy_org_id": "legacy_org_abc123",
"environment": "sandbox",
"entity_id": null,
"status": "pending",
"step": "Queued",
"step_number": 0,
"total_steps": 8,
"progress_detail": "Migration job is waiting to start.",
"error": null,
"created_at": "2024-01-01T00:00:00.000Z",
"started_at": null,
"completed_at": null
}Authenticate with legacy API
/legacy-migration/authAuthenticate with legacy Space Invoices credentials and get a list of owned organizations.
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Body parameters
Email for legacy Space Invoices account
Password for legacy Space Invoices account
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.legacyMigration.legacyMigrationAuth({
email: "user@example.com",
password: "legacy-account-password"
});
console.log(response);Returns
{
"organizations": [
{
"id": "legacy_org_abc123",
"name": "Nebula Systems GmbH",
"country": "DE",
"tax_number": "DE112233445",
"created_at": "2020-05-15T10:00:00.000Z",
"already_migrated": false,
"migrated_environment": null
}
],
"legacy_session_id": "lm_session_abc123"
}Create migration job
/legacy-migration/jobsCreate a new legacy migration job.
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Body parameters
Legacy organization ID to migrate
Temporary legacy session ID created after legacy authentication
Target environment
Possible values: "live", "sandbox"
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.legacyMigration.create({
legacy_org_id: "legacy_org_abc123",
legacy_session_id: "lm_session_abc123",
environment: "sandbox"
});
console.log(response);List migration jobs
/legacy-migration/jobsList all migration jobs for the current account.
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.legacyMigration.listMigrationJobs();
console.log(response);Returns
{
"data": [
{
"id": "mig_507f1f77bcf86cd799439011",
"legacy_org_id": "legacy_org_abc123",
"environment": "sandbox",
"entity_id": null,
"status": "pending",
"step": "Queued",
"step_number": 0,
"total_steps": 8,
"progress_detail": "Migration job is waiting to start.",
"error": null,
"created_at": "2024-01-01T00:00:00.000Z",
"started_at": null,
"completed_at": null
}
]
}Get migration job status
/legacy-migration/jobs/{id}Get status and progress of a migration job.
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Migration job ID
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.legacyMigration.getMigrationJob('LEGACYMIGRATION_ID');
console.log(response);Returns
Job ID
{
"id": "mig_507f1f77bcf86cd799439011",
"legacy_org_id": "legacy_org_abc123",
"environment": "sandbox",
"entity_id": null,
"status": "pending",
"step": "Queued",
"step_number": 0,
"total_steps": 8,
"progress_detail": "Migration job is waiting to start.",
"error": null,
"created_at": "2024-01-01T00:00:00.000Z",
"started_at": null,
"completed_at": null
}