Appearance
GLS Integration
GLS provides parcel shipping services. The integration generates shipping labels and retrieves tracking information through the GLS API.
Components
| Component | File | Role |
|---|---|---|
GlsApi | src/CoreBundle/Api/GlsApi.php | API client for GLS |
GlsService | src/CoreBundle/Services/GlsService.php | Shipment business logic |
Configuration
The source snapshot defines a gls parameter group. The names below describe the configuration shape; active values and credentials are environment-owned.
yaml
gls:
user: "..."
password: "..."
urlShipment: "https://..."
ContactID: "..."
ContactStQuentin: "..."
urlParcelDetails: "https://..."
label_width_mm: 102
label_height_mm: 125
label_margin_mm: 0This shape is from app/config/parameters.yml.dist at the reviewed source revision. It does not prove that the values are present or active.
Data Flow
View diagram source
sequenceDiagram
participant SVC as GlsService
participant API as GlsApi
participant GLS as GLS API
participant SP as SaleProduct
SVC->>API: createShipment(orderData)
API->>GLS: POST shipment request
GLS-->>API: Label PDF + tracking number
API-->>SVC: Parsed response
SVC->>SVC: Save label PDF
SVC->>SP: Update carrier, tracking, shipment info
Label Generation
GlsServiceprepares shipment data fromSaleProductrecordsGlsApisends the request to the GLS API- The response includes a PDF label and tracking number
- The label is stored locally and the tracking number is saved on the
SaleProduct
Error Handling
| Scenario | Behavior |
|---|---|
| API timeout or exception | The ticket command records a ticket error and synchronizes an error tracking row. A retry policy is not established by the reviewed command. |
| Invalid address | Provider response handling is delegated to GlsService; a general “logged and skipped” rule is not established by the reviewed command. |
| Authentication failure | Check the environment-owned gls configuration and the provider response. Credentials are not documented here. |
| Service unavailable | The command records the provider error; backoff or automatic retry is not established by the reviewed source. |
Tracking synchronization
The ticket command can reuse an existing local ticket and tracking links. The separate tracking synchronizer stores normalized status and status history; the reviewed source does not establish a polling schedule or successful provider readback. See carrier shipment operations.