Customers

Customer records (external and in-system suppliers' clients), recipients for invoice delivery.

9 endpoints·Scopes: customers:read, customers:write
GET/api/customers#

List customers

scope · customers:read

Lists customers the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via page and limit.

Scope: customers:read
Endpoint: GET /api/customers

Example request

curl "https://guliel.com/api/customers?organizationId=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • organizationIdreq
    string
  • pagereq
    integer
  • limitreq
    integer
  • searchreq
    string
  • inSystem
    string | string | string

Response (200/201)

  • customersreq
    array<object>
    • idreq
      string
    • namereq
      string | null
    • emailreq
      string | null
    • phonereq
      string | null
    • addressreq
      string | null
    • countryreq
      string | null
    • registrationNumberreq
      string | null
    • defaultCurrenciesreq
      array<string>
    • organizationIdreq
      string
    • representsOrganizationIdreq
      string | nullSet when the customer corresponds to a Guliel-registered organization.
    • displayNamereq
      stringResolved through the consolidation morphism — represented-org's name when in-system, local name otherwise.
    • displayAddressreq
      string | null
    • displayCountryreq
      string | null
    • displayRegistrationNumberreq
      string | null
    • activeOrderCount
      integer
    • totalOrderCount
      integer
    • representsOrganizationreq
      object | null
    • _count
      object
      • invoicesreq
        integer
    • createdAtreq
      string
    • updatedAtreq
      string
  • paginationreq
    object
    • pagereq
      integer
    • limitreq
      integer
    • totalreq
      integer
    • totalPagesreq
      integer

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/customers#

Create a customer

scope · customers:writerole · CONTRIBUTOR+

Creates a new customer in the target organization. Returns the created record on success.

Scope: customers:write
Min role: CONTRIBUTOR or higher
Endpoint: POST /api/customers

Example request

curl -X POST "https://guliel.com/api/customers" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "organizationId": "abc123",
  "name": "Sample",
  "country": "string",
  "defaultCurrencies": [
    "USD"
  ]
}'

Request body

  • organizationIdreq
    string
  • namereq
    string
  • email
    string | string
  • phone
    string
  • address
    string
  • countryreq
    string
  • registrationNumber
    string
  • defaultCurrenciesreq
    array<string>

Response (200/201)

  • idreq
    string
  • namereq
    string | null
  • emailreq
    string | null
  • phonereq
    string | null
  • addressreq
    string | null
  • countryreq
    string | null
  • registrationNumberreq
    string | null
  • defaultCurrenciesreq
    array<string>
  • organizationIdreq
    string
  • representsOrganizationIdreq
    string | nullSet when the customer corresponds to a Guliel-registered organization.
  • displayName
    stringResolved through the consolidation morphism — represented-org's name when in-system, local name otherwise.
  • displayAddress
    string | null
  • displayCountry
    string | null
  • displayRegistrationNumber
    string | null
  • activeOrderCount
    integer
  • totalOrderCount
    integer
  • representsOrganization
    object | null
  • _count
    object
    • invoicesreq
      integer
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
DELETE/api/customers/{id}#

Delete a customer

scope · customers:write

Deletes the customer. Some endpoints hard-delete the row, others soft-revoke (set revokedAt). Check the response shape.

Scope: customers:write
Endpoint: DELETE /api/customers/{id}

Example request

curl -X DELETE "https://guliel.com/api/customers/abc123?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string
  • mode
    string | string

Response (200/201)

  • successreq
    boolean
  • modereq
    string | stringWhich delete path executed — disconnect strips the consolidation link, hard removes the row entirely.

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/customers/{id}#

Get a customer

scope · customers:read

Fetches a single customer by id. Returns 404 if the customer isn't in the caller's accessible organizations.

Scope: customers:read
Endpoint: GET /api/customers/{id}

Example request

curl "https://guliel.com/api/customers/abc123?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string

Response (200/201)

  • idreq
    string
  • namereq
    string | null
  • emailreq
    string | null
  • phonereq
    string | null
  • addressreq
    string | null
  • countryreq
    string | null
  • registrationNumberreq
    string | null
  • defaultCurrenciesreq
    array<string>
  • organizationIdreq
    string
  • representsOrganizationIdreq
    string | null
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • ordersFromClient
    object | nullPresent only for in-system customers — orders the connected client has placed with this supplier.
  • _count
    object
    • invoicesreq
      integer
  • representsOrganizationreq
    object | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
PATCH/api/customers/{id}#

Update a customer

scope · customers:write

Updates an existing customer. Only the fields present in the request body are changed; omitted fields stay as-is.

Scope: customers:write
Endpoint: PATCH /api/customers/{id}

Example request

curl -X PATCH "https://guliel.com/api/customers/abc123" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123"
}'

Request body

  • idreq
    string
  • name
    string
  • email
    string | null
  • phone
    string | null
  • address
    string | null
  • country
    string
  • registrationNumber
    string | null
  • defaultCurrencies
    array<string>
  • notes
    string | null

Response (200/201)

  • idreq
    string
  • namereq
    string | null
  • emailreq
    string | null
  • phonereq
    string | null
  • addressreq
    string | null
  • countryreq
    string | null
  • registrationNumberreq
    string | null
  • defaultCurrenciesreq
    array<string>
  • organizationIdreq
    string
  • representsOrganizationIdreq
    string | null
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • ordersFromClient
    object | nullPresent only for in-system customers — orders the connected client has placed with this supplier.
  • _count
    object
    • invoicesreq
      integer
  • representsOrganizationreq
    object | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
PUT/api/customers/{id}#

Update a customer

scope · customers:write

Replaces an existing customer. All required fields must be supplied — omitted fields revert to their schema defaults.

Scope: customers:write
Endpoint: PUT /api/customers/{id}

Example request

curl -X PUT "https://guliel.com/api/customers/abc123" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123"
}'

Request body

  • idreq
    string
  • name
    string
  • email
    string | null
  • phone
    string | null
  • address
    string | null
  • country
    string
  • registrationNumber
    string | null
  • defaultCurrencies
    array<string>
  • notes
    string | null

Response (200/201)

  • idreq
    string
  • namereq
    string | null
  • emailreq
    string | null
  • phonereq
    string | null
  • addressreq
    string | null
  • countryreq
    string | null
  • registrationNumberreq
    string | null
  • defaultCurrenciesreq
    array<string>
  • organizationIdreq
    string
  • representsOrganizationIdreq
    string | null
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • ordersFromClient
    object | nullPresent only for in-system customers — orders the connected client has placed with this supplier.
  • _count
    object
    • invoicesreq
      integer
  • representsOrganizationreq
    object | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
DELETE/api/customers/{id}/recipients#

Detach recipients from a customer

scope · customers:write

Removes the association without deleting the underlying record.

Scope: customers:write
Endpoint: DELETE /api/customers/{id}/recipients

Example request

curl -X DELETE "https://guliel.com/api/customers/abc123/recipients?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string
  • recipientIdreq
    string

Response (200/201)

  • successreq
    boolean

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/customers/{id}/recipients#

List recipients for a customer

scope · customers:read

Returns every recipients row associated with the given customer.

Scope: customers:read
Endpoint: GET /api/customers/{id}/recipients

Example request

curl "https://guliel.com/api/customers/abc123/recipients?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string

Response (200/201)

Array of object:
  • idreq
    string
  • customerIdreq
    string
  • emailreq
    string
  • namereq
    string | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/customers/{id}/recipients#

Attach recipients to a customer

scope · customers:write

Creates a new recipients attached to the given customer.

Scope: customers:write
Endpoint: POST /api/customers/{id}/recipients

Example request

curl -X POST "https://guliel.com/api/customers/abc123/recipients" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123",
  "email": "you@example.com"
}'

Request body

  • idreq
    string
  • emailreq
    string <email>
  • name
    string

Response (200/201)

  • idreq
    string
  • customerIdreq
    string
  • emailreq
    string
  • namereq
    string | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal