Create Dealer

Onboards a new dealer (enterprise) and its first rooftops. The reseller is resolved from your token, so reseller_id is never sent in the request.

POSThttps://api.spyne.ai/api/pv1/enterprise/create-enterprise
AuthBearer token

Body parameters

  • business_name (string, required) — Dealer or business name.
  • user_name (string, optional): the owner's name.
  • user_email (string, optional): the owner's email. This person becomes the dealer admin and gets a welcome email with their login. If you leave it out, no owner user is created, and your partner account's owners manage the dealer.
  • type (string, required) — GROUP_DEALER or INDIVIDUAL_DEALER.
  • rooftops (array, required) — One or more rooftops to create (see Rooftop object).
  • address (object, optional): the dealer's address. Any of address_line, city, state, country, pin_code, all strings.

Rooftop object

  • teamName (string, required) — Rooftop name.
  • productLines (array, required): the products to turn on for this rooftop, as a list of product names from the table below, for example ["Image", "360 Spin", "Sales Inbound"]. Names are not case-sensitive.
  • address (object, optional): the rooftop's address. Any of address_line, city, state, country, pin_code, all strings.
  • email (string, optional) — Makes this email the rooftop admin (invited if new).

Product names

Product nameTurns on
ImageStudio images
360 Spin360° spins
VideoVideos
Sales InboundSales inbound agent
Sales OutboundSales outbound agent
Service InboundService inbound agent
Service OutboundService outbound agent

Sample request

curl --request POST \
  --url 'https://api.spyne.ai/api/pv1/enterprise/create-enterprise' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "business_name": "Acme Motors",
    "user_name": "Jane Owner",
    "user_email": "[email protected]",
    "type": "INDIVIDUAL_DEALER",
    "address": { "city": "Austin", "state": "TX", "country": "US" },
    "rooftops": [
      {
        "teamName": "Main Rooftop",
        "productLines": ["Image", "360 Spin", "Video", "Sales Inbound"],
        "address": { "address_line": "1200 Main St", "city": "Austin", "state": "TX", "pin_code": "78701" }
      }
    ]
  }'

Sample response

{
  "message": "Dealership onboarded",
  "data": {
    "enterpriseId": "<enterprise_id>",
    "type": "INDIVIDUAL_DEALER",
    "teams": [
      { "teamId": "<team_id>", "teamName": "Main Rooftop", "productLines": [] }
    ]
  }
}

Response parameters


ParameterTypeDescription
messagestringConfirmation message.
data.enterpriseIdstringThe new dealer's id.
data.typestringGROUP_DEALER or INDIVIDUAL_DEALER.
data.teamsarrayCreated rooftops, each with teamId, teamName and productLines.

Errors

Status codeDescription
400Invalid or missing parameters, or no reseller is mapped to your enterprise.
401Missing or invalid token.
403The token's user lacks permission on the target reseller.
500Unexpected server error.

Did this page help you?