Create buy order

Endpoint for creating buy order for crypto

POST https://papi.swapin.com/api/buy

Request Body

Name
Type
Description

from_amount*

Decimal

Total sum of payment in EUR

to_coin*

String

Coin symbol

from_currency*

String

EUR

to_coin_address*

String

deposit_method*

String

SEPA_BANK_TRANSFER|BALANCE

client_reference

String(50)

Reference to order in Partner system

receiver_name

String

Fullname of the receiver

receiver_external_id

String

ID of the receiver in partner system

jwt

String

JWT token with order details and signature. Required if deposit method "BALANCE" is used.

JWT Body

{
    "from_currency":"EUR",
    "from_amount":93.05, 
    "to_coin": "BTC", 
    "to_coin_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
    "receiver_external_id": "123456",
    "deposit_method": "BALANCE",
    "receiver_name": "John Doe",
    "client_reference": "65648e86-c890-444c-8549-ad44c961280b",
    "iat": 1761678857,
    "exp": 1761682457
}

Use JWT signing algorithm RS256. Unique client_reference is required! "iat" must be in the past but not more than 30min. Max "exp" is "iat" + 30min. We recommend "exp" to be "iat" + 5min.

{
  "ok": true,
  "exchange_order": {
    "order_id": "BBHT7HQ-EO-TNRASHV-3WZPETI",
    "account_id": "ABZBLRQ-4L05DEL",
    "user_id": "123",
    "status": "W",
    "status_text": "Waiting funds",
    "ready_to_send": false,
    "deposit_order_id": "BBHT7HQ-DO-5AVBLHZ-28QMPMR",
    "from_coin": "ESCT",
    "from_currency": "EUR",
    "from_account_id": "ABZBLRQ-4L05DEL",
    "from_amount": 100,
    "from_amount_indicative": 100,
    "to_coin": "BTC",
    "to_coin_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
    "to_amount": null,
    "to_amount_indicative": 0.00295642,
    "rate_target": null,
    "rate_indicative": 102676.93,
    "rate_final": null,
    "booked_amount": null,
    "fee_amount": 21,
    "fee_coin": "ESCT",
    "network_fee_amount": 4.56,
    "network_fee_coin": "ESCT",
    "transaction_fee_amount": 1.12,
    "transaction_fee_coin": "ESCT",
    "fees_info": {
            "start_eur": 0,
            "fee_eur": null,
            "fee_percent": "1.350",
            "fee_min_eur": "2.50"
    },
    "created_time": "2023-06-02 11:22:38 +00:00",
    "created_utime": 1685704958,
    "status_time": "2023-06-02 11:22:38 +00:00",
    "status_utime": 1685704958,
    "trade_time": null,
    "trade_utime": null,
    "completed_time": null,
    "completed_utime": null,
    "wallet_withdraw_sent": null,
    "wallet_withdraw_txid": null,
    "cancelled_reason": null,
    "client_reference": null,
    "receiver_name": null,
    "receiver_external_id": null
  }
}

Last updated