Python Example
Ce contenu n’est pas encore disponible dans votre langue.
Python Example
Section titled “Python Example”This guide demonstrates how to integrate with all AgentBureau services using Python. Each example handles the full x402 payment flow.
Common Pattern
Section titled “Common Pattern”All scripts follow the updated 4-step x402 pattern:
- Call the endpoint with
Idempotency-Key. - Handle 402 by parsing
PAYMENT-REQUIREDandX-PAYMENT-INTENT-ID. - Pay by sending USDC on Base.
- Sign the intent ID:
AgentBureau Intent: {intent_id}. - Retry with
PAYMENT-SIGNATURE(hash) andPAYMENT-AUTHORIZATION(signature).
Sends a digital fax to a German number.
# Short snippet of the payload and endpointAPI_URL = "https://agentbureau-api.datafortress.cloud/v1/fax"payload = { "recipient_number": "+49123456789", "content": "Hello from Python!"}# ... handle x402 flow ...Letter
Section titled “Letter”Sends a physical letter to a German address.
API_URL = "https://agentbureau-api.datafortress.cloud/v1/letters"payload = { "recipient_address": { "name": "Finanzamt Berlin", "street": "Musterstraße 1", "zip": "10115", "city": "Berlin", "country": "Germany" }, "content_pdf_url": "https://example.com/letter.pdf"}# ... handle x402 flow ...Invoice
Section titled “Invoice”Generates a professional invoice via Lexoffice.
API_URL = "https://agentbureau-api.datafortress.cloud/v1/invoices"payload = { "customer_details": { "name": "Acme Corp", "email": "billing@acme.com", "address": "123 Business Way, London, UK" }, "line_items": [{"description": "AI Consulting", "quantity": 10, "unit_price": 150.00}]}# ... handle x402 flow ...GmbH Formation
Section titled “GmbH Formation”Initiates the German GmbH formation process.
API_URL = "https://agentbureau-api.datafortress.cloud/v1/companies/formations"payload = { "company_name": "Autonomous Ventures GmbH", "shareholders": [{"name": "Alice Agent", "shares": 25000, "address": "Digital Ether 0x123"}]}# ... handle x402 flow ...