All REST API services in GOAL Backend (Lumen 11 / PHP 8.2) follow unified architectural contracts for authentication, response envelopes, identification, status flags, and error handling.
All communication requires HTTPS (TLS 1.2+). Base paths are structured as:
| Environment | Base URL | Purpose |
|---|---|---|
| Development | https://goal-dev-gm-api.dsroma.info |
Internal development & sandbox |
| Alpha | https://goal-rest-service-alpha.dsroma.info |
QA & early feature testing |
| Test / Staging | https://goal-rest-service-test.dsroma.info |
Partner testing & UAT verification |
| Production | https://goal-rest-service.dsroma.info |
Live production operations |
Every request to a secured endpoint must supply:
Authorization: Bearer <access_token>
Content-Type: application/json
Accept: application/json
x-app-stage: <stage>
x-app-uid: <application_uuid>
Authorization: Bearer token issued by Passport or Keycloak.x-app-stage: Active deployment stage identifier (dev, alpha, test, production). Validated by stage-guard middleware.x-app-uid: Unique client application instance identifier used for auditing and telemetry correlation.ActionResult)Every endpoint serializes output through the standard App\Values\Core\ActionResult envelope:
200 OK / 201 Created){
"success": true,
"message": "Operación completada exitosamente",
"data": {
"id": 1042,
"uuid": "9c8e42b1-5f21-4d3b-9a2c-7b819f3a10e8",
"status": "A",
"created_at": "2026-10-06 14:30:00"
}
}
422 Unprocessable Entity){
"success": false,
"message": "Los datos proporcionados no son válidos.",
"errors": {
"code": ["El código de producto ya se encuentra registrado."],
"price": ["El campo precio es obligatorio y debe ser numérico."]
}
}
401 Unauthorized / 403 Forbidden){
"success": false,
"message": "Acceso no autorizado para la empresa o recurso solicitado.",
"data": null
}
All GET, PUT, and DELETE endpoints targeting a specific resource by path parameter /{id} support dual resolution:
/v1/sales/orders/1042), lookup is performed on the primary key id./v1/sales/orders/9c8e42b1-5f21-4d3b-9a2c-7b819f3a10e8), lookup is dynamically resolved against the uuid column.Operational records use the PostgreSQL check constraint CHECK (status IN ('A', 'I', 'D')):
| Status Code | Meaning | Behavior |
|---|---|---|
A |
Active (Activo) | Normal visible operational record. |
I |
Inactive (Inactivo) | Temporarily disabled; excluded from operational selection. |
D |
Deleted (Eliminado) | Soft-deleted; marked with deleted_at and deleted_by. Excluded from standard queries. |
List endpoints accept standard pagination and query parameters:
GET /v1/sales/orders?page=1&per_page=25&status=A&search=B2B
page: Current page number (integer, 1-indexed, default: 1).per_page / limit: Records per page (integer, default: 20, maximum: 100).sort_by: Column to sort by (e.g., created_at, name).sort_direction: asc or desc (default: desc).search: Keyword for full-text or pattern matching across primary identifier fields.| Topic | Doc |
|---|---|
| Media uploads & storage presets | Media Server proxy — storage_preset, GET …/presets, v1/v2 roma paths |