Skip to content

Nationwide

Nationwide is an API-based data sync integration that imports annuity accounts from Nationwide Financial (Nationwide Advisory).

AttributeValue
Integration TypeData Sync (Inbound)
AuthenticationOAuth 2.0 Authorization Code grant, HTTP Basic for token exchange
OAuth Scopeopenid
Data FlowNationwide → RightCapital
Entity TypesAccounts (Annuity) only
SubtypeANNUITY_TAXABLE
ConstraintOne integration per advisor
DeveloperWinston Li (Zefeng Li)
Cron Ownerheli.yin
NotionNationwide Advisory

All accounts are investment accounts with subtype ANNUITY_TAXABLE. The vendor field linbus determines the annuity type:

Nationwide linbusRightCapital Annuity Type
FixedFixed Annuity
VariableVariable Annuity

Note: Holdings only fetched for Variable annuities. Fixed annuities have no subaccount allocations.

All fund types map to open_end_fund / fund / open_end:

Nationwide fundTypeRightCapital Discrete Type
Variableopen_end_fund
Fixedopen_end_fund
Indexopen_end_fund
Strategyopen_end_fund

Security matching priority: CUSIP → fundCode (as security_reference). CUSIP is nullable, 9-char string.

Price calculation:

  • If value and quantity are both non-zero: price = value / quantity
  • Otherwise: price = 1, quantity = value

Other holding behavior: isCash() always returns false. No date tracking (LacksDate trait).

Full paths relative to the configured API base (NATIONWIDE_API_ENDPOINT):

EndpointMethodPurpose
policy-management/nationwide-advisory-contract-list/v1/contractsGETList contracts
policy-management/nationwide-advisory-investments/v1/contracts/{id}/investmentsGETGet holdings

contractNumber, productName, productType, owner, linbus, contractStatus, issueDate, annuitant, contractTotalBalance

fundType, fundCode, longName, investmentValue, numberOfUnits, cusip, fundCompanyCode, fundCompany, cellType

  • Grant type: authorization_code — Advisor completes OAuth flow, code is exchanged for tokens.
  • Token exchange: HTTP Basic Auth (HttpBasicAuthOptionProvider) to Nationwide’s token endpoint.
  • User identification: userId claim extracted from JWT id_token, stored as the integration reference.
  • Request headers: Each request carries:
    • X-NW-Message-ID — unique UUID per request
    • client_id — OAuth client ID
  • Refresh token: 30-day expiry. When refreshed, the refresh token value stays the same (only the access token changes).
  • Error handling: Nationwide returns "Refresh Token Expired" (within 2 days of expiry) or "Invalid Refresh Token" (after 2 days). Both are mapped to RefreshTokenExpiredExceptionUnauthorizedException.
ComponentPath
Connectorretail-api/app/Integrations/Nationwide/Connector.php
Integratorretail-api/app/Integrations/Nationwide/Integrator.php
Syncretail-api/app/Integrations/Nationwide/Sync.php
Configretail-api/app/Integrations/Nationwide/Config.php
Controllerretail-api/app/Integrations/Nationwide/Controller.php
OAuth Providerretail-api/app/Integrations/Nationwide/OAuth2/Provider.php
Account Modelretail-api/app/Integrations/Nationwide/Models/Account.php
Investment Accountretail-api/app/Integrations/Nationwide/Models/InvestmentAccount.php
Holding Modelretail-api/app/Integrations/Nationwide/Models/Holding.php
Console Commandretail-api/app/Console/Commands/Integrations/Nationwide/Sync.php

Environment variables:

VariablePurpose
NATIONWIDE_API_ENDPOINTAPI base URL
NATIONWIDE_OAUTH_CLIENT_IDOAuth client ID
NATIONWIDE_OAUTH_CLIENT_SECRETOAuth client secret
NATIONWIDE_OAUTH_REDIRECT_URIOAuth redirect URI

Sync cron: 0 3 * * 2-6 (Tue–Sat UTC 3:00) via queue retail-integration-nationwide-nightly-sync (CLI: nationwide:sync).

Symptom: UnauthorizedException during sync.

Cause: Refresh token has a 30-day lifetime. Nationwide returns "Refresh Token Expired" for the first ~2 days after expiry, then "Invalid Refresh Token".

Solution: Advisor must re-authenticate through the OAuth flow.