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
Attributes
Connection identifier (shc_ prefix).
{
"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
/shipping-connectionsConnect 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 ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Carrier. dpd_si is DPD Slovenia (EasyShip).
Possible values: "dpd_si"
Carrier web-service username (DPD EasyShip account).
Carrier web-service password. Stored encrypted and never returned.
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);Returns
Connection identifier (shc_ prefix).
{
"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
/shipping-connectionsRetrieve the entity's shipping connections, excluding deleted ones. Results are ordered newest first and use cursor-based pagination.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Number of results per request.
Default: 10
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.
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.
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
Pagination metadata including cursors and result counts
{
"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
/shipping-connections/{id}Get a shipping connection
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
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
Connection identifier (shc_ prefix).
{
"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
/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 ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
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);Returns
Connection identifier (shc_ prefix).
{
"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
/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 ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
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');