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
  • kind
    enum<2>
    ORGANIZATION · INDIVIDUAL
  • sortByreq
    enum<4>
    name · email · createdAt · updatedAt
  • sortOrderreq
    enum<2>
    asc · desc

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
    • kindreq
      enum<2> | nullWhich party kind this counterparty edge points at.
    • displayNamereq
      stringResolved through the consolidation morphism — from the linked Organization or Individual.
    • displayAddressreq
      string | null
    • displayCountryreq
      string | null
    • displayRegistrationNumberreq
      string | null
    • activeOrderCount
      integer
    • totalOrderCount
      integer
    • _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"
  ],
  "kind": "ORGANIZATION"
}'

Request body

  • organizationIdreq
    string
  • namereq
    string
  • email
    string | string
  • phone
    string
  • address
    string
  • countryreq
    string
  • registrationNumber
    string
  • defaultCurrenciesreq
    array<string>
  • kindreq
    enum<2>
    ORGANIZATION · INDIVIDUAL

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
  • kindreq
    enum<2> | nullWhich party kind this counterparty edge points at.
  • displayNamereq
    stringResolved through the consolidation morphism — from the linked Organization or Individual.
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • activeOrderCount
    integer
  • totalOrderCount
    integer
  • _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

Response (200/201)

  • successreq
    boolean

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
  • kindreq
    enum<2> | nullWhich party kind this counterparty edge points at.
  • notesreq
    string | null
  • statusreq
    enum<3>
    PENDING · ACTIVE · INACTIVE
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • _count
    object
    • invoicesreq
      integer
  • 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 | string | null
  • phone
    string | null
  • address
    string | null
  • country
    string
  • registrationNumber
    string | null
  • defaultCurrencies
    array<string>
  • notes
    string | null
  • status
    enum<3>
    PENDING · ACTIVE · INACTIVE

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
  • kindreq
    enum<2> | nullWhich party kind this counterparty edge points at.
  • notesreq
    string | null
  • statusreq
    enum<3>
    PENDING · ACTIVE · INACTIVE
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • _count
    object
    • invoicesreq
      integer
  • 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 | string | null
  • phone
    string | null
  • address
    string | null
  • country
    string
  • registrationNumber
    string | null
  • defaultCurrencies
    array<string>
  • notes
    string | null
  • status
    enum<3>
    PENDING · ACTIVE · INACTIVE

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
  • kindreq
    enum<2> | nullWhich party kind this counterparty edge points at.
  • notesreq
    string | null
  • statusreq
    enum<3>
    PENDING · ACTIVE · INACTIVE
  • displayNamereq
    string
  • displayAddressreq
    string | null
  • displayCountryreq
    string | null
  • displayRegistrationNumberreq
    string | null
  • _count
    object
    • invoicesreq
      integer
  • 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