Aller au contenu principal
Aller au contenu principal

Développeurs

Vérifiez un acheteur avant d'expédier

Une requête POST renvoie un score de confiance de 0 à 5, un niveau de certitude et les raisons qui l'expliquent. Du HTTPS et du JSON — si vous savez envoyer un POST, l'intégration prend cinq minutes.

Cinq minutes
Créez un jeton dans l'application, envoyez une requête, lisez un score. Aucun SDK nécessaire.
Jetons à portée limitée
Des jetons liés à votre compte, pas à une personne. Donnez à un plugin le strict nécessaire, révoquez-le en un clic.
Toujours à jour
La référence ci-dessous est générée depuis le schéma de l'API en cours d'exécution : elle ne peut pas diverger du code.

Send a buyer's phone, name and address. Get back a score from 0 to 5, a confidence level, and the reasons behind it — before you hand the parcel to the courier.

Everything here works over plain HTTPS and JSON. If you can send a POST request, you can integrate in about five minutes.

  • Base URL — https://api.eblacklist.app/v1
  • Interactive reference — /docs, generated from the live OpenAPI schema, so it is never out of date
  • OpenAPI schema — /v1/openapi.json

Quick start

Create a token in the app under Settings → API tokens. You will see it once; store it somewhere safe. Then:

curl -s https://api.eblacklist.app/v1/checks \
  -H "Authorization: Bearer $EBLACKLIST_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
        "country": "MA",
        "buyer": {
          "phone": "0612345678",
          "name": "Mohamed El Amrani",
          "address": "Hay Salam, Rue 5, N 12, Sale"
        },
        "product": { "sku": "EARBUDS-01" }
      }'
{
  "check_id": "chk_01JCYQ8M3K7X2PQ4R5T6V7W8Y9",
  "trust_score": 2,
  "risk_probability": 0.41,
  "score_cap": 2,
  "confidence": "medium",
  "evidence_count": 6.3,
  "reasons": [
    {
      "code": "REFUSALS_MULTI_SELLER",
      "message": "2 refusals reported by 2 different sellers in the last 60 days"
    },
    {
      "code": "SHOP_AROUND_SAME_PRODUCT",
      "message": "Open orders for the same item with 3 other sellers in the last 72 hours"
    }
  ],
  "product_signal": {
    "concurrent_same_product": 3,
    "concurrent_same_type": 1,
    "product_refusal_level": "high"
  },
  "resolution_status": "complete",
  "followup_scheduled_for": "2026-11-17T10:00:00Z",
  "score_version": "bayes-v1.0"
}

risk_probability is the model's estimate. score_cap, when present, is the highest trust score allowed by the refusal history. Authenticated check responses can include the submitting seller's buyer name, phone, and request body. Older records may only have verified contact details. Keep these fields out of logs and shared caches.

That buyer has refused parcels from other sellers recently and currently has the same item on order with three more. Ship at your own risk.


The loop you need to implement

This is the part integrations get wrong, so it is worth sixty seconds of your time.

  ①  POST /v1/checks          → you get a score before shipping
  ②  you decide               → ship, call the buyer, or cancel
  ③  POST .../outcome         → you tell us what happened
  ④  we follow up at +3 days  → if you forget, we ask

Step ③ is not optional. The score is built entirely out of outcomes reported by sellers like you. An integration that only ever calls step ① is a free rider: it reads the network's signal and contributes nothing, and your own buyers' scores stay thin and low-confidence because your deliveries never get counted.

If you never answer, we close the check at +7 days and record an implied delivery at reduced weight — on the assumption that silence usually means the parcel arrived. That keeps the data moving, but it is a much weaker signal than you simply telling us.

You can correct an outcome for 14 days after the check. A later answer supersedes the earlier one, so reporting a refusal after an implied delivery is always safe.


Authentication

Send your token as a bearer token:

Authorization: Bearer cts_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Tokens belong to your seller account, not to a person, so they survive staff changes. Each one carries scopes, and a token can only do what its scopes allow:

ScopeLets the token
checks:writecreate checks
outcomes:writereport outcomes
products:writecreate and edit catalog products
webhooks:writeregister and manage webhook endpoints
readread checks, products and follow-ups

Give a store plugin checks:write and outcomes:write and nothing else. If a token leaks, revoke it in the app — revocation takes effect immediately, and nothing else breaks.

Never put a token in frontend code. It is a server-side credential. Anyone holding it can spend your quota and read your check history.


Idempotency

Every POST accepts an Idempotency-Key header. Send a fresh UUID with each logical request and retry safely:

Idempotency-Key: 0f9c1b2e-5a7d-4c3e-9b1a-2d4f6e8a0c2b

Replaying a key with an identical body returns the original response, with no new check created and no second follow-up scheduled. Replaying a key with a different body is a mistake on your side and returns 409 idempotency-conflict.

Separately, if you check the same buyer and product twice within 24 hours, we return the first check rather than creating a second one. Rechecking after a failed delivery attempt costs you nothing.


Rate limits

The default budget is 30 requests per second in burst and 50,000 per day. Every response carries your remaining budget:

RateLimit-Remaining: 49812
RateLimit-Reset: 1763164800

Over the limit you get 429 rate-limited with a retry_after_seconds field. Back off for that long — retrying immediately just burns the budget you have left. For catalog imports, use POST /v1/products/import with a CSV rather than looping over single creates.


Errors

Errors follow RFC 9457 and come back as application/problem+json:

{
  "type": "https://docs.eblacklist.app/errors/invalid-phone",
  "title": "The phone number could not be parsed",
  "status": 422,
  "detail": "'06123' is not a valid phone number for country MA.",
  "instance": "/v1/checks"
}

Branch on type, never on detail. The type URI is stable; the wording is not.

type suffixStatusWhat happened and what to do
invalid-phone422The number could not be parsed for that country. Check the country field; send national format or E.164, both work.
unknown-product422The SKU is not in your catalog. Send product.title alongside it and we will create the product for you.
validation-failed422A field is missing or malformed. The errors array names each one. Submitted values are deliberately omitted — they may be personal data.
unauthenticated401Missing, malformed, expired or revoked token.
insufficient-scope403The token is valid but lacks the scope named in required_scope. Issue a new token.
rate-limited429Over budget. Wait retry_after_seconds.
idempotency-conflict409This key was already used with a different body. Use a fresh key.
outcome-window-closed409More than 14 days since the check. The outcome can no longer be changed.
unsafe-webhook-url422The URL is not https://, carries credentials, or resolves inside a private network. Use a public hostname.
duplicate-webhook-url409You already have an endpoint on that URL. Edit it rather than registering it twice.
too-many-webhook-endpoints409You are at the per-account endpoint limit. Delete one you no longer use.
duplicate-sku409That SKU is already in your catalog. PATCH the product instead.

Retry 429 and 5xx with exponential backoff. Never retry a 4xx other than 429 — the request will fail the same way every time.


Reading the score

trust_score — 0 to 5

ScoreMeaning
5Very reliable. A consistent history of accepting parcels.
4Reliable.
3Mixed. Some risk; a confirmation call is cheap insurance.
2Risky.
1Very risky.
0Very likely to refuse.

risk_probability is the underlying number the score is banded from, if you would rather set your own thresholds.

confidence — how much evidence is behind it

low, medium or high, derived from evidence_count — the amount of real, time-decayed evidence we hold, over and above the prior.

A score of 2 with confidence: low is not the same as a score of 2 with confidence: high. The first mostly reflects the base rate for the area because we know almost nothing about this buyer; a brand-new buyer always looks like this and carries the reason code NO_HISTORY. The second is a genuine warning. Treat them differently.

resolution_status

complete means we finished resolving the buyer's identity within the latency budget. partial means we returned the best score we had and are still resolving in the background — GET /v1/checks/{id} a few seconds later may show a slightly different score. Partial results are rare and always safe to use; they simply have not yet taken every linked record into account.

reasons

Up to three codes, ranked by how much each contributed. Codes are stable identifiers you can branch on; message is localized for display and follows Accept-Language or your account language.

CodeMeaning
NO_HISTORYWe have not seen this buyer before. The score is the local base rate.
REFUSALS_MULTI_SELLERSeveral different sellers reported refusals recently.
REFUSALS_SINGLE_SELLERRefusals reported, but all by one seller. Weighted lower on purpose.
SHOP_AROUND_SAME_PRODUCTThe same item is on order with other sellers right now.
SHOP_AROUND_SAME_TYPEA similar item is on order with other sellers right now.
IDENTITY_CHURNThis buyer has used several different phone numbers recently.
HIGH_RISK_PRODUCTThis product is refused more often than average in this market.
GOOD_HISTORYA consistent record of accepted deliveries.
RETURNS_AFTER_DELIVERYParcels accepted and then returned.
UNREADABLE_CONTACT_DETAILSThe name and the address you sent are not usable delivery details.

UNREADABLE_CONTACT_DETAILS, and what it does not claim

This one fires when neither the name nor the address you sent reads as a name or an address — keyboard mash, a repeated letter, filler like test or asdf. It applies only to a buyer we have no record of yet, and it nudges the refusal probability up, which in practice costs one band: a 3 becomes a 2.

It describes your input, not the person. A check is a question about a buyer, and "the details you entered are not usable" is something you can act on by retyping them; it is not a claim that the buyer is fake, and nothing in the response or in our records keeps a copy of the text that triggered it.

Two limits we would rather state than have you discover:

  • Arabic script is never flagged. The detector only judges Latin text, so مشتري مجهول passes untouched. This is deliberate — we do not have enough Arabic training data to judge it without flagging real names — and it means you cannot rely on this signal to catch junk in Arabic.
  • Rare real spellings can trip it. A Darija or Amazigh spelling that drops its vowels looks like keyboard mash on every measure. We handle the ones we can: drop the vowels from Tafraout and from Tfrwt and both give the same frame, so a vowel-dropped spelling of a town we know about is recognised. A town we do not know about is not, and there will be others. That is why the signal needs both fields to fail and only applies to a buyer with no history, and why it moves the score by one band rather than condemning anyone.
  • Some junk still gets through, by choice. Anything shorter than three letters, and n/a — because n is a building-number marker and we would rather lose that one than start second-guessing "N 12". If a buyer's details look like nonsense to you and the score does not say so, trust your eyes: this signal is deliberately quiet.

product_signal

Present when you sent a product. concurrent_same_product counts other sellers with an open, unresolved order for the same item in the last 72 hours. It is the single most actionable number in the response: a buyer with the same item on order from four sellers will accept one parcel.


What you will never receive

By design, and not by policy alone:

  • No other seller is ever named. You get counts, never identities.
  • No other phone, name or address linked to the same buyer, even when our identity graph knows about them.
  • No other seller's catalog. Product matching happens internally against canonical products; your catalog stays yours.

This cuts both ways, and that is the point: the same wall protects your data from everyone else's integration.


Endpoints

Checks

MethodPathScope
POST/v1/checkschecks:write
GET/v1/checksread
GET/v1/checks/{id}read
POST/v1/checks/{id}/outcomeoutcomes:write

POST /v1/checks body:

FieldTypeRequiredNotes
countrystringnoISO 3166-1 alpha-2. Defaults to your account country. Used to parse the phone number.
buyer.phonestringyesNational or E.164 format.
buyer.namestringyesAs the buyer gave it. Arabic or Latin script both fine.
buyer.addressstringyesFree text, as typed. Do not try to normalize it — we do that better with the full picture.
product.skustringnoYour SKU. Unknown SKU without a title returns 422.
product.titlestringnoCreates the product if the SKU is new.

A repeat inside 24 hours is not a new check. Checking the same buyer, phone and product again within the window returns the check you already have, with reused: true and the original created_at. No second follow-up is scheduled, which is the point — one parcel should not produce two "what happened?" prompts.

Unless you already reported an outcome. A check you have answered is settled: its follow-up is closed and no further outcome can attach to it. Checking the same buyer again then gives you a genuinely new check, because the second parcel needs a follow-up of its own. So the way to get a fresh check inside the window is to report what happened to the first one.

Two things catch integrators out:

  • A different name or address does not make it a new check. The phone identifies the buyer, so a buyer who spells their name differently or ships to work is the same buyer.
  • The response is a 200 that looks ordinary. It carries a check_id, a score, and any outcome already reported — which belongs to the earlier check, not to this request. Branch on reused, and show it: a merchant who sees yesterday's refused on a check they think they just made will report it as a bug.

To check the same number again inside the window: report the outcome of the open check, or send a different product.

GET /v1/checks accepts from, to, score, followup_status, product_sku, limit and cursor. Paginate with the next_cursor in the response; do not build your own offsets.

POST /v1/checks/{id}/outcome body:

{ "outcome": "delivered" }

One of delivered, refused, returned (accepted, then sent back) or not_shipped (you decided not to ship — this never counts against the buyer).

Outcomes in bulk

POST /v1/outcomes/bulk with outcomes:write takes up to 500 at once:

{ "outcomes": [{ "check_id": "chk_...", "outcome": "delivered" }] }

Each entry succeeds or fails independently; the response reports per-item status. This is the right endpoint for a nightly sync from your order system.

Follow-ups

GET /v1/followups/pending returns the checks still waiting on an answer, with the deadline after which each becomes an implied delivery. Poll it daily, or let us push instead.

Webhooks

MethodPathScope
GET / POST/v1/webhooksread / webhooks:write
PATCH / DELETE/v1/webhooks/{id}webhooks:write
POST/v1/webhooks/{id}/testwebhooks:write

Three events: followup.due when a parcel has gone quiet for three days, outcome.recorded when an outcome lands by any route including the implied delivery at +7, and score.changed when a buyer you are still waiting on crosses a band.

POST returns a secret once. Every delivery carries X-EBlacklist-Signature: t=<unix>,v1=<hex>, an HMAC-SHA256 over the literal string {t}.{raw body} — the bytes as received, never a reserialised copy.

Polling is not the alternative to this; it is the fallback. If you implement one thing beyond the check itself, make it outcome.recorded, because a score only stays accurate if outcomes come back. The full contract, the retry schedule and two worked platform integrations are in the store plugin guide.

Products

MethodPathScope
GET / POST/v1/productsread / products:write
PATCH / DELETE/v1/products/{id}products:write
POST/v1/products/importproducts:write

CSV import columns: sku, title, description, image_url. Include an image URL where you have one — image similarity is what catches the same dropshipped item sold under five different names, which is exactly where shop-around detection earns its keep.


Code samples

JavaScript

const res = await fetch("https://api.eblacklist.app/v1/checks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.EBLACKLIST_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    country: "MA",
    buyer: { phone, name, address },
    product: { sku },
  }),
});

if (!res.ok) {
  const problem = await res.json();
  throw new Error(`${problem.type}: ${problem.detail ?? problem.title}`);
}

const check = await res.json();
if (check.trust_score <= 1 && check.confidence !== "low") {
  await flagForManualReview(order, check.reasons);
}

Python

import os, uuid, httpx

with httpx.Client(base_url="https://api.eblacklist.app/v1", timeout=10) as client:
    r = client.post(
        "/checks",
        headers={
            "Authorization": f"Bearer {os.environ['EBLACKLIST_TOKEN']}",
            "Idempotency-Key": str(uuid.uuid4()),
        },
        json={
            "country": "MA",
            "buyer": {"phone": phone, "name": name, "address": address},
            "product": {"sku": sku},
        },
    )
    r.raise_for_status()
    check = r.json()

PHP

$ch = curl_init('https://api.eblacklist.app/v1/checks');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('EBLACKLIST_TOKEN'),
        'Content-Type: application/json',
        'Idempotency-Key: ' . bin2hex(random_bytes(16)),
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'country' => 'MA',
        'buyer'   => ['phone' => $phone, 'name' => $name, 'address' => $address],
        'product' => ['sku' => $sku],
    ]),
]);
$check = json_decode(curl_exec($ch), true);

Versioning

The API is versioned in the path. Within /v1 we will add fields and add reason codes, but we will not remove a field, rename one, or change what an existing type URI means. Parse defensively: treat unknown fields and unknown reason codes as additive.

A new major version would live at /v2, and /v1 would keep working for at least twelve months after it ships.

score_version tells you which scoring configuration produced a result. When it changes, scores may shift slightly as the model is recalibrated. Store it alongside any score you cache so an old decision can always be explained.

Référence API en direct

Chaque endpoint, chaque champ, chaque erreur, générés depuis le schéma OpenAPI servi par l'API. Collez votre jeton et envoyez une vraie requête depuis cette page.