Update Instance
PATCH/api/magento2/integration-instances/:magento2IntegrationInstance
Partial update — every field is sometimes. connection_settings and integration_settings are deep-merged with the existing values, so rotating just the access_token does NOT wipe the base_url. Top-level scalars like name, country, and is_automatic_sync_enabled overwrite directly.
Body parameters (all optional):
name(string, max 255)country(string, 2 chars — nullable)connection_settings.base_url(URL)connection_settings.access_token(string, min 8 chars, max 255) — merchant-rotated tokens land here.connection_settings.admin_path(string, max 120, regex^[A-Za-z0-9_\-/]+$, nullable) — Magento admin URL frontname (e.g.admin_gmr1iop). Used to build deep-links into the Magento admin panel; defaults toadminserver-side when null/blank. Magento installs typically randomise this inapp/etc/env.php→backend.frontNamefor security.integration_settings(object) — merged into existing settings.is_automatic_sync_enabled(boolean)
Payment-pending order policy (integration_settings.orders.payment_pending) — controls how orders that arrive from Magento 2 unpaid are imported:
integration_settings.orders.payment_pending.enabled(boolean) — turn the policy on/off. When off, unpaid orders import normally.integration_settings.orders.payment_pending.disposition(string:open,draft,reserve) — what happens to an unpaid order:openimports it normally (no hold),draftimports it without allocating stock until approved,reserveallocates stock and holds fulfillment until payment arrives.integration_settings.orders.payment_pending.reserve_expiry_days(integer 1-90, nullable) — for thereservedisposition, how many days the stock reservation is held before it auto-releases if payment never arrives; null means the reservation does not expire.integration_settings.orders.payment_pending.auto_open_on_payment(boolean) — automatically open a held order as soon as its payment is confirmed.- Per-payment-method overrides are available via the Payment Method Mappings endpoints (
unpaid_disposition).
Accounting sync trigger (integration_settings.accounting.sales_order_sync_trigger, string: always or when_paid, nullable) — when this store's sales orders are pushed to the connected accounting provider: always (default — the invoice is pushed once the order is confirmed) or when_paid (unpaid orders stay out of the ledger until payment arrives). Per-payment-method overrides are available via the Payment Method Mappings endpoints (accounting_sync).
Does not re-probe Magento — use the test-connection endpoint first if the merchant changed base_url or access_token.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.