---
updatedAt: 2026-04-28T02:11:24.000Z
agentTools:
  projectIndex: https://docs.shipscience.com/llms.txt
---

# Read sub-account by id or external_id

**Partner-only.** Fetch a sub-account by its public ShipScience `id` (e.g. `acc_...`) or by the caller-supplied `external_id`. The path segment is resolved against the ShipScience `id` first, then `external_id` if the first lookup misses. Returns the sub-account and its primary user.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Shipscience API",
    "version": "v1",
    "description": "ShipScience's REST API for partners and customers.\n\n## Authentication\n\nMost endpoints require a bearer JWT in the `Authorization` header. Tokens\nare issued by the ShipScience login flow and are valid for 4 hours.\nClients are responsible for refreshing tokens before expiry. The\n`/api/v1/tokens` endpoint is an exception — it authenticates with the\n`api-key` header rather than a bearer JWT, since its purpose is to\nissue the JWT itself.\n\n## Partner endpoints\n\nThe **Sub Accounts** section is only available to accounts explicitly\nenabled as partners. If you receive `403 Forbidden`, contact\n**support@shipscience.com** to request access.\n"
  },
  "tags": [
    {
      "name": "Sub Accounts",
      "description": "**Partner-only.** These endpoints allow an authorized partner account to\nprovision and manage child (\"sub\") accounts on ShipScience. Access is\ndisabled by default.\n\nIf you receive `403 Forbidden`, your ShipScience account has not yet been\nenabled for the Partner API. Contact **support@shipscience.com** to\nrequest access.\n"
    }
  ],
  "paths": {
    "/api/v1/sub_accounts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The sub-account's public ShipScience `id` (e.g. `acc_...`) OR the caller-supplied `external_id`. The ShipScience `id` is tried first; if not found, the same value is matched against `external_id`."
        }
      ],
      "get": {
        "summary": "Read sub-account by id or external_id",
        "tags": [
          "Sub Accounts"
        ],
        "security": [
          {
            "bearer_auth": []
          }
        ],
        "description": "**Partner-only.** Fetch a sub-account by its public ShipScience `id` (e.g. `acc_...`) or by the caller-supplied `external_id`. The path segment is resolved against the ShipScience `id` first, then `external_id` if the first lookup misses. Returns the sub-account and its primary user.",
        "responses": {
          "200": {
            "description": "Sub-account found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sub_account_show_response"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api_error"
                }
              }
            }
          },
          "403": {
            "description": "Account not enabled for the Partner API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api_error"
                }
              }
            }
          },
          "404": {
            "description": "Sub-account not found under this parent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api_error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "sub_account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "acc_kD9aQ2pR7vN1xY3zB6cF8e",
            "description": "Public identifier for this sub-account."
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "merchant_42"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "created_at"
        ]
      },
      "sub_account_primary_user": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "usr_p4K2mN8vL1qR9xY3zB6cF7"
          },
          "external_id": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "email"
        ]
      },
      "sub_account_show_response": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/sub_account"
          },
          "primary_user": {
            "$ref": "#/components/schemas/sub_account_primary_user"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Per-sub-account inbound webhook URL. See POST /api/v1/sub_accounts for usage."
          }
        }
      },
      "api_error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://app.shipscience.com",
      "variables": {
        "defaultHost": {
          "default": "app.shipscience.com"
        }
      }
    }
  ]
}
```