Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

importCustomers

Sets how many successful orders each customer had before you reported orders to Grizzlee, so returning customers are not counted as new. Up to 1,000 customers per call. Safe to repeat.

POST /api/v1/customers/import

Requires events:write. Keep the Bearer key on your server.

SDK

ts
grizzlee.importCustomers(input: { customers: { customerId: string; priorOrderCount: number; }[]; }): Promise<{ imported: number; }>

HTTP

Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.

sh
curl --fail-with-body --request POST \
  'https://app.grizzlee.ca/api/v1/customers/import' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"customers":[{"customerId":"customer-example","priorOrderCount":1}]}'

Request body

FieldTypeRequiredDetails
customersarrayYes

customers[]

FieldTypeRequiredDetails
customers.customerIdstringYes
customers.priorOrderCountintegerYesminimum 0. maximum 100000

Request schema

json
{
  "type": "object",
  "properties": {
    "customers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "priorOrderCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": [
          "customerId",
          "priorOrderCount"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 1000
    }
  },
  "required": [
    "customers"
  ],
  "additionalProperties": false
}

Response

HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.

FieldTypeRequiredDetails
importednumberYes

Response schema

json
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "number"
    }
  },
  "required": [
    "imported"
  ]
}

Errors

Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.