Quick Start Guide

Get your first atomic transfer running in under 5 minutes. This guide covers authentication, basic transfers, and error handling.

Prerequisites

  • XferAPI account (contact us for early access)
  • API key and secret
  • Node.js 16+ or Python 3.8+ (for examples)
1

Get Early Access

XferAPI is currently in private beta. Contact our team to get your API credentials and start building.

2

Authentication

Once you have your credentials, authenticate your requests using API key authentication.

Authentication Example
curl
curl -X POST https://api.xferapi.com/api/v1/auth \ -H "Content-Type: application/json" \ -d '{ "api_key": "your_api_key", "api_secret": "your_api_secret" }'
3

Your First Transfer

Create your first atomic transfer between two accounts. This example transfers 100 credits from user_123 to user_456.

Basic Transfer
curl
curl -X POST https://api.xferapi.com/api/v1/transfer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer your_access_token" \ -d '{ "TransferId": "txn_001", "UseHalfSuccess": true, "FromAccounts": [{ "AccountId": "user_123", "ItemType": "credits", "Amount": 100, "ChangeType": "debit", "Comment": "Transfer to user_456" }], "ToAccounts": [{ "AccountId": "user_456", "ItemType": "credits", "Amount": 100, "ChangeType": "credit", "Comment": "Transfer from user_123" }], "TransferScene": "user_to_user", "Comment": "User credit transfer" }'
4

Handle the Response

Check the response to ensure your transfer was successful. A successful transfer returns no error.

Success Response
json
{ "error": null, "transfer_id": "txn_001", "status": "completed", "timestamp": "2024-01-15T10:30:00Z" }

If there's an error, you'll receive detailed error information:

Error Response
json
{ "error": "InsufficientAmountErr", "message": "Account user_123 has insufficient balance", "error_code": "E001", "transfer_id": "txn_001" }
5

Rollback if Needed

If you need to rollback a transfer (within the allowed time window), use the rollback endpoint.

Rollback Transfer
curl
curl -X POST https://api.xferapi.com/api/v1/rollback \ -H "Content-Type: application/json" \ -H "Authorization: Bearer your_access_token" \ -d '{ "TransferId": "txn_001", "TransferScene": "user_to_user" }'

Key Features You Just Used

Atomic Operations

Either all parts of your transfer succeed, or none do. No partial transfers ever.

Half-Success Support

Advanced error handling that maximizes success rates while maintaining consistency.

What's Next?

Explore the full API Reference

Complete documentation for all endpoints and parameters.

Learn common use cases

Real-world examples for gaming, e-commerce, and more.

Use our SDKs

Official libraries for faster integration.