Yellowpay Partner API — Integration Guide
Production endpoint:
https://api.getyellowpay.com/partner/graphqlGraphiQL:
https://api.getyellowpay.com/partner/graphiqlSandbox:
https://staging-api.getyellowpay.com/partner/graphql— see EnvironmentsThis 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:
-
Access levels — what the token may change. Every token can run queries; the levels add write access:
Level In the app Allows Who can have it READRead data Queries only — choose this alone for a read-only token Any company CREATE_BUYERRegister buyers and request credit limits createBuyer,addBuyerByDuns,requestCreditLimitSellers only CREATE_TERMS_REQUESTCreate and manage terms requests createTermsRequest,resendAgreement,cancelTermsRequestSellers only MANAGE_WEBHOOKSManage webhooks Creating, changing and deleting webhook endpoints, rotating their secrets, sending test events and retrying deliveries — see Webhooks Any company A full seller checkout integration needs
CREATE_BUYERandCREATE_TERMS_REQUEST. A buyer's token is always read-only, apart fromMANAGE_WEBHOOKS: the seller levels can't be given to a token of a company that isn't a seller. -
An optional IP allowlist. If your token has one, requests from other IPs are rejected.
-
An expiry date.
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
- Protocol — standard GraphQL over HTTP
POSTwith a JSON body{ "query": "...", "variables": { ... } }.GETis not supported. - Money — invoices, fees and payments are USD
Floatwith two decimal places. Credit limits (requestCreditLimit.amount,requestedLimit,approvedLimit) are whole USDInt. Rates (netTermsRates) are percentages rounded to two decimal places:0.69means 0.69%, not a fraction. - Dates —
LocalDateisYYYY-MM-DD.UTCDateTimeis ISO 8601 with aZsuffix, e.g.2026-08-26T12:00:00Z. - Strings — trimmed on input and must be non-empty.
Emailvalues are lowercased and trimmed. - IDs —
Buyer.id,Seller.idandTermsRequest.idare integers. Treat them as opaque identifiers. - Lists —
buyersandtermsRequestsare Relay-style paginated connections: passfirst(page size) andafter(cursor), readedges[].nodeandpageInfo. See Change polling. - Errors — standard GraphQL
errorsarray with a machine-readableextensions.code. Some errors return usable data alongside the error. See Errors — including a client configuration note you should not skip. - Examples — every example below uses variables. Do the same in your integration: it keeps the operation static and lets your GraphQL client validate and cache it.
Integration flow at a glance
Two stages. The first happens once per buyer, the second once 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.
1.2 Register the buyer — or link an existing one
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:
primaryContact— the buyer's main contact. This person signs purchase agreements unless you specify othersignerson a terms request.accountsPayable— the buyer's accounts-payable contact. Yellowpay sends payment notices here. All three fields are required.duns— from step 1.1, or your own records.
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, or subscribe to BUYER_CREDIT_APPLICATION_UPDATED webhooks. 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 }
]
}
}
invoiceAmount— the amount you passed in, excluding the fee.feesAmount— the fee added to the buyer's invoice;0when you bear the fee.totalAmount— what the buyer pays on the due date. This is the amount on the purchase agreement.
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:
buyerId— theBuyer.idfrom step 1.amount— the invoice amount, excluding any Yellowpay fee. The same value you priced withtermsCalculations.netTerms— one of the values fromnetTermsOptions/ the calculations.invoiceFile— the invoice, base64-encoded; PDF or most common image formats.invoiceNumber— your invoice number, unique across your requests. A duplicate fails withDUPLICATE_INVOICE_NUMBERand returns the existing request indata— which also makes a blind retry after a timeout safe.poNumber/poFile— optional purchase order or contract number and file.signers— who signs the purchase agreement. Optional; defaults to the buyer's primary contact.signedAgreementCC— optional. Addresses that receive a copy of the signed agreement, typically your own order desk.
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:
- Approved limit covering the amount — Yellowpay emails the purchase agreement to the signers as a DocuSign envelope, and the request proceeds through the statuses below.
- Otherwise — the request is still created but held for Yellowpay's manual review.
reviewReasonsstates why (CREDIT_LIMIT,BUYER_DELINQUENCY,SELLER_DELINQUENCY), and the agreement is not sent while the review is open. Once Yellowpay clears the review it sends the agreement — no action is needed on your side.
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:
amount— the invoice amount on the purchase agreement, including the fee when the buyer bears it.termsFeeAmount— the terms fee, whoever bears it.totalAmount— what the buyer pays ondueDate(purchaseDate+netTermsdays).
2.3 Track the request
Yellowpay's side of the lifecycle is asynchronous — signing, review, funding, payment. Subscribe to webhooks to be told when a status changes, or 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:
status— only requests in one of these statuses.buyerId— only requests for one of your buyers.role—SELLERorBUYER: only requests where your company has that role. Omit it to get both; it matters only if your company also buys through Yellowpay.
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 }
}
}
}
asOf— the business date the figures are calculated for, in Yellowpay's timezone. Figures are always current; there are no historical snapshots.feeStartDate/recurringFeeAmount— the first recurring fee date, the day after the net terms end (purchaseDate+netTerms+ 1 day; for requests created through the API, the day afterdueDate), and the standard fee per started week. Both are null when the request has no recurring fee schedule. WhenescalatedFeeStartDateis the same asfeeStartDate, every week is charged at the escalated rate, sorecurringFeeAmountis never charged.escalatedFeeStartDate/escalatedFeeAmount— when the escalated rate starts, and the fee per started week from then on. Null when no escalated rate applies.recurringFeeTotal— recurring fees accrued so far, both rates together. Zero before funding.fixedFeeAmount— any additional fixed fee, separate from recurring fees.totalPaid/payments— the payments recorded against the request, and their sum. Older requests settled without payment records showtotalPaid0 and nopayments; their status is what counts.openBalance— what the buyer owes now. Zero before funding. It follows Yellowpay's billing and settlement rules, settlement adjustments included, so read it rather than recomputing it from the other fields. A settlement can leave it non-zero on aREPAIDrequest.feeCharges— the recurring fees as dated lines, withtierSTANDARDorESCALATED; their sum isrecurringFeeTotal. Empty before funding.
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
}
}
prepaidRate— the terms fee rate for this option on your account, before any deposit or delivery adjustment.recurringRate/escalatedRecurringRate— the standard and escalated recurring fee rates, as a percentage of the request'samountper started week. These are Yellowpay's current rates for buyers, the same for every seller, and Yellowpay can set different recurring fees for an individual buyer.recurringRateis null when no recurring rate is configured, andescalatedRecurringRatewhen there is no escalated rate.escalationDay— days afterpurchaseDateon which the escalated rate first applies for this option — never within the net terms. Null when there is no escalated rate.defaultDay— days afterpurchaseDateon which a request created through the API with this option is in default. It is a threshold;invoiceStatuschanges toIN_DEFAULTwhen Yellowpay next updates it.
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 }
}
}
availableCredit— what the buyer can request terms for right now. If it's lower than the order amount, the request isn't rejected outright — it goes into manual review withreviewReasons: [CREDIT_LIMIT].creditApplication— the latest application and its status; null if none has been made yet.- To raise a limit, call
requestCreditLimitwith the new amount.
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 — plus MANAGE_WEBHOOKS to receive webhooks for its terms requests.
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 }
}
}
- Filters —
sellerIdnarrows to one seller (aSeller.id); it can't be combined withrole: SELLER.statusandupdatedSincework as described in 2.3. - What the buyer doesn't see — what's confidential to the seller.
termsFeeAmountis null when the seller bears the fee, andreviewReasonsleaves outSELLER_DELINQUENCY. - Fees and balance —
financials(see 2.5) shows the buyer the same figures as the seller; everything in it — fees, payments and balance — is the buyer's own.netTermsRatesreturns an empty list for a company that isn't a seller. - What the buyer can't do — create, resend or cancel terms requests, or register other buyers. The seller levels aren't available to a buyer's token.
5. Webhooks
Instead of polling, you can have Yellowpay send an HTTPS POST to your server when a terms request's status changes or a buyer's credit application is made or changes. Each event is signed, so you can verify it came from Yellowpay.
Events are signals, not records: they carry IDs and the values that changed. Read the current state through the API before acting on one.
5.1 Events
WebhookEvent and payload type |
Sent when | Sent to |
|---|---|---|
TERMS_REQUEST_STATUS_UPDATEDterms_request.status_updated |
A terms request's status changes — any of the transitions in 2.3 |
The seller and the buyer |
BUYER_CREDIT_APPLICATION_UPDATEDbuyer.credit_application.updated |
A buyer makes a credit application, or its status, requested limit or approved limit changes. The first event of a new application can have status PENDING. |
Every seller the buyer is linked to |
TESTwebhook.test |
You call sendTestWebhook |
That endpoint only; it can't be subscribed to |
Creating a terms request sends no event; the first event is its first status change. A credit decision that requestCreditLimit returns straight away is also sent as an event.
The body is JSON:
{
"id": "evt_3fZ8kQw1",
"type": "terms_request.status_updated",
"created": "2026-11-12T10:00:01Z",
"data": {
"termsRequestId": 7310,
"status": "FUNDED",
"previousStatus": "SIGNED",
"statusUpdated": "2026-11-12T10:00:00Z"
}
}
{
"id": "evt_9Lp2mXr4",
"type": "buyer.credit_application.updated",
"created": "2026-11-12T10:00:01Z",
"data": {
"buyerId": 4821,
"status": "APPROVED",
"previousStatus": "PENDING",
"requestedLimit": 50000,
"approvedLimit": 40000
}
}
{
"id": "evt_7Qa1nVt6",
"type": "webhook.test",
"created": "2026-11-12T10:00:01Z",
"data": { "endpointId": "6af5d2c1-5ad4-47d1-8dc1-456bf61b0f90" }
}
id— the event ID. It is the same on every attempt to deliver the event, and the same for each of your endpoints that receives it; it is also sent in theYellowpay-Event-Idheader. Use it to deduplicate — per endpoint, if several endpoints feed different systems.type— what happened; branch on this.created— when Yellowpay created the event.data— uses the same names and enum values as the API.termsRequestIdis aTermsRequest.idandbuyerIdaBuyer.id.previousStatusis null when there was none, as on a first credit application.requestedLimitandapprovedLimitare whole USD, with the same values asBuyer.creditApplication.
5.2 Set up an endpoint
Creating and changing endpoints needs a token with MANAGE_WEBHOOKS (see Authentication); any token can read them. Endpoints belong to your company, not to the token, so replacing or deleting the token that created one doesn't affect it.
mutation CreateWebhookEndpoint($input: WebhookEndpointInput!) {
createWebhookEndpoint(input: $input) {
secret
endpoint {
id
url
events
enabled
created
}
}
}
{
"input": {
"url": "https://yourcompany.example/yellowpay/webhooks",
"events": ["TERMS_REQUEST_STATUS_UPDATED", "BUYER_CREDIT_APPLICATION_UPDATED"],
"description": "Order sync"
}
}
secret— the signing secret (whsec_…) you verify every event with. It is returned only here and byrotateWebhookSecret, and can't be read again — store it like a password.url— must usehttpson the default port 443 and be reachable from the internet. Credentials and fragments in the URL,localhostand private IP addresses written in the URL are rejected withINVALID_INPUT. A hostname that resolves to a private address is accepted, but every delivery to it fails. To receive events on a development machine, register the public HTTPS URL of a tunnel to it.events— at least one event;TESTisn't allowed. Buyers subscribe toTERMS_REQUEST_STATUS_UPDATED;BUYER_CREDIT_APPLICATION_UPDATEDis sent to sellers only.description— an optional note for your own reference.
A company can have at most five endpoints; one more fails with LIMIT_EXCEEDED.
Then check that your endpoint receives and verifies events:
mutation SendTestWebhook($id: UUID!) {
sendTestWebhook(id: $id) {
id
status
attempts { at responseStatus error durationMs }
}
}
The test event is sent at once and the delivery is returned with the attempt's result. A test is a single attempt and is never retried; if it fails, fix your endpoint and send another. If your endpoint takes longer than 10 seconds to answer, the delivery is returned while the attempt is still in progress — read the result with webhookDelivery(id).
Changing an endpoint — updateWebhookEndpoint(id, input) changes only the fields you pass:
url/description—description: nullremoves the note.events— replaces the whole list. New events stop being sent for an event you remove.enabled—falsestops sending to the endpoint. Events that happen while it is disabled are never sent to it, not even after you re-enable it. Deliveries that were already pending wait, and resume when you set it back totrue; one created more than 4 days earlier fails instead of being sent, so you don't get outdated events. After re-enabling, catch up on what you missed with change polling.
deleteWebhookEndpoint(id) stops all deliveries to the endpoint: pending ones become FAILED. Its past deliveries stay readable.
webhookEndpoints lists your company's endpoints. If blocked is true, Yellowpay has blocked the endpoint — for example because it misbehaved — and it receives nothing, whatever enabled says: events that happen while it is blocked are never sent to it, and pending deliveries wait until Yellowpay unblocks it. Contact Yellowpay to resolve it.
5.3 Verify the signature
Each event is a POST with these headers:
Content-Type: application/json
User-Agent: Yellowpay-Webhooks
Yellowpay-Event-Id: evt_3fZ8kQw1
Yellowpay-Signature: t=1794477601,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
In Yellowpay-Signature, t is the time of the attempt in Unix seconds, and v1 is a hex HMAC-SHA256 of <t>.<raw body>, keyed with the whole secret — whsec_ prefix included. While a secret is being rotated (see 5.6) the header carries one v1 per secret; accept the request if any of them matches.
Reject any request that fails verification:
- Read the raw request body, before any JSON parsing. A body that has been parsed and serialized again won't match the signature.
- Compute the HMAC of
t, a.and the raw body, and compare it with eachv1in constant time. - Reject a
tmore than five minutes away from your clock, so a captured request can't be replayed later.
Node.js:
const crypto = require('crypto');
function verifyYellowpaySignature(rawBody, header, secret, toleranceSec = 300) {
if (typeof header !== 'string') return false;
const items = header.split(',').filter((part) => part.includes('=')).map((part) => {
const i = part.indexOf('=');
return [part.slice(0, i), part.slice(i + 1)];
});
const timestamp = items.find(([key]) => key === 't')?.[1];
const signatures = items
.filter(([key, value]) => key === 'v1' && value.length === 64 && !/[^0-9a-fA-F]/.test(value))
.map(([, value]) => value);
if (!timestamp || timestamp.length > 15 || /[^0-9]/.test(timestamp) || signatures.length === 0) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSec) return false;
const expected = crypto.createHmac('sha256', secret)
.update(`${timestamp}.`)
.update(rawBody)
.digest();
return signatures.some((signature) => crypto.timingSafeEqual(Buffer.from(signature, 'hex'), expected));
}
With Express, take the body as raw bytes on the webhook route — express.raw({ type: 'application/json' }) — and pass req.body and req.get('Yellowpay-Signature').
Python:
import hashlib
import hmac
import re
import time
def verify_yellowpay_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
if not isinstance(header, str):
return False
items = [part.split("=", 1) for part in header.split(",") if "=" in part]
timestamps = [value for key, value in items if key == "t"]
signatures = [value for key, value in items if key == "v1" and re.fullmatch(r"[0-9a-fA-F]{64}", value)]
if not timestamps or not signatures or not re.fullmatch(r"[0-9]{1,15}", timestamps[0]):
return False
timestamp = timestamps[0]
if abs(time.time() - int(timestamp)) > tolerance:
return False
signed = timestamp.encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).digest()
return any(hmac.compare_digest(expected, bytes.fromhex(signature)) for signature in signatures)
5.4 Handle deliveries
- Respond fast. A 2xx status within 10 seconds counts as delivered. Anything else — another status, a redirect (redirects aren't followed), a timeout or a refused connection — is a failed attempt. Store the event and answer first; do the work afterwards.
- Expect retries. A failed attempt is retried after 1, 5 and 30 minutes, then 2, 6 and 12 hours, then twice more 24 hours apart: nine attempts over about three days. Every retry has the same body and event
id, with a fresht. After the last one, the delivery isFAILED. - Deduplicate. An event can arrive more than once — for example when your 2xx was sent but didn't reach Yellowpay in time. Skip any
idyou've already processed on that endpoint. - Don't rely on order. Events can arrive out of order. Treat each as a prompt to read the terms request or buyer through the API, and act on what the API returns — not on the event's
status. - Keep a reconciliation. In rare failures an event is never sent. After downtime on your side, and periodically, catch up with change polling (
termsRequestswithupdatedSince) and by reading your buyers'creditApplication. - Fees and payments aren't events. As with change polling, only status changes are sent. Keep reading
financialsandinvoiceStatusfor funded requests, as described in 2.5.
While Yellowpay has disabled API access for your company, events aren't sent to any of your endpoints, then or later; pending deliveries wait. Once access is restored they resume, except those created more than 4 days earlier, which fail. Catch up on the rest with change polling.
5.5 Inspect and retry deliveries
Every event sent to an endpoint is a delivery, kept with each of its attempts. webhookDeliveries lists them newest first, including deliveries to endpoints you've since deleted, as a paginated connection:
query FailedDeliveries($filters: WebhookDeliveryFilters, $after: Cursor) {
webhookDeliveries(first: 20, after: $after, filters: $filters) {
edges {
node {
id
eventId
eventType
status
attemptCount
nextAttempt
created
completed
endpoint { id url }
attempts { at responseStatus error durationMs }
}
}
pageInfo { hasNextPage endCursor }
}
}
{ "filters": { "status": ["FAILED"], "createdSince": "2026-11-20T00:00:00Z" } }
Filters: endpointId, status, eventType, eventId, createdSince (inclusive) and createdBefore. payload returns the exact JSON body that was sent, and webhookDelivery(id) fetches one delivery.
| Status | Meaning |
|---|---|
PENDING |
Not delivered yet. The next attempt is due at nextAttempt, or an attempt is in progress. |
SUCCEEDED |
The endpoint answered the last attempt with a 2xx status. |
FAILED |
Every scheduled attempt failed; or a single attempt failed — a test event, or a manual retry of a delivery that had already finished; or the delivery stopped — its endpoint was deleted, or it waited more than 4 days. |
On each attempt, responseStatus is the HTTP status your endpoint returned, or error says why there was no response.
To send a delivery again — for example after fixing your endpoint — use retryWebhookDelivery:
mutation RetryWebhookDelivery($id: UUID!) {
retryWebhookDelivery(id: $id) {
id
status
attemptCount
attempts { at responseStatus error }
}
}
It resends the original payload, with the same event id, in any status, and returns the delivery like sendTestWebhook does. Retrying a SUCCEEDED or FAILED delivery is a single extra attempt, without new automatic retries. Retrying a PENDING delivery uses one of its nine attempts: if it fails, the automatic retries continue from there. It fails with DELIVERY_IN_PROGRESS while another attempt is running, DISABLED when the endpoint is disabled or blocked, and NOT_FOUND when its endpoint has been deleted.
5.6 Rotate the secret
mutation RotateWebhookSecret($id: UUID!, $overlapHours: Int) {
rotateWebhookSecret(id: $id, overlapHours: $overlapHours) {
secret
endpoint { id previousSecretExpires }
}
}
rotateWebhookSecret returns a new secret. For overlapHours — 24 by default, at most 168 — events are signed with both the new and the replaced secret, so you can deploy the new one without rejecting events; the old one stops signing at previousSecretExpires. If a secret has leaked, pass 0 to revoke it at once.
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, webhook operations |
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. For webhooks: no such endpoint or delivery for your company, or the endpoint has been deleted. |
INVALID_INPUT |
lookupCompanyDuns, termsRequests, createWebhookEndpoint, updateWebhookEndpoint, rotateWebhookSecret |
A name shorter than 3 characters or an unknown state code; or conflicting termsRequests filters. For webhooks: a URL that breaks the rules in 5.2, an empty event list or TEST, or overlapHours outside 0–168. |
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. |
LIMIT_EXCEEDED |
createWebhookEndpoint |
Your company already has five webhook endpoints. Delete one first, or subscribe an existing one to more events. |
DISABLED |
sendTestWebhook, retryWebhookDelivery |
The endpoint is disabled, or blocked by Yellowpay. Enable it with updateWebhookEndpoint; for a block, contact Yellowpay. |
DELIVERY_IN_PROGRESS |
retryWebhookDelivery |
Another attempt for this delivery is running. Check it with webhookDelivery(id) and retry later if it fails. |
Two failures bypass this format entirely, with no errors array and no extensions.code:
- HTTP 403 — Yellowpay has disabled API access for your company, or its account is suspended. Contact Yellowpay.
- HTTP 413 — the request body is over 25 MB. If your client reports a parse failure or a bare 413 on
createTermsRequest, check the size of the attached files first (see File size).
⚠ 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 |
webhookEndpoints |
List your company's webhook endpoints | Any token |
webhookDeliveries(first, after, filters) |
List events sent to your endpoints, with every attempt (paginated) | Any token |
webhookDelivery(id) |
Fetch one webhook delivery | Any token |
createWebhookEndpoint(input) |
Add an endpoint; returns its signing secret | MANAGE_WEBHOOKS |
updateWebhookEndpoint(id, input) |
Change an endpoint's URL, events or note, or disable it | MANAGE_WEBHOOKS |
deleteWebhookEndpoint(id) |
Delete an endpoint | MANAGE_WEBHOOKS |
rotateWebhookSecret(id, overlapHours) |
Replace an endpoint's signing secret | MANAGE_WEBHOOKS |
sendTestWebhook(id) |
Send a TEST event to an endpoint now |
MANAGE_WEBHOOKS |
retryWebhookDelivery(id) |
Send a delivery again now | MANAGE_WEBHOOKS |
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:
- Token — there is no self-service token page for the sandbox yet. Request a sandbox token from your Yellowpay contact; it arrives by email. To test the buyer side, ask for a read-only token for a sandbox buyer too.
lookupCompanyDuns— returns test data rather than querying Dun & Bradstreet. Live lookup in the sandbox is coming.- Credit — underwriting is mocked and approves instantly. To test the other outcomes, end the buyer's business name with
[pending]or[rejected]when registering. - Agreements — DocuSign emails are delivered only to
test+addresses (e.g.test+jane@yourdomain.com); everything else is suppressed. Usetest+signer emails to run the signing flow end to end — the same rule applies tosignedAgreementCC. - Funding — to move a signed request to
FUNDEDand beyond, ask your Yellowpay contact. - Webhooks — delivered to your HTTPS endpoints under the same rules as in production; ask for
MANAGE_WEBHOOKSon your sandbox token. Sandbox and production endpoints are separate. When the sandbox data is reset, endpoints created there are removed and must be created again.sendTestWebhookchecks an endpoint without creating terms requests.
Go-live checklist
- Your integration points at the production endpoint (
https://api.getyellowpay.com/partner/graphql). - A production token created in the Yellowpay app (Settings → API access) with
CREATE_BUYERandCREATE_TERMS_REQUEST; IP allowlist configured if your egress IPs are static. - Your GraphQL client is configured to surface
dataalongsideerrors(Apollo:errorPolicy: 'all') forcreateBuyer,createTermsRequestandrequestCreditLimit. Buyer.idis persisted against the buyer on your side; both onboarding doors are wired —addBuyerByDunswhenisRegistered(or onDUPLICATE_DUNS),createBuyerotherwise.- Buyers with a
PENDINGcredit application are not offered net terms until it'sAPPROVED. - The
termsFeePayerused intermsCalculationsis the same one sent increateTermsRequest. - Invoice numbers are unique; the
DUPLICATE_INVOICE_NUMBER+ existing-request response is handled as a success path for retries. - Your invoicing flow does not send the invoice to the buyer for Yellowpay-funded orders — Yellowpay invoices the buyer directly.
REFUSED,CANCELLEDand signerDECLINED/FAILEDare handled in your order flow;resendAgreementis wired up for bounced agreements.- Change polling with
updatedSinceis in place forSIGNEDandFUNDED, and handles a request seen twice at the poll boundary. - If you use webhooks: a production endpoint created with a
MANAGE_WEBHOOKStoken, its secret stored securely, signatures verified against the raw body, events deduplicated byid, and a 2xx returned within 10 seconds. Change polling stays in place as a reconciliation.
Changelog
- 2026-11 — Webhooks for terms request status changes and buyer credit application updates, with signed payloads, automatic retries, delivery history and secret rotation (see 5). New access level
MANAGE_WEBHOOKS, available to any company. - 2026-11 —
TermsRequest.financials: fee schedule, accrued recurring fees, payments and open balance (see 2.5). NewnetTermsRatesquery with the current rates behind each net terms option;netTermsOptionsis unchanged. Schema descriptions now say "payment" where they said "repayment", and so does this guide; no field or enum names changed. Fixed: the escalated rate no longer applies within the net terms, sototalAmountnever includes escalated fees. - 2026-11 — Breaking renames: customers are now buyers, and vendors sellers.
Customer→Buyer,customer(id)/customers→buyer(id)/buyers,createCustomer/addCustomerByDuns→createBuyer/addBuyerByDuns,customerId→buyerId,CustomerInput→BuyerInput, access levelCREATE_CUSTOMER→CREATE_BUYER,termsFeePayer: CUSTOMER→BUYER, review reasonsCUSTOMER_DELINQUENCY/VENDOR_DELINQUENCY→BUYER_DELINQUENCY/SELLER_DELINQUENCY. Every token can now run queries, and the seller levels are for seller companies only. Buyers can read their terms requests with a read-only token.TermsRequestgainsseller,invoiceNumber,poNumber,settledDateandinvoiceStatus;termsFeeAmountis now nullable.termsRequestsgainsroleandsellerIdfilters, andupdatedSinceis inclusive and catches new requests. Other companies' records are reported asNOT_FOUND. ClarifiedtermsCalculations:invoiceAmountexcludes the fee, and the purchase agreement showstotalAmount. - 2026-09 — Production tokens are now self-service in the Yellowpay app.
- 2026-08 — Initial version.