Skip to main content

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

  1. Request a Quote: The first step is to request a quote using the /quotes endpoint. This will provide you with a quoteId that you will use in the next step. Always include the x-sideshift-secret header, and if the request originates from the integration's server, the x-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"
}'
  1. Create a Fixed Shift: After obtaining the quoteId, you can create a fixed rate shift using the /shifts/fixed endpoint. The affiliateId 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"
}'
  1. Deposit: For fixed rate shifts, a deposit of exactly the amount of depositAmount must be made before the expiresAt timestamp, otherwise the deposit will be refunded.
  2. Set Refund Address (Optional): refundAddress and refundMemo 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 a refund status.
  3. 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 is true in the /coins endpoint, integrations can specify a settleMemo field.
  4. 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

  1. Create a Variable Shift: To create a variable shift, use the /shifts/variable endpoint with the required parameters. Always include the x-sideshift-secret header, and if the request originates from the integration's server, the x-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"
}'
  1. 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.
  2. Set Refund Address (Optional): refundAddress and refundMemo 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 a refund status.
  3. 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 is true in the /coins endpoint, integrations can specify a settleMemo field.
  4. Receive Settlement: Once the deposit is confirmed in the blockchain, SideShift.ai will process the shift and send the settled amount to the settleAddress.