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
Required parameters in parameters.yml:
gls:
api_url: "https://..."
user_id: "..."
password: "..."
contact_id: "..."
Data Flow
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 | Retry on next attempt |
| Invalid address | Logged and skipped |
| Authentication failure | Check parameters.yml credentials |
| Service unavailable | Retry with backoff |
:::tip Tracking synchronization
GLS tracking updates can be polled periodically using the tracking API endpoint. The tracking number stored on SaleProduct.shipment_infos is used as the lookup key.
:::