Procurement API
Payments
Track payment state and settlement references for procurement transactions without exposing sensitive payment credentials.
createdPayment created
authorizedAuthorized
capturedFunds captured
settledFunds settled
completedComplete
Payment lifecycle
Procurement payment records describe payment state and reconciliation references. Sensitive payment credentials remain with the configured payment provider and are never exposed through the Procurement API.
Payment status
| Status | Meaning | Can transition to |
|---|---|---|
| created | Payment record created | authorized, failed |
| authorized | Payment authorized | captured, cancelled |
| captured | Funds captured | settled, refunded |
| settled | Funds settled | completed, refunded |
| completed | Final state | refunded |
| failed | Payment failed | — |
Settlement references
| Field | Purpose |
|---|---|
| payment_id | Mediloop payment identifier |
| provider_reference | Underlying provider reference |
| invoice_id | Associated procurement invoice |
| purchase_order_id | Associated order |
| settled_at | Settlement timestamp |
Reconciliation
Payment
Provider state and captured amount.
Invoice
Amount due and invoice reference.
Reconciled
Commercial transaction matched.
Failures & exceptions
| Condition | Recommended handling |
|---|---|
| authorization_failed | Surface failure without changing procurement order history |
| capture_failed | Allow retry according to payment policy |
| amount_mismatch | Flag invoice/payment reconciliation issue |
| refund_pending | Track asynchronously until final provider state |
Example request
cURLJavaScriptPython
curl "https://api.mediloop.com/v1/procurement/payments/pay_42" \
-H "Authorization: Bearer $MEDILOOP_API_KEY" \
-H "X-Tenant-Id: $TENANT_ID"Get payment status
Response200 OK
{
"id":"pay_42", "status":"settled", "amount":{"amount":208.26,"currency":"EUR"},
"invoice_id":"inv_91", "provider_reference":"pi_..."
}