Queries
Read calls are signed GET requests: no body, no encryption, the query string is part of the signature. They are safe to call at any frequency within the rate limit and are the tool for every "outcome unknown" situation described in Errors.
Methods
| Purpose | Go | JavaScript | Python | PHP | Java |
|---|---|---|---|---|---|
| Payment by platform number | QueryPaymentByOrderNo | queryPaymentByOrderNo | query_payment_by_order_no | queryPaymentByOrderNo | queryPaymentByOrderNo |
| Payment by your number | QueryPaymentByMerchantOrderNo | queryPaymentByMerchantOrderNo | query_payment_by_merchant_order_no | queryPaymentByMerchantOrderNo | queryPaymentByMerchantOrderNo |
| Payout by platform number | QueryPayoutByOrderNo | queryPayoutByOrderNo | query_payout_by_order_no | queryPayoutByOrderNo | queryPayoutByOrderNo |
| Payout by your number | QueryPayoutByMerchantOrderNo | queryPayoutByMerchantOrderNo | query_payout_by_merchant_order_no | queryPayoutByMerchantOrderNo | queryPayoutByMerchantOrderNo |
| Balance | GetBalance(currency) | getBalance(currency) | get_balance(currency) | getBalance($currency) | getBalance(currency) |
| USD rate | GetUSDRate(currency, payMethod) | getUsdRate(currency, payMethod) | get_usd_rate(currency, pay_method) | getUsdRate($currency, $payMethod) | getUsdRate(currency, payMethod) |
| Payout receipt | GetPayoutReceipt(orderNo) | getPayoutReceipt(orderNo) | get_payout_receipt(order_no) | getPayoutReceipt($orderNo) | getPayoutReceipt(orderNo) |
A blank argument is rejected locally as a request error. An order that does not exist comes back as an API error with msg ORDER_NOT_FOUND.
Query an order
- Go
- JavaScript
- Python
- PHP
- Java
order, err := c.QueryPaymentByMerchantOrderNo(ctx, "M202605060001")
if apiErr, ok := deepayment.AsAPIError(err); ok && apiErr.Msg == deepayment.MsgOrderNotFound {
// the number was never used: safe to create with it
}
import { APIError, MSG } from '@support-deepayment/sdk';
try {
const order = await client.queryPaymentByMerchantOrderNo('M202605060001');
} catch (err) {
if (err instanceof APIError && err.msg === MSG.ORDER_NOT_FOUND) {
// the number was never used: safe to create with it
}
}
from deepayment import APIError
from deepayment.errors import MSG_ORDER_NOT_FOUND
try:
order = client.query_payment_by_merchant_order_no("M202605060001")
except APIError as e:
if e.msg == MSG_ORDER_NOT_FOUND:
... # the number was never used: safe to create with it
try {
$order = $client->queryPaymentByMerchantOrderNo('M202605060001');
} catch (ApiException $e) {
if ($e->msg === 'ORDER_NOT_FOUND') {
// the number was never used: safe to create with it
}
}
try {
Map<String, Object> order = client.queryPaymentByMerchantOrderNo("M202605060001");
} catch (DeepaymentException.Api e) {
if ("ORDER_NOT_FOUND".equals(e.msg)) {
// the number was never used: safe to create with it
}
}
The returned object is the same as on create, see The order object. Query results are authoritative: when a webhook and your local state disagree, the query wins.
Balance
Returns one currency's balances as decimal strings: balance, lockBalance, paymentBalance, paymentLockBalance, payoutBalance, payoutLockBalance. Locked balance is reserved by in-flight payouts and is not available for new ones.
USD rate
Returns usdRate for a currency and payment method as a decimal string. It is indicative for display and reconciliation; the settled amount of an order is the order's own paidAmount.
Payout receipt
Available for payouts that reached SUCCEEDED. Returns orderNo, amount, currency, timestamp, the channel trade number, sourceAccount and destinationAccount (each with name, taxId, taxType, key and a bank block), and url of the receipt document when the channel provides one. Fields absent for a channel are empty.