Skip to content

Shipping Connections

Shipping Connections

Carrier accounts an entity uses to create shipments and print parcel labels. DPD Slovenia (EasyShip) is supported.

The Shipping Connection object

object

Attributes

idstring

Connection identifier (shc_ prefix).

Other attributes
entity_idstring
is_activeboolean
created_atstring<date-time>
updated_atstring<date-time>
Examplejson
{
  "id": "shc_6595a27b5d35015c3ef0c501",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fc",
  "carrier": "dpd_si",
  "username": "shop-demo",
  "is_active": true,
  "settings": {
    "label_format": "pdf_a6",
    "default_parcel_count": 1,
    "default_weight_kg": 2.5,
    "cod_payment_methods": [
      "cod",
      "cash"
    ],
    "push_tracking_to_store": true,
    "sender": null
  },
  "created_at": "2026-11-01T09:00:00.000Z",
  "updated_at": "2026-11-01T09:00:00.000Z"
}

Create a shipping connection

POST/shipping-connections

Connect a carrier account. The credentials are verified with the carrier first: 422 invalid_carrier_credentials when the carrier refuses them, 502 carrier_unavailable when it cannot be reached. An entity has at most one connection per carrier; a second one answers 409 shipping_connection_exists. The password is stored encrypted and never returned.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

carrierstringrequired

Carrier. dpd_si is DPD Slovenia (EasyShip).

Possible values: "dpd_si"

usernamestringrequired

Carrier web-service username (DPD EasyShip account).

passwordstringrequired

Carrier web-service password. Stored encrypted and never returned.

Other parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.shippingConnections.create({
  carrier: "dpd_si",
  username: "shop-demo",
  password: "correct-horse-battery"
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:

Returns

idstring

Connection identifier (shc_ prefix).

Other parameters
entity_idstring
is_activeboolean
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "shc_6595a27b5d35015c3ef0c501",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fc",
  "carrier": "dpd_si",
  "username": "shop-demo",
  "is_active": true,
  "settings": {
    "label_format": "pdf_a6",
    "default_parcel_count": 1,
    "default_weight_kg": 2.5,
    "cod_payment_methods": [
      "cod",
      "cash"
    ],
    "push_tracking_to_store": true,
    "sender": null
  },
  "created_at": "2026-11-01T09:00:00.000Z",
  "updated_at": "2026-11-01T09:00:00.000Z"
}

List shipping connections

GET/shipping-connections

Retrieve the entity's shipping connections, excluding deleted ones. Results are ordered newest first and use cursor-based pagination.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

limitintegeroptional

Number of results per request.

Default: 10

next_cursorstringoptional

Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.

prev_cursorstringoptional

Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.

include_total_countbooleanoptional

Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.shippingConnections.listShippingConnections(undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

json
{
  "data": [
    {
      "id": "shc_6595a27b5d35015c3ef0c501",
      "entity_id": "ent_6595a27b5d35015c3ef0c3fc",
      "carrier": "dpd_si",
      "username": "shop-demo",
      "is_active": true,
      "settings": {
        "label_format": "pdf_a6",
        "default_parcel_count": 1,
        "default_weight_kg": 2.5,
        "cod_payment_methods": [
          "cod",
          "cash"
        ],
        "push_tracking_to_store": true,
        "sender": null
      },
      "created_at": "2026-11-01T09:00:00.000Z",
      "updated_at": "2026-11-01T09:00:00.000Z"
    }
  ],
  "pagination": {
    "total": 1,
    "next_cursor": null,
    "prev_cursor": null,
    "has_more": false
  }
}

Get a shipping connection

GET/shipping-connections/{id}

Get a shipping connection

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.shippingConnections.getShippingConnection('SHIPPINGCONNECTIONS_ID', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring

Connection identifier (shc_ prefix).

Other parameters
entity_idstring
is_activeboolean
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "shc_6595a27b5d35015c3ef0c501",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fc",
  "carrier": "dpd_si",
  "username": "shop-demo",
  "is_active": true,
  "settings": {
    "label_format": "pdf_a6",
    "default_parcel_count": 1,
    "default_weight_kg": 2.5,
    "cod_payment_methods": [
      "cod",
      "cash"
    ],
    "push_tracking_to_store": true,
    "sender": null
  },
  "created_at": "2026-11-01T09:00:00.000Z",
  "updated_at": "2026-11-01T09:00:00.000Z"
}

Update a shipping connection

PATCH/shipping-connections/{id}

Change the credentials, the settings or the active flag. Omitted properties are unchanged; settings is merged into the stored settings, and a null default_weight_kg or sender clears it. Changing the username or password verifies the new credentials with the carrier first (422 invalid_carrier_credentials, 502 carrier_unavailable).

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

Body parameters

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.shippingConnections.update('SHIPPINGCONNECTIONS_ID', {
  settings: {
    default_parcel_count: 2,
    push_tracking_to_store: false
  }
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:

Returns

idstring

Connection identifier (shc_ prefix).

Other parameters
entity_idstring
is_activeboolean
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "shc_6595a27b5d35015c3ef0c501",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fc",
  "carrier": "dpd_si",
  "username": "shop-demo",
  "is_active": true,
  "settings": {
    "label_format": "pdf_a6",
    "default_parcel_count": 2,
    "default_weight_kg": 2.5,
    "cod_payment_methods": [
      "cod",
      "cash"
    ],
    "push_tracking_to_store": false,
    "sender": null
  },
  "created_at": "2026-11-01T09:00:00.000Z",
  "updated_at": "2026-11-01T09:00:00.000Z"
}

Delete a shipping connection

DELETE/shipping-connections/{id}

Soft delete a shipping connection. Shipments created through it stay available. A new connection for the same carrier can be created afterwards.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.shippingConnections.delete('SHIPPINGCONNECTIONS_ID', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log('Deleted successfully');