Skip to main content

Update services

Your integration performs two operations on a service: it writes the ERP order code to it and sends it to production.

Link the ERP order code​

Routes: PUT /services/{id} or PATCH /services/{id}. Both do the same thing.

When the service center registers a service as an order in the ERP, write that order's code to the service's internal_code. From then on, the service can be found by the ERP code (internal_code filter of GET /services) and no longer shows up in the search for services without a code (internal_code=null).

Steps:

  1. Get the service id from the list or query.

  2. Register the order in the ERP and keep the generated code.

  3. Call the route with the id in the URL and the code in the body:

    { "internal_code": "PED-000123" }

internal_code is the only field that can be changed, and it is required in the body. It accepts text or a number; send null to clear it.

Linking is only accepted when the service is in one of the statuses the API exposes: quote generated (4), awaiting online payment (25), approved (6), sent to production (7) or produced (9).

Outside these statuses, or without internal_code in the body, the response is 500 with the reason in the message. Repeating the call does not help: fix the body or check the service status.

Send to production​

Route: POST /services/{id}/production.

Sends the service to the service center's production and records the salesperson with the given email as responsible. The effect is the same as the salesperson approving the service for production in Cortecloud. Use this route with the service approved (6).

{ "sellerEmail": "vendedor@example.com" }
  • The email must belong to an active salesperson in the request's service center; otherwise, the response is 422.
  • The 202 response confirms that the submission was accepted. The status changes shortly after: track it with GET /services/{id}, or by webhook, until the service reaches sent to production (7). While the submission is processed, status.code may carry an intermediate code that is not in the status table.
  • If Cortecloud rejects the submission, for example due to insufficient balance, the response is 502 with the reason in the message.