Orders
Crypto processing exchanges one currency for another with a given amount.
Order actions
The partner has 2 main methods - Estimate amount and Create a new order.
Estimate amount
POST
https://api.swapple.org/api/v3/estimate-amount
Using this endpoint, the partner can assess the current terms of exchange.
Returns estimated exchange value with fees included. Note that fromAmount
and toAmount
are both optional, but one of them is required.
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in milliseconds.
signature*
String
HMAC SHA512 key/value signature.
Request Body
from*
String
to*
String
fromAmount or toAmount*
String
The amount the partner wants to exchange. Transmitted in the from currency or to currency (the partner can transfer it in one currency or another (only one of them must be send to us)).
extraFromFee
String
The percentage that the partner wants to withdraw when processing the payment. Your's fromAmount percentage fee. 0.005 means 0.5%.
These fees will be accumulated on a separate account of the partner, to which he will have access through the account manager.
extraToFee
String
The percentage that the partner wants to withdraw when processing the payment. Your's toAmount percentage fee
0.005 means 0.5%
These fees will be accumulated on a separate account of the partner, to which he will have access through the account manager.
rateType
String
If you need to specify a rate type, then you can do this as follows. Only FLOATING or FIXED codes are supported (FLOATING by default).
FLOATING rate - when estimating or creating an order, we do not guarantee that the exchange will take place at a specific exchange rate, instead, the exchange will take place at the exchange rate that will be at the time of arrival of the currency.
FIXED rate - the rate is fixed in 2 stages: 1) the 1st fix is after the estimate - the partner makes an estimate, specifies the fixed rate and this rate is fixed for the agreed period. If the partner creates an order during this period, the rate at the estimate will be maintained. 2) the 2nd stage occurs when we expect the receipt of funds - if we receive funds during this period, we will also exchange at a fixed rate; if the rate expires, and the funds arrive after that time, the funds will be returned.
fromNetwork
String
toNetwork
String
Create a new order
POST
https://api.swapple.org/api/v3/create-order
The partner can directly create an exchange.
Generates a pay-in address or pay-in URL and returns Order object with an ID field to track a transaction status.
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in millisecond.
signature*
String
HMAC SHA512 key/value signature.
Request Body
from*
String
to*
String
fromNetwork
String
toNetwork
String
fromAmount or toAmount
String
The amount for which you need to calculate. Transmitted in the from currency or to currency.
userId*
String
Partner's client id.
partnerOrderId
String
Partner's custom order id.
redirectUrl*
String
For fiat deposits - where to redirect the user after payment.
toMemo
String
for XRP etc.
extraFromFee
String
The percentage that the partner wants to withdraw when processing the payment. Partner's fromAmount percentage fee. 0.005 means 0.5%.
These fees will be accumulated on a separate account of the partner, to which he will have access through the account manager.
extraToFee
String
The percentage that the partner wants to withdraw when processing the payment. Partner's toAmount percentage fee
0.005 means 0.5%
These fees will be accumulated on a separate account of the partner, to which he will have access through the account manager.
rateType
String
If you need to specify a rate type, then you can do this as follows. Only FLOATING or FIXED codes are supported (FLOATING by default).
FLOATING rate - when estimating or creating an order, we do not guarantee that the exchange will take place at a specific exchange rate, instead, the exchange will take place at the exchange rate that will be at the time of arrival of the currency.
FIXED rate - the rate is fixed in 2 stages: 1) the 1st fix is after the estimate - the partner makes an estimate, specifies the fixed rate and this rate is fixed for the agreed period. If the partner creates an order during this period, the rate at the estimate will be maintained. 2) the 2nd stage occurs when we expect the receipt of funds - if we receive funds during this period, we will also exchange at a fixed rate; if the rate expires, and the funds arrive after that time, the funds will be returned.
rateId*
String
ipAddress
String
ip address of partner's user.
toPaymentDetails*
String
User's credit card or crypto address. This determines where the partner wants to receive the currency after the exchange (if it is UAH, then it will be a card address, if crypto - a crypto address etc.)
fromPaymentDetails
String
User's income credit card or crypto address.
It shows from which card or address the user made the payment.
withdrawType
String
Withdrawal can be internal or external. All the documentation is described about the external withdrawal which is configured by default (that is, we received funds, exchanged and withdrew funds to toPaymentDetails). We can not withdraw funds, that is, save the result of the exchange on the partner's account in our system (internal withdrawal). The partner can withdraw these funds by contacting the contact manager.
Order entity response
This is the response we send.
id
Order id.
status
from
to
fromNetwork
toNetwork
payUrl
Deposit url in case of fiat from currency. URL for a partner if there is a need to redirect his client to the payment page. It can be an empty field, but then we pass payCryptoAddress (and vice versa for payCryptoAddress)
payCryptoAddress
Crypto address deposit in case of crypto from currency.
payCryptoMemo
In case the cryptocurrency requires a memo (XRP, etc.)
fromAmount
Amount to exchange from.
toAmount
Amount to exchange for.
userId
Partner's client id.
partnerOrderId
Partner's custom order id.
redirectUrl
For fiat deposits, where should the user be redirected after payment?
toPaymentDetails
User's credit card or crypto address.
fromPaymentDetails
This shows from which card or address the user made the payment
toMemo
In case the cryptocurrency requires a memo (XRP, etc.)
fromTxHash
Crypto deposit transaction hash in Blockchain.
toTxHash
Crypto withdraw transaction hash in Blockchain.
fromRate
Rate to exchange from.
toRate
Rate to exchange for.
fromFee
Swapple fromAmount fee.
toFee
Swapple toAmount fee.
extraFromFee
Partner's fromAmount calculated fee.
extraToFee
Partner's toAmount calculated fee.
rateType
If you need to specify a rate type, then you can do this as follows. Only FLOATING or FIXED codes are supported (FLOATING by default).
orderExpirationTimetamp
Order expiration time (utc)
fromAmountReceived
The amount we received after deducting Swapple fees
fromRate
It is set depending on whether it is a pair for deposit or withdrawal (if deposit, then fromRate=1)
toRate
It is set depending on whether it is a pair for deposit or withdrawal (if withdrawal, then toRate=1)
Сancel the order before the deposit is started.
POST
https://api.swapple.org/api/v3/cancel-order
If the partner has created an order and we have not yet received the funds in the currency from (the deposit has not taken place), the partner can cancel this order by calling this endpoint. If the partner cancels this order, then even if the deposit goes in, we will not exchange it, the funds will be suspended and the partner needs to contact the account manager for their return.
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in millisecond.
signature*
String
HMAC SHA512 key/value signature
Request Body
id*
String
The order id
Get information about order
GET
https://api.swapple.org/api/v3/check-order
This endpoint is used to check the status of the order.
Query Parameters
id*
String
The order id.
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in millisecond.
signature*
String
HMAC SHA512 key/value signature.
Returns list of orders
GET
https://api.swapple.org/api/v3/get-orders
This is the endpoint for getting order history.
Query Parameters
limit
String
To limit max returned orders.
offset
String
To offset returned orders.
user_id
String
filter by userId.
status
String
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in millisecond.
signature*
String
HMAC SHA512 key/value signature.
Get list of available exchange pairs
GET
https://api.swapple.org/api/v3/get-pairs-info
This is the endpoint for getting a list of available pairs for exchange
Headers
public-key*
String
timestamp*
String
Current timestamp that was used to generate the signature in millisecond.
signature*
String
HMAC SHA512 key/value signature.
Get exchange pair info
GET
https://api.swapple.org/api/v3/get-pair-info
The partner specifies a specific pair and if it is configured for them, we return the same parameters (rate, min-max amount etc) but for a specific pair.
Path Parameters
currency_from*
String
currency_to*
String
Query Parameters
rateType
String
If you need to specify a rate type, then you can do this as follows. Only FLOATING or FIXED codes are supported (FLOATING by default)
fromnetwork
String
tonetwork
String
Headers
public-key
String
timestamp
String
Current timestamp that was used to generate the signature in millisecond.
signature
String
HMAC SHA512 key/value signature.
Pair Entity
This is a description of the pair model. When a partner requests a pair, it is returned the fields shown in the table below.
from
string
to
string
fromnetwork
string
tonetwork
string
in
Rate to exchange from.
string
out
Rate to exchange for.
string
fromfee
Swapple fromAmount fee. May be percentage or static.
string
tofee
Swapple toAmount fee. May be percentage or static.
string
maxamount
The maximum amount of from currency that can be exchanged.
string
minamount
The minimum amount of from currency that can be exchanged.
string
rateType
Only FLOATING or FIXED codes are supported (FLOATING by default).
string
Last updated