Marketplaces and gateways
What it is
A marketplace is a sales channel Payability funds against — Amazon Seller Central, Amazon Vendor Central/Express, Walmart, Target, eBay, Shopify, Newegg, Volusion, MoreCommerce, Tophatter, PingPong — plus payment processors treated the same way (PayPal, Stripe, Payoneer, Authorize.net).
Two distinct things are easy to conflate:
- The marketplace (
marketplaceKey) -
A catalogue entry, global across all suppliers. Maintained under
/marketplaces. - The marketplace-supplier link (
mpSupKey/mpSupplierKey) -
One supplier’s account on one marketplace. Funding settings, opt-in periods, minimum-fee overrides, statements and gateway connections all attach here, not to the supplier.
Almost every funding-related bug traced to "the wrong marketplace" is actually a confusion between these two keys.
Where it lives
| Concern | Location |
|---|---|
Catalogue routes |
|
Catalogue services |
|
Catalogue models |
|
Catalogue store |
|
Supplier link routes |
|
Supplier link services |
|
Statements |
|
The catalogue
MarketplaceRepository on internalApiUrl:
| Endpoint | Purpose |
|---|---|
|
List all marketplaces. |
|
One marketplace. |
|
Create. |
|
Update. |
|
Funding period groups — the settlement cadences a marketplace can use. |
|
Free-trial configurations. |
There is no delete. A marketplace is retired by status, not removal.
MARKETPLACE (shared/enums/marketplace.enum.ts) enumerates only four names and
carries a // TODO: should be extended comment:
export enum MARKETPLACE {
AMAZON_SELLER_CENTRAL = 'Amazon Seller Central',
AMAZON_VENDOR_CENTRAL = 'Amazon Vendor Central',
AMAZON_VENDOR_EXPRESS = 'Amazon Vendor Express',
PAYABILITY = 'Payability',
}
|
This enum is not the marketplace catalogue — it is a partial list of names used for
Amazon-specific branching. The authoritative identifiers are the UUID constants in
|
Payment gateways
Some marketplaces settle through a payment gateway rather than paying Payability
directly. GatewayService (which reads environment directly rather than through
AppConfigService — legacy):
| Endpoint | Purpose |
|---|---|
|
The available gateways. |
|
Connect a gateway to a marketplace link, with
|
|
Disconnect. |
|
Update the bank account on an existing connection
( |
Note the singular supplier/ prefix and that the path parameter is the
marketplace-supplier key even though the segment reads supplier.
The marketplace store slice exists solely to hold the gateway list:
export interface IMarketplacesState { possiblePaymentGateways: IPaymentGateway[]; }
// single action: SET_POSSIBLE_GATEWAYS
It is a map-of-handlers reducer with no effects. Gateway connection changes on the
supplier side dispatch ADD_PAYMENT_GATEWAY in the supplier slice — which, as
noted in suppliers, resets that slice to initialState.
Linking gateways is gated by the MANAGE_LINKING_PAYMENT_GATEWAYS permission.
The supplier-marketplace link
SupplierMarketplacesService:
| Endpoint | Base URL |
|---|---|
Purpose |
|
|
The link’s details ( |
|
|
Update the link. |
|
|
Record why a marketplace was suspended for this supplier. |
|
|
Gateway bank account. |
|
|
Refresh sales data — the only call in the app to the marketplace service. |
|
This one service spans two backends. |
Models
| Model | Contents |
|---|---|
|
The summary shown on the supplier record: |
|
The full link record (uses |
|
An aggregate — details + funding + min-fee overrides + opt-in periods. Store-only, no serialisation decorators. |
|
A gateway connection on the link. |
draft distinguishes a link that has been started but not completed — relevant during
onboarding.
Amazon Seller Central links also show a Scraper card with one switch, Passkey Enroll
(passkeyEnroll, GAR-2454). When it is on, the earnings scraper registers Payability’s
passkey on the seller account at its next password sign-in. The card saves through the same
PUT suppliers/:supplierKey/mp/:mpSupKey as the other cards; the backend writes the flag
only when its value changed, so saving another card leaves it alone.
Store integration
Four actions in the supplier slice load link data:
| Action | Behaviour |
|---|---|
|
Loads all links via
|
|
Loads one link. The request-phase reducer case does
|
|
Loads a part of the link’s details for partial editing. |
|
|
Marketplace statements
A statement is the marketplace’s periodic settlement report. Screens:
| Surface | Detail |
|---|---|
|
|
Actions ▸ Edit MP Statement |
|
Actions ▸ Add MP Statement |
|
Actions ▸ Add / Add Zero MP Payment |
|
Statement catalogue |
|
Supplier statements folder |
|
Amazon lending
Amazon offers its own loans, which compete with a Payability advance. The app records them per supplier:
-
Routes
/suppliers/:key/amazon-lending/{list,add-loan,loan/:loanKey}. -
suppliers/supplier/supplier-amazon-lending/. -
suppliers/services/marketplace-loans.service.ts(+ mock),suppliers/model/marketplace-loan.model.ts. -
Add and edit are gated by
SubPermissionsGuardonMP_LOANS_MODIFY/MP_LOANS_DELETE— the only routes in the app using that guard.
Existing Amazon loans also appear as a card in initial underwriting — see underwriting.
Marketplace access and permissions
Obtaining and maintaining access to a supplier’s marketplace account is an onboarding
concern, implemented in the five marketplace-auth- folders and the two
supplier-onboarding-marketplace- folders. See
onboarding and KYC.
suppliers/supplier/marketplace-access-details/ shows the current access state
outside onboarding.
Gotchas
| Issue | Detail |
|---|---|
Two keys, similar names |
|
Endpoint prefix |
|
|
Four entries with a TODO. Not a catalogue. |
Name-based Amazon detection |
|
Single-link load clobbers the list |
See the warning above. |
|
It imports |