๐Ÿ“„ Public API Documentation

API Reference#

The AutoPlus public API uses HTTPS and JSON. It provides public AutoPlus statistics and user-authenticated endpoints for opening and automating escrow trades.

Base URL#

Version v1 is currently the only available API version.

Authentication#

Every trade endpoint requires an API token associated with one Discord user. Send it using the bearer authentication scheme:

Authorization: Bearer YOUR_API_TOKEN

Open a support ticket in the AutoPlus Discord server to request an API token. Keep it private and use it only from a trusted server.

The /servers, /stats, and /transactions endpoints do not require authentication.

Request format#

Requests with a body must include Content-Type: application/json.

Discord user IDs, guild IDs, and trade IDs are JSON strings. Timestamps are integer Unix timestamps in seconds. Optional response fields are omitted when they have no value.

Idempotency#

The following endpoints require an Idempotency-Key header:

  • POST /guilds/{guildId}/trades
  • POST /trades/{id}/confirm-action
  • POST /trades/{id}/confirm-claim

The key must contain 8 to 128 characters. Use a unique random value for each new operation. If a request times out, retry the identical request with the same key. Reusing a key with different request data returns 409 Conflict.

Crypto type#

The Crypto type identifies both the asset and, for tokens, its network:

"ltc" | "sol" | "eth" | "bnb" | "btc" | "pol" | "sol_usdt" | "sol_usdc" | "eth_usdt" | "eth_usdc" | "bnb_usdt" | "bnb_usdc" | "pol_usdt" | "pol_usdc" | "pol_usdce"

Availability also depends on the networks currently enabled by AutoPlus.

Trade automation rules#

  • The authenticated user must be the sender or receiver of every trade they access.
  • Route parameter id is the Discord trade thread ID returned by trade creation, not the incremental tradeId.
  • Identification and terms confirmations must repeat the exact values from the latest trade response.
  • Only the sender can release funds. Only the receiver can return funds.
  • Release, return, and claim operations use short-lived confirmation challenges.
  • A successful claim confirmation returns 202 Accepted; poll trade events for the final result.
  • The API can provide a reduction return address when a trade is already in waitingReduceAmountAddress, but it cannot initiate a reduction.

Public Endpoints#

GET

/servers

#

Get the list of Discord servers AutoPlus is in.

Response Structure

Each object in the returned array has this structure:

FieldTypeDescription
idstringDiscord server ID.
namestringDiscord server name.
iconstringServer icon URL.

GET

/stats

#

Get global AutoPlus trade statistics.

Response Structure

FieldTypeDescription
tradesnumberTotal completed and canceled trades.
volumenumberTotal completed and canceled volume in USD.
canceledTradesnumberTotal canceled trades.
canceledVolumenumberTotal canceled volume in USD.
trades24hnumberTrades recorded during the last 24 hours.
volume24hnumberVolume recorded during the last 24 hours in USD.

GET

/transactions

#

Get the 10 most recent public AutoPlus transactions.

Response Structure

Each object in the returned array has this structure:

FieldTypeDescription
cryptoCryptoCrypto used by the trade.
amountnumberTransaction amount in the selected crypto.
amountUsdnumberTransaction amount valued in USD.
txidstringIncoming escrow transaction ID.
txid2stringSettlement transaction ID.
receivedAtnumberTimestamp when escrow received the funds.
closedAtnumberTimestamp when the trade closed.

Authenticated Endpoints#

All endpoints in this section require bearer authentication.

POST

/guilds/{guildId}/trades

#

Create a trade in an API-enabled Discord server.

Requires bearer authentication and an Idempotency-Key header.

Request Structure

FieldTypeDescription
cryptoCryptoCrypto and network used by the trade.
senderstringDiscord user ID of the participant funding escrow.
receiverstringDiscord user ID of the participant receiving released funds.

The authenticated user must be either sender or receiver. Both participants must be different, non-bot members of the guild.

Response Structure โ€” 201 Created

FieldTypeDescription
idstringDiscord thread ID used as {id} in every other trade endpoint.
tradeIdnumberHuman-readable incremental trade number.

GET

/trades/{id}

#

Get the current public representation of a trade.

Requires bearer authentication. The caller must be a participant.

Response โ€” 200 OK

Returns a Trade. The escrow deposit address is exposed only to the sender.

GET

/trades/{id}/events

#

Poll durable trade events using a client-managed offset.

Requires bearer authentication. Maximum two concurrent polls per token and trade.

Query Parameters

FieldTypeDescription
offset?numberLast processed event ID. Omit to receive a current snapshot.
timeout?numberLong-poll timeout in seconds. Defaults to 55 and is capped at 60.

Response Structure โ€” 200 OK

FieldTypeDescription
eventsTradeEvent[]Events after the supplied offset, in chronological order.
nextOffsetnumberOffset to send with the next poll.

An empty events array means the poll timed out without a new event. Repeat the same offset. If retained history expired, the API returns a current trade.snapshot.

PUT

/trades/{id}/identification

#

Select the authenticated user's role after identification was reset.

Valid only while the trade is waiting for identification.

Request Structure

FieldTypeDescription
role"sender" | "receiver"Role assigned to the authenticated user.
revisionnumberCurrent identificationRevision from the trade.

Response โ€” 200 OK

Returns the updated Trade.

POST

/trades/{id}/identification/confirm

#

Confirm the exact current sender and receiver assignment.

Request Structure

FieldTypeDescription
senderstringExact current sender Discord user ID.
receiverstringExact current receiver Discord user ID.
revisionnumberCurrent identificationRevision from the trade.

Response โ€” 200 OK

Returns the updated Trade. After both participants confirm the same revision, the trade moves to waitingTermsAcceptance.

POST

/trades/{id}/identification/reset

#

Clear both role assignments and their confirmations.

Request Structure

FieldTypeDescription
sendernullMust be null.
receivernullMust be null.
revisionnumberCurrent identificationRevision from the trade.

Response โ€” 200 OK

Returns the updated Trade.

PUT

/trades/{id}/terms

#

Set, replace, or clear the authenticated user's terms.

Valid only while the trade is waiting for terms acceptance.

Request Structure

FieldTypeDescription
textstring | nullTerms text, up to 896 characters. Use null to clear it.
versionstringCurrent terms.version from the trade.

Each update creates a new terms version and clears existing confirmations.

Response โ€” 200 OK

Returns the updated Trade.

POST

/trades/{id}/terms/confirm

#

Confirm the complete current terms exactly as returned by the API.

Request Structure

FieldTypeDescription
senderstring | nullExact current sender terms, or null when absent.
receiverstring | nullExact current receiver terms, or null when absent.
versionstringExact current terms version.

Response โ€” 200 OK

Returns the updated Trade. After both participants confirm, the trade moves to waitingReceive. The sender's response then includes the escrow deposit address.

POST

/trades/{id}/action

#

Request a short-lived confirmation challenge for releasing or returning funds.

Valid at waitingAction. Sender may release; receiver may return.

Request Structure

FieldTypeDescription
action"release" | "return"Requested fund action.

Response Structure โ€” 201 Created

FieldTypeDescription
action"release" | "return"Action bound to the challenge.
recipientstringDiscord user ID that will receive the funds.
confirmationCodestringSecret confirmation code valid for 60 seconds.
expiresAtnumberChallenge expiration timestamp.

POST

/trades/{id}/confirm-action

#

Confirm a release or return challenge.

Requires an Idempotency-Key header.

Request Structure

FieldTypeDescription
action"release" | "return"Exact action returned by the challenge.
recipientstringExact recipient returned by the challenge.
confirmationCodestringConfirmation code returned by the challenge.

Response โ€” 200 OK

Returns the updated Trade. Release moves the trade to waitingAddress; return moves it to waitingReturnAddress.

POST

/trades/{id}/claim-funds

#

Request a confirmation challenge for a payout, return, or reduction-return address.

Receiver claims at waitingAddress. Sender claims at waitingReturnAddress or waitingReduceAmountAddress.

Request Structure

FieldTypeDescription
addressstringDestination address valid for the trade crypto.
cryptoCryptoExact crypto value from the trade.

Response Structure โ€” 201 Created

FieldTypeDescription
addressstringAddress bound to the challenge.
cryptoCryptoCrypto bound to the challenge.
confirmationCodestringSecret confirmation code valid for 60 seconds.
expiresAtnumberChallenge expiration timestamp.
btcFeeOptions?BtcFeeOption[]Available fee choices for BTC claims only.

POST

/trades/{id}/confirm-claim

#

Confirm the destination and begin the fund transfer.

Requires an Idempotency-Key header.

Request Structure

FieldTypeDescription
addressstringExact original address returned by the challenge.
cryptoCryptoExact crypto returned by the challenge.
confirmationCodestringConfirmation code returned by the challenge.
btcFee?BtcFeeOne unchanged BTC fee option. Omit for non-BTC trades.

Response Structure โ€” 202 Accepted

FieldTypeDescription
executionIdstringFund execution identifier.
status"pending"The transfer was accepted for asynchronous processing.

Continue polling trade events. trade.fund.execution.updated reports execution progress and trade.closed reports the final release or return.

Response Structures#

Trade#

FieldTypeDescription
idstringDiscord trade thread ID used in API routes.
tradeIdnumberHuman-readable incremental trade number.
revisionnumberCurrent public trade revision.
openedAtnumberTimestamp when the trade opened.
cryptoCryptoCrypto and network selected for the trade.
statusTradeStatusCurrent trade lifecycle status.
sender?stringSender Discord user ID. Omitted while identification is reset.
receiver?stringReceiver Discord user ID. Omitted while identification is reset.
identificationRevisionnumberRevision used for identification updates and confirmations.
identificationConfirmedBystring[]Participant IDs that confirmed the current identification.
terms?TradeTermsCurrent terms and confirmation state.
address?stringEscrow deposit address. Exposed only to the sender.
fees?numberNetwork fees in the selected crypto.
feesUsd?numberEstimated network fees in USD.
amount?numberAmount received by escrow in the selected crypto.
amountUsd?numberReceived amount valued in USD.
receivedAt?numberTimestamp when the deposit was received.
txid?stringIncoming deposit transaction ID.
settlementTxid?stringFinal payout or return transaction ID.
fundControlsLocked?booleanTrue when fund actions are temporarily locked.

TradeStatus#

"waitingIdentification" | "waitingTermsAcceptance" | "waitingReceive" | "waitingConfirmations" | "waitingAction" | "waitingReduceAmountAddress" | "waitingReturnAddress" | "waitingAddress" | "completed"

TradeTerms#

FieldTypeDescription
versionstringOpaque version required for terms updates and confirmations.
senderTradeTermsSideSender terms and confirmation state.
receiverTradeTermsSideReceiver terms and confirmation state.

Each TradeTermsSide contains:

FieldTypeDescription
text?stringTerms text. Omitted when no terms were set.
confirmedbooleanWhether this participant confirmed the current version.
confirmedAt?numberConfirmation timestamp.

TradeEvent#

FieldTypeDescription
idnumberMonotonically increasing event ID within the trade.
typeTradeEventTypeEvent category.
occurredAtnumberTimestamp when the event occurred.
changesTradeEventChangesChanged public fields and optional status or outcome information.
tradeTradeComplete API trade snapshot at this event.
"trade.snapshot" | "trade.created" | "trade.identification.updated" | "trade.terms.updated" | "trade.status.changed" | "trade.fund.execution.updated" | "trade.support.updated" | "trade.closed"

Events are retained for at least one hour. A closed trade may no longer be returned by GET /trades/{id}, but its retained event stream remains available to its participants.

BTC fee types#

FieldTypeDescription
priority"high" | "medium" | "none"Fee priority returned by AutoPlus.
satPerVbytenumberFee rate that must be returned unchanged.
estimatedCostUsdnumberEstimated transfer cost. Present in BtcFeeOption responses only.

Errors#

API errors use the HTTP status code as the primary result and return:

FieldTypeDescription
codestringStable machine-readable error code.
messagestringHuman-readable error description.
requestIdstringRequest identifier to provide when contacting support.
details?objectOptional safe machine-readable context.

Common status codes:

FieldTypeDescription
400Bad RequestMalformed JSON, missing field, or invalid field type.
401UnauthorizedBearer token is missing, invalid, expired, or revoked.
403ForbiddenThe authenticated user or guild cannot perform the operation.
404Not FoundTrade does not exist or the caller is not a participant.
409ConflictWrong state, stale revision, confirmation mismatch, or idempotency conflict.
410GoneConfirmation challenge expired. Request a new challenge.
422Unprocessable ContentInvalid address, crypto, or semantic request data.
429Too Many RequestsA rate or concurrent polling limit was exceeded.
500Internal Server ErrorUnexpected internal failure.
503Service UnavailableA required AutoPlus dependency is unavailable.

On stale_revision or confirmation_mismatch, fetch the trade again and compare the new values before asking the user to confirm them. Never automatically confirm changed roles, terms, recipients, crypto, or addresses.