Shift Integration Guide
info
The /pemissions
endpoint can be used to determine if the user is allowed to use SideShift.ai.
Steps on how to integrate fixed shift
- Request a Quote: The first step is to request a quote using the
/quotes
endpoint. This will provide you with aquoteId
that you will use in the next step. Always include thex-sideshift-secret
header, and if the request originates from the integration's server, thex-user-ip
header should be added.
Example of a quote request
curl -L -X POST 'https://sideshift.ai/api/v2/quotes' \
-H 'Content-Type: application/json' \
-H 'x-sideshift-secret: ACCOUNT_PRIVATE_KEY' \
-H 'x-user-ip: YOUR_USER_IP' \
--data-raw '{
"affiliateId": "ACCOUNT_AFFILIATE_ID",
"depositCoin": "BTC",
"settleCoin": "ETH",
"depositAmount": "0.01"
}'
- Create a Fixed Shift: After obtaining the
quoteId
, you can create a fixed rate shift using the/shifts/fixed endpoint
. TheaffiliateId
used in this step must match the one used to request the quote.
Example of creating a fixed shift
curl -L -X POST 'https://sideshift.ai/api/v2/shifts/fixed' \
-H 'x-sideshift-secret: ACCOUNT_PRIVATE_KEY' \
-H 'x-user-ip: YOUR_USER_IP' \
--data-raw '{
"settleAddress": "SETTLE_ADDRESS",
"affiliateId": "ACCOUNT_AFFILIATE_ID",
"quoteId": "QUOTE_ID"
}'
- Deposit: For fixed rate shifts, a deposit of exactly the amount of
depositAmount
must be made before theexpiresAt
timestamp, otherwise the deposit will be refunded. - Set Refund Address (Optional):
refundAddress
andrefundMemo
are optional. If not defined, the user will be prompted to enter a refund address manually on the SideShift.ai order page if the shift needs to be refunded. Alternatively, the/shifts/{shiftId}/set-refund-address
endpoint can also be used to set the refund address if the shift has arefund
status. - Handle Memos (Optional): For shifts that return a
depositMemo
, the deposit transaction must include this memo, otherwise the deposit might be lost. For shifts settling in coins where hasMemo istrue
in the/coins
endpoint, integrations can specify asettleMemo
field. - Receive Settlement: Once the deposit is confirmed in the blockchain, SideShift.ai will process the shift and send the settled amount to the
settleAddress
.
Steps on how to integrate variable shift
- Create a Variable Shift: To create a variable shift, use the
/shifts/variable
endpoint with the required parameters. Always include thex-sideshift-secret
header, and if the request originates from the integration's server, thex-user-ip
header should be added.
Example of creating a variable shift
curl -L -X POST 'https://sideshift.ai/api/v2/shifts/variable' \
-H 'Content-Type: application/json' \
-H 'x-sideshift-secret: ACCOUNT_PRIVATE_KEY' \
-H 'x-user-ip: YOUR_USER_IP' \
--data-raw '{
"settleAddress": "SETTLE_ADDRESS",
"affiliateId": "ACCOUNT_AFFILIATE_ID",
"depositCoin": "BTC",
"settleCoin": "ETH"
}'
- Deposit: For variable rate shifts, the user can send any amount within the minimum and maximum deposit ranges. The exchange rate will be determined when the user's deposit is received.
- Set Refund Address (Optional):
refundAddress
andrefundMemo
are optional. If not defined, the user will be prompted to enter a refund address manually on the SideShift.ai order page if the shift needs to be refunded. Alternatively, the/shifts/{shiftId}/set-refund-address
endpoint can also be used to set the refund address if the shift has arefund
status. - Handle Memos (Optional): For shifts that return a
depositMemo
, the deposit transaction must include this memo, otherwise the deposit might be lost. For shifts settling in coins wherehasMemo
is true in the/coins
endpoint, integrations can specify asettleMemo
field. - Receive Settlement: Once the deposit is confirmed in the blockchain, SideShift.ai will process the shift and send the settled amount to the
settleAddress
.