Guida all’API
Autenticazione, importi, idempotenza, paginazione ed errori dell’API REST v1 di Arbiro, con ogni endpoint pubblico generato dal documento OpenAPI.
L’API è REST su HTTPS a https://arbiro.com/v1, con corpi JSON. Il contratto completo è il documento OpenAPI 3.1 apis/openapi/v1.yaml; l’elenco degli endpoint qui sotto e il riferimento interattivo sono generati da esso.
Autenticazione
Invia la tua chiave segreta come token bearer. Le chiavi di test (arb_test_...) vedono solo i dati di test e le chiavi live (arb_live_...) solo i dati live.
curl https://arbiro.com/v1/account -H "Authorization: Bearer $ARBIRO_API_KEY"
const { merchant_id, livemode } = await arbiro.account.retrieve();
httpx.get("https://arbiro.com/v1/account", headers={"Authorization": f"Bearer {key}"}).json()
Importi
Gli importi sono stringhe di interi in unità atomiche con 6 decimali ("10500000" corrisponde a 10,50). Le percentuali sono punti base interi (10000 è il 100%). I numeri in virgola mobile vengono rifiutati.
Idempotenza
Invia Idempotency-Key in ogni POST. Il primo risultato viene salvato e restituito di nuovo per la stessa chiave e lo stesso corpo; riutilizzare una chiave con un corpo diverso restituisce 422 idempotency_key_reused.
Paginazione
Le liste restituiscono { "data": [...], "has_more": true }, dal più recente. Passa l’id dell’ultimo elemento come starting_after per la pagina successiva. GET /v1/events accetta anche ending_before per ottenere ciò che è successo dopo un evento.
Errori
Gli errori sono problem details secondo la RFC 9457 (application/problem+json) con un code stabile:
{ "type": "https://arbiro.com/docs/api-reference/#not_redeemable", "title": "A refunded payment cannot be redeemed", "status": 409, "code": "not_redeemable" }
Ogni risposta contiene un header Request-Id; includilo quando contatti l’assistenza.
Endpoints
Generated from apis/openapi/v1.yaml. Paths are relative to https://arbiro.com/v1. Each path opens its page in the interactive reference, with code samples and a Test Mode console.
Payment links
| Method | Path | Description |
|---|---|---|
POST |
/payment-links |
Create a hosted payment link (no-code, Level 1 integration). |
GET |
/payment-links |
Payment links of the account in the key's mode, newest first. |
GET |
/payment-links/{id} |
One payment link. |
Checkout sessions
| Method | Path | Description |
|---|---|---|
POST |
/payment-links/{id}/checkout-sessions |
Public. The hosted page opens a checkout session from a link (no API key in the browser). |
POST |
/checkout-sessions |
Create a checkout session for the embedded button or hosted checkout (Level 2). |
GET |
/checkout-sessions/{id} |
Read by the hosted checkout. Merchants follow payments through webhooks and /payments. |
POST |
/checkout-sessions/{id}/intent |
After the buyer connects a wallet, return the EIP-712 PaymentIntent signed by Arbiro. |
Payments
| Method | Path | Description |
|---|---|---|
GET |
/payments |
Payments of the account in the key's mode, newest first. |
GET |
/payments/{payment_id} |
One payment with its on-chain state, fee and timeline. |
GET |
/payments/export.csv |
Accounting export of every payment in the key's mode, oldest first. Amounts are exact decimal text with 6 decimals, never floats. |
POST |
/payments/{payment_id}/tracking |
Not available yet (Flow B, physical goods): attach a carrier tracking number for item-not-received coverage. Answers 404 today. |
Delivery evidence
| Method | Path | Description |
|---|---|---|
POST |
/evidence/redeem-token |
Flow A: atomic key-for-product redemption, called by the merchant backend before unlocking the product. |
Disputes
| Method | Path | Description |
|---|---|---|
GET |
/disputes |
The account's disputes in the key's mode, open ones first by evidence deadline (at most 200). |
GET |
/disputes/{dispute_id} |
The merchant (API key) or the buyer (wallet session) of the payment. Others get 404. |
POST |
/disputes/{dispute_id}/evidence |
Presigned direct-to-storage upload for one evidence file (PDF, original .eml, ZIP). The signature covers the declared size, type and SHA-256, so storage rejects any other bytes. Screenshots are not accepted. |
GET |
/disputes/{dispute_id}/evidence |
Evidence of both parties (metadata and verification results, never the content). |
POST |
/disputes/{dispute_id}/evidence/{evidence_id}/complete |
The upload finished. Arbiro verifies the hash and type, checks DKIM, extracts and masks the text. |
POST |
/disputes/{dispute_id}/appeal |
Appeal a proposed verdict within the appeal window (EU AI Act Art. 14). Sends it to human review. |
Webhooks and events
| Method | Path | Description |
|---|---|---|
POST |
/webhook-endpoints |
Register a webhook URL. HTTPS only in Live Mode; private, loopback and link-local targets are rejected (SSRF guard). |
GET |
/webhook-endpoints |
Webhook endpoints of the account in the key's mode. |
DELETE |
/webhook-endpoints/{endpoint_id} |
Disable the endpoint. Pending deliveries are dropped. |
POST |
/webhook-endpoints/{endpoint_id}/test |
Emit a synthetic payment.locked event to the subscribed endpoints of this mode. |
GET |
/webhook-endpoints/{endpoint_id}/deliveries |
Last 100 delivery attempts (dashboard log). |
GET |
/events |
Events of the key's account and mode, newest first. arbiro listen polls it with ending_before. |
GET |
/events/{event_id} |
One event, exactly as delivered. |
POST |
/events/trigger |
Test Mode only. Record a synthetic event (zero payment id, reference arbiro_trigger) and deliver it to the subscribed endpoints. It only notifies: no payment, dispute or transaction is created. |
System
| Method | Path | Description |
|---|---|---|
GET |
/health |
Readiness. Status of the service and its dependencies. |
GET |
/health/live |
Liveness only (no dependencies). Used by the load balancer and ECS health checks. |
Aggiornato il