Skip to content

Legacy Migration

The Legacy Migration object

object

Attributes

idstring

Job ID

Other attributes
legacy_org_idstring
environmentstring
entity_idstringnullable
statusstring
stepstringnullable
step_numbernumber
total_stepsnumber
progress_detailstringnullable
errorstringnullable
created_atstring
started_atstringnullable
completed_atstringnullable
Examplejson
{
  "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

POST/legacy-migration/auth

Authenticate with legacy Space Invoices credentials and get a list of owned organizations.

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Body parameters

emailstring<email>required

Email for legacy Space Invoices account

passwordstringrequired

Password for legacy Space Invoices account

curl -X POST "https://eu.spaceinvoices.com/legacy-migration/auth" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-account-id: YOUR_ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "legacy-account-password"
  }'

Returns

organizationsarray of objects
legacy_session_idstring
json
{
  "organizations": [
    {
      "id": "legacy_org_abc123",
      "name": "Acme d.o.o.",
      "country": "SI",
      "tax_number": "SI12345678",
      "created_at": "2020-05-15T10:00:00.000Z",
      "already_migrated": false,
      "migrated_environment": null
    }
  ],
  "legacy_session_id": "lm_session_abc123"
}

Create migration job

POST/legacy-migration/jobs

Create a new legacy migration job.

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Body parameters

legacy_org_idstringrequired

Legacy organization ID to migrate

legacy_session_idstringrequired

Temporary legacy session ID created after legacy authentication

environmentstringrequired

Target environment

Possible values: "live", "sandbox"

Other parameters
confirm_unsupported_databooleanoptional
curl -X POST "https://eu.spaceinvoices.com/legacy-migration/jobs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-account-id: YOUR_ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "legacy_org_id": "legacy_org_abc123",
    "legacy_session_id": "lm_session_abc123",
    "environment": "sandbox"
  }'
Example:

List migration jobs

GET/legacy-migration/jobs

List all migration jobs for the current account.

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

curl "https://eu.spaceinvoices.com/legacy-migration/jobs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-account-id: YOUR_ACCOUNT_ID"

Returns

dataarray of objects
json
{
  "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

GET/legacy-migration/jobs/{id}

Get status and progress of a migration job.

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstringrequired

Migration job ID

curl "https://eu.spaceinvoices.com/legacy-migration/jobs/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-account-id: YOUR_ACCOUNT_ID"

Returns

idstring

Job ID

Other parameters
legacy_org_idstring
environmentstring
entity_idstringnullable
statusstring
stepstringnullable
step_numbernumber
total_stepsnumber
progress_detailstringnullable
errorstringnullable
created_atstring
started_atstringnullable
completed_atstringnullable
json
{
  "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
}
Example: