API Documentation
Trade Assistance LLC API Documentation
Welcome to the Trade Assistance LLC API! This documentation provides comprehensive information and tools to integrate our secure escrow services directly into your applications, platforms, and marketplaces. By leveraging our API, you can automate transaction initiation, manage escrow statuses, and ensure funds are securely held and disbursed, offering unparalleled trust and confidence to your users.
Base URL: https://api.trade-assistance.biz/v1
Support Email: developer@trade-assistance.biz
Table of Contents
- Getting Started
- Core Concepts
- API Endpoints
- Transactions
POST /transactions
- Create a New Transaction
GET /transactions/{transaction_id}
- Retrieve a Transaction
PUT /transactions/{transaction_id}
- Update a Transaction
POST /transactions/{transaction_id}/accept
- Buyer/Seller Accepts Terms
POST /transactions/{transaction_id}/fund
- Buyer Funds Transaction
POST /transactions/{transaction_id}/ship
- Seller Confirms Shipment
POST /transactions/{transaction_id}/inspect
- Buyer Confirms Inspection/Receipt
POST /transactions/{transaction_id}/release
- Release Funds to Seller
POST /transactions/{transaction_id}/cancel
- Cancel a Transaction
GET /transactions
- List All Transactions
- Webhooks
POST /webhooks
- Register a Webhook Endpoint
GET /webhooks
- List Registered Webhooks
DELETE /webhooks/{webhook_id}
- Deregister a Webhook Endpoint
- Account (for Merchant Partners)
GET /account/balance
- Retrieve Account Balance
POST /account/withdraw
- Initiate Withdrawal
- Webhooks
- Data Models
- Code Examples
1. Getting Started
- Transactions
POST /transactions
- Create a New TransactionGET /transactions/{transaction_id}
- Retrieve a TransactionPUT /transactions/{transaction_id}
- Update a TransactionPOST /transactions/{transaction_id}/accept
- Buyer/Seller Accepts TermsPOST /transactions/{transaction_id}/fund
- Buyer Funds TransactionPOST /transactions/{transaction_id}/ship
- Seller Confirms ShipmentPOST /transactions/{transaction_id}/inspect
- Buyer Confirms Inspection/ReceiptPOST /transactions/{transaction_id}/release
- Release Funds to SellerPOST /transactions/{transaction_id}/cancel
- Cancel a TransactionGET /transactions
- List All Transactions
- Webhooks
POST /webhooks
- Register a Webhook EndpointGET /webhooks
- List Registered WebhooksDELETE /webhooks/{webhook_id}
- Deregister a Webhook Endpoint
- Account (for Merchant Partners)
GET /account/balance
- Retrieve Account BalancePOST /account/withdraw
- Initiate Withdrawal
Our API is designed to be intuitive and powerful, allowing you to seamlessly integrate secure escrow functionality.
Authentication
All API requests to Trade Assistance LLC must be authenticated using API Keys. You can generate and manage your API keys from your Trade Assistance merchant dashboard.
How to Authenticate:
Include your API Key in the Authorization
header of every request, using the Bearer
token scheme.
Example:Authorization: Bearer YOUR_SECRET_API_KEY
Important: Keep your API keys secure. Do not expose them in client-side code or public repositories.
Environments
We offer two environments for development and production:
- Sandbox Environment (Development):
- Base URL:
https://api.sandbox.trade-assistance.biz/v1
- Use this environment for all your development and testing. Transactions in the sandbox environment are simulated and do not involve real funds.
- Base URL:
- Production Environment (Live):
- Base URL:
https://api.trade-assistance.biz/v1
- Use this environment for live transactions once your integration is fully tested and approved by Trade Assistance LLC.
- Base URL:
API Keys
API keys are unique identifiers used to authenticate your application with our API.
- Public Key: Used for client-side operations (e.g., generating payment forms). (Not applicable for this current API which focuses on server-side actions, but good to note for future expansions).
- Secret Key: Used for server-side operations and must be kept confidential. All calls requiring authentication will use your Secret Key.
Rate Limits
To ensure stable performance for all users, our API has rate limits. If you exceed the limits, you will receive a 429 Too Many Requests
error. Current limits are:
- 60 requests per minute per IP address.
If you anticipate needing higher limits, please contact developer@trade-assistance.biz
with your use case.
Errors
Our API uses standard HTTP status codes to indicate the success or failure of an API request.
Status Code | Description |
---|---|
200 OK |
The request was successful. |
201 Created |
The resource was successfully created. |
400 Bad Request |
The request was malformed or invalid. |
401 Unauthorized |
Authentication credentials are missing or invalid. |
403 Forbidden |
You do not have permission to access the resource. |
404 Not Found |
The requested resource could not be found. |
405 Method Not Allowed |
The HTTP method used is not supported for this endpoint. |
409 Conflict |
The request could not be completed due to a conflict (e.g., trying to modify an immutable transaction). |
429 Too Many Requests |
You have sent too many requests in a given amount of time. |
500 Internal Server Error |
An unexpected error occurred on our server. |
Error Response Example:
{
"error": {
"code": "invalid_parameter",
"message": "The 'amount' field is required.",
"field": "amount"
}
}
2. Core Concepts
Understanding these core concepts will help you effectively utilize the Trade Assistance API.
Transactions
A transaction represents the escrow process for a specific item or service. It progresses through various stages (pending, funded, shipped, inspected, released, canceled).
Participants (Buyers & Sellers)
Each transaction involves at least two primary participants: a buyer and a seller. Our system verifies their identities to ensure secure dealings.
Items
The goods or services being transacted. Each transaction can involve one or more items, with details such as description, quantity, and price.
Milestones (for service-based transactions)
For service agreements, transactions can be structured with milestones. Funds are released incrementally as each milestone is completed and approved by the buyer.
Funds
The monetary value held in escrow. Funds are securely held by Trade Assistance LLC until all agreed-upon conditions for release are met.
3. API Endpoints
Transactions
Transactions are the central resource in the Trade Assistance API.
POST /transactions
- Create a New Transaction
Initiates a new escrow transaction. This is the first step to setting up a secure payment.
Request Body:
Field | Type | Required | Description |
---|---|---|---|
buyer |
Object | Yes | Details of the buyer (see Participant Object). |
seller |
Object | Yes | Details of the seller (see Participant Object). |
items |
Array | Yes | List of items/services (see Item Object). |
currency |
String | Yes | The currency of the transaction (e.g., "USD"). |
total_amount |
Number | Yes | The total amount of the transaction. |
description |
String | No | A brief description of the transaction. |
metadata |
Object | No | Custom key-value pairs for your internal reference. |
milestones |
Array | No | For service-based transactions, a list of milestone objects. |
Example Request:
POST /v1/transactions
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"buyer": {
"email": "buyer@example.com",
"name": "John Doe",
"phone": "+15551234567"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith",
"phone": "+15557654321"
},
"items": [
{
"name": "Innovative Software License",
"description": "Perpetual license for software XYZ",
"quantity": 1,
"price": 1500.00
}
],
"currency": "USD",
"total_amount": 1500.00,
"description": "Software purchase transaction"
}
Example Response (201 Created):
{
"id": "txn_abcdef1234567890",
"status": "pending_acceptance",
"buyer": {
"email": "buyer@example.com",
"name": "John Doe"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith"
},
"items": [
{
"name": "Innovative Software License",
"quantity": 1,
"price": 1500.00
}
],
"currency": "USD",
"total_amount": 1500.00,
"created_at": "2025-08-02T17:30:00Z",
"updated_at": "2025-08-02T17:30:00Z"
}
GET /transactions/{transaction_id}
- Retrieve a Transaction
Retrieves the details of a specific transaction by its ID.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction to retrieve. |
Example Request:
GET /v1/transactions/txn_abcdef1234567890
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (200 OK): (Same as POST /transactions
response, with updated status
and updated_at
)
PUT /transactions/{transaction_id}
- Update a Transaction
Allows updates to certain fields of a transaction before it progresses to critical stages (e.g., adding more items if still pending acceptance).
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction to update. |
Request Body: (Partial updates are supported. Only include fields you wish to change.)
Field | Type | Required | Description |
---|---|---|---|
description |
String | No | Updated description of the transaction. |
items |
Array | No | Updated list of items/services. |
total_amount |
Number | No | Updated total amount. |
metadata |
Object | No | Updated custom key-value pairs. |
Example Request:
PUT /v1/transactions/txn_abcdef1234567890
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"description": "Updated: Software purchase with additional support package"
}
POST /transactions/{transaction_id}/accept
- Buyer/Seller Accepts Terms
Marks a participant's acceptance of the transaction terms. Both buyer and seller must accept before the transaction can proceed to funding.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Request Body:
Field | Type | Required | Description |
---|---|---|---|
role |
String | Yes | "buyer" or "seller" |
Example Request:
POST /v1/transactions/txn_abcdef1234567890/accept
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"role": "buyer"
}
Example Response (200 OK):
{
"id": "txn_abcdef1234567890",
"status": "pending_seller_acceptance", // or "pending_funding" if both accepted
"buyer_accepted": true,
"seller_accepted": false,
"updated_at": "2025-08-02T17:35:00Z"
}
POST /transactions/{transaction_id}/fund
- Buyer Funds Transaction
Indicates that the buyer has initiated the payment to the Trade Assistance escrow account. This usually triggers a webhook notification when funds are received.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Request Body:
Field | Type | Required | Description |
---|---|---|---|
amount |
Number | Yes | The amount being funded. Must match total_amount . |
payment_method |
String | Yes | The payment method used (e.g., "wire_transfer", "credit_card"). |
transaction_reference |
String | No | Optional reference from the payment provider. |
Example Request:
POST /v1/transactions/txn_abcdef1234567890/fund
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"amount": 1500.00,
"payment_method": "wire_transfer"
}
Example Response (200 OK):
{
"id": "txn_abcdef1234567890",
"status": "pending_funding_verification",
"funded_amount": 1500.00,
"updated_at": "2025-08-02T17:40:00Z"
}
status
will update to funded
once Trade Assistance verifies receipt of funds.POST /transactions/{transaction_id}/ship
- Seller Confirms Shipment
Notifies Trade Assistance that the seller has shipped/delivered the item or service. Requires tracking information if applicable.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Request Body:
Field | Type | Required | Description |
---|---|---|---|
tracking_number |
String | No | Tracking number for physical goods. |
shipping_carrier |
String | No | Shipping carrier (e.g., "UPS", "FedEx"). |
delivery_confirmation_url |
String | No | URL to confirm digital delivery/service completion. |
Example Request:
POST /v1/transactions/txn_abcdef1234567890/ship
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"tracking_number": "TRK123456789",
"shipping_carrier": "UPS"
}
Example Response (200 OK):
{
"id": "txn_abcdef1234567890",
"status": "shipped",
"tracking_info": {
"number": "TRK123456789",
"carrier": "UPS"
},
"updated_at": "2025-08-02T17:50:00Z"
}
POST /transactions/{transaction_id}/inspect
- Buyer Confirms Inspection/Receipt
Notifies Trade Assistance that the buyer has received and inspected the item/service.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Request Body:
Field | Type | Required | Description |
---|---|---|---|
accepted |
Boolean | Yes | true if buyer accepts, false if buyer rejects. |
notes |
String | No | Optional notes from the buyer regarding inspection. |
Example Request (Acceptance):
POST /v1/transactions/txn_abcdef1234567890/inspect
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"accepted": true,
"notes": "Software received and confirmed working."
}
Example Response (200 OK - Acceptance):
{
"id": "txn_abcdef1234567890",
"status": "buyer_accepted",
"buyer_inspection_status": "accepted",
"updated_at": "2025-08-02T18:00:00Z"
}
Example Request (Rejection):
POST /v1/transactions/txn_abcdef1234567890/inspect
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"accepted": false,
"notes": "Software not as described. Missing features."
}
Example Response (200 OK - Rejection):
{
"id": "txn_abcdef1234567890",
"status": "dispute_initiated",
"buyer_inspection_status": "rejected",
"updated_at": "2025-08-02T18:00:00Z"
}
accepted
is false
, the transaction will enter a dispute resolution process, and funds will not be released automatically.POST /transactions/{transaction_id}/release
- Release Funds to Seller
Explicitly triggers the release of funds to the seller. This endpoint is typically used after the buyer has accepted the item/service.
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Example Request:
POST /v1/transactions/txn_abcdef1234567890/release
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (200 OK):
{
"id": "txn_abcdef1234567890",
"status": "funds_released",
"updated_at": "2025-08-02T18:10:00Z"
}
POST /transactions/{transaction_id}/cancel
- Cancel a Transaction
Cancels a transaction. This can only be done under specific conditions (e.g., before funding or if both parties agree to cancel during a dispute).
Path Parameters:
Parameter | Type | Description |
---|---|---|
transaction_id |
String | The ID of the transaction. |
Request Body: (Optional)
Field | Type | Required | Description |
---|---|---|---|
reason |
String | No | Reason for cancellation. |
Example Request:
POST /v1/transactions/txn_abcdef1234567890/cancel
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"reason": "Buyer no longer interested."
}
Example Response (200 OK):
{
"id": "txn_abcdef1234567890",
"status": "cancelled",
"cancellation_reason": "Buyer no longer interested.",
"updated_at": "2025-08-02T18:15:00Z"
}
GET /transactions
- List All Transactions
Retrieves a paginated list of all transactions associated with your account.
Query Parameters:
Parameter | Type | Description |
---|---|---|
status |
String | Filter by transaction status (e.g., "pending_funding", "funded"). |
buyer_email |
String | Filter by buyer's email. |
seller_email |
String | Filter by seller's email. |
limit |
Integer | Maximum number of results per page (default: 10, max: 100). |
offset |
Integer | Offset for pagination. |
Example Request:
GET /v1/transactions?status=funded&limit=5&offset=0
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (200 OK):
{
"data": [
{
"id": "txn_abcdef1234567890",
"status": "funded",
// ... transaction details ...
},
{
"id": "txn_fedcba0987654321",
"status": "funded",
// ... transaction details ...
}
],
"total_count": 25,
"limit": 5,
"offset": 0
}
Webhooks
Webhooks allow you to receive real-time notifications about important events in your Trade Assistance transactions.
POST /webhooks
- Register a Webhook Endpoint
Registers a URL to receive webhook notifications.
Request Body:
Field | Type | Required | Description |
---|---|---|---|
url |
String | Yes | The URL where webhook events will be sent. |
events |
Array | Yes | List of event types to subscribe to (e.g., ["transaction.created", "transaction.status_updated"]). |
secret |
String | No | An optional secret string for verifying webhook authenticity. |
Example Request:
POST /v1/webhooks
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"url": "https://your-app.com/trade-assistance-webhooks",
"events": ["transaction.status_updated", "transaction.created"],
"secret": "my_webhook_secret_123"
}
Example Response (201 Created):
{
"id": "whk_xyz789",
"url": "https://your-app.com/trade-assistance-webhooks",
"events": ["transaction.status_updated", "transaction.created"],
"created_at": "2025-08-02T18:30:00Z"
}
GET /webhooks
- List Registered Webhooks
Retrieves a list of all webhook endpoints registered to your account.
Example Request:
GET /v1/webhooks
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (200 OK):
{
"data": [
{
"id": "whk_xyz789",
"url": "https://your-app.com/trade-assistance-webhooks",
"events": ["transaction.status_updated", "transaction.created"]
}
]
}
DELETE /webhooks/{webhook_id}
- Deregister a Webhook Endpoint
Removes a registered webhook endpoint.
Path Parameters:
Parameter | Type | Description |
---|---|---|
webhook_id |
String | The ID of the webhook to deregister. |
Example Request:
DELETE /v1/webhooks/whk_xyz789
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (204 No Content): (Indicates successful deletion with no content returned)
Account (for Merchant Partners)
Endpoints for managing your Trade Assistance merchant account.
GET /account/balance
- Retrieve Account Balance
Retrieves the current balance of your Trade Assistance merchant account (e.g., for commission payouts).
Example Request:
GET /v1/account/balance
Authorization: Bearer YOUR_SECRET_API_KEY
Example Response (200 OK):
{
"currency": "USD",
"available_balance": 1250.75,
"pending_balance": 500.00
}
POST /account/withdraw
- Initiate Withdrawal
Requests a withdrawal of funds from your Trade Assistance merchant account to your linked bank account.
Request Body:
Field | Type | Required | Description |
---|---|---|---|
amount |
Number | Yes | The amount to withdraw. |
currency |
String | Yes | The currency of the withdrawal (e.g., "USD"). |
bank_account_id |
String | Yes | Your linked bank account ID for withdrawal. (This would be set up via a separate process on the Trade Assistance platform). |
Example Request:
POST /v1/account/withdraw
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
{
"amount": 1000.00,
"currency": "USD",
"bank_account_id": "ba_1a2b3c4d5e"
}
Example Response (200 OK):
{
"id": "wdr_ghijklmno",
"amount": 1000.00,
"currency": "USD",
"status": "pending_withdrawal",
"requested_at": "2025-08-02T18:45:00Z"
}
4. Webhooks
Webhooks provide an automated way to receive notifications about events related to your transactions.
Webhook Events
Trade Assistance LLC sends the following webhook events:
Event Type | Description |
---|---|
transaction.created |
A new transaction has been created. |
transaction.status_updated |
The status of a transaction has changed. |
transaction.funded |
Funds have been successfully received for a transaction. |
transaction.shipped |
The seller has confirmed shipment. |
transaction.buyer_accepted |
The buyer has accepted the item/service. |
transaction.funds_released |
Funds have been released to the seller. |
transaction.cancelled |
A transaction has been cancelled. |
transaction.dispute_initiated |
A dispute has been initiated for a transaction. |
account.withdrawal_processed |
A withdrawal from your account has been processed. |
Webhook Payload Example (transaction.status_updated
):
{
"event_id": "evt_1234567890",
"event_type": "transaction.status_updated",
"timestamp": "2025-08-02T18:00:00Z",
"data": {
"id": "txn_abcdef1234567890",
"status": "buyer_accepted",
"old_status": "shipped",
"buyer": {
"email": "buyer@example.com"
},
"seller": {
"email": "seller@example.com"
},
"total_amount": 1500.00,
"currency": "USD",
"updated_at": "2025-08-02T18:00:00Z"
}
}
Verifying Webhook Signatures
For security, we recommend verifying the signature of incoming webhooks to ensure they originate from Trade Assistance LLC and haven't been tampered with.
When you register a webhook, you can provide a secret
. For each webhook request, we will include a X-Trade-Assistance-Signature
header. This signature is an HMAC-SHA256 hash of the request body, using your webhook secret as the key.
Verification Steps:
- Retrieve the
X-Trade-Assistance-Signature
header from the incoming request. - Compute the HMAC-SHA256 hash of the raw request body using your webhook
secret
. - Compare your computed hash with the signature from the header. If they match, the webhook is valid.
Example (Python):
import hmac
import hashlib
import json
WEBHOOK_SECRET = "my_webhook_secret_123" # Your secret from webhook registration
def verify_webhook_signature(payload, signature_header, secret):
# Ensure payload is bytes
if isinstance(payload, str):
payload = payload.encode('utf-8')
# Ensure secret is bytes
if isinstance(secret, str):
secret = secret.encode('utf-8')
computed_signature = hmac.new(secret, payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(computed_signature, signature_header)
# Example usage (assuming you received payload_str and signature_from_header)
# payload_str = request.data.decode('utf-8') # Get raw request body
# signature_from_header = request.headers.get('X-Trade-Assistance-Signature')
# if verify_webhook_signature(payload_str, signature_from_header, WEBHOOK_SECRET):
# print("Webhook signature verified successfully!")
# event = json.loads(payload_str)
# # Process event
# else:
# print("Webhook signature verification failed!")
# # Reject request
5. Data Models
Transaction Object
Field | Type | Description |
---|---|---|
id |
String | Unique identifier for the transaction. |
status |
String | Current status of the transaction. Possible values: pending_acceptance , pending_seller_acceptance , pending_funding_verification , funded , shipped , buyer_accepted , dispute_initiated , funds_released , cancelled . |
buyer |
Object | Details of the buyer (see Participant Object). |
seller |
Object | Details of the seller (see Participant Object). |
items |
Array | List of items (see Item Object). |
currency |
String | Currency of the transaction (e.g., "USD"). |
total_amount |
Number | Total value of the transaction. |
funded_amount |
Number | The amount of funds received in escrow. |
description |
String | Description of the transaction. |
buyer_accepted |
Boolean | True if buyer has accepted terms. |
seller_accepted |
Boolean | True if seller has accepted terms. |
buyer_inspection_status |
String | Status of buyer's inspection (accepted , rejected , pending ). |
tracking_info |
Object | Object containing number and carrier if applicable. |
cancellation_reason |
String | Reason for cancellation, if applicable. |
metadata |
Object | Custom metadata. |
created_at |
DateTime | Timestamp of transaction creation. |
updated_at |
DateTime | Timestamp of last update. |
Item Object
Field | Type | Description |
---|---|---|
name |
String | Name of the item or service. |
description |
String | Detailed description of the item/service. |
quantity |
Integer | Quantity of the item. |
price |
Number | Unit price of the item. |
total_price |
Number | quantity * price for convenience. |
Participant Object
Field | Type | Description |
---|---|---|
email |
String | Email address of the participant. |
name |
String | Full name of the participant. |
phone |
String | Phone number of the participant. |
address |
Object | Optional: Physical address details. |
Error Object
Field | Type | Description |
---|---|---|
code |
String | A unique code for the error type. |
message |
String | A human-readable description of the error. |
field |
String | Optional: The specific field that caused the error. |
6. Code Examples
Creating a Transaction
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"buyer": {
"email": "buyer@example.com",
"name": "John Doe"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith"
},
"items": [
{
"name": "Custom Website Development",
"description": "Full-stack website development service.",
"quantity": 1,
"price": 5000.00
}
],
"currency": "USD",
"total_amount": 5000.00,
"description": "Website development project"
}'
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
transaction_data = {
"buyer": {
"email": "buyer@example.com",
"name": "John Doe",
"phone": "+15551234567"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith",
"phone": "+15557654321"
},
"items": [
{
"name": "Custom Website Development",
"description": "Full-stack website development service.",
"quantity": 1,
"price": 5000.00
}
],
"currency": "USD",
"total_amount": 5000.00,
"description": "Website development project"
}
response = requests.post(f"{BASE_URL}/transactions", headers=headers, data=json.dumps(transaction_data))
if response.status_code == 201:
print("Transaction created successfully:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error creating transaction: {response.status_code}")
print(response.text)
Node.js (using axios
):
const axios = require('axios');
const API_KEY = "YOUR_SECRET_API_KEY";
const BASE_URL = "https://api.trade-assistance.biz/v1";
const headers = {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
};
const transactionData = {
buyer: {
email: "buyer@example.com",
name: "John Doe",
phone: "+15551234567"
},
seller: {
email: "seller@example.com",
name: "Jane Smith",
phone: "+15557654321"
},
items: [
{
name: "Custom Website Development",
description: "Full-stack website development service.",
quantity: 1,
price: 5000.00
}
],
currency: "USD",
total_amount: 5000.00,
description: "Website development project"
};
axios.post(`${BASE_URL}/transactions`, transactionData, { headers })
.then(response => {
console.log("Transaction created successfully:");
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error(`Error creating transaction: ${error.response ? error.response.status : error.message}`);
if (error.response) {
console.error(error.response.data);
}
});
Funding a Transaction
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/fund \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000.00,
"payment_method": "wire_transfer"
}'
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
fund_data = {
"amount": 5000.00,
"payment_method": "wire_transfer"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/fund", headers=headers, data=json.dumps(fund_data))
if response.status_code == 200:
print("Transaction funding initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error funding transaction: {response.status_code}")
print(response.text)
Releasing Funds
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/release \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json"
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/release", headers=headers)
if response.status_code == 200:
print("Funds release initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error releasing funds: {response.status_code}")
print(response.text)
curl -X POST https://api.trade-assistance.biz/v1/transactions \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"buyer": {
"email": "buyer@example.com",
"name": "John Doe"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith"
},
"items": [
{
"name": "Custom Website Development",
"description": "Full-stack website development service.",
"quantity": 1,
"price": 5000.00
}
],
"currency": "USD",
"total_amount": 5000.00,
"description": "Website development project"
}'
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
transaction_data = {
"buyer": {
"email": "buyer@example.com",
"name": "John Doe",
"phone": "+15551234567"
},
"seller": {
"email": "seller@example.com",
"name": "Jane Smith",
"phone": "+15557654321"
},
"items": [
{
"name": "Custom Website Development",
"description": "Full-stack website development service.",
"quantity": 1,
"price": 5000.00
}
],
"currency": "USD",
"total_amount": 5000.00,
"description": "Website development project"
}
response = requests.post(f"{BASE_URL}/transactions", headers=headers, data=json.dumps(transaction_data))
if response.status_code == 201:
print("Transaction created successfully:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error creating transaction: {response.status_code}")
print(response.text)
Node.js (using axios
):
const axios = require('axios');
const API_KEY = "YOUR_SECRET_API_KEY";
const BASE_URL = "https://api.trade-assistance.biz/v1";
const headers = {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
};
const transactionData = {
buyer: {
email: "buyer@example.com",
name: "John Doe",
phone: "+15551234567"
},
seller: {
email: "seller@example.com",
name: "Jane Smith",
phone: "+15557654321"
},
items: [
{
name: "Custom Website Development",
description: "Full-stack website development service.",
quantity: 1,
price: 5000.00
}
],
currency: "USD",
total_amount: 5000.00,
description: "Website development project"
};
axios.post(`${BASE_URL}/transactions`, transactionData, { headers })
.then(response => {
console.log("Transaction created successfully:");
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error(`Error creating transaction: ${error.response ? error.response.status : error.message}`);
if (error.response) {
console.error(error.response.data);
}
});
Funding a Transaction
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/fund \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000.00,
"payment_method": "wire_transfer"
}'
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
fund_data = {
"amount": 5000.00,
"payment_method": "wire_transfer"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/fund", headers=headers, data=json.dumps(fund_data))
if response.status_code == 200:
print("Transaction funding initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error funding transaction: {response.status_code}")
print(response.text)
Releasing Funds
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/release \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json"
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/release", headers=headers)
if response.status_code == 200:
print("Funds release initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error releasing funds: {response.status_code}")
print(response.text)
const axios = require('axios');
const API_KEY = "YOUR_SECRET_API_KEY";
const BASE_URL = "https://api.trade-assistance.biz/v1";
const headers = {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
};
const transactionData = {
buyer: {
email: "buyer@example.com",
name: "John Doe",
phone: "+15551234567"
},
seller: {
email: "seller@example.com",
name: "Jane Smith",
phone: "+15557654321"
},
items: [
{
name: "Custom Website Development",
description: "Full-stack website development service.",
quantity: 1,
price: 5000.00
}
],
currency: "USD",
total_amount: 5000.00,
description: "Website development project"
};
axios.post(`${BASE_URL}/transactions`, transactionData, { headers })
.then(response => {
console.log("Transaction created successfully:");
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error(`Error creating transaction: ${error.response ? error.response.status : error.message}`);
if (error.response) {
console.error(error.response.data);
}
});
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/fund \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000.00,
"payment_method": "wire_transfer"
}'
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
fund_data = {
"amount": 5000.00,
"payment_method": "wire_transfer"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/fund", headers=headers, data=json.dumps(fund_data))
if response.status_code == 200:
print("Transaction funding initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error funding transaction: {response.status_code}")
print(response.text)
Releasing Funds
cURL:
curl -X POST https://api.trade-assistance.biz/v1/transactions/txn_abcdef1234567890/release \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json"
Python:
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/release", headers=headers)
if response.status_code == 200:
print("Funds release initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error releasing funds: {response.status_code}")
print(response.text)
import requests
import json
API_KEY = "YOUR_SECRET_API_KEY"
BASE_URL = "https://api.trade-assistance.biz/v1"
TRANSACTION_ID = "txn_abcdef1234567890"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(f"{BASE_URL}/transactions/{TRANSACTION_ID}/release", headers=headers)
if response.status_code == 200:
print("Funds release initiated:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error releasing funds: {response.status_code}")
print(response.text)