Test the full order lifecycle locally by placing XML files in the var/ directory and running the CLI.
Quick Start
# 1. Place an ORDP XML file in the input directory
cp my-order.xml var/digitec-galaxus/in/1/GORDP_12345678_test.xml
# 2. Run order import (skip FTP, use local files only)
bin/magento digitecgalaxus:order:import --skip-ftp
Output:
[Store 1] Create Order #12345678 => Order #000000042 created in Magento
Test a File Without Importing
Sales → Digitec Galaxus → Orders → Test import file uploads one GORDP file and shows what the import would read from it: order header, every line with the Magento product it resolves to, the total, and the reasons the import would skip or refuse the file (order already exists, no buyer or delivery party, a line without a matching product). Nothing is saved and the in/out folders are not touched, so a file can be checked before it is dropped in the input directory.
Directory Structure
| Directory | Purpose |
|---|---|
var/digitec-galaxus/in/{storeId}/ |
Input — place XML files here |
var/digitec-galaxus/in/{storeId}/processed/ |
Processed files are moved here automatically |
var/digitec-galaxus/out/{storeId}/ |
Output — ORDR, DELR, EOLN responses |
var/digitec-galaxus/orders/ |
Output — CANR (cancel confirmation) responses |
The {storeId} corresponds to your Magento store view ID (usually 1).
Document Types
All document types used in the Digitec Galaxus integration (see DocumentType source model):
| Code | Name | Direction | Description |
|---|---|---|---|
ORDP |
Order Placement | DG → Magento | Incoming order from Digitec Galaxus |
ORDR |
Order Response | Magento → DG | Confirmation that the order was received |
DELR |
Dispatch Notification | Magento → DG | Shipment and tracking information |
INVO |
Invoice | Magento → DG | Invoice document |
CANP |
Cancel Request | DG → Magento | DG requests cancellation of (part of) an order |
CANR |
Cancel Confirmation | Magento → DG | Confirms acceptance/rejection of cancel request |
EOLN |
Supplier Cancel Notification | Magento → DG | Supplier-initiated cancellation |
RETP |
Return Registration | DG → Magento | DG registers a return for a shipped order |
RETR |
Return Confirmation | Magento → DG | Confirms acceptance/rejection of return |
SURN |
Supplier Return Notification | Magento → DG | Supplier-initiated return notification |
CLI Processing Order
The digitecgalaxus:order:import --skip-ftp command processes inbound files in this order:
| Step | File Prefix | Action | Output |
|---|---|---|---|
| 1 | GORDP_ |
Parse order XML into DG orders table | GORDR_ in out/{storeId}/ |
| 2 | GCANP_ |
Process cancellation, create credit memo | GCANR_ in orders/ |
| 3 | — | Import parsed orders into Magento | Magento orders created |
| 4 | GRETP_ |
Process return registration | Return data stored in DB |
Preparing XML Files
SUPPLIER_PID (Product Identifier)
The SUPPLIER_PID value in the XML must match a product in your Magento catalog. By default, the module uses entity_id (the Magento product ID). If your config uses sku, set the SKU instead.
Check your setting at: Stores > Configuration > Digitec Galaxus > Order Settings > Product Identifier
<!-- entity_id mode: use the Magento product entity ID -->
<SUPPLIER_PID type="supplierProductKey">5</SUPPLIER_PID>
<!-- sku mode: use the product SKU -->
<SUPPLIER_PID type="supplierProductKey">24-MB01</SUPPLIER_PID>
ORDER_ID
Each order needs a unique ORDER_ID. Use any numeric value that doesn't conflict with existing DG orders. The filename should also contain this ID: GORDP_{ORDER_ID}_description.xml.
Currency
The CURRENCY in the XML must be allowed in your Magento store. Configure at: Stores > Configuration > General > Currency Setup > Allowed Currencies.
Testing Each Flow
1. Import an Order (GORDP)
Place an ORDP file and run the CLI:
# Copy a fixture (adjust SUPPLIER_PID to match your product)
cp Test/End-2-end/fixtures/xml/ordp/GORDP_61730204_private_customer.xml \
var/digitec-galaxus/in/1/GORDP_12345678_test.xml
# Edit the file: change ORDER_ID and SUPPLIER_PID to valid values
# Then run:
bin/magento digitecgalaxus:order:import --skip-ftp
Verify:
- Magento order created (check Sales > Orders)
- ORDR response XML in
var/digitec-galaxus/out/1/ - DG order record in
digitec_galaxus_orderstable
2. Cancel an Order (GCANP)
First import an order, then place a CANP file:
# Place cancel request (ORDER_ID must match an imported DG order)
cp Test/End-2-end/fixtures/xml/canp/GCANP_10000001_full_cancel.xml \
var/digitec-galaxus/in/1/GCANP_12345678_cancel.xml
# Edit: set ORDER_ID + SUPPLIER_PID to match the imported order
bin/magento digitecgalaxus:order:import --skip-ftp
Verify:
- DG order status changed to
4(Cancelled) for full cancel - Credit memo created on the Magento order
- CANR response XML in
var/digitec-galaxus/orders/
For partial cancellation, only include the items to cancel in CANCELREQUEST_ITEM_LIST. The order remains status 2 (Imported) with total_item_cancelled updated.
3. Return Registration (GRETP)
The order must be shipped before a return can be processed:
# After importing and shipping the order, place return request:
cp Test/End-2-end/fixtures/xml/retp/GRETP_10000001_return_request.xml \
var/digitec-galaxus/in/1/GRETP_12345678_return.xml
# Edit: set ORDER_ID + SUPPLIER_PID + RETURNREGISTRATION_ID
bin/magento digitecgalaxus:order:import --skip-ftp
Verify:
- DG order status changed to
6(Return Request) - Return data stored in
returnscolumn ofdigitec_galaxus_orderstable
Available Test Fixtures
Ready-to-use XML fixtures in Test/End-2-end/fixtures/xml/:
Orders (ordp/)
| File | Description |
|---|---|
GORDP_61730204_private_customer.xml |
Private customer, CH, CHF, 1 item |
GORDP_61730207_private_customer_de.xml |
Private customer, DE, EUR, 1 item |
GORDP_61730220_company_customer.xml |
Company customer, CH, CHF, 2 items |
GORDP_61730224_warehouse.xml |
Warehouse delivery, 2 items |
GORDP_69999999_eu_hub.xml |
EU-Hub delivery, 2 items |
Cancellations (canp/)
| File | Description |
|---|---|
GCANP_10000001_full_cancel.xml |
Full order cancellation (1 item) |
GCANP_10000002_partial_cancel.xml |
Partial cancellation (1 of N items) |
Returns (retp/)
| File | Description |
|---|---|
GRETP_10000001_return_request.xml |
Return registration for 1 item |
Troubleshooting
No output from CLI
The CLI only prints output for order creation results. Cancellation and return processing run silently. Check the digitec_galaxus_orders table directly or the module's debug log.
"Could not find product with SKU"
The SUPPLIER_PID in the XML doesn't match any product. Check your product identifier config setting and use the correct value (entity_id or SKU).
"Currency X is not available"
Add the currency to Stores > Configuration > General > Currency Setup > Allowed Currencies and set an exchange rate.
Order not processing
- Ensure the module is enabled:
magmodules_digitecgalaxus/general/enable = 1 - Ensure order import is enabled:
magmodules_digitecgalaxus/order/enable = 1 - Check the file is in the correct directory with the right prefix (
GORDP_,GCANP_,GRETP_) - Check the debug log at Digitec Galaxus > Debug Log in the admin
Cancel request not working
- The order must exist in
digitec_galaxus_orderswith a matchingorder_id - The order must not be shipped (shipped orders cannot be cancelled)
- The
SUPPLIER_PIDin the CANP must match the product in the original order
FTP deleting local files
When FTP is enabled, the module uploads response XMLs and deletes the local copy. For local testing, disable FTP at Stores > Configuration > Digitec Galaxus > General > FTP Settings > Enable.
For a complete overview of features and configuration options, see Magento 2 Digitec Galaxus integration.
