arcpaykit
Official ArcPay Python SDK for accepting stablecoin payments.
Installation
pip install arcpaykit
Quick Start
Get started in 5 minutes:
from arcpaykit import ArcPay
# Initialize the client
arcpay = ArcPay("your-api-key")
# Verify API connectivity
ping = arcpay.ping()
print(ping["status"]) # "ok"
# Create a payment (happy path - recommended)
payment = arcpay.payments.create(
amount="100.00",
currency="USDC",
description="Payment for order #123",
customer_email="customer@example.com"
)
# Redirect customer to checkout
print(payment["checkout_url"]) # https://arcpay.systems/checkout/pay_...
# That's it! ArcPay handles:
# - Merchant wallet (uses your default)
# - Test/live mode (inferred from API key)
# - Payment chain (inferred automatically)
# - Settlement currency (defaults to USDC)
No need to configure:
- ❌ Merchant wallet (uses your default)
- ❌ Test/live mode (inferred from API key:
sk_arc_test_vssk_arc_live_) - ❌ Payment chain ID (inferred automatically)
- ❌ Settlement currency (defaults to USDC)
For advanced use cases, see payments.create_advanced() below.
API Reference
ArcPay
Main SDK class.
Constructor
ArcPay(api_key: str, base_url: str = "https://arcpay.systems")
api_key: Your ArcPay API keybase_url: Optional base URL (defaults tohttps://arcpay.systems)
ping()
Verify API connectivity.
result = arcpay.ping()
# {"status": "ok", "timestamp": "2024-01-02T10:00:00.000Z"}
Payments
create(...) -> dict
Create a new payment (happy path - recommended for most users).
Most users should use this method. It only requires essential fields. All advanced fields are inferred automatically.
Parameters:
amount(str, required): Payment amount (e.g., "100.00")currency(str, optional): Payment currency (default: "USDC")description(str, optional): Payment descriptioncustomer_email(str, optional): Customer email address
Example:
payment = arcpay.payments.create(
amount="100.00",
currency="USDC",
description="Order #123",
customer_email="customer@example.com"
)
create_advanced(...) -> dict
Create a new payment with full control (advanced users only).
Most users should use payments.create() instead. This method allows full control over all payment parameters.
Parameters:
amount(str, required): Payment amount (e.g., "100.00")merchant_wallet(str, optional): Merchant wallet address (uses default if not provided)currency(str, optional): Payment currency (default: "USDC")settlement_currency(str, optional): Settlement currency ("USDC" or "EURC")payment_asset(str, optional): Specific asset identifierpayment_chain_id(int, optional): Chain ID for paymentconversion_path(str, optional): Conversion path JSON stringestimated_fees(str, optional): Estimated feesdescription(str, optional): Payment descriptioncustomer_email(str, optional): Customer email addressexpires_in_minutes(int, optional): Expiration time in minutesis_test(bool, optional): Test mode flag (inferred from API key if not provided)gas_sponsored(bool, optional): Gas sponsorship preference
Returns:
{
"id": "pay_...",
"status": "pending",
"checkout_url": "https://arcpay.systems/checkout/pay_...",
"amount": 100.00,
"currency": "USDC",
"merchantWallet": "0x...",
"expiresAt": "2024-...",
"createdAt": "2024-..."
}
retrieve(payment_id: str) -> dict
Retrieve a payment by ID.
submit_tx(...) -> dict
Submit a transaction hash for a payment.
Parameters:
payment_id(str, required): Payment IDtx_hash(str, required): Transaction hashpayer_wallet(str, required): Payer wallet addresscustomer_email(str, optional): Customer emailcustomer_name(str, optional): Customer namegas_sponsored(bool, optional): Gas sponsorship preference
confirm(...) -> dict
Confirm a payment (legacy endpoint).
fail(payment_id: str, reason: str = None) -> dict
Mark a payment as failed.
expire(payment_id: str) -> dict
Expire a payment.
Examples
Create and Track a Payment
from arcpaykit import ArcPay
import os
# Initialize with API key from environment
arcpay = ArcPay(os.getenv("ARCPAY_API_KEY"))
# Verify connectivity first
ping = arcpay.ping()
if ping["status"] != "ok":
raise Exception("Cannot connect to ArcPay API")
# Create payment (simple - recommended)
payment = arcpay.payments.create(
amount="50.00",
currency="USDC",
description="Monthly subscription",
customer_email="customer@example.com"
)
print(f"Payment created: {payment['id']}")
print(f"Checkout URL: {payment['checkout_url']}")
# Redirect customer (in your web framework)
# return redirect(payment['checkout_url'])
# Later, check payment status
status = arcpay.payments.retrieve(payment["id"])
print(f"Payment status: {status['status']}")
Advanced Payment Creation
For full control over payment parameters:
payment = arcpay.payments.create_advanced(
amount="50.00",
merchant_wallet="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
currency="USDC",
settlement_currency="EURC",
payment_asset="USDC_BASE",
payment_chain_id=8453,
description="Monthly subscription",
customer_email="customer@example.com",
expires_in_minutes=30,
is_test=False,
gas_sponsored=True
)
Using Custom Base URL
arcpay = ArcPay(
"your-api-key",
base_url="https://staging.arcpay.systems"
)
Error Handling
The SDK raises ArcPayError for failed requests:
from arcpaykit import ArcPay, ArcPayError
try:
payment = arcpay.payments.create(...)
except ArcPayError as e:
print(f"Payment creation failed: {e}")
REST API
The SDK is a thin wrapper around the ArcPay REST API. You can also use the REST API directly if needed. See the ArcPay API documentation for more details.
Support
License
MIT
Metadata
Release files for arcpaykit 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| arcpaykit-0.3.0.tar.gz | 9.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arcpaykit-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.3 kB
Release files / arcpaykit-0.3.0.tar.gz
| Download URL | arcpaykit-0.3.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
201f02606cdff08896d42a1a98bf81e2304e0b18d94718458d4b666e4a6d78c6
|
|
BLAKE2b-256 checksum How to use checksums |
8141d20692671b563117204c9662513b4761d8d4c408f0092ac48734686d337b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / arcpaykit-0.3.0-py3-none-any.whl
| Download URL | arcpaykit-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
779fa4e6720979c5dc02fa2aabd5d8fe858b69115298e369a5cfaea86f8ff4f7
|
|
BLAKE2b-256 checksum How to use checksums |
170ba6a043fb34112547fa4bcd2ce28417852911fbdaf4f4423fc6f615e2e2dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for arcpaykit 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.