Yellowpay Partner API — Integration Guide

Production endpoint: https://api.getyellowpay.com/partner/graphql

GraphiQL: https://api.getyellowpay.com/partner/graphiql

Sandbox: https://staging-api.getyellowpay.com/partner/graphql — see Environments

This guide covers the integration flow and the meaning behind each operation. For the complete list of types, fields and arguments, use the Docs panel in GraphiQL — it is generated from the live schema and always current.

What the API does

Yellowpay lets a business that buys from you take net terms (30, 60, 90 days…): Yellowpay funds the invoice to you up front, invoices the buyer with the agreed terms, and collects the payment. The Partner API lets you offer this inside your own ordering flow: your buyer picks "net terms" at checkout, your platform creates the request with Yellowpay, the buyer e-signs a purchase agreement through DocuSign, and Yellowpay funds it.

Buyers can use the API too, with a read-only token, to follow the terms requests they've taken — see Access for buyers.

Terminology

Yellowpay's terms may differ from the ones your platform uses. In this guide and in the API:

Term Meaning
Buyer The business buying from you and paying Yellowpay. If your platform calls these businesses something else — customers, installers, dealers, accounts — this is them.
Seller You, the Yellowpay partner selling to the buyer. Where the API says "seller" (for example SELLER_DELINQUENCY or termsFeePayer: SELLER), it means you.
Terms request A request to finance a single invoice on net terms. One invoice, one terms request.
Net terms The number of days the buyer has to pay, e.g. 30, 60, 90.
Credit limit The maximum a buyer can have outstanding across all their terms requests with Yellowpay.
Invoice · funding · payment The three money movements, always named distinctly. You invoice the buyer. Yellowpay funds the invoice — the payout to you. The buyer makes the payment to Yellowpay. The API uses "payment" only for this, never for the invoice or the funding.

Environments

Sandbox Production
GraphQL endpoint https://staging-api.getyellowpay.com/partner/graphql https://api.getyellowpay.com/partner/graphql
GraphiQL https://staging-api.getyellowpay.com/partner/graphiql https://api.getyellowpay.com/partner/graphiql

The sandbox is fully separate from production: no real money moves and no real credit decisions are made. See Testing in the sandbox for what to expect from it.

Authentication

All requests must carry an API token issued by Yellowpay, sent as a bearer token in the Authorization header:

POST /partner/graphql HTTP/1.1
Host: api.getyellowpay.com
Content-Type: application/json
Authorization: Bearer <your token>

API access is enabled for every company by default; Yellowpay can disable it for a company, and requests from a company without API access fail with HTTP 403. Production tokens are created and managed by you in the Yellowpay app under Settings → API access (https://app.getyellowpay.com/settings/api-access). Sandbox tokens are issued by Yellowpay and sent to you by email — see Testing in the sandbox.

Each token has:

A request without a valid token fails with the error code UNAUTHENTICATED; an operation your token or company isn't allowed fails with FORBIDDEN (see Errors).

To use GraphiQL, add the token in the Headers tab at the bottom of the editor:

{ "Authorization": "Bearer <your token>" }

Then verify your setup with tokenInfo — the simplest first call to make, and one that works with any token:

query TokenInfo {
  tokenInfo {
    name
    companyId
    accessLevels
    expires
    ipAllowlist
  }
}

accessLevels lists the levels in effect for the token: READ is always included.

Conventions

Integration flow at a glance

Two stages. The first happens once per buyer, the second once per order.

Integration flow: onboard the buyer once, then request terms per order

1. Onboard a buyer

Every buyer you work with must be linked to your account. A company becomes one of your buyers in exactly two ways: createBuyer (you register it with Yellowpay) or addBuyerByDuns (it's already registered — for example through another seller — and you link it). This section covers both.

1.1 Find the buyer's DUNS

Onboarding keys on the DUNS number. If you don't have it, search by company name and (optionally) two-letter state code:

query LookupDuns($name: String!, $state: String) {
  lookupCompanyDuns(name: $name, state: $state) {
    duns
    name
    address
    isRegistered
  }
}
{ "name": "Sunrise Solar Installers", "state": "CA" }

The query returns a list of candidate matches. Company names are rarely unique, so present the candidates (name and address) to the buyer and let them pick the right one rather than taking the first result. Including state narrows the results considerably. A name shorter than 3 characters, or an unknown state, fails with INVALID_INPUT.

isRegistered tells you which door to use next: true → link the buyer with addBuyerByDuns; false → register them with createBuyer. Both are in 1.2.

Already registered with Yellowpay (isRegistered: true) — link the buyer to your account:

mutation AddBuyerByDuns($duns: String!) {
  addBuyerByDuns(duns: $duns) {
    id
    businessName
    availableCredit
    creditApplication { status approvedLimit }
  }
}

It returns the full buyer, credit standing included — if they already have an approved limit, you can skip straight to step 2. If no company is registered with that DUNS, it fails with NOT_FOUND; register them instead. That fallback also makes a lookup-free shortcut possible when you already hold the DUNS: call addBuyerByDuns first, and on NOT_FOUND fall through to createBuyer.

Not yet registered (isRegistered: false) — register the buyer:

mutation CreateBuyer($input: BuyerInput!) {
  createBuyer(input: $input) {
    id
    businessName
    duns
  }
}
{
  "input": {
    "businessName": "Sunrise Solar Installers LLC",
    "duns": "123456789",
    "address": {
      "streetAddress": "2100 Geng Road",
      "city": "Palo Alto",
      "state": "CA",
      "postalCode": "94304"
    },
    "primaryContact": {
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@sunrisesolar.example",
      "phone": "650-555-0142"
    },
    "accountsPayable": {
      "name": "Bob Ledger",
      "email": "ap@sunrisesolar.example",
      "phone": "650-555-0143"
    }
  }
}

Note what's not here: no credit amount. Registration alone grants no credit; requesting a limit is the separate next step.

Field notes:

If a company with this DUNS is already registered, the mutation fails with DUPLICATE_DUNS and returns the existing buyer in data — see Errors for how to make sure your client actually receives it. That buyer isn't linked to your account yet: call addBuyerByDuns with the same DUNS, then continue with its id.

Store Buyer.id. It is the buyerId for every terms request for this buyer, and the argument to buyer(id).

1.3 Request a credit limit

mutation RequestCreditLimit($buyerId: Int!, $amount: Int!) {
  requestCreditLimit(buyerId: $buyerId, amount: $amount) {
    id
    availableCredit
    creditApplication {
      status
      requestedLimit
      approvedLimit
      created
    }
  }
}
{ "buyerId": 4821, "amount": 50000 }

amount is in whole USD. It must be at least the invoice you're about to finance, and it caps every future terms request for this buyer — so request what you expect the buyer to need over time, not just today's order.

Handling creditApplication.status:

Status Meaning What to do
APPROVED The limit is granted; approvedLimit and availableCredit reflect it. Continue to step 2.
PENDING Yellowpay is underwriting the buyer manually. Yellowpay contacts the buyer directly, often asking for financials. Poll buyer(id).creditApplication.status. You can create terms requests meanwhile, but they are held for manual review until the limit is approved — usually better to wait.
REJECTED Yellowpay declined to extend credit. Offer the buyer another way to pay.

requestCreditLimit is also how you request a higher limit for an already-approved buyer. Calling it while an application is still PENDING fails with CREDIT_APPLICATION_PENDING and returns the buyer (with the pending application) in data.

2. Request terms for an order

2.1 Price the options

One call prices every available net terms option, so you can render the whole selector — "Net 30 — $x · Net 60 — $y · Net 90 — $z" — from a single round trip. The figures are the ones the buyer will see:

query TermsCalculations($invoiceAmount: Float!, $termsFeePayer: TermsFeePayer) {
  termsCalculations(invoiceAmount: $invoiceAmount, termsFeePayer: $termsFeePayer) {
    netTerms
    invoiceAmount
    feesAmount
    totalAmount
  }
}
{ "invoiceAmount": 18750.00, "termsFeePayer": "BUYER" }

Illustrative response (fee rates on your account will differ):

{
  "data": {
    "termsCalculations": [
      { "netTerms": 30, "invoiceAmount": 18750.00, "feesAmount": 235.00, "totalAmount": 18985.00 },
      { "netTerms": 60, "invoiceAmount": 18750.00, "feesAmount": 468.75, "totalAmount": 19218.75 },
      { "netTerms": 90, "invoiceAmount": 18750.00, "feesAmount": 703.00, "totalAmount": 19453.00 }
    ]
  }
}

termsFeePayer decides who bears the cost of the terms. It defaults to SELLER when omitted.

termsFeePayer Who bears the fee feesAmount totalAmount (buyer pays) Your payout
BUYER The buyer — the fee is added to the invoice 468.75 19,218.75 18,750.00
SELLER (default) You — the fee is deducted from your payout 0.00 18,750.00 18,750.00 minus your fee

Figures for the Net 60 row of the example. When you bear the fee, the buyer never sees it: termsCalculations reports no fee, and your fee appears only on the terms request, as termsFeeAmount, for you. Re-run the query whenever the invoice amount or fee payer changes, and pass the same termsFeePayer to createTermsRequest, or the numbers the buyer saw won't match the request.

To show the buyer what applies if they pay late, netTermsRates lists the current recurring fee rates for each option — see 2.5.

2.2 Create the terms request

The invoice must exist before this call — Yellowpay finances a specific invoice, so issue it first and create the request against it.

Don't send this invoice to the buyer yourself. Yellowpay invoices the buyer directly, with the final amounts (including the fee when the buyer bears it), the agreed terms, and the payment details. Your invoice is the underlying document for the financing; if the buyer received it too, they'd hold two invoices with different amounts and the wrong payment instructions — and might pay you instead of Yellowpay.

mutation CreateTermsRequest($input: TermsRequestInput!) {
  createTermsRequest(input: $input) {
    id
    status
    amount
    netTerms
    termsFeePayer
    termsFeeAmount
    totalAmount
    purchaseDate
    dueDate
    reviewReasons
    signers {
      name
      email
      signing { status }
    }
  }
}
{
  "input": {
    "buyerId": 4821,
    "amount": 18750.00,
    "netTerms": 60,
    "termsFeePayer": "BUYER",
    "invoiceNumber": "INV-2026-00123",
    "invoiceFile": {
      "name": "INV-2026-00123.pdf",
      "base64": "<base64-encoded file>"
    },
    "poNumber": "PO-88412",
    "poFile": {
      "name": "PO-88412.pdf",
      "base64": "<base64-encoded file>"
    },
    "signers": [
      { "name": "Jane Doe", "email": "jane@sunrisesolar.example" }
    ],
    "signedAgreementCC": ["orders@yourcompany.example"]
  }
}

Field notes:

File size — the request body is capped at 25 MB in total, shared by everything in it. Base64 encoding adds about a third, so budget roughly 18 MB of original files per request, split between invoiceFile and poFile. A typical invoice PDF is well under 1 MB; the ceiling only matters for large scans.

The request can also fail outright: CREDIT_APPLICATION_MISSING if no credit limit has been requested for the buyer, INSUFFICIENT_CREDIT if the buyer's credit application was rejected, and INVALID_NET_TERMS if netTerms isn't one of your options. Otherwise, what happens next depends on the buyer's credit:

If DocuSign itself fails, the mutation returns DOCUSIGN_ERROR but the request is created — don't create it again; contact Yellowpay and the agreement will be sent.

Store the returned id; the response also carries the committed economics, so you can render a confirmation without recalculating:

2.3 Track the request

Yellowpay's side of the lifecycle is asynchronous — signing, review, funding, payment. There are no webhooks yet, so poll. A signing round trip takes hours to days; polling on the order of minutes is plenty.

Change polling — one query for "what changed since my last poll", instead of polling every open request individually:

query Changes($updatedSince: UTCDateTime!, $after: Cursor) {
  termsRequests(first: 50, after: $after, filters: { updatedSince: $updatedSince }) {
    edges {
      node {
        id
        status
        statusUpdated
        reviewReasons
      }
    }
    pageInfo { hasNextPage endCursor }
  }
}

Pass the timestamp of your previous poll as updatedSince; page with after while hasNextPage is true. updatedSince is inclusive — a request whose status changed exactly at that time is returned again — so make your handling idempotent, keyed on id and statusUpdated.

Other filters on termsRequests:

buyerId can't be combined with role: BUYER, and fails with INVALID_INPUT if it is.

For one request in detail (per-signer progress, dates):

query TermsRequest($id: Int!) {
  termsRequest(id: $id) {
    id
    status
    reviewReasons
    dueDate
    invoiceNumber
    poNumber
    signers {
      name
      email
      signing { status statusUpdated failureReason }
    }
  }
}

An ID that isn't one of your company's requests fails with NOT_FOUND.

Status Meaning What to do
REQUESTED Submitted. If reviewReasons is non-empty, the request is held for manual review; the agreement is sent automatically once the review clears. Wait.
AGREEMENT_SENT The purchase agreement has been sent to the signers via DocuSign. Tell the buyer to look for the DocuSign email. signers[].signing.status shows per-signer progress.
SIGNED All signers have signed. Yellowpay proceeds to funding.
FUNDED Yellowpay has funded the invoice — your payout has been made. The buyer now owes the payment to Yellowpay, not you.
REPAID The buyer has paid Yellowpay. Nothing — the cycle is complete.
REFUSED Yellowpay declined the request. Offer another way to pay.
CANCELLED Cancelled — by the buyer, or by you via cancelTermsRequest. Offer another way to pay or close the order.
REFUND_REQUESTED The buyer has requested a refund; Yellowpay handles this manually. No action for you.
UNCOLLECTIBLE Yellowpay could not collect the payment. No action for you.

reviewReasons is null when the request isn't under review.

Per-signer signing.status values: SENT, RECEIVED, OPENED, SIGNED, DECLINED, FAILED. FAILED means the DocuSign email couldn't be delivered — check failureReason and the signer's address, then fix it with resendAgreement. DECLINED means the signer refused to sign.

Once a request is funded, invoiceStatus follows Yellowpay's invoice to the buyer — OPEN, DELINQUENT, IN_DEFAULT or PAID — and settledDate is the date the buyer paid.

2.4 Fix problems: resend or cancel

Only you, the seller, can resend or cancel, with a CREATE_TERMS_REQUEST token. The buyer gets FORBIDDEN.

Agreement bounced or wrong signer — resend, optionally with a corrected signer list (a supplied list replaces the current signers; omit it to resend to the current ones):

mutation ResendAgreement($id: Int!, $signers: [SignerInput!]) {
  resendAgreement(id: $id, signers: $signers) {
    id
    status
    signers { name email signing { status } }
  }
}

Allowed only while the status is AGREEMENT_SENT — after the agreement has gone out and before it's signed; otherwise it fails with REQUEST_STATUS_VIOLATION.

Order fell through — cancel:

mutation CancelTermsRequest($id: Int!) {
  cancelTermsRequest(id: $id) {
    id
    status
  }
}

Allowed while the status is REQUESTED, AGREEMENT_SENT or SIGNED — i.e. any time before funding. After FUNDED, contact Yellowpay instead.

2.5 Fees, payments and balance after funding

If a funded request isn't fully paid when the net terms end, a recurring fee is charged for each started week until it is. The fee is a fixed amount per week, calculated on the request's amount (less any deposit): partial payments reduce the balance, not the weekly fee. Where the request has an escalated rate, it replaces the standard rate from escalatedFeeStartDate. These fees are always the buyer's, whoever bears the terms fee. TermsRequest.financials shows where a request stands:

query TermsRequestFinancials($id: Int!) {
  termsRequest(id: $id) {
    id
    status
    dueDate
    totalAmount
    financials {
      asOf
      feeStartDate
      recurringFeeAmount
      escalatedFeeStartDate
      escalatedFeeAmount
      recurringFeeTotal
      fixedFeeAmount
      totalPaid
      openBalance
      feeCharges { date amount tier }
      payments { date amount }
    }
  }
}

feeCharges is recalculated on every read — it is not a ledger of posted charges. At the switch to the escalated rate, the week in progress is repriced at the escalated rate, so don't treat the difference between two reads as a list of new transactions.

Change polling only tracks status changes. Fee accrual, payments that don't complete the request, and invoiceStatus moving to DELINQUENT or IN_DEFAULT leave the status unchanged, so updatedSince doesn't return the request for them. For each funded request you follow, read financials and invoiceStatus directly — once a day is enough.

Current rates. netTermsRates returns today's rates, one entry per net terms option on your account:

query NetTermsRates {
  netTermsRates {
    netTerms
    prepaidRate
    recurringRate
    escalatedRecurringRate
    escalationDay
    defaultDay
    asOf
  }
}

These are current offers. An existing request keeps the rates it was created with — use its financials, never netTermsRates, for its fees. netTermsOptions still returns the plain list of days.

3. Checking a buyer's credit

Before offering net terms on an order, check whether the buyer can take it:

query BuyerCredit($id: Int!) {
  buyer(id: $id) {
    id
    businessName
    availableCredit
    creditApplication { status approvedLimit }
  }
}

buyers(first: 20, filters: { query: "sunrise" }) lists your buyers as a paginated connection, with free-text search. A buyer(id) that isn't one of your buyers fails with NOT_FOUND.

4. Access for buyers

A buyer can integrate too — for example to show its open terms requests in its own procurement or accounting system. The buyer creates a token with READ only.

A buyer reads the requests it has taken with the same termsRequests and termsRequest(id) queries, where seller identifies who sold to it:

query MyPurchases($after: Cursor) {
  termsRequests(first: 50, after: $after, filters: { role: BUYER }) {
    edges {
      node {
        id
        status
        invoiceNumber
        totalAmount
        dueDate
        invoiceStatus
        seller { id businessName }
      }
    }
    pageInfo { hasNextPage endCursor }
  }
}

Errors

Errors follow the GraphQL convention: errors[] carries the details, with a machine-readable extensions.code and an extensions.status mirroring the equivalent HTTP status.

{
  "data": { "buyers": null },
  "errors": [
    {
      "message": "You have to log in to perform this action",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["buyers"],
      "extensions": { "code": "UNAUTHENTICATED", "status": 401 }
    }
  ]
}
Code Returned by Meaning and recovery
UNAUTHENTICATED any operation Token missing, invalid, expired, or the request came from outside the IP allowlist.
FORBIDDEN mutations Your token doesn't have the access level for this operation, or your company can't use it — for example a buyer cancelling a request. See Authentication.
NOT_FOUND addBuyerByDuns, buyer, termsRequest, resendAgreement, cancelTermsRequest, termsRequests with buyerId or sellerId No such company, or the buyer, seller or terms request isn't linked to your company. Other companies' records are always reported as not found.
INVALID_INPUT lookupCompanyDuns, termsRequests A name shorter than 3 characters or an unknown state code; or conflicting termsRequests filters.
DUPLICATE_DUNS createBuyer A company with this DUNS already exists. The existing buyer is returned in data — link it to your account with addBuyerByDuns, then continue with its id.
CREDIT_APPLICATION_PENDING requestCreditLimit An application is already under review. The buyer (with the pending application) is returned in data.
CREDIT_APPLICATION_MISSING createTermsRequest No credit limit has been requested for the buyer — call requestCreditLimit first.
INSUFFICIENT_CREDIT createTermsRequest The buyer's credit application was rejected. Offer another way to pay.
INVALID_NET_TERMS createTermsRequest netTerms is 0 or not one of your netTermsOptions.
DUPLICATE_INVOICE_NUMBER createTermsRequest A request with this invoice number already exists. The existing request is returned in data — this makes retries after timeouts safe.
REQUEST_STATUS_VIOLATION cancelTermsRequest, resendAgreement The request's status doesn't allow this operation — see the allowed statuses in section 2.4.
DOCUSIGN_ERROR createTermsRequest, resendAgreement The DocuSign envelope could not be sent. The request still exists — on create, contact Yellowpay to get the agreement sent; on resend, try again.

Two failures bypass this format entirely, with no errors array and no extensions.code:

⚠ Configure your client for error-plus-data responses

The three DUPLICATE_* / *_PENDING errors return the existing object alongside the error — that's what makes them recoverable in one step. But many GraphQL clients discard data when errors is present. Apollo Client's default errorPolicy: 'none' does exactly this — with the default configuration, the buyer or request Yellowpay hands back silently vanishes.

// Apollo Client — required for these mutations
const [createBuyer] = useMutation(CREATE_BUYER, {
  errorPolicy: 'all', // keep data AND errors
});

Whatever your client, verify it surfaces both data and errors for these three mutations. Then branch on extensions.code, never on message text.

Operation reference

Operation Purpose Access level
tokenInfo Verify your token and its access levels Any token
lookupCompanyDuns(name, state) Find a company's DUNS by name; flags already-registered companies Any token
createBuyer(input) Register a buyer (no credit yet) CREATE_BUYER
addBuyerByDuns(duns) Link an already-registered buyer to your account CREATE_BUYER
requestCreditLimit(buyerId, amount) Apply for (or raise) a buyer's credit limit CREATE_BUYER
buyer(id) Fetch a buyer, their available credit and credit application Any token
buyers(first, after, filters) List / search your buyers (paginated) Any token
netTermsOptions Available net terms, in days Any token
netTermsRates Current rates for each net terms option, including recurring and escalated fee rates Any token
termsCalculations(invoiceAmount, termsFeePayer) Price all net terms options in one call Any token
createTermsRequest(input) Create a terms request for an invoice CREATE_TERMS_REQUEST
termsRequest(id) Fetch one terms request with signer detail and financials Any token
termsRequests(first, after, filters) List / filter terms requests where you're the seller or the buyer; updatedSince for change polling Any token
resendAgreement(id, signers) Resend the DocuSign agreement, optionally with new signers CREATE_TERMS_REQUEST
cancelTermsRequest(id) Cancel a request before funding CREATE_TERMS_REQUEST

CREATE_BUYER and CREATE_TERMS_REQUEST are for seller companies only. Full field-level documentation for every type is in the Docs panel in GraphiQL.

Testing in the sandbox

The sandbox runs the same API against test data. Current behaviour:

Go-live checklist

Changelog