Skip to content

devdraftengineer/devdraft-sdk-python

Repository files navigation

Devdraft Python SDK

The official Python SDK for the Devdraft Payment & Business Management API.

Installation

From PyPI (Recommended)

pip install devdraft-ai-sdk

From Source

# Clone the repository
git clone https://github.com/devraftengineer/devdraft-sdk-python.git

# Navigate to the project directory
cd devdraft-sdk-python

# Install the package
pip install -e .

Quick Start

Basic Setup

from devdraft_ai_sdk import ApiClient, Configuration
from devdraft_ai_sdk.api import DefaultApi

# Configure API client
configuration = Configuration(
    host = "https://api.devdraft.ai/v1"
)
configuration.api_key['Authorization'] = 'YOUR_API_KEY'

# Create API client
api_client = ApiClient(configuration)
api = DefaultApi(api_client)

Example: Create a Payment Intent

from devdraft_ai_sdk.models import CreateStablePaymentIntentDto

# Create a payment intent
payment_intent = CreateStablePaymentIntentDto(
    amount=100.00,
    currency="USD",
    description="Payment for services"
)

try:
    response = api.create_payment_intent(payment_intent)
    print(f"Payment Intent created: {response.id}")
except Exception as e:
    print(f"Error creating payment intent: {e}")

Example: Get Account Balance

try:
    balance = api.get_balance()
    print(f"Current balance: {balance.amount} {balance.currency}")
except Exception as e:
    print(f"Error getting balance: {e}")

Example: Create a Customer

from devdraft_ai_sdk.models import CreateCustomerDto

customer = CreateCustomerDto(
    email="customer@example.com",
    name="John Doe"
)

try:
    response = api.create_customer(customer)
    print(f"Customer created: {response.id}")
except Exception as e:
    print(f"Error creating customer: {e}")

Features

  • Full support for all Devdraft API endpoints
  • Automatic request/response serialization
  • Built-in error handling
  • Type hints for better IDE support
  • Comprehensive documentation

Requirements

  • Python 3.6+
  • urllib3 >= 1.15
  • six >= 1.10
  • certifi
  • python-dateutil

Development

Setting up the development environment

# Clone the repository
git clone https://github.com/devraftengineer/devdraft-sdk-python.git

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -r requirements.txt
pip install -r test-requirements.txt

Running tests

# Run all tests
python -m pytest

# Run specific test file
python -m pytest test/test_payment_intents_api.py

Documentation

For detailed API documentation, please visit our API Documentation.

Support

If you need help or have questions, please:

License

This SDK is licensed under the MIT License. See the LICENSE file for details.

devdraft-ai-python-sdk

A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import devdraft_ai_sdk 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import devdraft_ai_sdk

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import devdraft_ai_sdk
from devdraft_ai_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = devdraft_ai_sdk.APIHealthApi(devdraft_ai_sdk.ApiClient(configuration))

try:
    # Authenticated health check endpoint
    api_response = api_instance.health_controller_check_v0()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIHealthApi->health_controller_check_v0: %s\n" % e)

# create an instance of the API class
api_instance = devdraft_ai_sdk.APIHealthApi(devdraft_ai_sdk.ApiClient(configuration))

try:
    # Public health check endpoint
    api_response = api_instance.health_controller_public_health_check_v0()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling APIHealthApi->health_controller_public_health_check_v0: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.devdraft.ai

Class Method HTTP request Description
APIHealthApi health_controller_check_v0 GET /api/v0/health Authenticated health check endpoint
APIHealthApi health_controller_public_health_check_v0 GET /api/v0/health/public Public health check endpoint
AppBalancesApi balance_controller_get_all_balances GET /api/v0/balance Get all stablecoin balances for an app
AppBalancesApi balance_controller_get_eurc_balance GET /api/v0/balance/eurc Get EURC balance for an app
AppBalancesApi balance_controller_get_usdc_balance GET /api/v0/balance/usdc Get USDC balance for an app
CustomersApi customer_controller_create POST /api/v0/customers Create a new customer
CustomersApi customer_controller_find_all GET /api/v0/customers Get all customers with filters
CustomersApi customer_controller_find_one GET /api/v0/customers/{id} Get a customer by ID
CustomersApi customer_controller_update PATCH /api/v0/customers/{id} Update a customer
ExchangeRatesApi exchange_rate_controller_get_eurto_usd_rate GET /api/v0/exchange-rate/eur-to-usd Get EUR to USD exchange rate
ExchangeRatesApi exchange_rate_controller_get_exchange_rate GET /api/v0/exchange-rate Get exchange rate between specified currencies
ExchangeRatesApi exchange_rate_controller_get_usdto_eur_rate GET /api/v0/exchange-rate/usd-to-eur Get USD to EUR exchange rate
InvoicesApi invoice_controller_create POST /api/v0/invoices Create a new invoice
InvoicesApi invoice_controller_find_all GET /api/v0/invoices Get all invoices
InvoicesApi invoice_controller_find_one GET /api/v0/invoices/{id} Get an invoice by ID
InvoicesApi invoice_controller_update PUT /api/v0/invoices/{id} Update an invoice
LiquidationAddressesApi liquidation_address_controller_create_liquidation_address POST /api/v0/customers/{customerId}/liquidation_addresses Create a new liquidation address for a customer
LiquidationAddressesApi liquidation_address_controller_get_liquidation_address GET /api/v0/customers/{customerId}/liquidation_addresses/{liquidationAddressId} Get a specific liquidation address
LiquidationAddressesApi liquidation_address_controller_get_liquidation_addresses GET /api/v0/customers/{customerId}/liquidation_addresses Get all liquidation addresses for a customer
PaymentIntentsApi payment_intent_controller_create_bank_payment_intent POST /api/v0/payment-intents/bank Create a bank payment intent
PaymentIntentsApi payment_intent_controller_create_stable_payment_intent POST /api/v0/payment-intents/stablecoin Create a stable payment intent
PaymentLinksApi payment_links_controller_create POST /api/v0/payment-links Create a new payment link
PaymentLinksApi payment_links_controller_find_all GET /api/v0/payment-links Get all payment links
PaymentLinksApi payment_links_controller_find_one GET /api/v0/payment-links/{id} Get a payment link by ID
PaymentLinksApi payment_links_controller_update PUT /api/v0/payment-links/{id} Update a payment link
ProductsApi product_controller_create POST /api/v0/products Create a new product
ProductsApi product_controller_find_all GET /api/v0/products Get all products
ProductsApi product_controller_find_one GET /api/v0/products/{id} Get a product by ID
ProductsApi product_controller_remove DELETE /api/v0/products/{id} Delete a product
ProductsApi product_controller_update PUT /api/v0/products/{id} Update a product
ProductsApi product_controller_upload_image POST /api/v0/products/{id}/images Upload images for a product
TaxesApi tax_controller_create POST /api/v0/taxes Create a new tax
TaxesApi tax_controller_find_all GET /api/v0/taxes Get all taxes
TaxesApi tax_controller_find_one GET /api/v0/taxes/{id} Get a tax by ID
TaxesApi tax_controller_remove DELETE /api/v0/taxes/{id} Delete a tax
TaxesApi tax_controller_update PUT /api/v0/taxes/{id} Update a tax
TestPaymentsApi test_payment_controller_create_payment_v0 POST /api/v0/test-payment Process a test payment
TestPaymentsApi test_payment_controller_get_payment_v0 GET /api/v0/test-payment/{id} Get payment details by ID
TestPaymentsApi test_payment_controller_refund_payment_v0 POST /api/v0/test-payment/{id}/refund Refund a payment
TransfersApi transfer_controller_create_direct_bank_transfer POST /api/v0/transfers/direct-bank Create a direct bank transfer
TransfersApi transfer_controller_create_direct_wallet_transfer POST /api/v0/transfers/direct-wallet Create a direct wallet transfer
TransfersApi transfer_controller_create_stablecoin_conversion POST /api/v0/transfers/stablecoin-conversion Create a stablecoin conversion
WalletsApi wallet_controller_get_wallets GET /api/v0/wallets Get wallets for an app
WebhooksApi webhook_controller_create POST /api/v0/webhooks Create a new webhook
WebhooksApi webhook_controller_find_all GET /api/v0/webhooks Get all webhooks
WebhooksApi webhook_controller_find_one GET /api/v0/webhooks/{id} Get a webhook by id
WebhooksApi webhook_controller_remove DELETE /api/v0/webhooks/{id} Delete a webhook
WebhooksApi webhook_controller_update PATCH /api/v0/webhooks/{id} Update a webhook

Documentation For Models

Documentation For Authorization

idempotency-key

  • Type: API key
  • API key parameter name: idempotency-key
  • Location: HTTP header

x-client-key

  • Type: API key
  • API key parameter name: x-client-key
  • Location: HTTP header

x-client-secret

  • Type: API key
  • API key parameter name: x-client-secret
  • Location: HTTP header

Author

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published