1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9628],{76024:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/api-docs/onboarding",function(){return n(66674)}])},38965:function(e,s,n){"use strict";n.d(s,{AW:function(){return N},EK:function(){return v},F5:function(){return y},HR:function(){return E},Iv:function(){return g},O2:function(){return w},UW:function(){return S},Yw:function(){return A},af:function(){return f},cn:function(){return j},h8:function(){return I},j4:function(){return x},kO:function(){return m},pp:function(){return k},qi:function(){return D}});var t=n(85893),r=n(67294),i=n(9008),o=n.n(i),a=n(93967),c=n.n(a),l=n(61582),d=n(80193),h=n.n(d);let p="ws-api-lang",u="ws-api-lang-change";function m(e){let{title:s,description:n,apiName:i,nav:a,children:d}=e,[p,u]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=document.querySelectorAll("section[id]"),s=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&u(e.target.id)})},{rootMargin:"-15% 0px -75% 0px"});return e.forEach(e=>s.observe(e)),()=>s.disconnect()},[]),(0,t.jsxs)(l.Z,{hasSpacer:!0,children:[(0,t.jsxs)(o(),{children:[(0,t.jsx)("title",{children:s}),n&&(0,t.jsx)("meta",{name:"description",content:n}),(0,t.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,t.jsxs)("div",{className:h().layout,children:[(0,t.jsxs)("aside",{className:h().sidebar,children:[(0,t.jsxs)("div",{className:h().apiName,children:[i,(0,t.jsx)("span",{className:h().versionBadge,children:"v1"})]}),(0,t.jsx)("nav",{children:a.map(e=>(0,t.jsxs)("div",{className:h().navGroup,children:[(0,t.jsx)("div",{className:h().navTitle,children:e.title}),e.links.map(e=>(0,t.jsx)("a",{href:"#".concat(e.id),className:c()({[h().active]:p===e.id}),children:e.label},e.id))]},e.title))})]}),(0,t.jsx)("div",{className:h().content,children:d})]})]})}function x(e){let{children:s}=e;return(0,t.jsx)("p",{className:h().eyebrow,children:s})}function j(e){let{title:s,children:n}=e;return(0,t.jsxs)("div",{className:h().partHeader,children:[(0,t.jsx)("h2",{children:s}),n&&(0,t.jsx)("p",{children:n})]})}function f(e){let{children:s}=e;return(0,t.jsx)("p",{className:h().lede,children:s})}function y(e){let{method:s,path:n}=e,r=n.split(/(\{[^}]+\})/g);return(0,t.jsxs)("div",{className:h().endpoint,children:[(0,t.jsx)("span",{className:c()(h().method,h()[s.toLowerCase()]),children:s}),(0,t.jsx)("span",{children:r.map((e,s)=>e.startsWith("{")?(0,t.jsx)("span",{className:h().pathVar,children:e},s):(0,t.jsx)("span",{children:e},s))})]})}function g(e){let{rows:s,headers:n=["Field","Description"]}=e;return(0,t.jsxs)("table",{className:h().fields,children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:n.map(e=>(0,t.jsx)("th",{children:e},e))})}),(0,t.jsx)("tbody",{children:s.map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsxs)("td",{children:[(0,t.jsx)("span",{className:h().fieldName,children:e.name}),e.type&&(0,t.jsx)("span",{className:h().fieldType,children:e.type}),e.req&&(0,t.jsx)("span",{className:h().required,children:"required"}),e.opt&&(0,t.jsx)("span",{className:h().optional,children:e.opt})]}),(0,t.jsx)("td",{children:e.desc})]},e.name))})]})}function b(e){let{text:s}=e,[n,i]=(0,r.useState)(!1);return(0,t.jsx)("button",{className:c()(h().copyBtn,{[h().copied]:n}),onClick:()=>{navigator.clipboard&&navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),1400)}).catch(()=>{})},children:n?"Copied":"Copy"})}let _=[{key:"curl",label:"cURL"},{key:"python",label:"Python"},{key:"node",label:"Node"}];function w(e){let{samples:s}=e,[n,i]=(0,r.useState)("curl");(0,r.useEffect)(()=>{let e=window.localStorage.getItem(p);e&&s[e]&&i(e);let n=e=>{s[e.detail]&&i(e.detail)};return window.addEventListener(u,n),()=>window.removeEventListener(u,n)},[s]);let o=e=>{window.localStorage.setItem(p,e),window.dispatchEvent(new CustomEvent(u,{detail:e})),i(e)};return(0,t.jsxs)("div",{className:h().codeBlock,children:[(0,t.jsxs)("div",{className:h().codeHead,children:[_.filter(e=>{let{key:n}=e;return s[n]}).map(e=>{let{key:s,label:r}=e;return(0,t.jsx)("button",{className:c()(h().langTab,{[h().active]:n===s}),onClick:()=>o(s),children:r},s)}),(0,t.jsx)(b,{text:s[n]})]}),(0,t.jsx)("pre",{children:(0,t.jsx)("code",{children:s[n]})})]})}function v(e){let{label:s,children:n}=e;return(0,t.jsxs)("div",{className:h().codeBlock,children:[(0,t.jsxs)("div",{className:h().codeHead,children:[(0,t.jsx)("span",{className:h().codeLabel,children:s}),(0,t.jsx)(b,{text:n})]}),(0,t.jsx)("pre",{children:(0,t.jsx)("code",{children:n})})]})}function A(e){let{children:s}=e;return(0,t.jsx)("div",{className:h().kicker,children:s})}let T={info:"â¹ï¸",warn:"â ï¸",agent:"\uD83E\uDD16"};function S(e){let{type:s="info",children:n}=e;return(0,t.jsxs)("div",{className:c()(h().callout,h()[s]),children:[(0,t.jsx)("span",{className:h().icon,children:T[s]}),n]})}function k(e){let{children:s}=e;return(0,t.jsx)("div",{className:h().recipe,children:s})}function I(e){let{n:s,title:n,route:r,children:i}=e;return(0,t.jsxs)("div",{className:h().step,children:[(0,t.jsx)("div",{className:h().stepNum,children:s}),(0,t.jsx)("h4",{children:n}),r&&(0,t.jsx)("p",{className:h().callRoute,children:r}),i]})}function N(e){let{method:s,children:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{children:s})," ",n]})}function E(e){let{values:s}=e;return(0,t.jsx)("div",{className:h().enumChips,children:s.map(e=>(0,t.jsx)("span",{children:e},e))})}function D(e){let{children:s}=e;return(0,t.jsx)("div",{className:h().metaFooter,children:s})}},61582:function(e,s,n){"use strict";n.d(s,{Z:function(){return o}});var t=n(85893),r=n(94415),i=n(43951);function o(e){let{children:s,hasSpacer:n}=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Z,{hasSpacer:n}),(0,t.jsx)("main",{children:s}),(0,t.jsx)(r.Z,{})]})}},66674:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return h}});var t=n(85893),r=n(38965);let i="https://api.paywholesail.com",o="6edaa445-9090-417e-acac-1a8ab4b5eb05",a="4719bce3-cb4f-4822-b312-564eb1f59dc8",c="customField_15_4c7c8eb2-390d-429c-a2de-0615013f89f6",l='{\n "id": "'.concat(a,'",\n "shortId": "101K",\n "state": "SUBMITTED",\n "sellerId": "').concat(o,'",\n "configId": "83a00be1-b4d1-4918-b0c9-795e9aed0905",\n "primaryUserId": "78710a6a-9b2a-45c2-b084-a5e41b494ed9",\n "submittedAt": "2026-09-08T17:24:03Z",\n "createdAt": "2026-09-08T16:51:47Z",\n "modifiedAt": "2026-09-08T17:24:03Z",\n "archived": false,\n "onboarding": {\n "company": {\n "fields": {\n "companyName": "Harbor Foods LLC",\n "dba": "Harbor Foods",\n "companyType": "Restaurant",\n "yearsInBusiness": 12,\n "duns": "150483782",\n "ein": "/company/ein",\n "resaleCertification": "/company/resaleCertification",\n "salesRep": "Dana Whitfield",\n "shippingAddress": {\n "lines": ["1200 Embarca
1dero", "Suite 400"],\n "city": "San Francisco",\n "subdivision": "California",\n "postCode": "94103"\n },\n "billingAddress": {\n "lines": ["PO Box 7781"],\n "city": "San Francisco",\n "subdivision": "California",\n "postCode": "94120"\n }\n }\n },\n "companyCustomField": {\n "fields": {\n "').concat(c,'": "Tuesday"\n }\n },\n "primaryUser": {\n "name": "Jordan Lee",\n "title": "Owner",\n "emailAddress": "[email protected]",\n "phoneNumber": "+14155550142"\n }\n }\n}'),d=[{title:"Getting started",links:[{id:"introduction",label:"Introduction"},{id:"for-agents",label:"Notes for AI agents"},{id:"authentication",label:"Authentication"},{id:"scope",label:"What you receive"},{id:"rate-limits",label:"Rate limits"},{id:"errors",label:"Errors"}]},{title:"Recipes",links:[{id:"recipe-import",label:"Import a pending application"}]},{title:"Endpoints",links:[{id:"issue-seller",label:"Issue a seller session"},{id:"list-pending",label:"List pending applications"},{id:"read-application",label:"Read one application"},{id:"read-config",label:"Read the form configuration"}]},{title:"Reference",links:[{id:"obj-record",label:"Application record"},{id:"obj-sections",label:"Sections & addresses"},{id:"obj-config",label:"Form configuration"},{id:"states",label:"States"}]}];function h(){return(0,t.jsxs)(r.kO,{title:"Wholesail Digital Credit Application API",description:"Read a seller's pending Digital Credit Applications, so you can create the customer in your own system without manual data entry.",apiName:"Digital Credit Application API",nav:d,children:[(0,t.jsxs)("section",{id:"introduction",children:[(0,t.jsx)(r.j4,{children:"Wholesail Digital Credit Application API"}),(0,t.jsx)("h1",{children:"Create customers without manual data entry."}),(0,t.jsx)(r.af,{children:"A seller publishes a Digital Credit Application on Wholesail. A prospective buyer fills it in and submits it. This API lets your integration read those submitted applications, so a seller employee can create the customer in your system without retyping what the applicant entered."}),(0,t.jsx)("p",{children:"The integration uses four calls:"}),(0,t.jsxs)("ul",{children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:"issueSeller"})," exchanges your partner key for a session scoped to one seller."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:"queryV2"})," lists that seller's pending applications."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:"onboarding/{onboardingId}"})," reads one application."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:"seller-configs/{sellerId}"})," reads the form configuration, which labels the seller's own fields."]})]})]}),(0,t.jsxs)("section",{id:"for-agents",children:[(0,t.jsx)("h3",{children:"Notes for AI agents"}),(0,t.jsxs)(r.UW,{type:"agent",children:[(0,t.jsx)("p",{children:(0,t.jsx)("strong",{children:"If you are driving this API, read this first."})}),(0,t.jsxs)("p",{children:["1. ",(0,t.jsx)("strong",{children:"Two credentials."})," The partner key authenticates only"," ",(0,t.jsx)("code",{children:"issueSeller"}),". Every other call takes the session token that"," ",(0,t.jsx)("code",{children:"issueSeller"})," returns."]}),(0,t.jsxs)("p",{children:["2. ",(0,t.jsx)("strong",{children:"Sessions last 60 minutes."})," On ",(0,t.jsx)("code",{children:"403"})," with"," ",(0,t.jsx)("code",{children:"session_rejected"}),", call ",(0,t.jsx)("code",{children:"issueSeller"})," again and retry."]}),(0,t.jsxs)("p",{children:["3. ",(0,t.jsx)("strong",{children:"The list returns full records."})," Read"," ",(0,t.jsx)("code",{children:"onboardingRecords"}),". You do not need a second call for each row."]}),(0,t.jsxs)("p",{children:["4. ",(0,t.jsx)("strong",{children:"Page until empty."})," The server caps ",(0,t.jsx)("code",{children:"limit"})," at 100. Increase ",(0,t.jsx)("code",{children:"offset"})," until a page comes back with no ids."]}),(0,t.jsxs)("p",{children:["5. ",(0,t.jsx)("strong",{children:"Trust each row's state."})," ",(0,t.jsx)("code",{children:"pageResult.totalResults"})," comes from an index that lags, so treat it as an estimate."]}),(0,t.jsxs)("p",{children:["6. ",(0,t.jsx)("strong",{children:"Label custom fields from the configuration."})," Custom field keys differ per seller. Do not hard-code them. If a key has no label, show the key."]}),(0,t.jsxs)("p",{children:["7. ",(0,t.jsx)("strong",{children:"Check the status before you parse."})," Some errors have an empty body."]}),(0,t.jsxs)("p",{children:["8. ",(0,t.jsx)("strong",{children:"Paths are case-sensitive."})," ",(0,t.jsx)("code",{children:"queryV2"})," has a capital V."]}),(0,t.jsxs)("p",{children:["9. ",(0,t.jsx)("strong",{children:"Be lenient."})," Ignore fields that this page does not document. New fields can appear over time."]})]})]}),(0,t.jsx)(r.cn,{title:"Getting started",children:"The credentials, scope, and error handling that apply to every call."}),(0,t.jsxs)("section",{id:"authentication",children:[(0,t.jsx)("h3",{children:"Authentication"}),(0,t.jsx)("p",{children:"Two credentials are involved, and they are not interchangeable."}),(0,t.jsxs)("p",{children:["Your ",(0,t.jsx)("strong",{children:"partner key"})," comes from Wholesail during onboarding. You cannot create one yourself. It authenticates only ",(0,t.jsx)("code",{children:"POST /v1/partner/iframe/issueSeller"})," ","and cannot read application data."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("code",{children:"issueSeller"})," returns a ",(0,t.jsx)("strong",{children:"session token"}),". The session acts as the seller employee you name, is scoped to that one seller, and lasts 60 minutes. Send it on every other call."]}),(0,t.jsx)(r.EK,{label:"Header",children:"Authorization: ws YOUR_PARTNER_KEY # issueSeller only\nAuthorization: ws SESSION_TOKEN # every other call"}),(0,t.jsx)(r.UW,{type:"warn",children:(0,t.jsxs)("p",{children:["Use the ",(0,t.jsx)("code",{children:"ws"})," scheme, not ",(0,t.jsx)("code",{children:"Basic"})," or ",(0,t.jsx)("code",{children:"Bearer"}),". Send"," ",(0,t.jsx)("code",{children:"Content-Type: application/json"})," on every ",(0,t.jsx)("code",{children:"POST"}),". Without it, the API returns ",(0,t.jsx)("code",{children:"415"}),"."]})}),(0,t.jsxs)("p",{children:["Base URL: ",(0,t.jsx)("code",{children:i})," (test: ",(0,t.jsx)("code",{children:"https://api-qa.paywholesail.com"}),"). Wholesail issues a separate partner key for each environment."]}),(0,t.jsx)("p",{children:"Call these endpoints from your backend only. Never put the partner key in browser or mobile code. Issue a session when you need one, and do not store it."}),(0,t.jsxs)("p",{children:["A seller must enable your integration before you can issue a session for them. When a seller disables it, ",(0,t.jsx)("code",{children:"issueSeller"})," refuses new sessions for that seller. A session that was already issued stays valid until it expires."]})]}),(0,t.jsxs)("section",{id:"scope",children:[(0,t.jsx)("h3",{children:"What you receive"}),(0,t.jsxs)("p",{children:["You receive only applications on the seller's ",(0,t.jsx)("strong",{children:"default"})," form, and only in these states:"]}
1),(0,t.jsx)(r.HR,{values:["SUBMITTED","PENDING_LINK","EXPORT_ENQUEUED"]}),(0,t.jsx)("p",{children:"Drafts, completed applications, and applications on the seller's other forms are not returned. Sellers use their other forms for other purposes, such as the migration of existing customers. The scope comes from your session. Other states or form ids in the request body do not widen it."}),(0,t.jsxs)("p",{children:["Each application carries its data in three sections: ",(0,t.jsx)("code",{children:"company"}),","," ",(0,t.jsx)("code",{children:"companyCustomField"})," and ",(0,t.jsx)("code",{children:"primaryUser"}),". The record also has other section keys, such as ",(0,t.jsx)("code",{children:"tradeRefs"})," and ",(0,t.jsx)("code",{children:"attachments"}),". In this integration they are always empty."]}),(0,t.jsxs)(r.UW,{type:"info",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Withheld data."})," Trade references and their survey responses, credit bureau and Lighthouse output, fraud reports, attachments, bank reports, payment accounts, personal guarantees, accepted terms and payment plans are not returned. Applicants give these to the seller in confidence. Send the user into Wholesail for them."]}),(0,t.jsxs)("p",{children:["Sensitive fields never appear in a response. ",(0,t.jsx)("code",{children:"ein"})," and"," ",(0,t.jsx)("code",{children:"resaleCertification"})," read as pointers such as"," ",(0,t.jsx)("code",{children:'"/company/ein"'}),", not the values."]})]}),(0,t.jsx)("p",{children:"The endpoints on this page are the supported surface for this integration. Other Wholesail endpoints are not part of it and can change without notice."})]}),(0,t.jsxs)("section",{id:"rate-limits",children:[(0,t.jsx)("h3",{children:"Rate limits"}),(0,t.jsxs)("p",{children:["Requests are rate limited ",(0,t.jsx)("strong",{children:"per integration"}),". Wholesail sets your limit during onboarding, so tell us your expected volume. When you exceed the limit, the API returns ",(0,t.jsx)("code",{children:"429"})," with ",(0,t.jsx)("code",{children:"rate_limit_exceeded"}),". Back off and retry."]})]}),(0,t.jsxs)("section",{id:"errors",children:[(0,t.jsx)("h3",{children:"Errors"}),(0,t.jsxs)("p",{children:["When the service names an error, the body has this shape. ",(0,t.jsx)("code",{children:"error"})," is a stable code. ",(0,t.jsx)("code",{children:"message"})," and ",(0,t.jsx)("code",{children:"detail"})," are optional and are left out when empty. Match on ",(0,t.jsx)("code",{children:"error"}),", not on ",(0,t.jsx)("code",{children:"message"}),". Some errors have an empty body, so check the status code before you parse."]}),(0,t.jsx)(r.EK,{label:"JSON",children:'{\n "error": "session_rejected"\n}'}),(0,t.jsx)(r.Iv,{headers:["Status","Meaning"],rows:[{name:"400",desc:(0,t.jsxs)(t.Fragment,{children:["Malformed request, with an empty body. ",(0,t.jsx)("code",{children:"internal_session"}),": the credential is not a valid token, for example a truncated or altered key. On"," ",(0,t.jsx)("code",{children:"issueSeller"}),", also ",(0,t.jsx)("code",{children:"company_not_integrated"}),": the seller has not enabled your integration."]})},{name:"403",desc:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("code",{children:"session_rejected"}),": the credential is missing, or the session expired."," ",(0,t.jsx)("code",{children:"permission_denied"}),": the credential is valid but not permitted here, for example the partner key on a read endpoint, or another seller's application or form configuration."]})},{name:"404",desc:(0,t.jsxs)(t.Fragment,{children:["The application does not exist, or it is outside the scope above. The body is empty. On"," ",(0,t.jsx)("code",{children:"issueSeller"}),": ",(0,t.jsx)("code",{children:"company_not_found"})," for the seller, or"," ",(0,t.jsx)("code",{children:"user_identity_not_found"})," for the email address."]})},{name:"405",desc:(0,t.jsxs)(t.Fragment,{children:["Wrong method for the path. A ",(0,t.jsx)("code",{children:"POST"})," to ",(0,t.jsx)("code",{children:"queryv2"})," in lowercase lands here, because the read route takes it as an application id. The body is empty."]})},{name:"415",desc:(0,t.jsxs)(t.Fragment,{children:["The ",(0,t.jsx)("code",{children:"POST"})," had no ",(0,t.jsx)("code",{children:"Content-Type: application/json"}),". The body is empty."]})},{name:"429",desc:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("code",{children:"rate_limit_exceeded"}),". Back off and retry."]})}]})]}),(0,t.jsx)(r.cn,{title:"Recipes",children:"How the four calls fit together."}),(0,t.jsxs)("section",{id:"recipe-import",children:[(0,t.jsx)("h3",{children:"Import a pending application"}),(0,t.jsx)("p",{children:"A seller employee opens your screen and wants to create a customer from an application they received on Wholesail."}),(0,t.jsxs)(r.pp,{children:[(0,t.jsx)(r.h8,{n:1,title:"Issue a session",route:(0,t.jsx)(r.AW,{method:"POST",children:"/v1/partner/iframe/issueSeller"}),children:(0,t.jsxs)("p",{children:["Name the seller and the employee at the screen. Keep the"," ",(0,t.jsx)("code",{children:"sessionToken"})," for up to 60 minutes."]})}),(0,t.jsx)(r.h8,{n:2,title:"List pending applications",route:(0,t.jsx)(r.AW,{method:"POST",children:"/v1/company/onboarding/queryV2"}),children:(0,t.jsxs)("p",{children:["Page with ",(0,t.jsx)("code",{children:"offset"})," until a page comes back empty. Each id in"," ",(0,t.jsx)("code",{children:"result"}
1)," has its full record in ",(0,t.jsx)("code",{children:"onboardingRecords"}),"."]})}),(0,t.jsx)(r.h8,{n:3,title:"Label the seller's own fields",route:(0,t.jsx)(r.AW,{method:"GET",children:"/v1/company/onboarding/seller-configs/{sellerId}"}),children:(0,t.jsxs)("p",{children:["For each key in ",(0,t.jsx)("code",{children:"companyCustomField.fields"}),", read the label at"," ",(0,t.jsx)("code",{children:"config.companyCustomField.fields[key].label"}),". If the key is not in the configuration, show the key. The labels change only when the seller edits the form, so you can cache them per seller."]})}),(0,t.jsx)(r.h8,{n:4,title:"Create the customer",children:(0,t.jsxs)("p",{children:["Map ",(0,t.jsx)("code",{children:"company.fields"})," to your customer record and"," ",(0,t.jsx)("code",{children:"primaryUser"})," to its contact. Keep the application ",(0,t.jsx)("code",{children:"id"})," as the reference in your system, so you do not import the same application twice."]})})]})]}),(0,t.jsx)(r.cn,{title:"Endpoints",children:"The full reference for each call: request fields, examples in cURL, Python, and Node, and responses."}),(0,t.jsxs)("section",{id:"issue-seller",children:[(0,t.jsx)("h3",{children:"Issue a seller session"}),(0,t.jsx)(r.F5,{method:"post",path:"/v1/partner/iframe/issueSeller"}),(0,t.jsxs)("p",{children:["Authenticate with the partner key. Name a seller and one of its employees. The employee must be an ",(0,t.jsx)("strong",{children:"owner or sales representative"})," of that seller."]}),(0,t.jsx)(r.Iv,{headers:["Body field","Description"],rows:[{name:"sellerId",type:"uuid",req:!0,desc:"The Wholesail id of the seller."},{name:"emailAddress",type:"string",req:!0,desc:"Email of an owner or sales representative of the seller."}]}),(0,t.jsx)(r.O2,{samples:{curl:"curl ".concat(i,'/v1/partner/iframe/issueSeller \\\n -H "Authorization: ws $WS_PARTNER_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "sellerId": "').concat(o,'",\n "emailAddress": "[email protected]"\n }\''),python:'import os, requests\n\nr = requests.post(\n "'.concat(i,'/v1/partner/iframe/issueSeller",\n headers={"Authorization": f"ws {os.environ[\'WS_PARTNER_KEY\']}"},\n json={"sellerId": "').concat(o,'",\n "emailAddress": "[email protected]"},\n)\nr.raise_for_status()\nsession_token = r.json()["sessionToken"]'),node:'const url = "'.concat(i,'/v1/partner/iframe/issueSeller";\nconst res = await fetch(url, {\n method: "POST",\n headers: {\n "Authorization": `ws ${process.env.WS_PARTNER_KEY}`,\n "Content-Type": "application/json",\n },\n body: JSON.stringify({\n sellerId: "').concat(o,'",\n emailAddress: "[email protected]",\n }),\n});\nif (!res.ok) {\n throw new Error(`issueSeller: ${res.status} ${await res.text()}`);\n}\nconst { sessionToken } = await res.json();')}}),(0,t.jsx)(r.Yw,{children:"Response"}),(0,t.jsx)(r.EK,{label:"200 \xb7 JSON",children:'{\n "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",\n "embedUri": "https://app.paywholesail.com/embed/..."\n}'}),(0,t.jsxs)("p",{children:["Send ",(0,t.jsx)("code",{children:"sessionToken"})," on every other call. You do not need"," ",(0,t.jsx)("code",{children:"embedUri"})," for this integration."]}),(0,t.jsx)(r.UW,{type:"info",children:(0,t.jsx)("p",{children:"The employee's access to other sellers does not travel with the session. A session for one seller cannot read another seller's applications, even when the same person works for both."})})]}),(0,t.jsxs)("section",{id:"list-pending",children:[(0,t.jsx)("h3",{children:"List pending applications"}),(0,t.jsx)(r.F5,{method:"post",path:"/v1/company/onboarding/queryV2"}),(0,t.jsxs)("p",{children:["Lists the seller's pending applications, newest first unless"," ",(0,t.jsx)("code",{children:"sortBy"})," says otherwise."]}),(0,t.jsx)(r.Iv,{headers:["Body field","Description"],rows:[{name:"sellerId",type:"uuid",req:!0,desc:"The seller your session was issued for."},{name:"limit",type:"integer",desc:"Rows per page. Defaults to 100. The server caps it at 100: a larger value returns 100 rows, not an error."},{name:"offset",type:"integer",desc:"Rows to skip. Defaults to 0."},{name:"sortBy",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("code",{children:"field"})," is ",(0,t.jsx)("code",{children:"COMPANY_NAME"}),", ",(0,t.jsx)("code",{children:"SUBMITTED_AT"}),","," ",(0,t.jsx)("code",{children:"REVIEWED_AT"})," or ",(0,t.jsx)("code",{children:"MODIFIED_AT"}),". ",(0,t.jsx)("code",{children:"direction"})," is"," ",(0,t.jsx)("code",{children:"ASC"})," or ",(0,t.jsx)("code",{children:"DESC"}),". Defaults to ",(0,t.jsx)("code",{children:"SUBMITTED_AT"}),","," ",(0,t.jsx)("code",{children:"DESC"}),"."]})}]}),(0,t.jsx)(r.O2,{samples:{curl:"curl ".concat(i,'/v1/company/onboarding/queryV2 \\\n -H "Authorization: ws $SESSION_TOKEN" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "sellerId": "').concat(o,'",\n "limit": 100,\n "offset": 0\n }\''),python:'import requests\n\nurl = "'.concat(i,'/v1/company/onboarding/queryV2"\nheaders = {"Authorization": f"ws {session_token}"}\noffset = 0\nwhile True:\n r = requests.post(url, headers=headers, json={\n "sellerId": "').concat(o,'",\n "limit": 100,\n "offset": offset,\n })\n r.raise_for_status()\n page = r.json()\n if not page["result"]:\n break\n for application_id in page["result"]:\n record = page["onboardingRecords"][application_id]\n ...\n offset += len(page["result"])'),node:'const url = "'.concat(i,'/v1/company/onboarding/queryV2";\nlet offset = 0;\nfor (;;) {\n const res = await fetch(url, {\n method: "POST",\n headers: {\n "Authorization": `ws ${sessionToken}`,\n "Content-Type": "application/json",\n },\n body: JSON.stringify({\n sellerId: "').concat(o,'",\n limit: 100,\n offset,\n }),\n });\n if (!res.ok) {\n throw new Error(`queryV2: ${res.status} ${await res.text()}`);\n }\n const page = await res.json();\n if (page.result.length === 0) break;\n for (const id of page.result) {\n const record = page.onboardingRecords[id];\n // ...\n }\n offset += page.result.length;\n}')}}),(0,t.jsx)(r.Yw,{children:"Response"}),(0,t.jsx)(r.EK,{label:"200 \xb7 JSON",children:'{\n "result": ["'.concat(a,'"],\n "onboardingRecords": {\n "').concat(a,'": {\n "id": "').concat(a,'",\n "state": "SUBMITTED",\n "...": "the full record, as on Read one application"\n }\n },\n "companyRefs": {\n "').concat(o,'": {\n "id": "').concat(o,'",\n "displayName": "Bayside Provisions",\n "slug": "baysideprovisions"\n }\n },\n "pageResult": { "limit": 100, "offset": 0, "totalResults": 1 }\n}')}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"result",type:"uuid[]",desc:(0,t.jsxs)(t.Fragment,{children:["Application ids, in the order ",(0,t.jsx)("code",{children:"sortBy"})," asked for."]})},{name:"onboardingRecords",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:["Application id to its full ",(0,t.jsx)("a",{href:"#obj-record",children:"record"}),". Every id in ",(0,t.jsx)("code",{children:"result"})," has an entry."]})},{name:"companyRefs",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:["Seller id to ",(0,t.jsx)("code",{children:"{id, displayName, slug}"}),", so you can label a row without a second call."]})},{name:"onboardingConfigRefs",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:["Form id to ",(0,t.jsx)("code",{children:"{id, sellerId, slug}"}),"."]})},{name:"pageResult",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("code",{children:"limit"}),", ",(0,t.jsx)("code",{children:"offset"})," and ",(0,t.jsx)("code",{children:"totalResults"}),". The total is an estimate: see below."]})}]}),(0,t.jsxs)("p",{children:["The response also has other top-level keys, such as ",(0,t.jsx)("code",{children:"success"})," and a set of maps that are always empty in this integration. Ignore them."]}),(0,t.jsx)(r.UW,{type:"info",children:(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Freshness."})," The list comes from a search index that lags a moment behind. In that window, a row can still show an application that the seller just decided or archived, and ",(0,t.jsx)("code",{children:"totalResults"}
1)," can differ from your count. Each record is read live, so its ",(0,t.jsx)("code",{children:"state"})," is current. Use"," ",(0,t.jsx)("code",{children:"totalResults"})," to size a grid, and trust the ",(0,t.jsx)("code",{children:"state"})," on each row."]})})]}),(0,t.jsxs)("section",{id:"read-application",children:[(0,t.jsx)("h3",{children:"Read one application"}),(0,t.jsx)(r.F5,{method:"get",path:"/v1/company/onboarding/{onboardingId}"}),(0,t.jsxs)("p",{children:["Returns the full record, in the same shape as one entry of"," ",(0,t.jsx)("code",{children:"onboardingRecords"}),". An id that does not exist, or that is outside the scope above, returns ",(0,t.jsx)("code",{children:"404"}),". Another seller's application returns"," ",(0,t.jsx)("code",{children:"403"})," with ",(0,t.jsx)("code",{children:"permission_denied"}),"."]}),(0,t.jsx)(r.Iv,{headers:["Path parameter","Description"],rows:[{name:"onboardingId",type:"uuid",req:!0,desc:(0,t.jsxs)(t.Fragment,{children:["The application id, as returned in ",(0,t.jsx)("code",{children:"result"})," by ",(0,t.jsx)("code",{children:"queryV2"}),"."]})}]}),(0,t.jsx)(r.O2,{samples:{curl:"BASE=".concat(i,'/v1/company/onboarding\ncurl "$BASE/').concat(a,'" \\\n -H "Authorization: ws $SESSION_TOKEN"'),python:'import requests\n\nBASE = "'.concat(i,'/v1/company/onboarding"\napplication_id = "').concat(a,'"\nr = requests.get(f"{BASE}/{application_id}",\n headers={"Authorization": f"ws {session_token}"})\nr.raise_for_status()\nrecord = r.json()'),node:'const BASE = "'.concat(i,'/v1/company/onboarding";\nconst applicationId = "').concat(a,'";\nconst res = await fetch(`${BASE}/${applicationId}`, {\n headers: { "Authorization": `ws ${sessionToken}` },\n});\nif (!res.ok) {\n throw new Error(`onboarding: ${res.status} ${await res.text()}`);\n}\nconst record = await res.json();')}}),(0,t.jsx)(r.Yw,{children:"Response"}),(0,t.jsx)(r.EK,{label:"200 \xb7 JSON",children:l})]}),(0,t.jsxs)("section",{id:"read-config",children:[(0,t.jsx)("h3",{children:"Read the form configuration"}),(0,t.jsx)(r.F5,{method:"get",path:"/v1/company/onboarding/seller-configs/{sellerId}"}),(0,t.jsx)("p",{children:"Returns a list with one entry: the seller's default form configuration. Use it to label the seller's own fields."}),(0,t.jsxs)("p",{children:["For each key in an application's ",(0,t.jsx)("code",{children:"companyCustomField.fields"}),", read the label at ",(0,t.jsx)("code",{children:"config.companyCustomField.fields[key].label"}),". Custom field keys are opaque and differ per seller, so do not hard-code them. A key can be missing from the configuration, for example when the seller removed a question after the applicant answered it. In that case, show the key."]}),(0,t.jsxs)("p",{children:["The configuration has no labels for ",(0,t.jsx)("code",{children:"company"})," fields. Their names are stable, so use your own labels for them."]}),(0,t.jsxs)("p",{children:["You receive only the ",(0,t.jsx)("code",{children:"company"})," and ",(0,t.jsx)("code",{children:"companyCustomField"})," ","sections. Other sections in the response carry default values. They are not the seller's settings, so do not read them as such."]}),(0,t.jsx)(r.Iv,{headers:["Path parameter","Description"],rows:[{name:"sellerId",type:"uuid",req:!0,desc:"The seller your session was issued for."}]}),(0,t.jsx)(r.O2,{samples:{curl:"BASE=".concat(i,'/v1/company/onboarding\ncurl "$BASE/seller-configs/').concat(o,'" \\\n -H "Authorization: ws $SESSION_TOKEN"'),python:'import requests\n\nBASE = "'.concat(i,'/v1/company/onboarding"\nseller_id = "').concat(o,'"\nr = requests.get(f"{BASE}/seller-configs/{seller_id}",\n headers={"Authorization": f"ws {session_token}"})\nr.raise_for_status()\ncustom = r.json()[0]["config"]["companyCustomField"]["f
1ields"]\nlabels = {key: field.get("label", key) for key, field in custom.items()}'),node:'const BASE = "'.concat(i,'/v1/company/onboarding";\nconst sellerId = "').concat(o,'";\nconst res = await fetch(`${BASE}/seller-configs/${sellerId}`, {\n headers: { "Authorization": `ws ${sessionToken}` },\n});\nif (!res.ok) {\n throw new Error(`seller-configs: ${res.status} ${await res.text()}`);\n}\nconst [form] = await res.json();\nconst custom = form.config.companyCustomField.fields;\nconst labels = Object.fromEntries(\n Object.entries(custom).map(([key, field]) => [key, field.label ?? key]),\n);')}}),(0,t.jsx)(r.Yw,{children:"Response (abridged)"}),(0,t.jsx)(r.EK,{label:"200 \xb7 JSON",children:'[\n {\n "id": "83a00be1-b4d1-4918-b0c9-795e9aed0905",\n "sellerId": "'.concat(o,'",\n "name": "New customer",\n "slug": "new-customer",\n "isDefaultConfig": true,\n "config": {\n "companyCustomField": {\n "fields": {\n "').concat(c,'": {\n "label": "Preferred delivery day",\
1n "type": "STRING",\n "req": "OPTIONAL"\n }\n }\n },\n "company": { "fields": { "...": "..." } }\n }\n }\n]')})]}),(0,t.jsx)(r.cn,{title:"Reference",children:"The object shapes the API returns."}),(0,t.jsxs)("section",{id:"obj-record",children:[(0,t.jsx)("h3",{children:"Application record"}),(0,t.jsx)("p",{children:"Timestamps are ISO 8601 strings in UTC."}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"id",type:"uuid",desc:"The application id. Stable for the life of the application."},{name:"shortId",type:"string",desc:(0,t.jsxs)(t.Fragment,{children:["The short reference a seller sees in Wholesail, for example ",(0,t.jsx)("code",{children:"101K"}),"."]})},{name:"state",type:"string",desc:(0,t.jsxs)(t.Fragment,{children:["One of the ",(0,t.jsx)("a",{href:"#states",children:"states"})," below. Read live, so always current."]})},{name:"sellerId",type:"uuid",desc:"The seller the applicant applied to."},{name:"configId",type:"uuid",desc:"The form the application was submitted on."},{name:"primaryUserId",type:"uuid",desc:"The applicantâs Wholesail user id."},{name:"submittedAt",type:"date-time",desc:"When the applicant submitted."},{name:"createdAt",type:"date-time",desc:"When the applicant started the application."},{name:"modifiedAt",type:"date-time",desc:"When the application last changed."},{name:"archived",type:"boolean",desc:"Always false, because archived applications are outside the scope."},{name:"onboarding",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:["The submitted content: ",(0,t.jsx)("code",{children:"company"}),", ",(0,t.jsx)("code",{children:"companyCustomField"})," and ",(0,t.jsx)("code",{children:"primaryUser"}),". Each section is optional."]})}]})]}),(0,t.jsxs)("section",{id:"obj-sections",children:[(0,t.jsx)("h3",{children:"company"}),(0,t.jsxs)("p",{children:["The business identity, which is what your system maps to a customer."," ",(0,t.jsx)("code",{children:"company.fields"})," maps a field name to its submitted value. These names are the same for every seller. The first three are on every form. The seller chooses which of the others to ask for:"]}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"companyName",type:"string",desc:"Always configured."},{name:"shippingAddress",type:"Address",desc:"Always configured."},{name:"billingAddress",type:"Address",desc:"Always configured."},{name:"dba",type:"string",desc:"Trade name, if different."},{name:"companyType",type:"string",desc:"The kind of business, as entered on the form."},{name:"yearsInBusiness",type:"number",desc:(0,t.jsxs)(t.Fragment,{children:["How many years the business has operated. Can arrive as ",(0,t.jsx)("code",{children:"12.0"}),", so do not assume an integer."]})},{name:"duns",type:"string",desc:"The businessâs D-U-N-S number."},{name:"ein",type:"string",desc:(0,t.jsxs)(t.Fragment,{children:["Always the pointer ",(0,t.jsx)("code",{children:'"/company/ein"'}),", never the identifier."]})},{name:"resaleCertification",type:"string",desc:(0,t.jsxs)(t.Fragment,{children:["Always the pointer ",(0,t.jsx)("code",{children:'"/company/resaleCertification"'}),", never the value."]})},{name:"liquorLicense",type:"string",desc:"The liquor license number."},{name:"liquorLicenseExpDate",type:"string",desc:"The license expiry date, as entered on the form."},{name:"salesRep",type:"string",desc:"The sales representative for the account, as entered on the form."},{name:"deliveryInstructions",type:"string",desc:"Delivery instructions from the applicant."}]}),(0,t.jsx)("p",{children:"A seller can add fields beyond these, so read the map rather than assuming a fixed set of keys."}),(0,t.jsx)("h3",{children:"companyCustomField"}),(0,t.jsxs)("p",{children:["The seller's own questions. ",(0,t.jsx)("code",{children:"companyCustomField.fields"})," maps an opaque, per-seller key such as ",(0,t.jsx)("code",{children:"customField_15_â¦"})," to the submitted value. Read each label from the ",(0,t.jsx)("a",{href:"#read-config",children:"form configuration"}),"."]}),(0,t.jsx)("h3",{children:"primaryUser"}),(0,t.jsxs)("p",{children:["The applicant contact. Unlike the two sections above, this is a flat object, not a"," ",(0,t.jsx)("code",{children:"fields"})," map. At least one of ",(0,t.jsx)("code",{children:"emailAddress"})," and"," ",(0,t.jsx)("code",{children:"phoneNumber"})," is present."]}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"name",type:"string",desc:"The contactâs full name."},{name:"title",type:"string",desc:"Optional."},{name:"emailAddress",type:"string",desc:"The contactâs email address."},{name:"phoneNumber",type:"string",desc:"The contactâs phone number."},{name:"contactMetadata",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:["Any extra contact details the seller asked for, keyed by field name. Eac
1h value has ",(0,t.jsx)("code",{children:"label"}),", ",(0,t.jsx)("code",{children:"type"})," and ",(0,t.jsx)("code",{children:"value"}),"."]})}]}),(0,t.jsx)("h3",{children:"Address"}),(0,t.jsxs)("p",{children:["Every field except ",(0,t.jsx)("code",{children:"lines"})," can be absent."]}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"lines",type:"string[]",desc:"Street lines, in order."},{name:"city",type:"string",desc:"City."},{name:"subdivision",type:"string",desc:"State or province."},{name:"postCode",type:"string",desc:"Postal or ZIP code."},{name:"country",type:"string",desc:(0,t.jsxs)(t.Fragment,{children:["Two-letter country code, for example ",(0,t.jsx)("code",{children:"US"}),"."]})}]})]}),(0,t.jsxs)("section",{id:"obj-config",children:[(0,t.jsx)("h3",{children:"Form configuration"}),(0,t.jsx)(r.Iv,{headers:["Field","Notes"],rows:[{name:"id",type:"uuid",desc:(0,t.jsxs)(t.Fragment,{children:["The form id. Matches ",(0,t.jsx)("code",{children:"configId"})," on the application."]})},{name:"sellerId",type:"uuid",desc:"The seller that owns the form."},{name:"name",type:"string",desc:"The form name the seller chose."},{name:"slug",type:"string",desc:"A short name for the form."},{name:"isDefaultConfig",type:"boolean",desc:"Always true here, since you receive only the default form."},{name:"config",type:"object",desc:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("code",{children:"company"})," and ",(0,t.jsx)("code",{children:"companyCustomField"})," each have a ",(0,t.jsx)("code",{children:"fields"})," map of field name to ",(0,t.jsx)("code",{children:"{type, req}"}),". Custom fields also have ",(0,t.jsx)("code",{children:"label"}),", which is optional. If it is absent, show the key. Other sections are present, with default values."]})}]})]}),(0,t.jsxs)("section",{id:"states",children:[(0,t.jsx)("h3",{children:"States"}),(0,t.jsx)(r.Iv,{headers:["State","Meaning"],rows:[{name:"SUBMITTED",desc:"The applicant submitted. The seller has not decided yet."},{name:"PENDING_LINK",desc:"Approved, and waiting for a link to a customer record."},{name:"EXPORT_ENQUEUED",desc:"Approved, and queued for export to the sellerâs system."}]})]}),(0,t.jsxs)(r.qi,{children:["Wholesail Digital Credit Application API \xb7 v1 \xb7 ",(0,t.jsx)("code",{children:i})," \xb7 partner key for"," ",(0,t.jsx)("code",{children:"issueSeller"}),", session token for every other call (",(0,t.jsx)("code",{children:"ws"})," scheme) \xb7 at most 100 records per page"]})]})}},80193:function(e){e.exports={layout:"ApiDocs_layout__2Gm3K",sidebar:"ApiDocs_sidebar___WiXj",apiName:"ApiDocs_apiName__wWadi",versionBadge:"ApiDocs_versionBadge__moKE2",navGroup:"ApiDocs_navGroup__bt7T8",navTitle:"ApiDocs_navTitle__nrZ68",active:"ApiDocs_active__Uj_Sr",content:"ApiDocs_content__t4gO8",partHeader:"ApiDocs_partHeader___rVvZ",eyebrow:"ApiDocs_eyebrow__6q7Dc",lede:"ApiDocs_lede__lxw6P",endpoint:"ApiDocs_endpoint__tDBMR",method:"ApiDocs_method__kx1Ky",post:"ApiDocs_post__CUEdg",get:"ApiDocs_get__Ub6JM",delete:"ApiDocs_delete__gNwYp",pathVar:"ApiDocs_pathVar__0PqRT",fields:"ApiDocs_fields__OjLlg",fieldName:"ApiDocs_fieldName___kxJ_",fieldType:"ApiDocs_fieldType__52S1u",required:"ApiDocs_required__rczka",optional:"ApiDocs_optional__lsF9B",codeBlock:"ApiDocs_codeBlock__oJdEi",codeHead:"ApiDocs_codeHead__5Aooj",codeLabel:"ApiDocs_codeLabel__pOJ76",langTab:"ApiDocs_langTab__4PJOg",copyBtn:"ApiDocs_copyBtn__tRdXr",copied:"ApiDocs_copied__FJuRG",kicker:"ApiDocs_kicker__0xkma",callout:"ApiDocs_callout__N7vY9",icon:"ApiDocs_icon__SxSWo",info:"ApiDocs_info__exuqK",warn:"ApiDocs_warn__RWdjV",agent:"ApiDocs_agent__BrYJl",recipe:"ApiDocs_recipe__RQm1q",step:"ApiDocs_step__HkPOu",stepNum:"ApiDocs_stepNum__JwQUf",callRoute:"ApiDocs_callRoute__k_Zku",enumChips:"ApiDocs_enumChips__coZvx",metaFooter:"ApiDocs_metaFooter__zf0Yq",plain:"ApiDocs_plain__Gd1d6"}},93967:function(e,s){var n;/*! 2 Copyright (c) 2018 Jed Watson. 3 Licensed under the MIT License (MIT), see 4 http://jedwatson.github.io/classnames 5*/!function(){"use strict";var t={}.hasOwnProperty;function r(){for(var e="",s=0;s<arguments.length;s++){var n=arguments[s];n&&(e=i(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var s="";for(var n in e)t.call(e,n)&&e[n]&&(s=i(s,n));return s}(n)))}return e}function i(e,s){return s?e?e+" "+s:e+s:e}e.exports?(r.default=r,e.exports=r):void 0!==(n=(function(){return r}).apply(s,[]))&&(e.exports=n)}()}},function(e){e.O(0,[5560,3098,2888,9774,179],function(){return e(e.s=76024)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.