Services

Create or update an array of 1 to 300 services atomically. If any item fails, none are stored. service.name is required when creating a new service; service.code, service.type, unit, description, and price are optional. When price is provided for a new service, price.value is required and price.currency is optional.

POSThttp://localhost:3000/api/v1/services
Method
POST
Content type
application/json
Authentication
Required · active locations · non-expired key
Maximum payload
1 MiB
Request frequency
30 requests per 60 seconds

Request headers

Send these headers with every POST request.

Content-Type: application/json
Authorization: Bearer y3m_ABCD2345_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

To get the authorization key, open Dashboard, use the three-dot menu on the company card, and select API integrations. Under Secret keys, select Create secret key, enable the Services scope, and assign at least one active location. Copy the full key when it is created because it is shown only once, then send it after Bearer in the Authorization header.

Request fields

Required and optional fields accepted in the JSON request body. Unknown fields are rejected at every level.

FieldTypeRequirementDescription
externalIdstringRequiredCaller-controlled Service identifier from the source system; it does not need to be a UUID. It is unique within the company; the internal Y3M identifier is a UUID v7. Maximum 200 characters.
serviceobject | nullOptionalOptional service identity. Name is required here when creating a new service.
service.codestringOptionalOptional visible service code. Maximum 100 characters.
service.typestringOptionalOptional external service type. Maximum 100 characters.
service.namestringOn createRequired when externalId does not match an existing service. When omitted for an existing service, the stored name is used. Maximum 200 characters.
descriptionstring | nullOptionalOptional service description. Maximum 2,000 characters.
unit"service"OptionalOptional case-sensitive catalog unit. The only allowed value is service; new services default to service when omitted.
priceobject | nullOptionalOptional base catalog price.
price.valuedecimal stringOn createRequired when price is provided for a new service; omitted values preserve the existing price. Non-negative value with up to three decimal places.
price.currency"UAH" | "EUR" | "USD" | "PLN"OptionalOptional price currency. Allowed values: UAH, EUR, USD, PLN.

Error responses

Possible errors returned by this endpoint and how to resolve them.

StatusCodeMeaningResolution
400INVALID_JSONThe request body is not valid JSON.Send one correctly formatted JSON array.
400INVALID_PAYLOADThe JSON body is not an array.Send a root JSON array containing between 1 and 300 objects.
401UNAUTHORIZEDThe Authorization header is missing, malformed, or contains an invalid API key.Send a valid API key using the Bearer authorization scheme.
401API_KEY_EXPIREDThe API key has reached its expiration date.Create a new API key and retry the request.
403FORBIDDENThe API key cannot access this module or is not assigned to an active company location.Assign an active location, enable the required module, or use another key.
409SERVICE_DELETEDA service referenced by externalId is deleted.Restore the service in Y3M, then retry the request.
413PAYLOAD_TOO_LARGEThe request body exceeds the 1 MiB limit.Reduce the JSON payload size to 1 MiB or less.
415UNSUPPORTED_MEDIA_TYPEThe Content-Type header is not application/json.Send Content-Type: application/json.
422VALIDATION_ERRORThe JSON is valid but one or more fields do not satisfy the endpoint contract.Use each { path, message } entry in error.details to correct the specified field.
429RATE_LIMIT_EXCEEDEDMore than 30 requests were sent within 60 seconds.Wait for the number of seconds specified by the Retry-After header.
500INTERNAL_ERRORRequest infrastructure, authentication, or rate-limit processing is temporarily unavailable.Retry later. Contact support if the error continues.
500STORAGE_ERRORThe validated payload could not be stored.Retry later. Contact support if the error continues.

Example request

Send this JSON array in the POST request body.

[
  {
    "externalId": "SERVICE-001",
    "service": {
      "code": "INSTALL-001",
      "type": "Installation",
      "name": "Installation"
    },
    "description": "Standard installation service",
    "unit": "service",
    "price": {
      "value": "50.000",
      "currency": "EUR"
    }
  }
]