Shipments, stock and credit memos
Lesson 8 of 30 7 min read
Update Magento shipments, push stock to the right inventory source without hitting rate limits, and import credit memos.
Orders are only half a Magento project. Customers expect a despatch email, the shop needs stock it can trust, and refunds raised in Magento need to reach the books. Magento has a Configuration for each, and each has one or two decisions worth getting right.
By the end of this lesson you'll be able to configure Magento Shipment, Inventory and Credit Configurations and avoid the rate-limit and duplicate-email traps.
Shipments: what the customer sees
| notify | When true, Magento emails the customer a shipment notification. When false or unset, no email. |
|---|---|
| defaultCarrierCode | The carrier code set on the Magento shipment when the fulfilment data doesn't provide one, so every shipment has a carrier. |
| appendComment | When true, a comment is appended to the Magento shipment. |
| comment | The static comment text used when appendComment is true. |
Decide who sends the despatch email
If the 3PL or another app already emails customers, leave notify off or customers will get two
emails. If nobody else does, turn it on.
Stock: which source, and how fast
| defaultSourceCode | The Magento inventory source that receives stock updates. |
|---|---|
| useBulkEndpoint | Use Magento's bulk inventory endpoint instead of individual calls. Generally faster for many products. |
| useSingleProductUpdate | Update each product individually. Slower, but useful when a Magento setup can't handle bulk operations. |
| rateLimitPermitLimit | The maximum number of API requests in each rate-limit window. |
| rateLimitWindow | The length of the window, for example 00:01:00 for one minute. Requests beyond the limit are throttled. |
| customAttributeTagMaps | Rules that read Magento product custom attributes and turn them into tags, each with an attributeCode, a valueIsLabel switch and a tagMap with a default. |
Start with the bulk endpoint. If the host or an extension struggles, switch to single-product updates and set a rate limit the host can cope with.
Good to know
Magento's multi-source inventory lets a shop hold stock against several sources. Supply Lens
sends to the one in defaultSourceCode, so make sure it's the source the storefront sells from.
Credit memos: refunds into the back office
| setupDate / lastImportDate | Go-live cut-off and watermark, as for orders. |
|---|---|
| importDelay | Wait before importing a credit memo, so other systems can finish changing it. |
| useBaseValues | Use base currency amounts for the credit memo, matching the choice you made for orders. |
Keep useBaseValues the same on Order and Credit, or a refund may not match the order it
reverses.
Fern & Finch: a slow host
Fern & Finch's Magento host throttles heavy traffic, and stock updates for 2,000 SKUs were timing out.
- The implementer keeps
useBulkEndpointon but setsrateLimitPermitLimitto a value the host agreed andrateLimitWindowto00:01:00. defaultSourceCodeis thedefaultsource the storefront sells from.- On shipments, the 3PL already emails tracking, so
notifystays off.defaultCarrierCodecovers the occasional shipment without a carrier. - Credit memos get a five-minute
importDelayanduseBaseValuesmatching the orders.
Recap
notifycontrols Magento's shipment email; avoid double emails.defaultCarrierCodeguarantees a carrier on every shipment.- Stock goes to
defaultSourceCode; prefer the bulk endpoint, and rate-limit when the host needs it. - Credit memos have their own delay and base-values setting; match the order settings.
Quick guides for this topic
Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.