Korzystanie z API Whalestack

Odblokuj szybkie, bezpieczne i łatwe płatności w kryptowalutach za pomocą Whalestack API. Po zabezpieczeniu swojego klucza API po rejestracji utwórz płatność lub wygeneruj adres depozytu blockchain. Niezależnie od tego, czy jest to Bitcoin, Lightning, Litecoin, Stellar, czy inna obsługiwana sieć, zarabianie jest proste. Dodatkowo skorzystaj z możliwości wjazdu i wyjazdu fiat poprzez SWIFT lub SEPA.

Portfele i Depozyty

Dzięki Whalestack natychmiast otrzymasz dedykowane adresy depozytowe dla Bitcoin, Lightning, Litecoin, Stellar, SWIFT, SEPA i innych. Rozpocznij otrzymywanie płatności blockchain zaraz po rejestracji. Użyj punktów końcowych GET /wallets i POST /adres depozytu, aby pobrać adresy blockchain i zainicjować niestandardowe wpłaty.

Checkouts

Checkouts Whalestack usprawniają płatności klientów. Oferujemy doskonałe doświadczenie użytkownika dzięki w pełni konfigurowalnym hostowanym checkoutom. Jeśli gotowe strony płatności nie odpowiadają Twojemu stylowi, wykorzystaj nasze interfejsy API realizacji transakcji, aby uzyskać pełną kontrolę. Przeczytaj nasze wprowadzenie do budowania checkout lub przejdź bezpośrednio do punktów końcowych POST /checkout lub POST /checkout/hosted.

Wymiany i Transfery

Po otrzymaniu środków za pośrednictwem checkout lub wpłat niestandardowych możesz je natychmiast wykorzystać. Zamień je na różne aktywa lub przenieś na konto bankowe lub blockchain (choć dla maksymalnego bezpieczeństwa sugerujemy przesyłanie do chłodni). Użyj punktów końcowych POST /swap i POST /transfer, aby eksplorować swapy i transfery.

Przejrzysta Sprawozdawczość Finansowa

Koniec z zastanawianiem się nad złożonymi ścieżkami płatności blockchain. Whalestack agreguje wszystkie Twoje transakcje w sekcji Raporty Finansowe na Twoim koncie. Możesz nawet powiązać transakcje z określonymi kontrahentami, takimi jak klienci (POST /customer) lub beneficjenci (POST /beneficiary). Dostarczamy raporty CSV, wykresy wizualne i wnikliwe analizy, usprawniające procesy księgowe.

Zestawy Programistyczne

API Whalestack bezproblemowo integruje się z klientami REST we wszystkich językach programowania. Na dobry początek wybraliśmy pakiety SDK dla PHP, Ruby i NodeJS. Przejrzyj te zasoby na naszej stronie GitHub.

Integracja E-Commerce

Naszym celem jest regularne udoskonalanie naszego zestawu narzędzi e-commerce, zapewniając bezproblemową integrację z Whalestack. Nasz pakiet bibliotek, wtyczek i rozszerzeń został stworzony z myślą o szybkim i bezproblemowym wdrażaniu. Odkryj poniżej szeroką gamę integracji handlu e-commerce gotowych do wdrożenia.

Budowa Checkouts

Zacznij od wyboru pomiędzy naszą w pełni konfigurowalną stroną checkout a opcją samodzielnego hostowania, w której wykorzystujesz nasze interfejsy backend API, aby zachować pełną kontrolę nad procesem płatności.

Opcja 1: Checkouts Hostowane Samodzielnie

Dostarcz proces realizacji checkout pod swoją marką w swojej aplikacji internetowej. Wybierz samodzielnie hostowane bacend API checkouts, aby zapewnić płynne doświadczenie dla użytkowników, trzymając ich w ekosystemie twojej aplikacji. Inicjuj płatności typu whitelabel za pośrednictwem punktu końcowego API POST /checkout.

Opcja 2: Strony Checkout

Nasze w pełni brandowane, hostowane strony checkout to najprostszy sposób otrzymywania płatności na Whalestack. Punkt końcowy API POST /checkout/hosted tworzy link do płatności. Niezależnie od tego, czy kierujesz użytkowników do whalestack.com, czy do własnej domeny za pośrednictwem Brand Connect, proces ten przebiega bezproblemowo. Po uzyskaniu adresu URL realizacji transakcji skieruj klienta na hostowaną stronę, a on będzie gotowy do zapłaty. Powiadamiamy Cię za pośrednictwem webhooków, e-maili lub ankiet API o przychodzących środkach.

Poniżej znajduje się przewodnik krok po kroku dotyczący tworzenia dynamicznej hostowanej transakcji:

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/checkout/hosted \
     -H "X-Digest-Key: YOUR_API_KEY" \
     -H "X-Digest-Signature: DIGEST_AUTH_SIGNATURE" \
     -H "X-Digest-Timestamp: TIMESTAMP" \
     -d "@charge.json"

Uwierzytelnianie jest dostarczane za pośrednictwem nagłówków HTTP, a opłata.json jest obiektem JSON:

Przykładowa Opłata (minimalnie)

{
   "charge":{
      "billingCurrency":"EUR",
      "lineItems":[
         {
            "description":"PCI Graphics Card",
            "netAmount":169.99
         }
      ]
   },
   "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}

Powyższy przykład tworzy opłatę za przedmiot wyceniony na 169.99 EUR. Możesz skonfigurować więcej szczegółów, takich jak koszty wysyłki, rabaty, podatki, powiązany klient, a także preferowany składnik rozliczeń, jak udokumentowano tutaj.

Przykładowa Odpowiedź (application/json)

{
   "id":"b5bcf27e5482",
   "url":"https://www.whalestack.com/en/checkout?id=b5bcf27e5482"
}

Interfejs API zwraca unikalny identyfikator wraz z adresem URL hostowanej transakcji, który wyświetlasz klientowi, aby mógł dokończyć płatność. Gdy środki zostaną przechwycone, powiadomimy Cię za pośrednictwem WEBHOOK checkout-completed.

Otrzymywanie Płatności

Transakcje kryptowalutowe różnią się od tradycyjnych płatności kartą kredytową. Zamiast handlowców pobierających środki przy użyciu danych karty kredytowej, kryptowaluta działa w modelu push. Wymaga to od klienta aktywnego zainicjowania i wysłania płatności do sprzedawcy.

Po zainicjowaniu realizacji transakcji Whalestack czujnie śledzi wybrany blockchain pod kątem przychodzących płatności. Czas na zakończenie transakcji to 60 minut. Jeśli płatność nie zostanie sfinalizowana w tym terminie, zostanie oznaczona jako wygasła. Jednakże opóźnione płatności, które ostatecznie dotrą do odbiorcy, są nadal akceptowane.

Po pomyślnym otrzymaniu płatności saldo zostanie zaktualizowane, pulpit nawigacyjny odzwierciedli zmiany, a na Twój serwer zostanie wysłane wywołanie zwrotne webhooka. Zapewnia to automatyczną realizację zamówienia w Twoim systemie poprzez mechanizm WEBHOOK checkout-completed.

Przykładowy Webhook (application/json)

{
   "eventType":"CHECKOUT_COMPLETED",
   "data":{
      "checkout":{
         "id":"a2d963a87d70",
         "timestamp":"2023-05-29T17:36:30+00:00",
         "state":"COMPLETED",
         "type":"HOSTED",
         "origin":"API",
         "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "settlementAmountRequired":"117.8379738",
         "settlementAmountReceived":"117.8379738",
         "settlementAmountFeePaid":"0.0000000",
         "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "sourceAmountRequired":"0.0043193",
         "sourceAmountReceived":"0.0043193",
         "sourceNetwork":"BITCOIN",
         "sourceNetworkName":"Bitcoin",
         "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
         "blockchainTransactions":[
            {
               "type":"CHECKOUT_ORIGIN",
               "typeDescription":"Blockchain payment transaction initiated by customer.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2023-05-29T17:55:52+00:00",
               "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_BRIDGE",
               "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_SETTLEMENT",
               "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"9e912d924d6a27ee858e011db14825f016f835249302f90b82237a9b9782bde0",
               "amount":"117.8379738",
               "amountAssetCode":"USDC",
               "exception":null
            }
         ],
         "payload":{
            "charge":{
               "customerId":"bb657e88a23d",
               "currency":"EUR",
               "lineItems":[
                  {
                     "description":"Mobile Data Prepaid Credits",
                     "netAmount":"110.00000"
                  }
               ],
               "shippingCostItems":[
                  {
                     "description":"Instant Delivery",
                     "netAmount":0
                  }
               ],
               "taxItems":[
                  {
                     "name":"Hong Kong Sales Tax",
                     "percent":0
                  }
               ]
            },
            "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "webhook":"https://www.my-server.com/api/?action=cq-webhook",
            "links":{
               "cancelUrl":"https://www.my-server.com/en/payments",
               "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
            }
         },
         "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
      }
   }
}

Webhook zawiera obiekt JSON w treści żądania HTTP i informuje o przychodzących płatnościach oraz ich atrybutach określonych w polu WEBHOOK checkout-completed. W powyższym przykładzie klient zapłacił w BTC, a sprzedawca otrzymał kredyt w USDC.

Brand Connect przez Whalestack

Usługa Brand Connect w Whalestack zapewnia doświadczenie realizacji transakcji w Whalestack dzięki unikalnej tożsamości marki. Niezależnie od tego, czy jest to Twoje charakterystyczne logo, obrazy tematyczne, czy interfejs użytkownika dostosowany do estetyki Twojej marki, Brand Connect sprawia, że strony realizacji transakcji sprawiają wrażenie organicznego rozszerzenia Twojej platformy. Wybierz pomiędzy hostingiem na whalestack.com lub wdrożeniem we własnej domenie dzięki naszej prostej konfiguracji kontenera dokowanego.

Brand Connect to idealne rozwiązanie dla dostawców usług płatniczych, którzy chcą wykorzystać kompleksowy system realizacji transakcji Whalestack, zachowując jednocześnie własną, charakterystyczną prezentację marki. Obejmuje to umiejętną obsługę niuansów transakcyjnych, takich jak nadpłaty, niedopłaty, zwroty pieniędzy lub transakcje wielokrotne. Nawet jeśli nie jesteś usługodawcą, ale chcesz po prostu mieć spójne wrażenia wizualne w swoim sklepie internetowym, Brand Connect będzie dla Ciebie rozwiązaniem.

Personalizacja Marki

Konfiguracja dostosowanego wyglądu kasy jest prosta dzięki naszemu interfejsowi Brand Connect w ustawieniach konta. Oto jak spersonalizować swoją markę:

  1. Aktywuj Brand Connect w ustawieniach konta
  2. Kontynuuj modyfikowanie Informacji o Marce, Obrazach, Czcionkach i Kolorach w ustawieniach.

Po skonfigurowaniu strony checkout będą płynnie komponować się z Twoim logo marki, faviconą, dostosowanymi obrazami kryptograficznymi, preferencjami czcionek i schematami kolorów. Sprawdzając swoją transakcję, zauważysz bezbłędną integrację bez śladu Whalestack jako podstawowego dostawcy usług.

Kastomowa Konfiguracja Domeny Internetowej

Domyślnie Brand Connect działa w domenie whalestack.com. Jeśli jednak zależy Ci na głębszym zanurzeniu się w marce, możesz kierować swoje zakupy przez własną domenę internetową. Jest to idealne rozwiązanie dla tych, którzy świadczą usługi płatnicze i chcą bezproblemowo zintegrować możliwości Whalestack, zachowując jednocześnie wyraźną aurę marki.

Integracja ta odbywa się za pośrednictwem kontenera dokowanego Brand Connect (GitHub). Umieszczając go w konfiguracji hostingu i dokonując kilku poprawek w DNS, umożliwiasz przepływ transakcji całkowicie zsynchronizowany z tożsamością Twojej marki. Oto przewodnik krok po kroku:

  1. Aktywuj Brand Connect w ustawieniach konta
  2. Doprecyzuj Informacje o Marce, Obrazach, Czcionkach i Kolorach w ustawieniach
  3. Wyznacz niestandardową domenę internetową do realizacji transakcji i otrzymaj WS_BRANDING_KEY (po wykonaniu powyższych kroków)
  4. Zaimplementuj kontener dokowany Brand Connect obok swojego certyfikatu SSL
  5. Przekieruj DNS swojej domeny internetowej na adres IP, na którym znajduje się kontener dokowany.

I wuala! Twoje strony checkout Whalestack są teraz integralną częścią Twojej domeny i odzwierciedlają wyjątkową istotę Twojej marki. Zanurz się głębiej w GitHub.

Zapewnienie Bezpiecznego Uwierzytelniania

Interfejs API Whalestack wymaga przede wszystkim uwierzytelnienia. Punkty końcowe interfejsu API są wyraźnie klasyfikowane jako publiczne () lub chronione (). Aby uzyskać dostęp do chronionego punktu końcowego, uwierzytelnij swoje żądanie przy użyciu klucza API za pomocą metody Basic-Auth lub bezpieczniejszej metody Digest-Auth. Aby bez wysiłku zweryfikować metodę uwierzytelniania, użyj punktu końcowego GET /auth-test.

Zabezpieczanie Danych Uwierzytelniających API

Przejdź do Ustawień API, aby pobrać klucz i sekret API. Tutaj możesz także ustawić ulubioną strategię uwierzytelniania i zwiększyć bezpieczeństwo, włączając „białą listę adresów IP”. W przypadku jakichkolwiek podejrzeń dotyczących bezpieczeństwa Twojego sekretu API, masz możliwość jego ponownego wygenerowania z poziomu tych ustawień.

Digest-Auth: Nasz Zalecany Wybór

Zalecamy stosowanie metody Digest-Auth podczas korzystania z chronionych punktów końcowych interfejsu API Whalestack. Niezbędne nagłówki każdego żądania obejmują X-Digest-Key, X-Digest-Signature i X-Digest-Timestamp, wszystkie omówione w kolejnych sekcjach.

Rządanie

curl 'https://www.whalestack.com/api/v1/auth-test' \
     -H "X-Digest-Key: YOUR_API_KEY" \
     -H "X-Digest-Signature: DIGEST_AUTH_SIGNATURE" \
     -H "X-Digest-Timestamp: UNIX_TIMESTAMP"

Nagłówki Rządania

Klucz Rodzaj Opis
X-Digest-Key string Your Whalestack API key. mandatory
X-Digest-Signature string Unique Digest-Auth Signature (see below). mandatory
X-Digest-Timestamp integer Current Unix timestamp (also see GET /time). mandatory

Wartość X-Digest-Signature jest generowana poprzez utworzenie skrótu SHA256 HMAC przy użyciu tajnego klucza API jako wspólnego hasła w skrócie wiadomości. Zaszyfrowany ładunek składa się w następujący sposób:
ENDPOINT_PATH . UNIX_TIMESTAMP . REQUEST_METHOD . REQUEST_BODY, gdzie . oznacza łączenie ciągów.

Składniki X-Digest-Signature

Komponent Rodzaj Opis
ENDPOINT_PATH string The path of the endpoint that is being invoked, e.g. /auth-test in lower case.
UNIX_TIMESTAMP integer Current Unix timestamp. Must be less than 30 seconds old (also see GET /time).
REQUEST_METHOD string The request method, e.g. POST or GET in upper case.
REQUEST_BODY string The request body string. Only needed in POST, PUT, or DELETE requests. Set null for GET requests.

PHP Logo Przykład Kodu (PHP)

$path = '/auth-test'
$timestamp = time();
$method = 'GET';
$body = $method == 'GET' ? null : json_encode($params);
$secret = 'YOUR_API_SECRET';

$signature = hash_hmac('sha256', $path . $timestamp . $method . $body, $secret);

Ruby Logo Przykład Kodu (Ruby)

require 'openssl'

path = '/auth-test'
timestamp = Time.now.to_i
method = 'GET'
body = method == 'GET' ? NIL : params.to_json
secret = 'YOUR_API_SECRET'

signature = OpenSSL::HMAC.hexdigest('sha256', secret, path + timestamp.to_s + method + body.to_s)

Ruby Logo Przykład Kodu (NodeJS)

require('crypto');

let path = '/auth-test'
let timestamp = Date.now() / 1000 | 0;
let method = 'GET'
let body = method === 'GET' ? '' : JSON.stringify(params)
let secret = 'YOUR_API_SECRET'

let signature = crypto.createHmac('sha256', secret)
                .update(path + timestamp + method + body)
                .digest('hex');

Zobacz te przykłady, jeśli nie masz pewności, jak utworzyć podpis HMAC SHA256 w swoim języku programowania.

Basic-Auth

Możesz wybrać podstawowy nagłówek uwierzytelniania, który jest łatwiejszy do wdrożenia (ponieważ jest to statyczny skrót nad kluczem i sekretem API), ale mniej bezpieczny niż Digest-Auth. Zalecamy używanie metody Basic-Auth wyłącznie podczas programowania lub w środowiskach testowych.

Rządanie

curl 'https://www.whalestack.com/api/v1/auth-test' \
     -H "X-Basic: BASIC_AUTH_HASH"

Nagłówki Rządania

Klucz Rodzaj Opis
X-Basic string SHA256 hash over YOUR_API_KEY:YOUR_API_SECRET mandatory

Przykład Kodu

$key = 'YOUR_API_KEY';
$secret = 'YOUR_API_SECRET';

$basicAuthHash = hash('sha256', $key . ':' . $secret);

Biała Lista Adresów IP

Użyj Ustawień API, aby skonfigurować, czy dostęp do Twojego konta API będzie możliwy z dowolnego adresu IP, czy tylko z adresów IP znajdujących się na białej liście. Biała lista adresów IP jest zalecana w środowiskach produkcyjnych, ponieważ znacznie zwiększa bezpieczeństwo. Dostęp do punktów końcowych wypłat można uzyskać wyłącznie z adresów IP znajdujących się na białej liście.

Zestawy Programistyczne (SDK)

Nasze Zestawy Programistyczne dla PHP, Ruby i NodeJS są tutaj, aby pomóc Ci szybko i bezproblemowo zintegrować się z Płatnościami API Whalestack.

Poniżej znajduje się lista pakietów SDK dostępnych obecnie w naszym GitHub.

PHP Logo

PHP
Oficjalny pakiet SDK Whalestack dla PHP

1  include('WhalestackClient.class.php');
2
3  $client = new WhalestackClient(
4      'YOUR-API-KEY',
5      'YOUR-API-SECRET',
6      '/var/log/whalestack.log'
7  );
Ruby Logo

Ruby
Oficjalny pakiet SDK Whalestack dla Ruby

1  require 'whalestack_sdk/client'
2
3  client = WhalestackSDK::Client.new(
4      'YOUR-API-KEY',
5      'YOUR-API-SECRET',
6      '/var/log/whalestack.log'
7  )
NodeJS Logo

NodeJS
Oficjalny pakiet SDK Whalestack dla NodeJS

1  require('whalestack-sdk');
2
3  const client = new WhalestackClient(
4      'YOUR-API-KEY',
5      'YOUR-API-SECRET'
6  );

GET/networkszabezpieczony

Zwraca listę sieci blockchain i bankowych obsługiwanych przez platformę Whalestack.

Rządanie

curl 'https://www.whalestack.com/api/v1/networks'

Odpowiedź Udana application/json

{
   "networks":[
      {
         "id":"BITCOIN",
         "name":"Bitcoin",
         "type":"BLOCKCHAIN",
         "imageSrc":"/images/icon-btc-88.png",
         "deposits":true,
         "transfers":true,
         "bridged":true,
         "assets":[
            "BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
         ]
      },
      {
         "id":"SWIFT",
         "name":"SWIFT",
         "type":"BANK",
         "imageSrc":"/images/icon-swift-88.png",
         "deposits":false,
         "transfers":true,
         "bridged":true,
         "assets":[
            "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2"
         ]
      },
      {
         "id":"SEPA",
         "name":"SEPA",
         "type":"BANK",
         "imageSrc":"/images/icon-sepa-88.png",
         "deposits":false,
         "transfers":true,
         "bridged":true,
         "assets":[
            "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2"
         ]
      },
      {
         "id":"STELLAR",
         "name":"Stellar",
         "type":"BLOCKCHAIN",
         "imageSrc":"/images/icon-xlm-88.png",
         "deposits":true,
         "transfers":true,
         "bridged":false,
         "assets":[
            "XLM:NATIVE",
            "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "ARS:GCYE7C77EB5AWAA25R5XMWNI2EDOKTTFTTPZKM2SR5DI4B4WFD52DARS",
            "BRL:GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP",
            "BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
            "BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
            "LTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
            "EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2"
         ]
      },
      {
         "id":"ETHEREUM",
         "name":"Ethereum",
         "type":"BLOCKCHAIN",
         "imageSrc":"/images/icon-eth-88.png",
         "deposits":false,
         "transfers":true,
         "bridged":true,
         "assets":[
            "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2"
         ]
      },
      {
         "id":"LITECOIN",
         "name":"Litecoin",
         "type":"BLOCKCHAIN",
         "imageSrc":"/images/icon-ltc-88.png",
         "deposits":true,
         "transfers":true,
         "bridged":true,
         "assets":[
            "LTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
         ]
      },
      {
         "id":"LIGHTNING",
         "name":"Lightning",
         "type":"BLOCKCHAIN",
         "imageSrc":"/images/icon-sat-88.png",
         "deposits":true,
         "transfers":true,
         "bridged":true,
         "assets":[
            "BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT"
         ]
      },
      {
         "id":"PIX",
         "name":"Brazilian PIX",
         "type":"BANK",
         "imageSrc":"/images/icon-brl-88.png",
         "deposits":false,
         "transfers":true,
         "bridged":true,
         "assets":[
            "BRL:GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP"
         ]
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.networks[] array A list objects representing a blockchain or bank network. false
.id string The network identifier. false
.name string The network name. false
.type string The network type. Can be either BLOCKCHAIN or BANK. false
.imageSrc string The URL of the Whalestack icon depicting the network. A path relative to www.whalestack.com. false
.deposits boolean Indicates whether this network can be used as to originate payments towards checkouts and deposits. false
.transfers boolean Indicates whether this network can receive transfers. false
.bridged boolean Indicates whether this network is native to the Whalestack platform or bridged via Stellar (SEP-6 or OTC). false
.assets array A list of asset identifiers as given by GET /assets indicating the assets available for redemption and reception via the network. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/assetszabezpieczony

Zwraca listę zasobów obsługiwanych przez platformę Whalestack.

Rządanie

curl 'https://www.whalestack.com/api/v1/assets'

Odpowiedź Udana application/json

{
   "assets":[
      {
         "id":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "assetCode":"BTC",
         "assetIssuer":"GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "name":"Bitcoin",
         "group":"BTC",
         "groupImageSrc":"/images/icon-btc-88.png",
         "issuerName":"Whalestack LLC",
         "issuerDomain":"whalestack.com",
         "issuerAddress":"54 Jedności Street, 65-018 Zielona Góra, Poland",
         "imageSrc":"/images/icon-btc-88.png",
         "checkouts":true,
         "deposits":true,
         "settlement":true,
         "swaps":true,
         "transfers":true,
         "hexColor":"#f7931a",
         "riskLevel":"LOW",
         "bridge":true,
         "networks":[
            "STELLAR",
            "BITCOIN"
         ]
      },
      {
         "id":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "assetCode":"USDC",
         "assetIssuer":"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "name":"USD Coin",
         "group":"USD",
         "groupImageSrc":"/images/icon-usd-88.png",
         "issuerName":"Centre",
         "issuerDomain":"centre.io",
         "issuerAddress":"Centre Consortium LLC, United States",
         "imageSrc":"/images/icon-usdc-88.png",
         "checkouts":true,
         "deposits":true,
         "settlement":true,
         "swaps":true,
         "transfers":true,
         "hexColor":"#2775ca",
         "riskLevel":"LOW",
         "bridge":true,
         "networks":[
            "STELLAR",
            "SWIFT",
            "SEPA"
         ]
      },
      {
         "id":"XLM:NATIVE",
         "assetCode":"XLM",
         "assetIssuer":"NATIVE",
         "name":"Stellar Lumens",
         "group":"XLM",
         "groupImageSrc":"/images/icon-xlm-88.png",
         "issuerName":"SDF",
         "issuerDomain":"stellar.org",
         "issuerAddress":"Stellar Development Foundation, San Francisco, CA, United States",
         "imageSrc":"/images/icon-xlm-88.png",
         "checkouts":true,
         "deposits":true,
         "settlement":true,
         "swaps":true,
         "transfers":true,
         "hexColor":"#5894ca",
         "riskLevel":"LOW",
         "bridge":false,
         "networks":[
            "STELLAR"
         ]
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.assets[] array A list objects representing a Stellar asset. false
.id string The identifier of the asset. false
.assetCode string The asset code. false
.assetIssuer string The identifier of the asset issuer on the Stellar Network. false
.name string The asset name. false
.group string The group to which the asset belongs. For example, USDC and USDT belong to the USD group. BTC and BTCLN (Lightning) belong to the BTC group. false
.groupImageSrc string The URL of the Whalestack icon depicting the asset group. A path relative to www.whalestack.com. false
.issuerName string The asset issuer name in English plain text. false
.issuerDomain string The asset issuer's web domain. false
.issuerAddress string The asset issuer's physical address. false
.imageSrc string The URL of the Whalestack icon depicting the asset. A path relative to www.whalestack.com. false
.checkouts boolean Indicates whether this asset can be used as payment method in checkouts. false
.deposits boolean Indicates whether this asset can be used as payment method in deposits. false
.settlement boolean Indicates whether this asset can be used for checkout settlement. false
.swaps boolean Indicates whether this asset can be used as source or target asset in swaps. false
.transfers boolean Indicates whether this asset can be used as target assets in transfers. false
.hexColor string(7) Whalestack's color code for this asset. Useful for charts and other visualizations. false
.riskLevel string Indicating the assets risk level as LOW, MEDIUM, or HIGH. Your risk tolerance can be configured in the (browser-based) settlement settings in your account.

Assets with a LOW risk level are native to the Stellar Network and can be widely redeemed (e.g. XLM and USDC).

Assets with a MEDIUM risk level assets are bridged onto the Stellar network by trusted custodians (anchors) and can be redeemed via SEP-6 or OTC via Whalestack (e.g. BTC, LTC, ETH, Bitcoin Lightning BTC).

Assets with a HIGH risk level are only available to you if manually enabled in your account settings (e.g. USDT).
false
.bridge boolean Indicates whether this asset is bridged via Stellar (SEP-6 or OTC). false
.networks array A list of network identifiers as given by GET /networks indicating the networks on which payment transactions for this asset can be processed. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/currencieszabezpieczony

Zwraca listę walut obsługiwanych przez platformę Whalestack.

Rządanie

curl 'https://www.whalestack.com/api/v1/currencies'

Odpowiedź Udana application/json

{
    "currencies": [
        {
            "assetCode": "BTC",
            "name": "Bitcoin",
            "type": "CRYPTO",
            "billing": true,
            "settlement": true,
            "payment": true
        },
        {
            "assetCode": "USD",
            "name": "US Dollar",
            "type": "FIAT",
            "billing": true,
            "settlement": true,
            "payment": false
        },
        {
            "assetCode": "XLM",
            "name": "Stellar Lumens",
            "type": "CRYPTO",
            "billing": true,
            "settlement": true,
            "payment": true
        }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.currencies[] array A list objects representing a currency. false
.assetCode string The asset code of the currency. false
.name string The name of the currency. false
.type string The currency type. Either CRYPTO or FIAT. false
.billing boolean Indicates whether this currency can be specified as billing currency in checkout objects. false
.settlement boolean Indicates whether this currency can be specified as settlement currency in checkout objects and deposits. false
.payment boolean Indicates whether this currency can used as payment currency in checkout objects and deposits. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST /checkout zabezpieczony

Rozpocznij proces płatności self-hosted, inicjując realizację transakcji. Ten punkt końcowy umożliwia realizację checkout bezpośrednio na serwerze, zapewniając pełną autonomię w zakresie UI lub API. Aby znaleźć alternatywę, która automatyzuje stronę checkout w infrastrukturze Whalestack, rozważ opcję POST /checkout/hosted. Jeśli dopiero zaczynasz inicjowanie procesu checkout, zalecamy rozpoczęcie tutaj.

Aby móc wchodzić w interakcję z tym punktem końcowym, musisz podać obiekt opłaty, który obejmuje pozycję zamówienia, potencjalne dodatki, takie jak opłaty za wysyłkę lub rabaty, oraz obowiązujące podatki. Aby uzyskać bardziej spersonalizowany kontakt i generowanie faktur, powiąż opłatę z konkretnym klientem. Otrzymujesz także możliwość dyktowania waluty rozliczenia, która może różnić się od nominału opłaty lub waluty wybranej przez klienta. Pomyślna interakcja z tym punktem końcowym zapewnia szereg metod płatności i odpowiadających im kwot, które zostaną zaprezentowane Twoim klientom.

Twoi klienci mogą następnie wybrać preferowaną metodę płatności (na przykład Bitcoin). Po ich wybraniu prześlij nowe żądanie zawierające wybrany blockchain i odpowiednie ID transakcji do POST /checkout/commit, co zwróci instrukcje dotyczące wpłaty, które zostaną wyświetlone Twojemu klientowi. Gdy tylko checkout zostanie zrealizowany, system Whalestack skrupulatnie skanuje blockchain w poszukiwaniu przychodzących płatności, informując Cię na bieżąco o postępach płatności za pośrednictwem narzędzia WEBHOOK checkout-completed.

Pamiętaj, że checkouts deklarują zamiar zapłaty i są przeznaczone do jednorazowego użytku. Zawsze inicjuj nowy checkout dla każdej transakcji.

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/checkout \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload (Minimalny)

{
   "charge":{
      "billingCurrency":"EUR",
      "lineItems":[
         {
            "description":"PCI Graphics Card",
            "netAmount":169.99
         }
      ]
   },
   "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}

Wyjaśnienie Powyższej Konfiguracji Payload

Powyżej znajduje się minimalna konfiguracja wymagana do zainicjowania realizacji checkout. Opłata jest denominowana w EUR i obejmuje dokładnie jedną pozycję o koszcie 169,99 EUR. Kwota płatności, jaką pobierze Twój klient w wybranej przez niego crypto, jest obliczana na podstawie całkowitej kwoty rozliczeniowej określonej tutaj.

Przykład Payload (Pełna)

{
   "charge":{
      "customerId":"716dad4c5e5f",
      "billingCurrency":"USD",
      "lineItems":[
         {
            "description":"PCI Graphics Card",
            "netAmount":199,
            "quantity":1,
            "productId":"P1234"
         }
      ],
      "discountItems":[
         {
            "description":"Loyalty Discount",
            "netAmount":5
         }
      ],
      "shippingCostItems":[
         {
            "description":"Shipping and Handling",
            "netAmount":3.99,
            "taxable":false
         }
      ],
      "taxItems":[
         {
            "name":"Sales Tax",
            "percent":0.0825
         }
      ]
   },
   "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "checkoutLanguage":"en",
   "webhook":"https://www.your-server.com/path/to/webhook",
   "pageSettings":{
      "returnUrl":"https://www.merchant.com/path/to/complete/checkout",
      "cancelUrl":"https://www.merchant.com/path/to/cancel/checkout",
      "shopName":"The T-Shirt Store Ltd.",
      "displayBuyerInfo":true,
      "displaySellerInfo":true
   },
   "meta":{
      "customAttribute":"customValue"
   },
   "anchors":{
      "BITCOIN":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "LITECOIN":"LTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
   }
}

Parametry Żądania (POST)

Łączenie Klientów

Podaj identyfikator klienta charge.customerId podany przez POST /customer, aby automatycznie połączyć checkout z klientem. Łączenie płatności z klientami pomaga w księgowości, zapewnia więcej szczegółów w historii transakcji i umożliwia wysyłanie automatycznych faktur i powiadomień o statusie płatności.


Wzór Kwoty Całkowitej

Obliczenie kwoty całkowitej odbywa się przy użyciu poniższego wzoru.
$net = sum($lineItems) - sum($discountItems) + sum($shippingCostItems)
$taxableSum = $net - sum($shippingCostItems) + sum($taxableShippingCostItems)
$total = $net + ($taxableSum * sum($taxItems))

Klucz Rodzaj Opis Domyślny Obowiązkowy
charge{} object This is the core information needed to create a checkout. It provides a charge object, which describes what products or services you want to bill, optional shipping and handling costs, discounts and tax information. It also links this checkout to a customer. null mandatory
.customerId string(12) Specifies the customer to which this charge relates to. Use the identifier as given by POST /customer. This links the charge to your customer, which helps with your accounting, provides more details in your transaction history and enables invoicing and status update emails to your customer. null optional
.billingCurrency string A currency code as given by GET /currencies. This is the customer facing billing currency quoted on the payment page in hosted checkouts and on invoices. Blockchain payment amounts are calculated against the billing currency and total amount specified in the charge. This is not the payment currency. Your customers will get to choose their preferred blockchain to make payment in their available asset regardless of the currency you specify here. null mandatory
.lineItems{} object An object providing payment amounts and details about the charged products or services. null mandatory
.description string The product or service description as plain text (Unicode). Maximum of 200 characters. null mandatory
.netAmount numeric The net cost for this item in the currency provided in charge.currency. null mandatory
.quantity numeric The quantity of this item. If you provide a quantity n then the resulting total amount charged will be n * netAmount 1 optional
.productId string An optional product id to link this item with a corresponding relation in your own database. Maximum of 20 characters. null optional
.discountItems{} object An optional object listing any potential discounts related to this payment request. null optional
.description string The discount description as plain text (Unicode). Maximum of 200 characters. null mandatory
.netAmount numeric The net amount for this discount in the currency provided in charge.currency. null mandatory
.shippingCostItems{} object An optional object listing any potential shipping and handling costs related to this payment request. null optional
.description string The shipping or handling cost description as plain text (Unicode), e.g. "Shipping Costs". Maximum of 200 characters. null mandatory
.netAmount numeric The net amount of this shipping cost in the currency provided in charge.currency. null mandatory
.taxable boolean Indicates whether this shipping cost is taxable. If set to true then tax calculation includes this item. false optional
.taxItems{} object An optional object listing any potential taxes related to this payment request. null optional
.name string The applied tax or tax identifier, e.g. "SALES TAX". null mandatory
.percent numeric The percentage of the applied tax in decimal notation, e.g. 0.0825 to represent a tax rate of 8.25% null mandatory
.settlementAsset string An asset id as given by GET /assets. Specifies the asset you will be credited in when the checkout completes. Set to ORIGIN to get credited in the asset your customer pays in without any type of currency conversion. ORIGIN optional
.checkoutLanguage string A language code as given by GET /languages. Use auto to automatically detect the customer's main browser language. Fallback language code is en.

Supported values are: auto en de pt es it tr pl fr
auto optional
.webhook string A webhook URL on your server that listens for related checkout events as specified in webhook concepts. null optional
.anchors{} object An advanced setting to declare preferred Stellar SEP-0006 anchors to use during the checkout process. An object containing key value pairs, with the key being a network id as given by GET /networks and the value being an anchored asset id as given by GET /assets. null optional
.pageSettings{} object An object containing display settings for the customer facing hosted checkout page. Values provided here override your global account settings (if any). null optional
.returnUrl string Specifies the url to which to redirect the customer when the payment completes successfully.

Do not rely on this url to capture completed payments. Always confirm payment status with a call to GET /checkout or implement webhooks for reliable payment notifications in your application.

The checkout id, as given in above response, is automatically appended as GET parameter checkoutId to facilitate mapping in your application. You can specify arbitrary additional GET parameters.
null optional
.cancelUrl string Specifies the url to which to redirect the customer when he cancels the checkout process.

This is typically the checkout page in your web application or a shopping cart view.

The checkout id, as given in above response, is automatically appended as GET parameter checkoutId to facilitate mapping in your application. You can specify arbitrary additional GET parameters.
null optional
.shopName string Your shop or company name, which is displayed in large, bold letters on top of customer facing hosted checkout pages. If no shop name is provided, your account default is used. null optional
.displayBuyerInfo boolean Configures whether to display the customer's billing address on customer facing hosted checkout pages. This field is only relevant if the checkout is associated with a customer. If this field is not provided, your account default is used. null optional
.displaySellerInfo boolean Configures whether you want to display your own mail address on customer facing hosted checkout pages. If this field is not provided, your account default is used. null optional
.meta object A custom object containing arbitrary information that you would like to associate with this checkout, if any. This object is included in associated webhook payloads and API responses whenever this checkout is referenced. true optional

Odpowiedź Udana application/json

{
   "id":"3296a3f29bcd",
   "paymentMethods":[
      {
         "assetCode":"SAT",
         "blockchain":"Lightning",
         "network":"LIGHTNING",
         "relatedAssetId":"BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
         "paymentAmount":"735612",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"XLM",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"XLM:NATIVE",
         "paymentAmount":"1908.8467626",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"USD",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "paymentAmount":"199.0000000",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"EUR",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2",
         "paymentAmount":"197.3775345",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.id string(12) The identifier of the checkout. You should store this persistently to match payments and associated information against this checkout. false
.paymentMethods[] array Contains a list of available payment methods for this checkout and associated payment amounts for your customer.

The given payment methods and amounts should be displayed back to your customer to let him select his desired form of payment. Upon selection, your application submits a POST /checkout/commit with the selected payment method and obtains the deposit information for your customer to make payment.
false
.assetCode string The corresponding payment asset code, e.g. BTC. Inspect GET /currencies for a list of possible values. false
.blockchain string The blockchain name in plain text. false
.network string The payment network identifier as given by GET /networks. Use this identifier to select the desired payment network in the next step at POST /checkout/commit. false
.relatedAssetId string An asset id as given by GET /assets. If the related network supports more than one asset, then use this identifier to select the desired payment asset in the next step at POST /checkout/commit. false
.paymentAmount string The required payment amount to display back to your customer. false
.settlement{} object An object containing information on the settlement asset and amount guaranteed to be credited to your account when the payment completes. The quote is valid for 60 minutes. false
.assetId string The asset credited to your account when the payment completes. Contains an asset id as given by GET /assets. false
.amount string The gross amount credited to your account when the payment completes. false
.netAmount string The net amount credited to your account when the payment completes. This amount is constituted by the amount minus fee. false
.fee string The settlement fee collected by Whalestack. false

Next Step

Your application displays the payment methods received in the response back to your customer. The customer then selects his preferred payment method and your server submits the selected network identifier in a new API request to the POST /checkout/commit endpoint. In return you receive the deposit address for the selected blockchain for display to your customer. Continue here.

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/checkout/commitzabezpieczony

Ten punkt końcowy stanowi istotną kontynuację procesu checkout, który został zainicjowany poprzez POST /checkout. Jeśli dopiero zaczynasz inicjowanie procesu checkout, zalecamy rozpoczęcie tutaj.

Wysyłając żądanie do tego punktu końcowego, musisz podać identyfikatory checkoutId i network uzyskane z żądania POST /checkout. Jeśli wybrana sieć obsługuje wiele zasobów, musisz także uwzględnić element asset (jeśli zostanie pominięty, zostanie użyty domyślny zasób sieci). Po pozytywnym rozpatrzeniu żądania otrzymasz informacje o wpłacie, które należy przedstawić swojemu klientowi, aby ułatwić proces płatności.

Po wywołaniu tego punktu końcowego Whalestack inicjuje monitorowanie w czasie rzeczywistym odpowiedniej sieci blockchain. Po zakończeniu płatności Twój serwer zostanie automatycznie powiadomiony za pośrednictwem elementu WEBHOOK checkout-completed. Alternatywnie możesz okresowo sprawdzać status płatności za pomocą polecenia GET /checkout po wyświetleniu klientowi informacji o wpłacie.

W poprzednim kroku POST /checkout udostępniło Ci listę dostępnych metod płatności, jak pokazano poniżej:

Przykładowa Odpowiedź (jak podano przez POST /checkout)

{
   "id":"3296a3f29bcd",
   "paymentMethods":[
      {
         "assetCode":"SAT",
         "blockchain":"Lightning",
         "network":"LIGHTNING",
         "relatedAssetId":"BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
         "paymentAmount":"735612",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"XLM",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"XLM:NATIVE",
         "paymentAmount":"1908.8467626",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"USD",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "paymentAmount":"199.0000000",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      },
      {
         "assetCode":"EUR",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2",
         "paymentAmount":"197.3775345",
         "settlement":{
            "assetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "amount":"199",
            "netAmount":"198.005",
            "fee":"0.995"
         }
      }
   ]
}

Warunkiem wstępnym wywołania tego punktu końcowego jest otrzymanie odpowiedzi jak powyżej z punktu końcowego POST /checkout. Zawiera listę metod płatności, które wyświetlasz klientowi do wyboru. Po wybraniu wywołujesz POST /checkout/commit (ten punkt końcowy) z wybraną siecią depositNetwork, relatedAssetId (jeśli to konieczne) i checkoutId, aby otrzymać informacje o wpłacie dla Twojego klienta w celu dokonania płatności.

Rządanie

curl -X POST 'https://www.whalestack.com/api/v1/checkout/commit'
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload (Bitcoin)

{
  "checkoutId":"6d55626309d6",
  "network":"BITCOIN"
}

Przykładowy Payload (EURC, Stellar)

{
  "checkoutId":"6d55626309d6",
  "network":"STELLAR",
  "asset":"EURC:GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2"
}

Przykładowy Payload (XLM, Stellar)

{
  "checkoutId":"6d55626309d6",
  "network":"STELLAR",
  "asset":"XLM:NATIVE"
}

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
checkoutId string(12) Unique identifier as given by POST /checkout. null mandatory
network string The payment network selected by your customer. As given by POST /checkout. null mandatory
asset string The payment asset selected by your customer. As given by POST /checkout. If omitted, then the network default asset is used. null optional

Przykład Udanej Odpowiedzi (Bitcoin) application/json

{
    "depositInstructions": {
        "assetCode":"BTC",
        "blockchain": "Bitcoin",
        "network": "BITCOIN",
        "amount": "0.0001807",
        "address": "3NBFeR5BBSt9JfL2bodpG89LSqNZrcZdseV",
        "memo": null,
        "memoType": null
    },
    "settlement": {
        "assetId": "BTC:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
        "amount": "0.0001807",
        "netAmount": "0.0001798",
        "fee": "0.0000009"
    },
    "expirationTime": "2023-05-29T20:33:49+00:00",
    "checkoutId": "793f2c605f26"
}

Przykład Udanej Odpowiedzi (XLM) application/json

{
   "depositInstructions":{
      "assetCode":"XLM",
      "blockchain":"Stellar Network",
      "network":"STELLAR",
      "amount":"17.8639906",
      "address":"GASKYWPPQ2VSO6KNIPIRVXMSSDGZLYZQ67CDTLVXOXYDG26SPZ66EDCQ",
      "memo":"4c52bcad95114c52bcad9512",
      "memoType":"text"
   },
   "settlement": {
       "assetId": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
       "amount": "2.3354345"
   },
   "expirationTime":"2020-02-26T18:48:58+00:00",
   "checkoutId":"d95114c52bca"
}

Podaj swojemu klientowi adres address oraz memo i memoType, gdy do płatności zostanie wybrana sieć STELLAR. Jest to ważne, aby Whalestack przypisał płatność do Twojego konta sprzedawcy.

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositInstructions{} object The deposit information to display to your customer. false
.blockchain string The selected blockchain name as plain text. false
.assetCode string The selected payment asset code, e.g. BTC, SAT, XLM, or LTC. false
.network string The selected payment network as given by GET /networks. false
.amount string The required payment amount for the selected blockchain. Display this back to your customer. Please note that this field is of type string even though it is numeric. You might need to do some type casting here. false
.memo string This field is only relevant for payments in XLM. Otherwise it is null. If the assetCode is XLM, it is extremely important to display this back to your customer alongside the deposit address because it is needed to map the payment to your merchant account. true
.memoType string This field is only relevant for payments in XLM. Otherwise it is null. If the assetCode is XLM, it is extremely important to display this back to your customer alongside the deposit address because it is needed to map the payment to your merchant account. true
.settlement{} object An object containing information on the settlement asset and amount guaranteed to be credited to your account when the payment completes. false
.assetId string The asset credited to your account when the payment completes. Contains an asset id as given by GET /assets. false
.amount string The amount credited to your account when the payment completes. false
.expirationTime timestamp W3C formatted timestamp with the expiration time for this checkout. Whalestack allows for a 60 minutes window to complete the payment, afterwards we mark the charge as expired. Don't worry though, you will still be credited even if the payment arrives late. false
.checkoutId array The checkout id as originally given by POST /checkout. false

Następne Kroki

Wyświetl informacje o wpłacie twojemu klientowi. W międzyczasie Whalestack rozpoczyna monitorowanie adresu blockchain podanego w powyższej odpowiedzi API i automatycznie powiadamia Cię za pośrednictwem WEBHOOK checkout-completed po zakończeniu płatności. Alternatywnie możesz okresowo podpytywać GET /checkout w celu uzyskania aktualizacji płatności.

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST /checkout/hosted zabezpieczony

Ten punkt końcowy generuje i dostarcza unikalny adres URL wskazujący stronę checkout, w pełni zarządzaną na serwerach Whalestack. Aby uzyskać bardziej praktyczne podejście, w którym nadzorujesz UI użytkownika i przepływ checkout, rozważ zamiast tego punkt końcowy POST /checkout. Jeśli dopiero zaczynasz inicjowanie procesu checkout, zalecamy rozpoczęcie tutaj.

Wywołując ten punkt końcowy, serwer udostępnia parametry obejmujące szczegóły płatności, opcjonalne pozycje podatku, dane klienta i żądaną walutę rozliczeniową. W zamian Twój serwer otrzymuje adres URL checkout, gotowy do zaprezentowania Twoim klientom.

Po uzyskaniu dostępu do tego adresu URL klienci napotykają przyjazną dla użytkownika stronę checkout umieszczoną w infrastrukturze Whalestack. Ta interaktywna strona zawiera wszystkie niezbędne informacje ułatwiające proces płatności. Po zakończeniu transakcji nasz system natychmiast informuje Twoją aplikację za pośrednictwem WEBHOOK checkout-completed. Dla tych, którzy cenią proaktywność, punkt końcowy GET /checkout umożliwia ciągłe monitorowanie statusu płatności.

Zaprojektowane z myślą o możliwościach adaptacji, hostowane checkouts Whalestack płynnie dostosowują się zarówno do wyświetlaczy mobilnych, jak i rozległych ekranów komputerów stacjonarnych. Dostosuj ich wygląd, aby współgrał z estetyką Twojej marki, korzystając z Brand Connect.

Pamiętaj, że każdy adres URL hostowanej transakcji jest odrębny i jednorazowy. Upewnij się, że dla każdej nowej transakcji generujesz nowy adres URL.

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/checkout/hosted \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload (Minimalny)

{
   "charge":{
      "billingCurrency":"EUR",
      "lineItems":[
         {
            "description":"PCI Graphics Card",
            "netAmount":169.99
         }
      ]
   },
   "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}

Wyjaśnienie Powyższej Konfiguracji Payload

Powyżej znajduje się minimalna konfiguracja wymagana do zainicjowania realizacji checkout. Opłata jest denominowana w EUR i obejmuje dokładnie jedną pozycję o koszcie 169,99 EUR. Kwota płatności, jaką pobierze Twój klient w wybranej przez niego crypto, jest obliczana na podstawie całkowitej kwoty rozliczeniowej określonej tutaj.

Przykład Payload (Pełna)

{
   "charge":{
      "customerId":"716dad4c5e5f",
      "billingCurrency":"USD",
      "lineItems":[
         {
            "description":"PCI Graphics Card",
            "netAmount":199,
            "quantity":1,
            "productId":"P1234"
         }
      ],
      "discountItems":[
         {
            "description":"Loyalty Discount",
            "netAmount":5
         }
      ],
      "shippingCostItems":[
         {
            "description":"Shipping and Handling",
            "netAmount":3.99,
            "taxable":false
         }
      ],
      "taxItems":[
         {
            "name":"Sales Tax",
            "percent":0.0825
         }
      ]
   },
   "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "checkoutLanguage":"en",
   "webhook":"https://www.your-server.com/path/to/webhook",
   "pageSettings":{
      "returnUrl":"https://www.merchant.com/path/to/complete/checkout",
      "cancelUrl":"https://www.merchant.com/path/to/cancel/checkout",
      "shopName":"The T-Shirt Store Ltd.",
      "displayBuyerInfo":true,
      "displaySellerInfo":true
   },
   "meta":{
      "customAttribute":"customValue"
   },
   "anchors":{
      "BITCOIN":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "LITECOIN":"LTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
   }
}

Parametry Żądania (POST)

Łączenie Klientów

Podaj identyfikator klienta charge.customerId podany przez POST /customer, aby automatycznie połączyć checkout z klientem. Łączenie płatności z klientami pomaga w księgowości, zapewnia więcej szczegółów w historii transakcji i umożliwia wysyłanie automatycznych faktur i powiadomień o statusie płatności.


Wzór Kwoty Całkowitej

Obliczenie kwoty całkowitej odbywa się przy użyciu poniższego wzoru.
$net = sum($lineItems) - sum($discountItems) + sum($shippingCostItems)
$taxableSum = $net - sum($shippingCostItems) + sum($taxableShippingCostItems)
$total = $net + ($taxableSum * sum($taxItems))

Klucz Rodzaj Opis Domyślny Obowiązkowy
charge{} object This is the core information needed to create a checkout. It provides a charge object, which describes what products or services you want to bill, optional shipping and handling costs, discounts and tax information. It also links this checkout to a customer. null mandatory
.customerId string(12) Specifies the customer to which this charge relates to. Use the identifier as given by POST /customer. This links the charge to your customer, which helps with your accounting, provides more details in your transaction history and enables invoicing and status update emails to your customer. null optional
.billingCurrency string A currency code as given by GET /currencies. This is the customer facing billing currency quoted on the payment page in hosted checkouts and on invoices. Blockchain payment amounts are calculated against the billing currency and total amount specified in the charge. This is not the payment currency. Your customers will get to choose their preferred blockchain to make payment in their available asset regardless of the currency you specify here. null mandatory
.lineItems{} object An object providing payment amounts and details about the charged products or services. null mandatory
.description string The product or service description as plain text (Unicode). Maximum of 200 characters. null mandatory
.netAmount numeric The net cost for this item in the currency provided in charge.currency. null mandatory
.quantity numeric The quantity of this item. If you provide a quantity n then the resulting total amount charged will be n * netAmount 1 optional
.productId string An optional product id to link this item with a corresponding relation in your own database. Maximum of 20 characters. null optional
.discountItems{} object An optional object listing any potential discounts related to this payment request. null optional
.description string The discount description as plain text (Unicode). Maximum of 200 characters. null mandatory
.netAmount numeric The net amount for this discount in the currency provided in charge.currency. null mandatory
.shippingCostItems{} object An optional object listing any potential shipping and handling costs related to this payment request. null optional
.description string The shipping or handling cost description as plain text (Unicode), e.g. "Shipping Costs". Maximum of 200 characters. null mandatory
.netAmount numeric The net amount of this shipping cost in the currency provided in charge.currency. null mandatory
.taxable boolean Indicates whether this shipping cost is taxable. If set to true then tax calculation includes this item. false optional
.taxItems{} object An optional object listing any potential taxes related to this payment request. null optional
.name string The applied tax or tax identifier, e.g. "SALES TAX". null mandatory
.percent numeric The percentage of the applied tax in decimal notation, e.g. 0.0825 to represent a tax rate of 8.25% null mandatory
.settlementAsset string An asset id as given by GET /assets. Specifies the asset you will be credited in when the checkout completes. Set to ORIGIN to get credited in the asset your customer pays in without any type of currency conversion. ORIGIN optional
.checkoutLanguage string A language code as given by GET /languages. Use auto to automatically detect the customer's main browser language. Fallback language code is en.

Supported values are: auto en de pt es it tr pl fr
auto optional
.webhook string A webhook URL on your server that listens for related checkout events as specified in webhook concepts. null optional
.anchors{} object An advanced setting to declare preferred Stellar SEP-0006 anchors to use during the checkout process. An object containing key value pairs, with the key being a network id as given by GET /networks and the value being an anchored asset id as given by GET /assets. null optional
.pageSettings{} object An object containing display settings for the customer facing hosted checkout page. Values provided here override your global account settings (if any). null optional
.returnUrl string Specifies the url to which to redirect the customer when the payment completes successfully.

Do not rely on this url to capture completed payments. Always confirm payment status with a call to GET /checkout or implement webhooks for reliable payment notifications in your application.

The checkout id, as given in above response, is automatically appended as GET parameter checkoutId to facilitate mapping in your application. You can specify arbitrary additional GET parameters.
null optional
.cancelUrl string Specifies the url to which to redirect the customer when he cancels the checkout process.

This is typically the checkout page in your web application or a shopping cart view.

The checkout id, as given in above response, is automatically appended as GET parameter checkoutId to facilitate mapping in your application. You can specify arbitrary additional GET parameters.
null optional
.shopName string Your shop or company name, which is displayed in large, bold letters on top of customer facing hosted checkout pages. If no shop name is provided, your account default is used. null optional
.displayBuyerInfo boolean Configures whether to display the customer's billing address on customer facing hosted checkout pages. This field is only relevant if the checkout is associated with a customer. If this field is not provided, your account default is used. null optional
.displaySellerInfo boolean Configures whether you want to display your own mail address on customer facing hosted checkout pages. If this field is not provided, your account default is used. null optional
.meta object A custom object containing arbitrary information that you would like to associate with this checkout, if any. This object is included in associated webhook payloads and API responses whenever this checkout is referenced. true optional

Odpowiedź Udana application/json

{
   "id":"b5bcf27e5482",
   "url":"https://www.whalestack.com/en/checkout?id=b5bcf27e5482",
   "oracle":[
      {
         "assetCode":"BTC",
         "blockchain":"Bitcoin",
         "network":"BITCOIN",
         "relatedAssetId":"BTC:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
         "paymentAmount":"0.0001807",
         "settlement":{
            "assetId":"BTC:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
            "amount":"0.0001807",
            "netAmount":"0.0001798",
            "fee":"0.0000009"
         }
      },
      {
         "assetCode":"SAT",
         "blockchain":"Lightning",
         "network":"LIGHTNING",
         "relatedAssetId":"BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
         "paymentAmount":"18074",
         "settlement":{
            "assetId":"BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
            "amount":"18073.3779143",
            "netAmount":"17983.0110247",
            "fee":"90.3668896"
         }
      },
      {
         "assetCode":"LTC",
         "blockchain":"Litecoin",
         "network":"LITECOIN",
         "relatedAssetId":"LTC:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
         "paymentAmount":"0.0548930",
         "settlement":{
            "assetId":"LTC:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
            "amount":"0.054893",
            "netAmount":"0.0546185",
            "fee":"0.0002745"
         }
      },
      {
         "assetCode":"XLM",
         "blockchain":"Stellar",
         "network":"STELLAR",
         "relatedAssetId":"XLM:NATIVE",
         "paymentAmount":"56.0444605",
         "settlement":{
            "assetId":"XLM:NATIVE",
            "amount":"56.0444605",
            "netAmount":"55.7642382",
            "fee":"0.2802223"
         }
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.id string(12) The identifier of the hosted checkout. You should store this persistently to match payments against this checkout. false
.url string(12) The hosted checkout URL, which you display back to your customer to initiate payment. Upon visiting this URL your client is presented with a checkout interface where he completes the payment. When completed, your application is automatically notified via WEBHOOK checkout-completed. Alternatively you can poll GET /checkout using the id given in the above response to query information about the payment state. Returns branded URL if Brand Connect is enabled. false
.oracle[] array Contains a list of available payment methods for this checkout alongside indicative payment amounts and corresponding indicative settlement amounts. The given amounts are an estimation and and based on the current liquidity and market making situation on Whalestack's decentralized exchange provider. The payment amounts can deviate by the time the buyer initiates payment on the checkout page.

We recommend to apply your own sanity checks on the amounts given in this object and only display the checkout URL to the end user if you are satisfied with the quoted settlement and payment amount estimations.
false
.assetCode string The asset code of the payment currency, e.g. BTC. false
.blockchain string The payment blockchain name in plain text. false
.network string The payment network identifier as given by GET /networks. false
.relatedAssetId string An asset id as given by GET /assets. This asset identifies the Stellar SEP-6 anchor used for capturing the payment, if applicable. false
.paymentAmount string The required payment amount currently needed to fill your settlement amount. This amount can deviate on the customer facing payment page. false
.settlement{} object An object containing information on the settlement asset and amount to be credited to your account when the payment completes. false
.assetId string The asset credited to your account when the payment completes. Contains an asset id as given by GET /assets. false
.amount string The gross amount credited to your account when the payment completes. This amount can deviate upon completion of payment unless your billing and settlement currencies are equal. false
.netAmount string The net amount credited to your account when the payment completes. This amount is constituted by the amount minus fee. This amount can deviate upon completion of payment unless your billing and settlement currencies are equal. false
.fee string The settlement fee collected by Whalestack. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/checkoutzabezpieczony

Pobiera informacje o danym checkout

Odpowiedź tego punktu końcowego zawiera informacje o płatnościach typu blockchain powiązanych z tą realizacją transakcji, jej ogólnym stanie zakończenia, a także dodatkowe informacje kontekstowe.

Ten punkt końcowy jest odpowiedni do odpytywania zdarzeń płatniczych powiązanych z danym checkout. Bardziej efektywną alternatywą jest nasłuchiwanie zdarzeń płatniczych przy użyciu narzędzia WEBHOOK checkout-completed na Twoim serwerze.

Rządanie

curl 'https://www.whalestack.com/api/v1/checkout?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by POST /checkout or POST /checkout/hosted. null mandatory

Odpowiedź Udana application/json

{
   "checkout":{
      "id":"a2d963a87d70",
      "timestamp":"2023-05-29T17:36:30+00:00",
      "state":"COMPLETED",
      "type":"HOSTED",
      "origin":"API",
      "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
      "settlementAmountRequired":"117.8379738",
      "settlementAmountReceived":"117.8379738",
      "settlementAmountFeePaid":"0.0000000",
      "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "sourceAmountRequired":"0.0043193",
      "sourceAmountReceived":"0.0043193",
      "sourceNetwork":"BITCOIN",
      "sourceNetworkName":"Bitcoin",
      "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
      "blockchainTransactions":[
         {
            "type":"CHECKOUT_ORIGIN",
            "typeDescription":"Blockchain payment transaction initiated by customer.",
            "network":"BITCOIN",
            "networkName":"Bitcoin",
            "timestamp":"2023-05-29T17:55:52+00:00",
            "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
            "amount":"0.0043193",
            "amountAssetCode":"BTC",
            "exception":null
         },
         {
            "type":"CHECKOUT_BRIDGE",
            "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
            "network":"STELLAR",
            "networkName":"Stellar",
            "timestamp":"2023-05-29T17:56:03+00:00",
            "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
            "amount":"0.0043193",
            "amountAssetCode":"BTC",
            "exception":null
         },
         {
            "type":"CHECKOUT_SETTLEMENT",
            "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
            "network":"STELLAR",
            "networkName":"Stellar",
            "timestamp":"2023-05-29T17:56:03+00:00",
            "tx":"9e912d924d6a27ee858e011db14825f016f835249302f90b82237a9b9782bde0",
            "amount":"117.8379738",
            "amountAssetCode":"USDC",
            "exception":null
         }
      ],
      "payload":{
         "charge":{
            "customerId":"bb657e88a23d",
            "currency":"EUR",
            "lineItems":[
               {
                  "description":"Mobile Data Prepaid Credits",
                  "netAmount":"110.00000"
               }
            ],
            "shippingCostItems":[
               {
                  "description":"Instant Delivery",
                  "netAmount":0
               }
            ],
            "taxItems":[
               {
                  "name":"Hong Kong Sales Tax",
                  "percent":0
               }
            ]
         },
         "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "webhook":"https://www.my-server.com/api/?action=cq-webhook",
         "links":{
            "cancelUrl":"https://www.my-server.com/en/payments",
            "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
         }
      },
      "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.checkout{} array The checkout object. false
.id string(12) Unique identifier of the checkout. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the checkout was created. false
.state string Indicates the current payment state associated with this checkout. A state of COMPLETED indicates this checkout has completed and the funds were credited to your account.

Possible payment states:

PENDING_CHARGE, NEW_CHARGE, IN_PROGRESS, COMPLETED, EXPIRED, UNRESOLVED_GENERIC, UNRESOLVED_UNDERPAID, REFUNDED, RESOLVED_REFUNDED, RESOLVED_OTHER.
false
.type string Indicates whether this is a hosted (HOSTED) or self-hosted (SELF-HOSTED) checkout. false
.origin string Indicates whether this checkout was originally created via UI or API. false
.settlementAssetId string The settlement asset used for this checkout. Indicates the asset as given by GET /assets that you are credited in when the checkout is complete. false
.settlementAmountRequired string Indicates the total gross amount credited to your account when the checkout is complete. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.settlementAmountReceived string The net amount credited to your account. These funds are instantly available for transfer. false
.settlementAmountFeePaid string The processing fee collected by Whalestack. false
.sourceAssetId string The Stellar representation of the source asset as given by GET /assets. Indicates the payment asset selected by your customer. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceAmountRequired string Indicates the total amount payable by the customer to complete this checkout. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceAmountReceived string The total amount paid by the customer so far. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceNetwork string A payment network id as given by (GET /networks). Indicates the payment network selected by the customer in English plain text. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceNetworkName string The selected network name in English plain text. true
.depositAddress string The deposit address associated with this checkout. This field is null for checkouts in PENDING_CHARGE state. For checkouts on Stellar this field combines the memo, memo type, and account in the following format:
{memo}:{memoType}@{stellarAccount}
true
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction. Can be CHECKOUT_ORIGIN (blockchain payment transaction initiated by the sender, CHECKOUT_BRIDGE (fund transfer from native blockchain to Stellar Network), or CHECKOUT_SETTLEMENT (Stellar transaction crediting your Whalestack account). false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.exception string An exception identifier that is set when a processing error or other exception occurred when handling this transaction. This is field is typically null.

Possible exceptions:

EXCHANGE_FAILED, CHECKOUT_ALREADY_COMPLETED, GENERIC.
true
.payload{} object The checkout payload as originally submitted by you to POST /checkout or POST /checkout/hosted. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/checkoutszabezpieczony

Pobiera listę obiektów checkout (w kolejności malejącej od najnowszych do najstarszych).

Rządanie

curl 'https://www.whalestack.com/api/v1/checkouts?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of checkout objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":67,
   "limit":1,
   "offset":0,
   "checkouts":[
      {
         "id":"a2d963a87d70",
         "timestamp":"2023-05-29T17:36:30+00:00",
         "state":"COMPLETED",
         "type":"HOSTED",
         "origin":"API",
         "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "settlementAmountRequired":"117.8379738",
         "settlementAmountReceived":"117.8379738",
         "settlementAmountFeePaid":"0.0000000",
         "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "sourceAmountRequired":"0.0043193",
         "sourceAmountReceived":"0.0043193",
         "sourceNetwork":"BITCOIN",
         "sourceNetworkName":"Bitcoin",
         "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
         "blockchainTransactions":[
            {
               "type":"CHECKOUT_ORIGIN",
               "typeDescription":"Blockchain payment transaction initiated by customer.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2023-05-29T17:55:52+00:00",
               "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_BRIDGE",
               "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_SETTLEMENT",
               "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"9e912d924d6a27ee858e011db14825f016f835249302f90b82237a9b9782bde0",
               "amount":"117.8379738",
               "amountAssetCode":"USDC",
               "exception":null
            }
         ],
         "payload":{
            "charge":{
               "customerId":"bb657e88a23d",
               "currency":"EUR",
               "lineItems":[
                  {
                     "description":"Mobile Data Prepaid Credits",
                     "netAmount":"110.00000"
                  }
               ],
               "shippingCostItems":[
                  {
                     "description":"Instant Delivery",
                     "netAmount":0
                  }
               ],
               "taxItems":[
                  {
                     "name":"Hong Kong Sales Tax",
                     "percent":0
                  }
               ]
            },
            "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "webhook":"https://www.my-server.com/api/?action=cq-webhook",
            "links":{
               "cancelUrl":"https://www.my-server.com/en/payments",
               "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
            }
         },
         "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of checkout URLs in existence for this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.checkouts[] array A list of checkout objects. false
.id string(12) Unique identifier of the checkout. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the checkout was created. false
.state string Indicates the current payment state associated with this checkout. A state of COMPLETED indicates this checkout has completed and the funds were credited to your account.

Possible payment states:

PENDING_CHARGE, NEW_CHARGE, IN_PROGRESS, COMPLETED, EXPIRED, UNRESOLVED_GENERIC, UNRESOLVED_UNDERPAID, REFUNDED, RESOLVED_REFUNDED, RESOLVED_OTHER.
false
.type string Indicates whether this is a hosted (HOSTED) or self-hosted (SELF-HOSTED) checkout. false
.origin string Indicates whether this checkout was originally created via UI or API. false
.settlementAssetId string The settlement asset used for this checkout. Indicates the asset as given by GET /assets that you are credited in when the checkout is complete. false
.settlementAmountRequired string Indicates the total gross amount credited to your account when the checkout is complete. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.settlementAmountReceived string The net amount credited to your account. These funds are instantly available for transfer. false
.settlementAmountFeePaid string The processing fee collected by Whalestack. false
.sourceAssetId string The Stellar representation of the source asset as given by GET /assets. Indicates the payment asset selected by your customer. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceAmountRequired string Indicates the total amount payable by the customer to complete this checkout. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceAmountReceived string The total amount paid by the customer so far. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceNetwork string A payment network id as given by (GET /networks). Indicates the payment network selected by the customer in English plain text. This field is null if the checkout state is PENDING_CHARGE and the customer did not select a payment method yet. true
.sourceNetworkName string The selected network name in English plain text. true
.depositAddress string The deposit address associated with this checkout. This field is null for checkouts in PENDING_CHARGE state. For checkouts on Stellar this field combines the memo, memo type, and account in the following format:
{memo}:{memoType}@{stellarAccount}
true
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction. Can be CHECKOUT_ORIGIN (blockchain payment transaction initiated by the sender, CHECKOUT_BRIDGE (fund transfer from native blockchain to Stellar Network), or CHECKOUT_SETTLEMENT (Stellar transaction crediting your Whalestack account). false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.exception string An exception identifier that is set when a processing error or other exception occurred when handling this transaction. This is field is typically null.

Possible exceptions:

EXCHANGE_FAILED, CHECKOUT_ALREADY_COMPLETED, GENERIC.
true
.payload{} object The checkout payload as originally submitted by you to POST /checkout or POST /checkout/hosted. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/walletszabezpieczony

Zwraca listę obiektów portfela zawierającą informacje o powiązanym zasobie, saldzie, dostępnych sieciach i adresach depozytów (jeśli są dostępne).

Rządanie

curl 'https://www.whalestack.com/api/v1/wallets'

Odpowiedź Udana application/json

{
   "wallet":{
      "asset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
      "balance":"0.7343414",
      "currencyCode":"USD",
      "networks":[
         {
            "network":"STELLAR",
            "depositAddress":{
               "fields":{
                  "asset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
                  "account":"GBDHWMSXQ24FA2LJTPUH3HNK3WR7BJW3DUUBLMSNSJ7ST4XZK7WJHPCQ",
                  "memo":"sd376139586edb",
                  "memoType":"text"
               },
               "fieldConfig":[
                  {
                     "key":"asset",
                     "label":"Stellar Asset",
                     "description":"The deposit asset identifier on the Stellar network. Consists of asset code and Stellar account."
                  },
                  {
                     "key":"account",
                     "label":"Stellar Account",
                     "description":"The deposit account on the Stellar network. Starting with G."
                  },
                  {
                     "key":"memo",
                     "label":"Memo",
                     "description":"The mandatory memo to be included in the transaction. Do not omit this or your deposit will be delayed."
                  },
                  {
                     "key":"memoType",
                     "label":"Memo Type",
                     "description":"The mandatory memo type to be included in the transaction."
                  }
               ],
               "minAmount":"0.0000001",
               "maxAmount":"1000000"
            }
         },
         {
            "network":"SWIFT",
            "depositAddress":{
               "fields":{
                  "reference":"EUR-BD-USDC-376139586eda",
                  "beneficiary":"Whalestack Sp. z o.o.",
                  "account":"LT293550020000022181",
                  "swiftCode":"UAPELT22XXX",
                  "bankName":"UAB Pervesk",
                  "bankAddress":"Gedimino pr. 5-3, LT-01103 Vilnius, Lithuania",
                  "correspondentBankSwift":"INCOCHZZXXX",
                  "correspondentBankName":"INCORE BANK AG",
                  "correspondentBankAddress":"Wiesenstrasse 17, Schlieren, Switzerland"
               },
               "fieldConfig":[
                  {
                     "key":"reference",
                     "label":"Payment Reference",
                     "description":"Add this reference to your SWIFT deposit. It is needed to map the deposit to your merchant account. Do not omit this or your deposit will be delayed."
                  },
                  {
                     "key":"beneficiary",
                     "label":"Beneficiary",
                     "description":"The beneficiary account name."
                  },
                  {
                     "key":"account",
                     "label":"Bank Account Number",
                     "description":"The bank account number."
                  },
                  {
                     "key":"swiftCode",
                     "label":"SWIFT\/BIC",
                     "description":"The 8-11 character SWIFT or BIC code identifying your bank or financial institution."
                  },
                  {
                     "key":"bankName",
                     "label":"Bank Name",
                     "description":"The beneficiary bank name."
                  },
                  {
                     "key":"bankAddress",
                     "label":"Bank Address",
                     "description":"The beneficiary bank address."
                  },
                  {
                     "key":"correspondentBankSwift",
                     "label":"Correspondent Bank SWIFT\/BIC",
                     "description":"Provide this SWIFT\/BIC code if your bank asks you for an intermediary or correspondent bank."
                  },
                  {
                     "key":"correspondentBankName",
                     "label":"Correspondent Bank Name",
                     "description":"The correspondent bank name. Provide this if your bank asks you for an intermediary or correspondent bank."
                  },
                  {
                     "key":"correspondentBankAddress",
                     "label":"Correspondent Bank Address",
                     "description":"The correspondent bank address."
                  }
               ],
               "minAmount":"250",
               "maxAmount":"1000000"
            }
         },
         {
            "network":"SEPA",
            "depositAddress":{
               "fields":{
                  "reference":"EUR-BD-USDC-376139586eda",
                  "beneficiary":"Whalestack Sp. z o.o.",
                  "iban":"LT293550020000022181",
                  "swiftCode":"UAPELT22XXX",
                  "bankName":"UAB Pervesk",
                  "bankAddress":"Gedimino pr. 5-3, LT-01103 Vilnius, Lithuania"
               },
               "fieldConfig":[
                  {
                     "key":"reference",
                     "label":"Payment Reference",
                     "description":"Add this reference to your SEPA deposit. It is needed to map the deposit to your merchant account. Do not omit this or your deposit will be delayed."
                  },
                  {
                     "key":"beneficiary",
                     "label":"Beneficiary",
                     "description":"The beneficiary account name."
                  },
                  {
                     "key":"iban",
                     "label":"IBAN",
                     "description":"The international bank account number (IBAN)."
                  },
                  {
                     "key":"swiftCode",
                     "label":"SWIFT\/BIC",
                     "description":"The 8-11 character SWIFT or BIC code identifying your bank or financial institution."
                  },
                  {
                     "key":"bankName",
                     "label":"Bank Name",
                     "description":"The beneficiary bank name."
                  },
                  {
                     "key":"bankAddress",
                     "label":"Bank Address",
                     "description":"The beneficiary bank address."
                  }
               ],
               "minAmount":"100",
               "maxAmount":"1000000"
            }
         }
      ]
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.wallets[] array A list objects, representing the wallets in your account. false
.asset string The asset identifier as given by GET /assets. false
.balance string The asset balance in your wallet. false
.currencyCode string The asset's normalized currency code as given by GET /currencies. false
.networks[] array A list of networks with your wallet deposit addresses. Network identifiers as given by GET /networks. This list also indicates to which networks the asset can be transferred to. false
.network string A network identifier as given by GET /networks. false
.depositAddress{} object An object containing the deposit address to which the payment was made. Consists of fields, fieldConfig, minAmount, and maxAmount as documented in POST /deposit-address. true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/walletzabezpieczony

Zwraca obiekt portfela zawierający informacje o powiązanym zasobie, saldzie, dostępnych sieciach i adresach depozytów (jeśli są dostępne).

Rządanie

curl 'https://www.whalestack.com/api/v1/wallet?asset=XXX'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
asset string An asset identifier as given by GET /assets or GET /wallets. - mandatory

Odpowiedź Udana application/json

{
   "wallet":{
      "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "balance":"7.1403584",
      "currencyCode":"BTC",
      "networks":[
         {
            "network":"BITCOIN",
            "depositAddress":{
               "fields":{
                  "address":"3QdzvaD2pfKEkqguxAfXW274TUJMtiXqG5"
               },
               "fieldConfig":[
                  {
                     "key":"address",
                     "label":"Bitcoin Address",
                     "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
                  }
               ],
               "minAmount":"0.0000100",
               "maxAmount":"100.0000000"
            }
         },
         {
            "network":"STELLAR",
            "depositAddress":{
               "fields":{
                  "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
                  "account":"GBDHWMSXQ24FA2LJTPUH3HNK3WR7BJW3DUUBLMSNSJ7ST4XZK7WJHPCQ",
                  "memo":"sd376139586edb",
                  "memoType":"text"
               },
               "fieldConfig":[
                  {
                     "key":"asset",
                     "label":"Stellar Asset",
                     "description":"The deposit asset identifier on the Stellar network. Consists of asset code and Stellar account."
                  },
                  {
                     "key":"account",
                     "label":"Stellar Account",
                     "description":"The deposit account on the Stellar network. Starting with G."
                  },
                  {
                     "key":"memo",
                     "label":"Memo",
                     "description":"The mandatory memo to be included in the transaction. Do not omit this or your deposit will be delayed."
                  },
                  {
                     "key":"memoType",
                     "label":"Memo Type",
                     "description":"The mandatory memo type to be included in the transaction."
                  }
               ],
               "minAmount":"0.0000001",
               "maxAmount":"1000000"
            }
         }
      ]
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.wallet{} array An object containing information about the wallet. false
.asset string The asset identifier as given by GET /assets. false
.balance string The asset balance in your wallet. false
.currencyCode string The asset's normalized currency code as given by GET /currencies. false
.networks[] array A list of networks with your wallet deposit addresses. Network identifiers as given by GET /networks. This list also indicates to which networks the asset can be transferred to. false
.network string A network identifier as given by GET /networks. false
.depositAddress{} object An object containing the deposit address to which the payment was made. Consists of fields, fieldConfig, minAmount, and maxAmount as documented in POST /deposit-address. true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/deposit-addresszabezpieczony

Tworzy adres blockchain lub depozytu bankowego dla danej sieci i zasobu.

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/deposit \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładyowe Payloads

Payload zależy od sieci źródłowej, z której deponujesz środki. Wybierz poniżej.

{
    "network": "BITCOIN"
}
{
    "network": "LIGHTNING",
    "amount": "5000"
}
{
    "network": "LITECOIN"
}
{
    "network": "STELLAR",
    "asset": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}
{
    "network": "SWIFT",
    "asset": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}
{
    "network": "SEPA",
    "asset": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}

Parametry Żądania (POST)

Payload zależy od sieci źródłowej, z której deponujesz środki. Wybierz poniżej.

Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. BITCOIN false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional
Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. LIGHTNING false mandatory
.amount string Kwota faktury w SAT. false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional
Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. LITECOIN false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional
Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. STELLAR false mandatory
.asset string Identyfikator aktywów depozytowych w sieci Stellar. Składa się z kodu aktywa i emitenta. false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional
Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. SWIFT false mandatory
.asset string Określa aktywa przelane na twoje konto po zakończeniu depozytu. Odniesienia USDC lub EURC. Identyfikator zasobu podany przez GET /assets. false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional
Klucz Rodzaj Opis Zerowalny Obowiązkowy
.network string Identyfikator sieci docelowej podany przez GET /networks, tj. SEPA false mandatory
.asset string Określa aktywa przelane na twoje konto po zakończeniu depozytu. Odniesienia USDC lub EURC. Identyfikator zasobu podany przez GET /assets. false mandatory
.webhook string URL on your server listening for deposits via WEBHOOK deposit-completed. Overwrites previously submitted URLs and overrides webhook URL API Settings in the UI (if any). false optional

Odpowiedź Udana application/json

Payload zależy od sieci źródłowej, z której deponujesz środki. Wybierz poniżej.

{
    "depositAddress": {
        "network": "BITCOIN",
        "fields": {
            "address": "bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
        },
        "fieldConfig": [
            {
                "key": "address",
                "label": "Bitcoin Adres",
                "description": "Adres Bitcoin. Mou017ce byu0107 w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH)."
            }
        ],
        "minAmount": "0.0000100",
        "maxAmount": "100.0000000"
    }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. BITCOIN. false
.fields object A set of fields (all strings) specifying the deposit account. false
.address string Adres Bitcoin. Może być w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH). false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false
{
    "depositAddress": {
        "network": "LIGHTNING",
        "fields": {
            "invoice": "lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9c...",
            "amount": "5000"
        },
        "fieldConfig": [
            {
                "key": "invoice",
                "label": "Faktura Lightning",
                "description": "Faktura BOLT 11 Lightning z zakodowanu0105 kwotu0105."
            },
            {
                "key": "amount",
                "label": "Kwota Faktury",
                "description": "Kwota faktury w SAT."
            }
        ],
        "minAmount": "4000.0000000",
        "maxAmount": "507059.0000000"
    }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. LIGHTNING. false
.fields object A set of fields (all strings) specifying the deposit account. false
.invoice string Faktura BOLT 11 Lightning z zakodowaną kwotą. false
.amount string Kwota faktury w SAT. false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false
{
    "depositAddress": {
        "network": "LITECOIN",
        "fields": {
            "address": "LgVQ2XamTCjBa3tnUpWQ1H4hgzMddWCPdf"
        },
        "fieldConfig": [
            {
                "key": "address",
                "label": "Litecoin Adres",
                "description": "Adres Litecoin. Mou017ce byu0107 w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH)."
            }
        ],
        "minAmount": "0.0000100",
        "maxAmount": "10000.0000000"
    }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. LITECOIN. false
.fields object A set of fields (all strings) specifying the deposit account. false
.address string Adres Litecoin. Może być w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH). false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false
{
    "depositAddress": {
        "network": "STELLAR",
        "fields": {
            "asset": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "account": "GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU7",
            "memo": "sda3195ad7ed65",
            "memoType": "text"
        },
        "fieldConfig": [
            {
                "key": "asset",
                "label": "Zasu00f3b Stellar",
                "description": "Identyfikator aktywu00f3w depozytowych w sieci Stellar. Sku0142ada siu0119 z kodu aktywa i emitenta."
            },
            {
                "key": "account",
                "label": "Konto Stellar",
                "description": "Konto depozytowe w sieci Stellar. Poczu0105wszy od G."
            },
            {
                "key": "memo",
                "label": "Notka",
                "description": "Obowiu0105zkowa notatka, ktu00f3ru0105 naleu017cy dou0142u0105czyu0107 do transakcji. Nie pomijaj tego, w przeciwnym razie Twoja wpu0142ata zostanie opu00f3u017aniona."
            },
            {
                "key": "memoType",
                "label": "Rodzaj Notki",
                "description": "Obowiu0105zkowy typ noty, ktu00f3ry ma zostau0107 uwzglu0119dniony w transakcji."
            }
        ],
        "minAmount": "0.0000001",
        "maxAmount": "1000000"
    }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. STELLAR. false
.fields object A set of fields (all strings) specifying the deposit account. false
.asset string Identyfikator aktywów depozytowych w sieci Stellar. Składa się z kodu aktywa i emitenta. false
.account string Konto depozytowe w sieci Stellar. Począwszy od G. false
.memo string Obowiązkowa notatka, którą należy dołączyć do transakcji. Nie pomijaj tego, w przeciwnym razie Twoja wpłata zostanie opóźniona. false
.memoType string Obowiązkowy typ noty, który ma zostać uwzględniony w transakcji. false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false
{
    "depositAddress": {
        "network": "SWIFT",
        "fields": {
            "reference": "EUR-BD-USDC-1a2b3c4d5e6f",
            "beneficiary": "Whalestack Sp. z o.o.",
            "account": "LT293550020000047621",
            "swiftCode": "UAPELT22XXX",
            "bankName": "UAB Pervesk",
            "bankAddress": "Vilnius, Lithuania",
            "correspondentBankSwift": "INCOCHZZXXX",
            "correspondentBankName": "INCORE BANK AG",
            "correspondentBankAddress": "Schlieren, Switzerland"
        },
        "fieldConfig": [
            {
                "key": "reference",
                "label": "Referencje Pu0142atnou015bci",
                "description": "Dodaj to odniesienie do swojej wpu0142aty SWIFT. Jest potrzebny do zmapowania wpu0142aty na konto handlowca. Nie pomijaj tego, w przeciwnym razie Twoja wpu0142ata zostanie opu00f3u017aniona."
            },
            {
                "key": "beneficiary",
                "label": "Beneficjent",
                "description": "Nazwa rachunku beneficjenta."
            },
            {
                "key": "account",
                "label": "Numer Konta Bankowego",
                "description": "Numer konta bankowego."
            },
            {
                "key": "swiftCode",
                "label": "SWIFT/BIC",
                "description": "Kod SWIFT lub BIC sku0142adaju0105cy siu0119 z 8-11 znaku00f3w identyfikuju0105cy twu00f3j bank lub instytucju0119 finansowu0105."
            },
            {
                "key": "bankName",
                "label": "Nazwa Banku",
                "description": "Nazwa banku beneficjenta."
            },
            {
                "key": "bankAddress",
                "label": "Adres Banku",
                "description": "Adres banku beneficjenta."
            },
            {
                "key": "correspondentBankSwift",
                "label": "Bank Korespondent SWIFT/BIC",
                "description": "Podaj ten kod SWIFT/BIC, jeu015bli Twu00f3j bank prosi o podanie banku pou015bredniczu0105cego lub korespondenta."
            },
            {
                "key": "correspondentBankName",
                "label": "Nazwa Banku Korespondencyjnego",
                "description": "Nazwa banku korespondenta. Podaj to, jeu015bli Twu00f3j bank poprosi Ciu0119 o podanie banku pou015bredniczu0105cego lub korespondenta."
            },
            {
                "key": "correspondentBankAddress",
                "label": "Adres Banku Korespondencyjnego",
                "description": "Adres banku korespondencyjnego. Podaj to, jeu015bli Twu00f3j bank poprosi Ciu0119 o podanie banku pou015bredniczu0105cego lub korespondenta."
            }
        ],
        "minAmount": 250,
        "maxAmount": 500000
    }
}

Wyślij Płatność w EUR

Wyślij płatność denominowaną w EUR.

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. SWIFT. false
.fields object A set of fields (all strings) specifying the deposit account. false
.reference string Dodaj to odniesienie do swojej wpłaty SWIFT. Jest potrzebny do zmapowania wpłaty na konto handlowca. Nie pomijaj tego, w przeciwnym razie Twoja wpłata zostanie opóźniona. false
.beneficiary string Nazwa rachunku beneficjenta. false
.account string Numer konta bankowego. false
.swiftCode string Kod SWIFT lub BIC składający się z 8-11 znaków identyfikujący twój bank lub instytucję finansową. false
.bankName string Nazwa banku beneficjenta. false
.bankAddress string Adres banku beneficjenta. false
.correspondentBankSwift string Podaj ten kod SWIFT/BIC, jeśli Twój bank prosi o podanie banku pośredniczącego lub korespondenta. false
.correspondentBankName string Nazwa banku korespondenta. Podaj to, jeśli Twój bank poprosi Cię o podanie banku pośredniczącego lub korespondenta. false
.correspondentBankAddress string Adres banku korespondencyjnego. Podaj to, jeśli Twój bank poprosi Cię o podanie banku pośredniczącego lub korespondenta. false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false
{
    "depositAddress": {
        "network": "SEPA",
        "fields": {
            "reference": "EUR-BD-USDC-1a2b3c4d5e6f",
            "beneficiary": "Whalestack Sp. z o.o.",
            "iban": "LT293550020000047621",
            "swiftCode": "UAPELT22XXX",
            "bankName": "UAB Pervesk",
            "bankAddress": "Vilnius, Lithuania"
        },
        "fieldConfig": [
            {
                "key": "reference",
                "label": "Referencje Pu0142atnou015bci",
                "description": "Dodaj to odniesienie do swojej wpu0142aty SEPA. Jest potrzebny do zmapowania wpu0142aty na konto handlowca. Nie pomijaj tego, w przeciwnym razie Twoja wpu0142ata zostanie opu00f3u017aniona."
            },
            {
                "key": "beneficiary",
                "label": "Beneficjent",
                "description": "Nazwa rachunku beneficjenta."
            },
            {
                "key": "iban",
                "label": "IBAN",
                "description": "Miu0119dzynarodowy numer konta bankowego (IBAN)."
            },
            {
                "key": "swiftCode",
                "label": "SWIFT/BIC",
                "description": "Kod SWIFT lub BIC sku0142adaju0105cy siu0119 z 8-11 znaku00f3w identyfikuju0105cy twu00f3j bank lub instytucju0119 finansowu0105."
            },
            {
                "key": "bankName",
                "label": "Nazwa Banku",
                "description": "Nazwa banku beneficjenta."
            },
            {
                "key": "bankAddress",
                "label": "Adres Banku",
                "description": "Adres banku beneficjenta."
            }
        ],
        "minAmount": 50,
        "maxAmount": 500000
    }
}

Wyślij Płatność w EUR

Wyślij płatność denominowaną w EUR.

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.depositAddress{} object An object containing deposit information. false
.network string A network identifier as given by GET /networks, e.g. SEPA. false
.fields object A set of fields (all strings) specifying the deposit account. false
.reference string Dodaj to odniesienie do swojej wpłaty SEPA. Jest potrzebny do zmapowania wpłaty na konto handlowca. Nie pomijaj tego, w przeciwnym razie Twoja wpłata zostanie opóźniona. false
.beneficiary string Nazwa rachunku beneficjenta. false
.iban string Międzynarodowy numer konta bankowego (IBAN). false
.swiftCode string Kod SWIFT lub BIC składający się z 8-11 znaków identyfikujący twój bank lub instytucję finansową. false
.bankName string Nazwa banku beneficjenta. false
.bankAddress string Adres banku beneficjenta. false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.minAmount string The minimum deposit amount. false
.maxAmount string The maximum deposit amount. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/depositzabezpieczony

Pobiera szczegóły dotyczące danego depozytu.

Rządanie

curl 'https://www.whalestack.com/api/v1/deposit?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Blockchain transaction id of your deposit or unique identifier as given by GET /deposits. null mandatory

Odpowiedź Udana application/json

{
   "deposit":{
      "id":"eb3729168fb2",
      "state":"COMPLETED",
      "timestamp":"2022-10-14T19:49:51+00:00",
      "network":"BITCOIN",
      "networkName":"Bitcoin",
      "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "currencyCode":"BTC",
      "amountGross":"7.1479281",
      "amountNet":"7.1479281",
      "amountFees":"0.0000000",
      "webhook":"https://www.your-server.com/path/to/webhook",
      "blockchainTransactions":[
         {
            "type":"DEPOSIT_ORIGIN",
            "typeDescription":"Blockchain transaction on the source network.",
            "network":"BITCOIN",
            "networkName":"Bitcoin",
            "timestamp":"2022-10-14T20:00:17+00:00",
            "tx":"77ddc93467f12fc79d73a936f09044689eebb1e045c1f81b5c14a91396147fed",
            "amount":"7.1479281",
            "amountAssetCode":"BTC"
         },
         {
            "type":"DEPOSIT_SETTLEMENT",
            "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
            "network":"STELLAR",
            "networkName":"Stellar",
            "timestamp":"2022-10-14T20:00:17+00:00",
            "tx":"24c69c410e48ab3f7dd264429ec090e954b3b8b3b9860a5dd6c130f2926e0857",
            "amount":"7.1479281",
            "amountAssetCode":"BTC"
         }
      ],
      "depositAddress":{
         "fields":{
            "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
         },
         "fieldConfig":[
            {
               "key":"address",
               "label":"Bitcoin Address",
               "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
            }
         ]
      },
      "bankTransactions":null
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.deposit{} object An object containing deposit information. false
.id string(12) Unique identifier of this deposit. false
.state string The deposit state. Possible values:
COMPLETED, FAILED, PROCESSING, PENDING_EXTERNAL
false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the deposit was first detected. false
.network string A payment network id as given by GET /networks. Indicates the payment network on which the deposit was made. false
.networkName string The payment network name in English plain text. false
.asset string The Stellar representation of the asset credited to your account as given by GET /assets. false
.currencyCode string The deposit currency code as given by GET /currencies. false
.amountGross string The gross amount credited to your account. false
.amountNet string The net amount credited to your account. These funds are instantly available for transfer. false
.amountFees string The paid fees, if any. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this deposit (as specified in webhook concepts). true
.blockchainTransactions[] array A list of blockchain transactions associated with this deposit. false
.type string The type of blockchain transaction. Can be DEPOSIT_ORIGIN (blockchain payment transaction initiated by the sender) or DEPOSIT_SETTLEMENT (Stellar transaction crediting your Whalestack account). false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.depositAddress{} object An object containing the deposit address to which the payment was made. Consists of fields and fieldConfig as documented in POST /deposit-address. true
.bankTransactions[] array A list of bank transactions associated with this deposit, if any. true
.id string(12) A string identifying the bank transaction on Whalestack. false
.network string The bank network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The bank network name in English plain text. false
.grossAmount string The gross amount received by Whalestack in the bank transaction. false
.amountCurrency string(3) The source currency as given by GET /currencies. false
.bankFee string The fees collected by the bank(s) for processing the payment. false
.bankFeeCurrency string(3) The fee currency as given by GET /currencies. false
.netAmount string The net amount used for minting the deposit asset on Whalestack. false
.reference string The reference line used in the bank payment. false
.sender string The name of the sender of the originating bank account. true
.sourceAccount string The bank account number of the sender. true
.sourceBank string A BIC/SWIFT code identifying the sending bank. true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/depositszabezpieczony

Pobiera listę Twoich depozytów (w kolejności malejącej od najnowszych do najstarszych).

Rządanie

curl 'https://www.whalestack.com/api/v1/deposits?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of deposit objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":1,
   "limit":10,
   "offset":0,
   "deposits":[
      {
         "id":"eb3729168fb2",
         "state":"COMPLETED",
         "timestamp":"2022-10-14T19:49:51+00:00",
         "network":"BITCOIN",
         "networkName":"Bitcoin",
         "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "currencyCode":"BTC",
         "amountGross":"7.1479281",
         "amountNet":"7.1479281",
         "amountFees":"0.0000000",
         "webhook":"https://www.your-server.com/path/to/webhook",
         "blockchainTransactions":[
            {
               "type":"DEPOSIT_ORIGIN",
               "typeDescription":"Blockchain transaction on the source network.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2022-10-14T20:00:17+00:00",
               "tx":"77ddc93467f12fc79d73a936f09044689eebb1e045c1f81b5c14a91396147fed",
               "amount":"7.1479281",
               "amountAssetCode":"BTC"
            },
            {
               "type":"DEPOSIT_SETTLEMENT",
               "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2022-10-14T20:00:17+00:00",
               "tx":"24c69c410e48ab3f7dd264429ec090e954b3b8b3b9860a5dd6c130f2926e0857",
               "amount":"7.1479281",
               "amountAssetCode":"BTC"
            }
         ],
         "depositAddress":{
            "fields":{
               "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
            },
            "fieldConfig":[
               {
                  "key":"address",
                  "label":"Bitcoin Address",
                  "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
               }
            ]
         },
         "bankTransactions":null
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of deposits initiated in this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.deposits[] array A list of deposit objects. false
.id string(12) Unique identifier of this deposit. false
.state string The deposit state. Possible values:
COMPLETED, FAILED, PROCESSING, PENDING_EXTERNAL
false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the deposit was first detected. false
.network string A payment network id as given by GET /networks. Indicates the payment network on which the deposit was made. false
.networkName string The payment network name in English plain text. false
.asset string The Stellar representation of the asset credited to your account as given by GET /assets. false
.currencyCode string The deposit currency code as given by GET /currencies. false
.amountGross string The gross amount credited to your account. false
.amountNet string The net amount credited to your account. These funds are instantly available for transfer. false
.amountFees string The paid fees, if any. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this deposit (as specified in webhook concepts). true
.blockchainTransactions[] array A list of blockchain transactions associated with this deposit. false
.type string The type of blockchain transaction. Can be DEPOSIT_ORIGIN (blockchain payment transaction initiated by the sender) or DEPOSIT_SETTLEMENT (Stellar transaction crediting your Whalestack account). false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.depositAddress{} object An object containing the deposit address to which the payment was made. Consists of fields and fieldConfig as documented in POST /deposit-address. true
.bankTransactions[] array A list of bank transactions associated with this deposit, if any. true
.id string(12) A string identifying the bank transaction on Whalestack. false
.network string The bank network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The bank network name in English plain text. false
.grossAmount string The gross amount received by Whalestack in the bank transaction. false
.amountCurrency string(3) The source currency as given by GET /currencies. false
.bankFee string The fees collected by the bank(s) for processing the payment. false
.bankFeeCurrency string(3) The fee currency as given by GET /currencies. false
.netAmount string The net amount used for minting the deposit asset on Whalestack. false
.reference string The reference line used in the bank payment. false
.sender string The name of the sender of the originating bank account. true
.sourceAccount string The bank account number of the sender. true
.sourceBank string A BIC/SWIFT code identifying the sending bank. true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/swapzabezpieczony

Inicjuje wymianę zasobów na Twoim koncie i zwraca obiekt wymiany w stanie PENDING_API_COMMIT. Obiekt zawiera wycenę z kwotami źródłowymi i docelowymi. Aby zaakceptować wycenę, potwierdź wymianę, wywołując POST /swap/commit.

Rządanie

curl -X POST https://www.whalestack.com/api/v1/swap \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykład: Wymiana 100 USDC na BTC

{
   "sourceAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "sourceAmount":100,
   "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
}

Przykład: Wymiana 100 USDC na BTC

{
   "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
   "targetAsset":"XLM:NATIVE",
   "targetAmount":100
}

Parametry Żądania (POST)

Klucz Rodzaj Opis Domyślny Obowiązkowy
sourceAsset string An asset identifier as given by GET /assets or GET /wallets. Specifies the source asset in the swap. null mandatory
sourceAmount numeric Specifies the amount of sourceAsset you wish to debit from your account to make the swap.

The API response contains the calculated target amount, which you can inspect and confirm by invoking a subsequent request to POST /swap/commit.

If you would like to specify the exact target amount instead, please use the targetAmount attribute and don't specify a sourceAmount.
null optional
targetAsset string An asset identifier as given by GET /assets or GET /wallets. Specifies the target asset in the swap. null mandatory
targetAmount numeric Specifies the amount of targetAsset you wish to credit to your account when the swap completes.

The API response contains the required source amount, which you can inspect and confirm by invoking a subsequent request to POST /swap/commit.

If you would like to specify the exact source amount instead, please use the sourceAmount attribute and don't specify a targetAmount.
null optional
webhook string URL on your server listening for swap state changes as specified in webhook concepts. Overwrites webhook URL API Settings in the UI (if any). null optional

Odpowiedź Udana application/json

{
   "swap":{
      "id":"5074f4ee055d",
      "state":"PENDING_API_COMMIT",
      "type":"SOURCE_SPECIFIED",
      "origin":"API",
      "createTime":"2021-05-06T22:15:37+00:00",
      "completeTime":null,
      "expireTime":"2021-05-06T23:15:37+00:00",
      "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
      "sourceAmount":"100.0000000",
      "targetAssetId":"XLM:NATIVE",
      "targetAmount":"243.3928192",
      "blockchainTransactions":[],
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.swap{} object An object with swap information. false
.id string(12) Unique identifier of this swap. false
.state string The swap state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.type string The swap type. SOURCE_SPECIFIED indicates that you specified the source amount. TARGET_SPECIFIED indicates that you specified the target amount. false
.origin string Indicates how the swap was initiated, either UI or API. false
.createTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was created. false
.completeTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was completed. This value is set when the swap state is COMPLETED and otherwise it is null. true
.expireTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the guaranteed conversion rate expires. Please send the API commit before the expiration time to ensure swap execution. true
.sourceAssetId string The source asset in the swap. An asset id as given by GET /assets. false
.sourceAmount string A numeric string indicating the total amount of sourceAsset debited from your account on swap completion. false
.targetAssetId string The target asset in the swap. An asset id as given by GET /assets. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.blockchainTransactions[] array A list of blockchain transactions associated with this swap. false
.type string The type of blockchain transaction, i.e. SWAP. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this swap (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/swap/commitzabezpieczony

Zatwierdza i wykonuje wymianę w stanie PENDING_API_COMMIT, zainicjowaną wcześniej za pomocą POST /swap.

Zwraca obiekt wymiany w stanie innym niż końcowy PROCESSING. Końcowy stan COMPLETED lub FAILED jest wysyłany przez webhook i alternatywnie można go odpytywać za pomocą GET /swap.

Rządanie

curl -X POST 'https://www.whalestack.com/api/v1/swap/commit'
    -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
  "swapId":"12d72c3c8145"
}

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
swapId string(12) Unique identifier as given by POST /swap. null mandatory

Odpowiedź Udana application/json

{
   "swap":{
      "id":"5074f4ee055d",
      "state":"PROCESSING",
      "type":"SOURCE_SPECIFIED",
      "origin":"API",
      "createTime":"2021-05-06T22:15:37+00:00",
      "completeTime":"2021-05-06T22:16:01+00:00",
      "expireTime":"2021-05-06T23:15:37+00:00",
      "sourceAssetIssuer":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
      "sourceAmount":"100.0000000",
      "targetAssetIssuer":"XLM:NATIVE",
      "targetAmount":"243.3928192",
      "blockchainTransactions":[],
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.swap{} object An object containing swap information. false
.id string(12) Unique identifier of this swap. false
.state string The swap state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.type string The swap type. SOURCE_SPECIFIED indicates that you specified the source amount. TARGET_SPECIFIED indicates that you specified the target amount. false
.origin string Indicates how the swap was initiated, either UI or API. false
.createTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was created. false
.completeTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was completed. This value is set when the swap state is COMPLETED and otherwise it is null. true
.expireTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the guaranteed conversion rate expires. Please send the API commit before the expiration time to ensure swap execution. true
.sourceAssetId string The source asset in the swap. An asset id as given by GET /assets. false
.sourceAmount string A numeric string indicating the total amount of sourceAsset debited from your account on swap completion. false
.targetAssetId string The target asset in the swap. An asset id as given by GET /assets. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.blockchainTransactions[] array A list of blockchain transactions associated with this swap. false
.type string The type of blockchain transaction, i.e. SWAP. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this swap (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/swapzabezpieczony

Pobiera szczegóły danej wymiany.

Rządanie

curl 'https://www.whalestack.com/api/v1/swap?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by GET /swaps or POST /swap. null mandatory

Odpowiedź Udana application/json

{
   "swap":{
      "id":"5074f4ee055d",
      "state":"COMPLETED",
      "type":"SOURCE_SPECIFIED",
      "origin":"API",
      "createTime":"2021-05-06T22:15:37+00:00",
      "completeTime":"2021-05-06T22:16:01+00:00",
      "expireTime":"2021-05-06T23:15:37+00:00",
      "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
      "sourceAmount":"100.0000000",
      "targetAssetId":"XLM:NATIVE",
      "targetAmount":"243.3928192",
      "blockchainTransactions":[
        {
           "type":"SWAP",
           "typeDescription":"Blockchain transaction executed during the swap on the Stellar Network.",
           "network": "STELLAR",
           "networkName": "Stellar",
           "timestamp": "2021-05-06T22:16:01+00:00",
           "tx":"ac8f8554b273c8a0191309154bd108346c333b7f9dc3ada8f080c7efaab614a7",
           "amount":"243.3928192",
           "amountAssetCode":"XLM"
        }
      ],
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.swap{} object An object containing swap information. false
.id string(12) Unique identifier of this swap. false
.state string The swap state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.type string The swap type. SOURCE_SPECIFIED indicates that you specified the source amount. TARGET_SPECIFIED indicates that you specified the target amount. false
.origin string Indicates how the swap was initiated, either UI or API. false
.createTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was created. false
.completeTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was completed. This value is set when the swap state is COMPLETED and otherwise it is null. true
.expireTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the guaranteed conversion rate expires. Please send the API commit before the expiration time to ensure swap execution. true
.sourceAssetId string The source asset in the swap. An asset id as given by GET /assets. false
.sourceAmount string A numeric string indicating the total amount of sourceAsset debited from your account on swap completion. false
.targetAssetId string The target asset in the swap. An asset id as given by GET /assets. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.blockchainTransactions[] array A list of blockchain transactions associated with this swap. false
.type string The type of blockchain transaction, i.e. SWAP. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this swap (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/swapszabezpieczony

Pobiera listę swapów (w kolejności malejącej od najnowszych do najstarszych).

Rządanie

curl 'https://www.whalestack.com/api/v1/swaps?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of swap objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":2,
   "limit":10,
   "offset":0,
   "swaps":[
      {
         "id":"23b4f4ee055d",
         "state":"PENDING_API_COMMIT",
         "type":"SOURCE_SPECIFIED",
         "origin":"API",
         "createTime":"2021-05-06T22:15:37+00:00",
         "completeTime":null,
         "expireTime":"2021-05-06T23:15:37+00:00",
         "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "sourceAmount":"10.0000000",
         "targetAssetId":"XLM:NATIVE",
         "targetAmount":"24.1392819",
         "blockchainTransactions":[

         ],
         "webhook":"https://www.your-server.com/path/to/webhook"
      },
      {
         "id":"5074f4ee055d",
         "state":"COMPLETED",
         "type":"SOURCE_SPECIFIED",
         "origin":"API",
         "createTime":"2021-05-06T22:15:37+00:00",
         "completeTime":"2021-05-06T22:16:01+00:00",
         "expireTime":"2021-05-06T23:15:37+00:00",
         "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "sourceAmount":"100.0000000",
         "targetAssetId":"XLM:NATIVE",
         "targetAmount":"243.3928192",
         "blockchainTransactions":[
            {
               "type":"SWAP",
               "typeDescription":"Blockchain transaction executed during the swap on the Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2021-05-06T22:16:01+00:00",
               "tx":"ac8f8554b273c8a0191309154bd108346c333b7f9dc3ada8f080c7efaab614a7",
               "amount":"243.3928192",
               "amountAssetCode":"XLM"
            }
         ],
         "webhook":"https://www.your-server.com/path/to/webhook"
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of swaps initiated in this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.swaps[] array A list of swap objects. false
.id string(12) Unique identifier of this swap. false
.state string The swap state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.type string The swap type. SOURCE_SPECIFIED indicates that you specified the source amount. TARGET_SPECIFIED indicates that you specified the target amount. false
.origin string Indicates how the swap was initiated, either UI or API. false
.createTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was created. false
.completeTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the swap was completed. This value is set when the swap state is COMPLETED and otherwise it is null. true
.expireTime timestamp W3C formatted time stamp with time zone (UTC) specifying when the guaranteed conversion rate expires. Please send the API commit before the expiration time to ensure swap execution. true
.sourceAssetId string The source asset in the swap. An asset id as given by GET /assets. false
.sourceAmount string A numeric string indicating the total amount of sourceAsset debited from your account on swap completion. false
.targetAssetId string The target asset in the swap. An asset id as given by GET /assets. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.targetAmount string A numeric string indicating the total amount of targetAsset credited to your account on swap completion. false
.blockchainTransactions[] array A list of blockchain transactions associated with this swap. false
.type string The type of blockchain transaction, i.e. SWAP. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this swap (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/target-accountszabezpieczony

Zwraca listę docelowych obiektów konta (w kolejności malejącej od najnowszych do najstarszych).

Rządanie

curl 'https://www.whalestack.com/api/v1/target-accounts?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of target account objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

Payload każdego obiektu zależy od jego sieci docelowej. Wybierz poniżej.

{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "BITCOIN",
            "label": "Ledger Nano on Bitcoin",
            "fields": {
                "address": "bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23"
            },
            "fieldConfig": [
                {
                    "key": "address",
                    "label": "Bitcoin Adres",
                    "description": "Adres Bitcoin. Mo\u017ce by\u0107 w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH)."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": "b5bcf27e5482"
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "ETHEREUM",
            "label": "Ledger Nano on Ethereum",
            "fields": {
                "account": "0xA2Bf179E09C503262E418FC72261837726f68F36"
            },
            "fieldConfig": [
                {
                    "key": "account",
                    "label": "Konto Ethereum",
                    "description": "Konto w sieci Ethereum. Zaczyna si\u0119 od 0x."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": "b5bcf27e5482"
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "LITECOIN",
            "label": "Ledger Nano on Litecoin",
            "fields": {
                "address": "LgVQ2XamTCjBa3tnUpWQ1H4hgzMddWCPdn"
            },
            "fieldConfig": [
                {
                    "key": "address",
                    "label": "Litecoin Adres",
                    "description": "Adres Litecoin. Mo\u017ce by\u0107 w dowolnym formacie, np. natywnym SegWit (bech32), SegWit (P2SH) lub starszym (P2PKH)."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": "b5bcf27e5482"
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "STELLAR",
            "label": "Ledger Nano on Stellar",
            "fields": {
                "account": "GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU6",
                "memo": "EXODUS",
                "memoType": "text"
            },
            "fieldConfig": [
                {
                    "key": "account",
                    "label": "Konto Stellar",
                    "description": "Konto w sieci Stellar. Pocz\u0105wszy od G."
                },
                {
                    "key": "memo",
                    "label": "Notka",
                    "description": "Identyfikuje odbiorc\u0119 lub cel p\u0142atno\u015bci. Notatka jest cz\u0119sto wymagana przez gie\u0142dy i portfele. Pami\u0119taj, aby go poda\u0107 w razie potrzeby."
                },
                {
                    "key": "memoType",
                    "label": "Rodzaj Notki",
                    "description": "Dodatkowa flaga identyfikuj\u0105ca typ notatki. Zwykle jest to `tekst`."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": "b5bcf27e5482"
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "SWIFT",
            "label": "My Bank Account on SWIFT",
            "fields": {
                "account": "DE12334567890",
                "bic": "NTSBDEB1XXX",
                "bankName": "N26",
                "bankAddress": "Berlin, Germany"
            },
            "fieldConfig": [
                {
                    "key": "account",
                    "label": "Numer Konta Bankowego",
                    "description": "Numer konta bankowego."
                },
                {
                    "key": "bic",
                    "label": "SWIFT\/BIC",
                    "description": "Kod SWIFT lub BIC sk\u0142adaj\u0105cy si\u0119 z 8-11 znak\u00f3w identyfikuj\u0105cy tw\u00f3j bank lub instytucj\u0119 finansow\u0105."
                },
                {
                    "key": "bankName",
                    "label": "Nazwa Banku",
                    "description": "Nazwa banku beneficjenta."
                },
                {
                    "key": "bankAddress",
                    "label": "Adres Banku",
                    "description": "Adres banku beneficjenta."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": null
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "SEPA",
            "label": "My Bank Account on SEPA",
            "fields": {
                "iban": "DE23100110012624331586",
                "bic": "NTSBDEB1XXX",
                "bankName": "N26",
                "bankAddress": "Berlin, Germany"
            },
            "fieldConfig": [
                {
                    "key": "iban",
                    "label": "IBAN",
                    "description": "Mi\u0119dzynarodowy numer konta bankowego (IBAN)."
                },
                {
                    "key": "bic",
                    "label": "SWIFT\/BIC",
                    "description": "Kod SWIFT lub BIC sk\u0142adaj\u0105cy si\u0119 z 8-11 znak\u00f3w identyfikuj\u0105cy tw\u00f3j bank lub instytucj\u0119 finansow\u0105."
                },
                {
                    "key": "bankName",
                    "label": "Nazwa Banku",
                    "description": "Nazwa banku beneficjenta."
                },
                {
                    "key": "bankAddress",
                    "label": "Adres Banku",
                    "description": "Adres banku beneficjenta."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": null
        }
    ]
}
{
    "count": 1,
    "limit": 10,
    "offset": 0,
    "targetAccounts": [
        {
            "network": "PIX",
            "label": "My Bank Account on Brazilian PIX",
            "fields": {
                "pixKey": "34.773.171\/0001-75",
                "taxId": "34.773.171\/0001-75"
            },
            "fieldConfig": [
                {
                    "key": "pixKey",
                    "label": "Klucz PIX",
                    "description": "Klucz PIX powi\u0105zany z kontem bankowym odbiorcy. Zazwyczaj numer telefonu, kod CPF, adres email lub losowy klucz."
                },
                {
                    "key": "taxId",
                    "label": "Identyfikator Podatkowy",
                    "description": "Identyfikator podatkowy odbiorcy. Format CNPJ (00.000.000\/0000-00) dla to\u017csamo\u015bci korporacyjnych lub format CPF (000.000.000-00) dla os\u00f3b fizycznych."
                }
            ],
            "state": "ACTIVE",
            "timestamp": "2023-04-16T21:34:28+00:00",
            "beneficiaryId": null
        }
    ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of target accounts in this account. false
.limit integer The limit parameter used in this request. false
.offset integer The pagination offset used in this request. false
.targetAccounts[] array An list of objects with target account information. false
.network string A network identifier as given by GET /networks, e.g. BITCOIN, LITECOIN, SWIFT, or SEPA. false
.label string An arbitrary account name given by you when creating the target account. This is a unique identifier which you use this to reference this target account in other API requests, such as POST /transfer. false
.fields object A set of fields (all strings) specifying the account on the target network. Conforms to the field specification used when invoking POST /target-account. Inspect the fieldConfig attribute for an explanation of each field. false
.fieldConfig array A list of objects describing the keys and values received in the fields attribute. false
.key string A string indicating an attribute in the fields object. false
.label string A label for the field associated with the key. false
.description string A description of the field associated with the key. false
.state string The target account state. Possible values:
ACTIVE, PENDING_CONFIRMATION , TRANSIENT
true
timestamp string W3C formatted time stamp with time zone (UTC) indicating when the target account was added. true
.beneficiaryId string(12) An identifier referencing the beneficiary associated this target account with, if any. As given by GET /beneficiaries or other beneficiary related endpoints. true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/transferzabezpieczony

Inicjuje transfer środków z Twojego portfela do zewnętrznego banku lub konta blockchain. Zwraca obiekt transferu w stanie PENDING_API_COMMIT. Obiekt zawiera wycenę zawierającą kwotę opłaty źródłowej, docelowej oraz opłaty sieciowej (jeśli występuje). Aby zaakceptować wycenę, potwierdź przelew wywołując POST /transfer/commit.

Zależy od wcześniejszych połączeń z POST /target-account linkujących konta zewnętrzne w celu przelewów.

Rządanie

curl -X POST https://www.whalestack.com/api/v1/transfer \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykład: Przelew 5000 USDC na swoje konto SEPA (w EUR)

{
   "network":"SEPA",
   "asset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "amount":5000,
   "targetAccount":"A unique SEPA account label as previously specified in POST /target-account"
}

Przykład: Przelew BTC z docelową kwotą netto 0,5 BTC

{
   "network":"BITCOIN",
   "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
   "amount":0.5,
   "amountType":"target",
   "targetAccount":"A unique Bitcoin address label as previously specified in POST /target-account"
}

Przykład: Przelew na fakturę BOLT 11 Bitcoin Lightning

{
   "network":"LIGHTNING",
   "asset":"BTCLN:GDPKQ2TSNJOFSEE7XSUXPWRP27H6GFGLWD7JCHNEYYWQVGFA543EVBVT",
   "invoice":"lnbc138200n1p3mxqgwpp53800g24ftkeevp82sfvkm20ygw34f4cst99fq9ar..."
}

Przykład: Przelew 5000 USDC na konto Stellar

{
   "network":"STELLAR",
   "asset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "amount":5000,
   "targetAccount":"A unique Stellar account label as previously specified in POST /target-account"
}

Przykład: Przelew 5000 USDC na konto Ethereum

{
   "network":"ETHEREUM",
   "asset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
   "amount":5000,
   "targetAccount":"A unique Ethereum account label as previously specified in POST /target-account"
}

Parametry Żądania (POST)

Klucz Rodzaj Opis Domyślny Obowiązkowy
network string A network identifier as given by GET /networks or GET /wallets. Specifies the target network for the transfer. null mandatory
asset string An asset identifier as given by GET /assets or GET /wallets. Specifies the source asset in the transfer. null mandatory
amount numeric Specifies the amount of asset you wish to send.

By default, this amount is debited from your account and the beneficiary is credited the same amount net of network fees, if any.

If you wish to specify the exact target amount and carry the network fees on your side, please set target on the amountType parameter and specify the desired net target amount in this field.
null mandatory
amountType string Can be source (default) or target.

If set to source then the amount field specifies the exact amount debited from your account. Beneficiary receives the same amount net of fees. Obtain fee and target amount details from the response.

If set to target then the amount field specifies the exact target amount received by the beneficiary. Fees are carried by the sender and included in the amount debited from your account. Obtain fee and source amount details from the response.
source optional
targetAccount string The target account to which the transfer is sent. Referenced by the unique label originally specified in POST /target-account. Must match the network of the given asset. null mandatory
invoice string This field is only relevant when sending transfers towards the Bitcoin LIGHTNING network. It is also the only required field besides network and asset in that case. Should include a BOLT 11 Lightning invoice with encoded amount. Ignore this field when transferring to other networks. null optional
note string An arbitrary note in plain text providing you with additional context for this transfer. null optional
webhook string URL on your server listening for transfer state changes via WEBHOOK transfer-completed or WEBHOOK transfer-failed. Overwrites webhook URL API Settings in the UI (if any). null optional

Odpowiedź Udana application/json

{
   "transfer":{
      "id":"8947deb6a087",
      "type":"TRANSFER",
      "state":"PENDING_API_COMMIT",
      "origin":"API",
      "network":"BITCOIN",
      "timestamp":"2023-05-22 03:06:34+03:00",
      "note":null,
      "sourceAmountGross":"0.5000000",
      "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "networkFeeAmount":"0.0002010",
      "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "targetAmountNet":"0.4997990",
      "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "blockchainTransactions":[],
      "targetAccount":{
         "network":"BITCOIN",
         "label":"Bitcoin (bc1qj)",
         "fields":{
            "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
         },
         "fieldConfig":[
            {
               "key":"address",
               "label":"Bitcoin Address",
               "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
            }
         ],
         "state":"ACTIVE",
         "timestamp":"2023-05-21T21:00:26+00:00",
         "beneficiaryId":null
      },
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.transfer{} object An object with transfer information. false
.id string(12) Unique identifier of this transfer. false
.type string The transfer type, i.e. TRANSFER false
.state string The transfer state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.origin string Indicates how the transfer was initiated, either UI or API. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the transfer was created. false
.note note An arbitrary text submitted when invoking POST /transfer. true
.sourceAmountGross string A numeric string indicating the total amount of sourceAsset debited from your account during the transfer. false
.sourceAsset string The source asset. An asset id as given by GET /assets. false
.networkFeeAmount string A numeric string indicating the total amount of networkFeeAsset used during the transfer. false
.networkFeeAsset string The network fee asset. An asset id as given by GET /assets. false
.targetAmountNet string A numeric string indicating the total amount of targetAsset received by the beneficiary. false
.targetAsset string The target asset. An asset id as given by GET /assets. false
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction, i.e. TRANSFER_PAYOUT. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.targetAccount object An object specifying the target account for this transfer, as documented here: GET /target-account. true
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this transfer (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/transfer/commitzabezpieczony

Zatwierdza i wykonuje transfer środków w stanie PENDING_API_COMMIT, zainicjowany wcześniej w POST /transfer.

Zwraca obiekt transferu w stanie innym niż końcowy PROCESSING. Końcowy stan COMPLETED lub FAILED jest wysyłany przez webhook i alternatywnie można go odpytywać za pomocą GET /transfer.

Rządanie

curl -X POST 'https://www.whalestack.com/api/v1/transfer/commit'
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
  "transferId":"12d72c3c8145"
}

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
transferId string(12) Unique identifier as given by POST /transfer. null mandatory

Odpowiedź Udana application/json

{
   "transfer":{
      "id":"8947deb6a087",
      "type":"TRANSFER",
      "state":"PROCESSING",
      "origin":"API",
      "network":"BITCOIN",
      "timestamp":"2023-05-22 03:06:34+03:00",
      "note":null,
      "sourceAmountGross":"0.5000000",
      "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "networkFeeAmount":"0.0002010",
      "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "targetAmountNet":"0.4997990",
      "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "blockchainTransactions":[],
      "targetAccount":{
         "network":"BITCOIN",
         "label":"Bitcoin (bc1qj)",
         "fields":{
            "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
         },
         "fieldConfig":[
            {
               "key":"address",
               "label":"Bitcoin Address",
               "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
            }
         ],
         "state":"ACTIVE",
         "timestamp":"2023-05-21T21:00:26+00:00",
         "beneficiaryId":null
      },
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.transfer{} object An object containing transfer information. false
.id string(12) Unique identifier of this transfer. false
.type string The transfer type, i.e. TRANSFER false
.state string The transfer state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.origin string Indicates how the transfer was initiated, either UI or API. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the transfer was created. false
.note note An arbitrary text submitted when invoking POST /transfer. true
.sourceAmountGross string A numeric string indicating the total amount of sourceAsset debited from your account during the transfer. false
.sourceAsset string The source asset. An asset id as given by GET /assets. false
.networkFeeAmount string A numeric string indicating the total amount of networkFeeAsset used during the transfer. false
.networkFeeAsset string The network fee asset. An asset id as given by GET /assets. false
.targetAmountNet string A numeric string indicating the total amount of targetAsset received by the beneficiary. false
.targetAsset string The target asset. An asset id as given by GET /assets. false
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction, i.e. TRANSFER_PAYOUT. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.targetAccount object An object specifying the target account for this transfer, as documented here: GET /target-account. true
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this transfer (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/transferzabezpieczony

Pobiera szczegóły danego przelewu.

Rządanie

curl 'https://www.whalestack.com/api/v1/transfer?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by GET /transfers or POST /transfer. null mandatory

Odpowiedź Udana application/json

{
   "transfer":{
      "id":"8947deb6a087",
      "type":"TRANSFER",
      "state":"COMPLETED",
      "origin":"API",
      "network":"BITCOIN",
      "timestamp":"2023-05-22 03:06:34+03:00",
      "note":null,
      "sourceAmountGross":"0.5000000",
      "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "networkFeeAmount":"0.0002010",
      "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "targetAmountNet":"0.4997990",
      "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "blockchainTransactions":[
         {
            "type":"TRANSFER_PAYOUT",
            "typeDescription":"Transaction transferring funds from Whalestack to target account.",
            "network":"STELLAR",
            "networkName":"Stellar",
            "timestamp":"2022-10-14T20:06:34+00:00",
            "tx":"9be365f2a550ef83cb0bdab6a606e9a892a896e69a44393e177b7537872d4688",
            "amount":"0.5000000",
            "amountAssetCode":"BTC"
         },
         {
            "type":"TRANSFER_PAYOUT",
            "typeDescription":"Transaction transferring funds from Whalestack to target account.",
            "network":"BITCOIN",
            "networkName":"Bitcoin",
            "timestamp":"2022-10-14T20:06:39+00:00",
            "tx":"f0ddcd0cc9f989c75ce5141f5b85a81d762fb7a8754243e6de977cfa91dd7cb6",
            "amount":"0.4997990",
            "amountAssetCode":"BTC"
         }
      ],
      "targetAccount":{
         "network":"BITCOIN",
         "label":"Bitcoin (bc1qj)",
         "fields":{
            "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
         },
         "fieldConfig":[
            {
               "key":"address",
               "label":"Bitcoin Address",
               "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
            }
         ],
         "state":"ACTIVE",
         "timestamp":"2023-05-21T21:00:26+00:00",
         "beneficiaryId":null
      },
      "webhook":"https://www.your-server.com/path/to/webhook"
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.transfer{} object An object containing transfer information. false
.id string(12) Unique identifier of this transfer. false
.type string The transfer type, i.e. TRANSFER false
.state string The transfer state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.origin string Indicates how the transfer was initiated, either UI or API. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the transfer was created. false
.note note An arbitrary text submitted when invoking POST /transfer. true
.sourceAmountGross string A numeric string indicating the total amount of sourceAsset debited from your account during the transfer. false
.sourceAsset string The source asset. An asset id as given by GET /assets. false
.networkFeeAmount string A numeric string indicating the total amount of networkFeeAsset used during the transfer. false
.networkFeeAsset string The network fee asset. An asset id as given by GET /assets. false
.targetAmountNet string A numeric string indicating the total amount of targetAsset received by the beneficiary. false
.targetAsset string The target asset. An asset id as given by GET /assets. false
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction, i.e. TRANSFER_PAYOUT. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.targetAccount object An object specifying the target account for this transfer, as documented here: GET /target-account. true
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this transfer (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/transferszabezpieczony

Pobiera listę Twoich przelewów (w kolejności malejącej od najnowszego do najstarszego).

Rządanie

curl 'https://www.whalestack.com/api/v1/transfers?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of transfer objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":1,
   "limit":10,
   "offset":0,
   "transfers":[
      {
         "transfer":{
            "id":"8947deb6a087",
            "type":"TRANSFER",
            "state":"COMPLETED",
            "origin":"API",
            "network":"BITCOIN",
            "timestamp":"2023-05-22 03:06:34+03:00",
            "note":null,
            "sourceAmountGross":"0.5000000",
            "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
            "networkFeeAmount":"0.0002010",
            "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
            "targetAmountNet":"0.4997990",
            "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
            "blockchainTransactions":[
               {
                  "type":"TRANSFER_PAYOUT",
                  "typeDescription":"Transaction transferring funds from Whalestack to target account.",
                  "network":"STELLAR",
                  "networkName":"Stellar",
                  "timestamp":"2022-10-14T20:06:34+00:00",
                  "tx":"9be365f2a550ef83cb0bdab6a606e9a892a896e69a44393e177b7537872d4688",
                  "amount":"0.5000000",
                  "amountAssetCode":"BTC"
               },
               {
                  "type":"TRANSFER_PAYOUT",
                  "typeDescription":"Transaction transferring funds from Whalestack to target account.",
                  "network":"BITCOIN",
                  "networkName":"Bitcoin",
                  "timestamp":"2022-10-14T20:06:39+00:00",
                  "tx":"f0ddcd0cc9f989c75ce5141f5b85a81d762fb7a8754243e6de977cfa91dd7cb6",
                  "amount":"0.4997990",
                  "amountAssetCode":"BTC"
               }
            ],
            "targetAccount":{
               "network":"BITCOIN",
               "label":"Bitcoin (bc1qj)",
               "fields":{
                  "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
               },
               "fieldConfig":[
                  {
                     "key":"address",
                     "label":"Bitcoin Address",
                     "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
                  }
               ],
               "state":"ACTIVE",
               "timestamp":"2023-05-21T21:00:26+00:00",
               "beneficiaryId":null
            },
            "webhook":"https://www.your-server.com/path/to/webhook"
         }
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of transfers initiated in this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.transfers[] array A list of transfer objects. false
.id string(12) Unique identifier of this transfer. false
.type string The transfer type, i.e. TRANSFER false
.state string The transfer state. The list of possible values is COMPLETED , PENDING_API_COMMIT, PROCESSING, and FAILED. false
.origin string Indicates how the transfer was initiated, either UI or API. false
.timestamp timestamp W3C formatted time stamp with time zone (UTC) specifying when the transfer was created. false
.note note An arbitrary text submitted when invoking POST /transfer. true
.sourceAmountGross string A numeric string indicating the total amount of sourceAsset debited from your account during the transfer. false
.sourceAsset string The source asset. An asset id as given by GET /assets. false
.networkFeeAmount string A numeric string indicating the total amount of networkFeeAsset used during the transfer. false
.networkFeeAsset string The network fee asset. An asset id as given by GET /assets. false
.targetAmountNet string A numeric string indicating the total amount of targetAsset received by the beneficiary. false
.targetAsset string The target asset. An asset id as given by GET /assets. false
.blockchainTransactions[] array A list of blockchain transactions associated with this checkout. false
.type string The type of blockchain transaction, i.e. TRANSFER_PAYOUT. false
.typeDescription string An explanation of the above blockchain transaction type in English plain text. false
.network string The network id as given by GET /networks. Indicates where this transaction was executed. false
.networkName string The network name in English plain text. false
.timestamp string The timestamp at which this transaction was registered on Whalestack. false
.tx string The corresponding blockchain transaction id. false
.amount string The amount transferred during in this transaction. false
.amountAssetCode string The asset code of the amount transferred in this transaction. false
.targetAccount object An object specifying the target account for this transfer, as documented here: GET /target-account. true
.webhook string The webhook URL on your server to which Whalestack posts callback notifications during events related to this transfer (as specified in webhook concepts). true

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/pingpubliczny

Wysyła żądanie ping do interfejsu API. Ten punkt końcowy jest odpowiedni do testowania łączności sieciowej z interfejsem API Whalestack.

Rządanie

curl 'https://www.whalestack.com/api/v1/ping'

Odpowiedź Udana application/json

{
    "success":true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates the request was processed successfully. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/address-validationzabezpieczony

Weryfikuje klucze publiczne (adresy lub konta) w obsługiwanych blockchainach. Może być używany jako punkt końcowy narzędzia do sprawdzania poprawności danych wejściowych użytkownika w aplikacji.

Rządanie

curl 'https://www.whalestack.com/api/v1/address-validation?network=BITCOIN&address=bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
network string A network identifier as given by GET /networks, e.g. BITCOIN, STELLAR, ETHEREUM, or LITECOIN. null mandatory
address string An address or account public key corresponding to the selected network. null mandatory

Odpowiedź Udana application/json

{
    "valid":true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
valid boolean Indicates whether the given address or account public key is valid. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/exchange-ratezabezpieczony

Ten punkt końcowy zwraca bieżący kurs wymiany pomiędzy dwoma aktywami w danej kwocie, biorąc pod uwagę obowiązującą płynność i głębokość księgi zamówień. Ten punkt końcowy można wykorzystać do obliczenia wstępnego kursu zamiany podczas realizacji checkout lub wymian na Whalestack.

Aby zapytać o globalny średni kurs wymiany pomiędzy dwiema dowolnymi walutami, użyj zamiast tego punktu końcowego GET /globalny kurs wymiany.

Rządanie

curl 'https://www.whalestack.com/api/v1/exchange-rate?sourceAsset=USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&targetAsset=BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT&amount=5000'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
sourceAsset string A source asset id as given by GET /assets. null mandatory
targetAsset string A target asset id as given by GET /assets. null mandatory
amount numeric The source amount in send-amount queries or the target amount in receive-amount queries (see switch). null mandatory
switch string Set to send-amount to indicate that you want to query the tentative amount of targetAsset you will receive for sending a given amount of sourceAsset.

Set to receive-amount to indicate that you want to query the tentative amount of sourceAsset you will have to send to receive a given amount of targetAsset.
send-amount mandatory

Odpowiedź Udana application/json

{
    "sourceAsset": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
    "sourceAmount": "5000",
    "targetAsset": "BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
    "targetAmount": "0.1622371",
    "pair": "BTC/USD",
    "exchangeRate": "1:30819.0913175",
    "deviation": "0.182",
    "switch": "send-amount"
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
sourceAsset string The given source asset. false
sourceAmount string The given source amount for send-amount lookups, or the calculated source amount in receive-amount lookups. false
targetAsset string The given target asset. false
targetAmount string The given target amount for receive-amount lookups, or the calculated target amount in send-amount lookups. false
pair string The currency pair. Base currency followed by the quote currency. false
exchangeRate string A numeric string indicating the tentative exchange rate for the given assets and amount. false
deviation string A numeric string indicating how much the given exchange rate deviates from the global average exchange rate in percentage points. A negative value indicates that the exchange rate is *better* than the global average and a positive value indicates that the exchange rate is *worse* than the global average. false
switch string The given send-amount or receive-amount setting. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/exchange-rate-globalzabezpieczony

Zwraca globalny średni kurs wymiany pomiędzy dwiema dowolnymi walutami. Ten punkt końcowy ma charakter wyłącznie informacyjny i nie odzwierciedla kursów wymiany dostępnych w Whalestack. Aby zapytać o kursy wymiany używane przez platformę Whalestack, użyj zamiast tego punktu końcowego GET /kurs wymiany.

Rządanie

curl 'https://www.whalestack.com/api/v1/exchange-rate-global?baseCurrency=CHF&quoteCurrency=EUR'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
baseCurrency string The ISO code of the base currency. See below for a list of supported currencies. null mandatory
quoteCurrency string The ISO code of the quote (counter) currency. See below for a list of supported currencies. null mandatory
timestamp string A timestamp in the format YYYY-MM-DD (2019-01-01 or later). Defaults to the current time. null optional

Supported Currencies

Asset Code Nazwa Rodzaj
AEDEmirati DirhamFIAT
ARSArgentine PesoFIAT
AUDAustralian DollarFIAT
BDTBangladeshi TakaFIAT
BHDBahraini DinarFIAT
BMDBermudian DollarFIAT
BRLBrazilian RealFIAT
BTCBitcoinCRYPTO
CADCanadian DollarFIAT
CHFSwiss FrancFIAT
CLPChilean PesoFIAT
CNYChinese YuanFIAT
CZKCzech KorunaFIAT
DKKDanish KroneFIAT
ETHEtherCRYPTO
EUREuroFIAT
GBPBritish PoundFIAT
HKDHong Kong DollarFIAT
HUFHungarian ForintFIAT
IDRIndonesian RupiahFIAT
ILSIsraeli ShekelFIAT
INRIndian RupeeFIAT
JPYJapanese YenFIAT
KRWKorean WonFIAT
KWDKuwaiti DinarFIAT
LKRSri Lankan RupeeFIAT
LTCLitecoinCRYPTO
MMKMyanmar KyatFIAT
MXNMexican PesoFIAT
MYRMalaysian RinggitFIAT
NGNNigerian NairaFIAT
NOKNorwegian KroneFIAT
NZDNew Zealand DollarFIAT
PHPPhilippine PesoFIAT
PKRPakistani RupeeFIAT
PLNPolish ZlotyFIAT
RUBRussian RubleFIAT
SARSaudi Arabian RiyalFIAT
SATSatoshiCRYPTO
SEKSwedish KronaFIAT
SGDSingapore DollarFIAT
THBThai BahtFIAT
TRYTurkish LiraFIAT
TWDTaiwan DollarFIAT
UAHUkrainian HryvniaFIAT
USDUS DollarFIAT
VEFVenezuelan BolivarFIAT
VNDVietnamese DongFIAT
XLMStellar LumensCRYPTO
XRPXRPCRYPTO
ZARSouth African RandFIAT

Odpowiedź Udana application/json

{
    "baseCurrency": "CHF",
    "quoteCurrency": "EUR",
    "pair": "CHF/EUR",
    "exchangeRate": "0.9339042",
    "timestamp": "2021-09-04T21:29:10+00:00"
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
baseCurrency string The base currency as given in the API request. false
quoteCurrency string The quote (counter) currency as given in the API request. false
pair string The currency pair used for this exchange. Base currency followed by the quote (counter) currency. false
exchangeRate numeric The exchange rate at the given timestamp. false
timestamp string W3C formatted timestamp at which the exchange rate was calculated. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/timepubliczny

Zwraca znacznik czasu Uniksa z bieżącym czasem serwera Whalestack. Użyj tego punktu końcowego podczas generowania podpisu Digest-Auth do uwierzytelnienia, jeśli uważasz, że czas między Twoim serwerem a serwerem Whalestack jest nierówny.

Rządanie

curl 'https://www.whalestack.com/api/v1/time'

Odpowiedź Udana application/json

{
    "time":1525898643
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
time integer Unix timestamp with Whalestack server time. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/auth-testzabezpieczony

Dobre miejsce na początek do przetestowania implementacji Basic-Auth lub Digest-Auth pod kątem API uwierzytelniania. Poniższy przykład ilustruje żądanie Digest-Auth.

Rządanie

curl 'https://www.whalestack.com/api/v1/auth-test' \
-H "X-Digest-Key: YOUR_API_KEY" \
-H "X-Digest-Signature: DIGEST_AUTH_SIGNATURE" \
-H "X-Digest-Timestamp: UNIX_TIMESTAMP"

Nagłówki Rządania

Klucz Rodzaj Opis
X-Digest-Key string Your Whalestack API Key
X-Digest-Signature string Unique Digest-Auth signature (see authentication)
X-Digest-Timestamp integer Current Unix timestamp (also see GET /time).

Odpowiedź Udana application/json

{
    "success":true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates the request was processed successfully. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/languageszabezpieczony

Zwraca listę języków obsługiwanych POST /checkout/hosted i POST /checkout.

Rządanie

curl 'https://www.whalestack.com/api/v1/languages'

Odpowiedź Udana application/json

{
   "languages":[
      {
         "name":"English",
         "languageCode":"en",
         "countryCode":"EN",
         "locale":"en_US"
      },
      {
         "name":"Português",
         "languageCode":"pt",
         "countryCode":"PT",
         "locale":"pt_PT"
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.languages[] array A list of supported languages. false
.name string Name of the language. false
.languageCode string ISO-639 language code. false
.countryCode string ISO-3166 country code. false
.locale string Code of the locale. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/customerszabezpieczony

Pobiera listę klientów (w kolejności malejącej od najnowszych do najstarszych).

Rządanie

curl 'https://www.whalestack.com/api/v1/customers?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of customer objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":1,
   "limit":"250",
   "offset":"0",
   "customers":[
      {
         "id":"fd4f47a50c7f",
         "email":"john@doe.com",
         "firstname":"John",
         "lastname":"Doe",
         "name":"John Doe",
         "company":"ACME Inc.",
         "adr1":"810 Beach St",
         "adr2":"Finance Dept",
         "zip":"CA 94133",
         "city":"San Francisco",
         "countrycode":"US",
         "country":"United States",
         "phonenumber":"+14156226819",
         "taxid":"US1234567890",
         "note":"Always pays on time. Never late.",
         "meta":{
            "reference":123
         },
         "inserttime":"2018-12-10T16:16:18+00:00",
         "updatetime":"2018-12-11T17:34:09+00:00",
         "invoiceable":true
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of customers in existence for this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.customers[] array A list of customer objects. false
.id string(12) Unique identifier. false
.email string The customer's email address. false
.firstname string The customer's first name. true
.lastname string The customer's last name. true
.name string The customer's first name and last name conveniently concatenated into a single attribute. true
.company string The customer's company name. true
.adr1 string The customer's first address line. true
.adr2 string The customer's second address line. true
.zip string The customer's zip code. true
.city string The customer's city. true
.countrycode string(2) The customer's country in two character ISO format. true
.country string The customer's country in plain English. true
.phonenumber string The customer's phone number in international standard format (leading plus). true
.taxid string The customer's tax id. true
.note string An arbitrary note associated with the customer. true
.meta string An arbitrary JSON object associated with the customer. true
.inserttime timestamp W3C formatted time stamp with time zone (UTC) specifying when the customer was created. true
.updatetime timestamp W3C formatted time stamp with time zone (UTC) specifying when the customer was last updated. true
.invoiceable boolean Indicates whether this customer can be invoiced. To qualify for invoices the following fields must be set, adr1, zip, city, countrycode and either firstname and lastname or company. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/customerzabezpieczony

Tworzy obiekt klienta, który można powiązać z checkouts, płatnościami i fakturami. Jeżeli klient o podanym adresie e-mail już istnieje, przeprowadzana jest aktualizacja.

Checkouts powiązane z klientem generują więcej szczegółów transakcji, pomagają w księgowości i mogą automatycznie generować faktury dla Twojego klienta i dla Ciebie.

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/customer \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
   "customer":{
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      }
   }
}

Parametry Żądania (POST)

Faktury

Aby umożliwić fakturowanie klienta, musisz podać imię i nazwisko lub firmę, a także pełny adres, zawierający co najmniej adr1, zip, city i countrycode.

Klucz Rodzaj Opis Zerowalny Obowiązkowy
customer{} object An object containing information about your customer. false mandatory
.email string The customer's email address. If a customer with the given email address already exists an update of below records is performed. false mandatory
.firstname string The customer's first name. true optional
.lastname string The customer's last name. true optional
.company string The customer's company name. true optional
.adr1 string The customer's first address line. Must be provided alongside zip, city, and countrycode true optional
.adr2 string The customer's second address line. true optional
.zip string The customer's zip code. Must be provided alongside adr1, city, and countrycode true optional
.city string The customer's city. Must be provided alongside adr1, zip, and countrycode true optional
.countrycode string The customer's country as two character ISO code. Must be provided alongside adr1, zip, and city true optional
.phonenumber string The customer's phone number. true optional
.taxid string The customer's tax id. Useful for accounting and invoicing purposes. true optional
.note string An arbitrary note associated with the customer. true optional
.meta object An arbitrary JSON object associated with the customer. Useful for storing additional reference information for later use. true optional

Odpowiedź Udana application/json

{
    "customerId":"fd4f47a50c7f"
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.customerId string(12) Unique identifier of the new customer object. Store this persistently for later use. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/customerzabezpieczony

Pobiera dane dotyczące danego klienta.

Rządanie

curl 'https://www.whalestack.com/api/v1/customer?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by POST /customer. null mandatory

Odpowiedź Udana application/json

{
   "customer":{
      "id":"fd4f47a50c7f",
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "name":"John Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "country":"United States",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      },
      "inserttime":"2018-12-10T16:16:18+00:00",
      "updatetime":"2018-12-11T17:34:09+00:00",
      "invoiceable":true
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.customer{} array An object with details about the customer. false
.id string(12) Unique identifier. false
.email string The customer's email address. false
.firstname string The customer's first name. true
.lastname string The customer's last name. true
.name string The customer's first name and last name conveniently concatenated into a single attribute. true
.company string The customer's company name. true
.adr1 string The customer's first address line. true
.adr2 string The customer's second address line. true
.zip string The customer's zip code. true
.city string The customer's city. true
.countrycode string(2) The customer's country in two character ISO format. true
.country string The customer's country in plain English. true
.phonenumber string The customer's phone number in international standard format (leading plus). true
.taxid string The customer's tax id. true
.note string An arbitrary note associated with the customer. true
.meta string An arbitrary JSON object associated with the customer. true
.inserttime timestamp W3C formatted time stamp with time zone (UTC) specifying when the customer was created. true
.updatetime timestamp W3C formatted time stamp with time zone (UTC) specifying when the customer was last updated. true
.invoiceable boolean Indicates whether this customer can be invoiced. To qualify for invoices the following fields must be set, adr1, zip, city, countrycode and either firstname and lastname or company. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

PUT/customerzabezpieczony

Aktualizuje istniejący obiekt klienta.

Wszystkie atrybuty oprócz id i email są opcjonalne. Możesz przesłać częściowy obiekt klienta, zawierający tylko pola, które chcesz zaktualizować. Aby wyłączyć atrybut, ustaw jego wartość na null.

Przykładowe Żądanie

curl -X PUT https://www.whalestack.com/api/v1/customer \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
   "customer":{
      "id":"fd4f47a50c7f",
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      }
   }
}

Parametry Żądania (PUT)

PRO Tip

To make a customer invoiceable you need to provide a name or a company as well as a complete address with adr1, zip, city, and countrycode at a minimum.

Klucz Rodzaj Opis Zerowalny Obowiązkowy
customer{} object The customer object to be included in the request. false mandatory
.id string(12) The customer's unique identifier as given by POST /customer. false mandatory
.email string The customer's email address. false optional
.firstname string The customer's first name. true optional
.lastname string The customer's last name. true optional
.company string The customer's company name. true optional
.adr1 string The customer's first address line. Must be provided alongside zip, city, and countrycode true optional
.adr2 string The customer's second address line. true optional
.zip string The customer's zip code. Must be provided alongside adr1, city, and countrycode true optional
.city string The customer's city. Must be provided alongside adr1, zip, and countrycode true optional
.countrycode string The customer's country as two character ISO code. Must be provided alongside adr1, zip, and city true optional
.phonenumber string The customer's phone number. true optional
.taxid string The customer's tax id. Useful for accounting and invoicing purposes. true optional
.note string An arbitrary note associated with the customer. true optional
.meta object An arbitrary JSON object associated with the customer. Useful for storing additional reference information for later use. true optional

Odpowiedź Udana application/json

{
    "success": true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates that the request was processed successfully false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

DELETE/customerzabezpieczony

Usuwa istniejący obiekt klienta.

Przykładowe Żądanie

curl -X DELETE https://www.whalestack.com/api/v1/customer \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
    "id":"fd4f47a50c7f"
}

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by POST /customer. null mandatory

Odpowiedź Udana application/json

{
    "success":true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates that request was processed successfully. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

POST/beneficiaryzabezpieczony

Tworzy obiekt beneficjenta, który można powiązać z checkout, płatnościami i fakturami. Jeżeli beneficjent o podanym adresie email już istnieje następuje aktualizacja.

Przykładowe Żądanie

curl -X POST https://www.whalestack.com/api/v1/beneficiary \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
   "beneficiary":{
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      }
   }
}

Parametry Żądania (POST)

Klucz Rodzaj Opis Zerowalny Obowiązkowy
beneficiary{} object An object containing information about your beneficiary. false mandatory
.email string The beneficiary's email address. If a beneficiary with the given email address already exists an update of below records is performed. false mandatory
.firstname string The beneficiary's first name. true optional
.lastname string The beneficiary's last name. true optional
.company string The beneficiary's company name. true optional
.adr1 string The beneficiary's first address line. Must be provided alongside zip, city, and countrycode true optional
.adr2 string The beneficiary's second address line. true optional
.zip string The beneficiary's zip code. Must be provided alongside adr1, city, and countrycode true optional
.city string The beneficiary's city. Must be provided alongside adr1, zip, and countrycode true optional
.countrycode string The beneficiary's country as two character ISO code. Must be provided alongside adr1, zip, and city true optional
.phonenumber string The beneficiary's phone number. true optional
.taxid string The beneficiary's tax id. Useful for accounting and invoicing purposes. true optional
.note string An arbitrary note associated with the beneficiary. true optional
.meta object An arbitrary JSON object associated with the beneficiary. Useful for storing additional reference information for later use. true optional

Odpowiedź Udana application/json

{
    "beneficiaryId":"fd4f47a50c7f"
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.beneficiaryId string(12) Unique identifier of the new beneficiary object. Store this persistently for later use. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/beneficiaryzabezpieczony

Pobiera dane dotyczące danego beneficjenta.

Rządanie

curl 'https://www.whalestack.com/api/v1/beneficiary?id=xxx'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by POST /beneficiary. null mandatory

Odpowiedź Udana application/json

{
   "beneficiary":{
      "id":"fd4f47a50c7f",
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "name":"John Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "country":"United States",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      },
      "inserttime":"2018-12-10T16:16:18+00:00",
      "updatetime":"2018-12-11T17:34:09+00:00",
      "invoiceable":true
   }
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.beneficiary{} array An object with details about the beneficiary. false
.id string(12) Unique identifier. false
.email string The beneficiary's email address. false
.firstname string The beneficiary's first name. true
.lastname string The beneficiary's last name. true
.name string The beneficiary's first name and last name conveniently concatenated into a single attribute. true
.company string The beneficiary's company name. true
.adr1 string The beneficiary's first address line. true
.adr2 string The beneficiary's second address line. true
.zip string The beneficiary's zip code. true
.city string The beneficiary's city. true
.countrycode string(2) The beneficiary's country in two character ISO format. true
.country string The beneficiary's country in plain English. true
.phonenumber string The beneficiary's phone number in international standard format (leading plus). true
.taxid string The beneficiary's tax id. true
.note string An arbitrary note associated with the beneficiary. true
.meta string An arbitrary JSON object associated with the beneficiary. true
.inserttime timestamp W3C formatted time stamp with time zone (UTC) specifying when the beneficiary was created. true
.updatetime timestamp W3C formatted time stamp with time zone (UTC) specifying when the beneficiary was last updated. true
.invoiceable boolean Indicates whether this beneficiary can be invoiced. To qualify for invoices the following fields must be set, adr1, zip, city, countrycode and either firstname and lastname or company. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

PUT/beneficiaryzabezpieczony

Aktualizuje istniejący obiekt beneficjenta.

Wszystkie atrybuty oprócz id i email są opcjonalne. Możesz przesłać częściowy obiekt beneficjenta, zawierający tylko pola, które chcesz zaktualizować. Aby wyłączyć atrybut, ustaw jego wartość na null.

Przykładowe Żądanie

curl -X PUT https://www.whalestack.com/api/v1/beneficiary \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
   "beneficiary":{
      "id":"fd4f47a50c7f",
      "email":"john@doe.com",
      "firstname":"John",
      "lastname":"Doe",
      "company":"ACME Inc.",
      "adr1":"810 Beach St",
      "adr2":"Finance Dept",
      "zip":"CA 94133",
      "city":"San Francisco",
      "countrycode":"US",
      "phonenumber":"+14156226819",
      "taxid":"US1234567890",
      "note":"Always pays on time. Never late.",
      "meta":{
         "reference":123
      }
   }
}

Parametry Żądania (PUT)

Klucz Rodzaj Opis Zerowalny Obowiązkowy
beneficiary{} object The beneficiary object to be included in the request. false mandatory
.id string(12) The beneficiary's unique identifier as given by POST /beneficiary. false mandatory
.email string The beneficiary's email address. false optional
.firstname string The beneficiary's first name. true optional
.lastname string The beneficiary's last name. true optional
.company string The beneficiary's company name. true optional
.adr1 string The beneficiary's first address line. Must be provided alongside zip, city, and countrycode true optional
.adr2 string The beneficiary's second address line. true optional
.zip string The beneficiary's zip code. Must be provided alongside adr1, city, and countrycode true optional
.city string The beneficiary's city. Must be provided alongside adr1, zip, and countrycode true optional
.countrycode string The beneficiary's country as two character ISO code. Must be provided alongside adr1, zip, and city true optional
.phonenumber string The beneficiary's phone number. true optional
.taxid string The beneficiary's tax id. Useful for accounting and invoicing purposes. true optional
.note string An arbitrary note associated with the beneficiary. true optional
.meta object An arbitrary JSON object associated with the beneficiary. Useful for storing additional reference information for later use. true optional

Odpowiedź Udana application/json

{
    "success": true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates that the request was processed successfully false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

DELETE/beneficiaryzabezpieczony

Usuwa istniejący obiekt beneficjenta.

Przykładowe Żądanie

curl -X DELETE https://www.whalestack.com/api/v1/beneficiary \
     -d "@payload.json"

Gdzie payload.json jest obiektem JSON.

Przykładowy Payload

{
    "id":"fd4f47a50c7f"
}

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
id string(12) Unique identifier as given by POST /beneficiary. null mandatory

Odpowiedź Udana application/json

{
    "success":true
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
success boolean Indicates that request was processed successfully. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

GET/beneficiarieszabezpieczony

Pobiera listę beneficjentów (w kolejności malejącej od najnowszego do najstarszego).

Rządanie

curl 'https://www.whalestack.com/api/v1/beneficiaries?limit=250&offset=0'

Parametry Żądania

Klucz Rodzaj Opis Domyślny Obowiązkowy
limit integer Maximum number of beneficiary objects to be retrieved. 250 optional
offset integer Specifies the pagination offset. 0 optional

Odpowiedź Udana application/json

{
   "count":1,
   "limit":"250",
   "offset":"0",
   "beneficiaries":[
      {
         "id":"fd4f47a50c7f",
         "email":"john@doe.com",
         "firstname":"John",
         "lastname":"Doe",
         "name":"John Doe",
         "company":"ACME Inc.",
         "adr1":"810 Beach St",
         "adr2":"Finance Dept",
         "zip":"CA 94133",
         "city":"San Francisco",
         "countrycode":"US",
         "country":"United States",
         "phonenumber":"+14156226819",
         "taxid":"US1234567890",
         "note":"Always pays on time. Never late.",
         "meta":{
            "reference":123
         },
         "inserttime":"2018-12-10T16:16:18+00:00",
         "updatetime":"2018-12-11T17:34:09+00:00",
         "invoiceable":true
      }
   ]
}

Atrybuty Udanej Odpowiedzi

Nazwa Rodzaj Opis Zerowalny
.count integer The total number of beneficiaries in existence for this account. false
.limit integer The limit argument used in this request. false
.offset integer The pagination offset used in this request. false
.beneficiaries[] array A list of beneficiary objects. false
.id string(12) Unique identifier. false
.email string The beneficiary's email address. false
.firstname string The beneficiary's first name. true
.lastname string The beneficiary's last name. true
.name string The beneficiary's first name and last name conveniently concatenated into a single attribute. true
.company string The beneficiary's company name. true
.adr1 string The beneficiary's first address line. true
.adr2 string The beneficiary's second address line. true
.zip string The beneficiary's zip code. true
.city string The beneficiary's city. true
.countrycode string(2) The beneficiary's country in two character ISO format. true
.country string The beneficiary's country in plain English. true
.phonenumber string The beneficiary's phone number in international standard format (leading plus). true
.taxid string The beneficiary's tax id. true
.note string An arbitrary note associated with the beneficiary. true
.meta string An arbitrary JSON object associated with the beneficiary. true
.inserttime timestamp W3C formatted time stamp with time zone (UTC) specifying when the beneficiary was created. true
.updatetime timestamp W3C formatted time stamp with time zone (UTC) specifying when the beneficiary was last updated. true
.invoiceable boolean Indicates whether this beneficiary can be invoiced. To qualify for invoices the following fields must be set, adr1, zip, city, countrycode and either firstname and lastname or company. false

Odpowiedź na Błąd application/json

{
    "errors":[
        "invalid request (and more information explaining the error in plain text)"
    ]
}

Parametry Reakcji na Błąd

Nazwa Rodzaj Opis Zerowalny
errors[] string[ ] A list of strings explaining the error. false

Koncepcje Webhooków

Webhooki służą jako mechanizm przekazywania informacji do Twojego serwera w czasie rzeczywistym, gdy wystąpią określone zdarzenia, takie jak pomyślne płatności lub rozbieżności, takie jak niedopłaty podczas realizacji transakcji.

Dla tych, którzy chcą zautomatyzować przepływ pracy w swojej aplikacji, webhooki są niezbędne. Ułatwiają automatyczne procedury, umożliwiając takie działania, jak potwierdzenie realizacji transakcji przez klienta lub rozpoczęcie dostawy towarów i usług.

Definiowanie URL Webhooka

Wyznaczony URL webhooka jest definiowany podczas pierwszego wywołania interfejsu API, czy to za pośrednictwem POST /checkout, POST /checkout/hosted, czy POST /deposit-address. Chociaż możesz ustawić domyślne adresy URL webhooka w ustawieniach interfejsu API, każdy adres URL podany podczas wywołań interfejsu API będzie miał pierwszeństwo. Po określeniu adresu URL elementu webhook nasz system niezwłocznie poinformuje Cię za pomocą protokołu HTTP POST o odpowiednich zdarzeniach.

Zrozumienie Zdarzeń Webhooka

Zdarzenia webhook są aktywowane w scenariuszach takich jak pomyślne zakończenie transakcji (WEBHOOK checkout-completed) lub anomalie, takie jak niedopłata (WEBHOOK checkout-underpaid). Ponieważ stale ulepszamy naszą platformę, bądź na bieżąco z kolejnymi wydarzeniami związanymi z webhookami. Pełną listę zdarzeń webhook znajdziesz w menu po lewej stronie.

Anatomia Webhooka

Wyobraź sobie webhook jako konwencjonalne żądanie HTTP POST wysyłane z naszego końca do Twojego serwera. To żądanie zawiera nagłówki HTTP, które mogą pomóc w uwierzytelnieniu jego pochodzenia, wraz z treścią HTTP zawierającą podstawowe dane, wyszczególniającą typ zdarzenia elementu webhook i odpowiednie dane.

Nagłówki Webhooka

POST / HTTP/1.1
User-Agent: Whalestack Webhook Engine 1.0.1
Host: www.merchant.com
Accept: */*
Content-Type: application/json
Connection: close
X-Webhook-Auth: 06b7ff792a30a172c51c163f666dd6908d85fdda78451b36de9f3f8e985412be
Content-Length: 532

Treść Webhooka

{
  "eventType": "CHECKOUT_COMPLETED",
  "data": {...}
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type. Different types have different payloads and you should implement a parser for each event type. Valid types are:
CHECKOUT_COMPLETED, CHECKOUT_UNDERPAID, UNDERPAID_ACCEPTED, DEPOSIT_PENDING, DEPOSIT_COMPLETED, SWAP_COMPLETED, SWAP_FAILED, TRANSFER_COMPLETED, TRANSFER_FAILED.
false
.data string An object containing the payload associated with this event type. false

Analizowanie Payloads Webhooka

Payloads elementu webhook różnią się w zależności od typu zdarzenia. Twój system powinien sprawdzić eventType i zaimplementować parser dla każdego typu zdarzenia, które chcesz obsługiwać.

PHP Logo Przykład: Analiza na Podstawie Typu Zdarzenia (PHP)

$payload = json_decode(file_get_contents("php://input"), true);
$type = $payload['eventType'];
$data = $payload['data'];

switch($type) {
    case('CHECKOUT_COMPLETED'):
        // do something when a checkout was successfully completed (and your account is credited)
        break;
    case('CHECKOUT_UNDERPAID'):
        // do something when a checkout was underpaid (and your account is not credited yet)
        break;
    case('UNDERPAID_ACCEPTED'):
        // do something when an underpaid checkout was manually accepted (and your account is credited)
        break;
    case('DEPOSIT_PENDING'):
        // do something when a deposit was detected on chain but is still unconfirmed (and your account is not credited yet)
        break;
    case('DEPOSIT_COMPLETED'):
        // do something when a deposit completed (and your account is credited)
        break;
    case('SWAP_COMPLETED'):
        // do something when a swap completed (and funds in your account are exchanged)
        break;
    case('SWAP_FAILED'):
        // do something when a swap failed (and no funds are affected)
        break;
    case('TRANSFER_COMPLETED'):
        // do something when a transfer completed (and your account is debited)
        break;
    case('TRANSFER_FAILED'):
        // do something when a transfer failed (and no funds were affected)
        break;
    break;
}

Uwierzytelnianie Webhooka

Dodaj dodatkowe zabezpieczenia do swojego punktu końcowego i zapobiegnij fałszowaniu, analizując nagłówek X-Webhook-Auth i weryfikując jego wartość.

Sprawdź, czy żądanie zostało wysłane przez platformę Whalestack, tworząc skrót hash('sha256', YOUR_API_SECRET . WEBHOOK_REQUEST_BODY) (gdzie . reprezentuje konkatenację) i dopasowując go do wartości nagłówka X-Webhook-Auth.

PHP Logo Przykład: Kontrola Uwierzytelnienia (PHP)

$authHeader = $_SERVER['HTTP_X_WEBHOOK_AUTH'];
$payload = file_get_contents("php://input");

if ($authHeader != hash('sha256', $yourApiSecret . $payload)) {
    // this is not a valid webhook
}

Odpowiadanie na Webhooki

Odpowiedz za pomocą protokołu HTTP 200 OK. Twój serwer musi odpowiedzieć kodem stanu 200 w odpowiedzi HTTP po pomyślnym przeanalizowaniu i utrwaleniu ładunku elementu webhook. Nasz system będzie wysyłał żądania webhooka przez maksymalnie 48 godzin w rosnących odstępach czasu, aż wykryjemy kod stanu 200. Jeśli przez dłuższy czas nie otrzymamy kodu stanu HTTP o wartości 200, element webhook wygaśnie i przestanie próbować.

Sprawdzanie Historii Webhooka

Sprawdź webhooki wysyłane przez Whalestack wraz z odpowiedziami HTTP w platformy.

Może to być niezwykle przydatne na etapie wdrażania, ponieważ pomaga w debugowaniu problemów w żądaniach i odpowiedziach HTTP.

WEBHOOK EVENTcheckout-completed

To zdarzenie webhook jest wyzwalane, gdy płatność klienta została pomyślnie zakończona, Twój portfel Whalestack został zasilony i można bezpiecznie wysyłać wszelkie towary lub usługi.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"CHECKOUT_COMPLETED",
   "data":{
      "checkout":{
         "id":"a2d963a87d70",
         "timestamp":"2023-05-29T17:36:30+00:00",
         "state":"COMPLETED",
         "type":"HOSTED",
         "origin":"API",
         "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "settlementAmountRequired":"117.8379738",
         "settlementAmountReceived":"117.8379738",
         "settlementAmountFeePaid":"0.0000000",
         "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "sourceAmountRequired":"0.0043193",
         "sourceAmountReceived":"0.0043193",
         "sourceNetwork":"BITCOIN",
         "sourceNetworkName":"Bitcoin",
         "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
         "blockchainTransactions":[
            {
               "type":"CHECKOUT_ORIGIN",
               "typeDescription":"Blockchain payment transaction initiated by customer.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2023-05-29T17:55:52+00:00",
               "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_BRIDGE",
               "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_SETTLEMENT",
               "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"9e912d924d6a27ee858e011db14825f016f835249302f90b82237a9b9782bde0",
               "amount":"117.8379738",
               "amountAssetCode":"USDC",
               "exception":null
            }
         ],
         "payload":{
            "charge":{
               "customerId":"bb657e88a23d",
               "currency":"EUR",
               "lineItems":[
                  {
                     "description":"Mobile Data Prepaid Credits",
                     "netAmount":"110.00000"
                  }
               ],
               "shippingCostItems":[
                  {
                     "description":"Instant Delivery",
                     "netAmount":0
                  }
               ],
               "taxItems":[
                  {
                     "name":"Hong Kong Sales Tax",
                     "percent":0
                  }
               ]
            },
            "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "webhook":"https://www.my-server.com/api/?action=cq-webhook",
            "links":{
               "cancelUrl":"https://www.my-server.com/en/payments",
               "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
            }
         },
         "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (CHECKOUT_COMPLETED). false
.data object Contains an object of type checkout. false
.checkout object An object of type checkout with a COMPLETED state as documented in GET checkout false

WEBHOOK EVENTcheckout-underpaid

To zdarzenie elementu webhook jest wywoływane, gdy płatność klienta została przechwycona, ale kwota płatności była mniejsza niż oczekiwano. W tej sytuacji środki nie zostały zaksięgowane na Twoim koncie i nie powinieneś jeszcze wysyłać żadnych towarów ani usług.

Nierozstrzygnięte płatności są wyświetlane w panelu UI i zawierają opcje działań, takie jak zwrot pieniędzy lub akceptacja niedopłaconej płatności poprzez przyznanie niestandardowego rabatu.

Jeśli jest to transakcja typu HOSTED i powiązałeś z nią klienta, nasz system automatycznie powiadomi klienta o instrukcjach, jak dokończyć checkout i zapłacić pozostałą różnicę.

Jeśli jest to checkout typu SELF-HOSTED lub nie powiązałeś jej z klientem, powinieneś powiadomić użytkownika, aby wysłał kolejną płatność pokrywającą różnicę między sourceAmountRequired a sourceAmountReceived. Płatność powinna zostać wysłana na ten sam adres depozytu, który został pierwotnie powiązany z tą transakcją.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"CHECKOUT_COMPLETED",
   "data":{
      "checkout":{
         "id":"a2d963a87d70",
         "timestamp":"2023-05-29T17:36:30+00:00",
         "state":"UNRESOLVED_UNDERPAID",
         "type":"HOSTED",
         "origin":"API",
         "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "settlementAmountRequired":"117.8379738",
         "settlementAmountReceived":"0.0000000",
         "settlementAmountFeePaid":"0.0000000",
         "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "sourceAmountRequired":"0.0043193",
         "sourceAmountReceived":"0.0040000",
         "sourceNetwork":"BITCOIN",
         "sourceNetworkName":"Bitcoin",
         "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
         "blockchainTransactions":[
            {
               "type":"CHECKOUT_ORIGIN",
               "typeDescription":"Blockchain payment transaction initiated by customer.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2023-05-29T17:55:52+00:00",
               "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_BRIDGE",
               "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
               "amount":"0.0040000",
               "amountAssetCode":"BTC",
               "exception":null
            }
         ],
         "payload":{
            "charge":{
               "customerId":"bb657e88a23d",
               "currency":"EUR",
               "lineItems":[
                  {
                     "description":"Mobile Data Prepaid Credits",
                     "netAmount":"110.00000"
                  }
               ],
               "shippingCostItems":[
                  {
                     "description":"Instant Delivery",
                     "netAmount":0
                  }
               ],
               "taxItems":[
                  {
                     "name":"Hong Kong Sales Tax",
                     "percent":0
                  }
               ]
            },
            "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "webhook":"https://www.my-server.com/api/?action=cq-webhook",
            "links":{
               "cancelUrl":"https://www.my-server.com/en/payments",
               "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
            }
         },
         "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (CHECKOUT_UNDERPAID). false
.data object Contains an object of type checkout. false
.checkout object An object of type checkout with a UNRESOLVED_UNDERPAID state as documented in GET checkout false

WEBHOOK EVENTunderpaid-accepted

To zdarzenie webhook jest wyzwalane, gdy ręcznie zaakceptujesz niedopłatę checkout za pośrednictwem UI platformy Whalestack lub włączysz automatyczne rozliczanie niedopłat checkout w ustawieniach konta. W takich przypadkach na Twoje konto zostanie zasilone kwotą częściową pierwotnie żądanej kwoty rozliczeniowej.

Pole atrybutu settlementAmountReceived podaje dokładną kwotę zaksięgowaną na Twoim koncie. Pola sourceAmountRequired i sourceAmountReceived wskazują, o jaką kwotę płatność checkout została zaniżona.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"UNDERPAID_ACCEPTED",
   "data":{
      "checkout":{
         "id":"a2d963a87d70",
         "timestamp":"2023-05-29T17:36:30+00:00",
         "state":"COMPLETED",
         "type":"HOSTED",
         "origin":"API",
         "settlementAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "settlementAmountRequired":"117.8379738",
         "settlementAmountReceived":"108.7364213",
         "settlementAmountFeePaid":"0.0000000",
         "sourceAssetId":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "sourceAmountRequired":"0.0043193",
         "sourceAmountReceived":"0.0040000",
         "sourceNetwork":"BITCOIN",
         "sourceNetworkName":"Bitcoin",
         "depositAddress":"3Qg8rR28fPZXMiEbM2QB9RjQfM1MjuN9f8",
         "blockchainTransactions":[
            {
               "type":"CHECKOUT_ORIGIN",
               "typeDescription":"Blockchain payment transaction initiated by customer.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2023-05-29T17:55:52+00:00",
               "tx":"27a3e9425ef73e80a2c2d97886a0e1f88662df9358150f773f39cfef7cb39621",
               "amount":"0.0043193",
               "amountAssetCode":"BTC",
               "exception":null
            },
            {
               "type":"CHECKOUT_BRIDGE",
               "typeDescription":"Fund transfer from native blockchain to Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2023-05-29T17:56:03+00:00",
               "tx":"f016f835249302f90b82237a9b9782bde09e912d924d6a27ee858e011db14825",
               "amount":"0.0040000",
               "amountAssetCode":"BTC",
               "exception":null
            }
         ],
         "payload":{
            "charge":{
               "customerId":"bb657e88a23d",
               "currency":"EUR",
               "lineItems":[
                  {
                     "description":"Mobile Data Prepaid Credits",
                     "netAmount":"110.00000"
                  }
               ],
               "shippingCostItems":[
                  {
                     "description":"Instant Delivery",
                     "netAmount":0
                  }
               ],
               "taxItems":[
                  {
                     "name":"Hong Kong Sales Tax",
                     "percent":0
                  }
               ]
            },
            "settlementAsset":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
            "webhook":"https://www.my-server.com/api/?action=cq-webhook",
            "links":{
               "cancelUrl":"https://www.my-server.com/en/payments",
               "returnUrl":"https://www.my-server.com/en/invoice/57abff04a03d"
            }
         },
         "hostedCheckoutUrl":"https://www.whalestack.com/en/checkout/a2d963a87d70"
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (UNDERPAID_ACCEPTED). false
.data object Contains an object of type checkout. false
.checkout object An object of type checkout with a COMPLETED state as documented in GET checkout false

WEBHOOK EVENTdeposit-pending

To zdarzenie webhook jest wyzwalane, gdy w sieci wykryta została wpłata, która nadal nie została potwierdzona, a Twoje konto nie zostało jeszcze zasilone. Aby wpłata została sfinalizowana, potrzeba od jednego do sześciu potwierdzeń blockchain.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"DEPOSIT_PENDING",
   "data":{
      "deposit":{
         "id":"eb3729168fb2",
         "state":"PENDING_EXTERNAL",
         "timestamp":"2022-10-14T19:49:51+00:00",
         "network":"BITCOIN",
         "networkName":"Bitcoin",
         "depositAddress":"bc1q2acmt0h28k0n5zlazj2m8k3zwxaklzpcx0kf34",
         "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "currencyCode":"BTC",
         "amountGross":"7.1479281",
         "amountNet":"7.1479281",
         "amountFees":"0.0000000",
         "webhook":"https://www.your-server.com/path/to/webhook",
         "customerId":null,
         "blockchainTransactions":[
            {
               "type":"DEPOSIT_ORIGIN",
               "typeDescription":"Blockchain transaction on the source network.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2022-10-14T20:00:17+00:00",
               "tx":"77ddc93467f12fc79d73a936f09044689eebb1e045c1f81b5c14a91396147fed",
               "amount":"7.1479281",
               "amountAssetCode":"BTC"
            }
         ]
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (PENDING_EXTERNAL). false
.data object Contains an object of type deposit. false
.deposit object An object of type deposit with a PENDING_EXTERNAL state as documented in GET deposit false

WEBHOOK EVENTdeposit-completed

To zdarzenie webhooka jest wyzwalane po pomyślnym zakończeniu depozytu.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"DEPOSIT_COMPLETED",
   "data":{
      "deposit":{
         "id":"eb3729168fb2",
         "state":"COMPLETED",
         "timestamp":"2022-10-14T19:49:51+00:00",
         "network":"BITCOIN",
         "networkName":"Bitcoin",
         "depositAddress":"bc1q2acmt0h28k0n5zlazj2m8k3zwxaklzpcx0kf34",
         "asset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "currencyCode":"BTC",
         "amountGross":"7.1479281",
         "amountNet":"7.1479281",
         "amountFees":"0.0000000",
         "webhook":"https://www.your-server.com/path/to/webhook",
         "customerId":null,
         "blockchainTransactions":[
            {
               "type":"DEPOSIT_ORIGIN",
               "typeDescription":"Blockchain transaction on the source network.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2022-10-14T20:00:17+00:00",
               "tx":"77ddc93467f12fc79d73a936f09044689eebb1e045c1f81b5c14a91396147fed",
               "amount":"7.1479281",
               "amountAssetCode":"BTC"
            },
            {
               "type":"DEPOSIT_SETTLEMENT",
               "typeDescription":"Stellar transaction crediting your Whalestack merchant account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2022-10-14T20:00:17+00:00",
               "tx":"24c69c410e48ab3f7dd264429ec090e954b3b8b3b9860a5dd6c130f2926e0857",
               "amount":"7.1479281",
               "amountAssetCode":"BTC"
            }
         ]
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (DEPOSIT_COMPLETED). false
.data object Contains an object of type deposit. false
.deposit object An object of type deposit with a COMPLETED state as documented in GET deposit false

WEBHOOK EVENTswap-completed

To zdarzenie elementu webhook jest wyzwalane po pomyślnym zakończeniu wymiany.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"SWAP_COMPLETED",
   "data":{
      "swap":{
         "id":"5074f4ee055d",
         "state":"COMPLETED",
         "type":"SOURCE_SPECIFIED",
         "origin":"API",
         "createTime":"2021-05-06T22:15:37+00:00",
         "completeTime":"2021-05-06T22:16:01+00:00",
         "expireTime":"2021-05-06T23:15:37+00:00",
         "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "sourceAmount":"100.0000000",
         "targetAssetId":"XLM:NATIVE",
         "targetAmount":"243.3928192",
         "blockchainTransactions":[
            {
               "type":"SWAP",
               "typeDescription":"Blockchain transaction executed during the swap on the Stellar Network.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2021-05-06T22:16:01+00:00",
               "tx":"ac8f8554b273c8a0191309154bd108346c333b7f9dc3ada8f080c7efaab614a7",
               "amount":"243.3928192",
               "amountAssetCode":"XLM"
            }
         ]
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (SWAP_COMPLETED). false
.data object Contains an object of type swap. false
.swap object An object of type swap with a COMPLETED state as documented in GET swap false

WEBHOOK EVENTswap-failed

To zdarzenie elementu webhook jest wyzwalane w przypadku niepowodzenia wymiany (i nie wystąpiła żadna transakcja wpływająca na saldo).

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"SWAP_FAILED",
   "data":{
      "swap":{
         "id":"5074f4ee055d",
         "state":"FAILED",
         "type":"SOURCE_SPECIFIED",
         "origin":"API",
         "createTime":"2021-05-06T22:15:37+00:00",
         "completeTime":"2021-05-06T22:16:01+00:00",
         "expireTime":"2021-05-06T23:15:37+00:00",
         "sourceAssetId":"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
         "sourceAmount":"100.0000000",
         "targetAssetId":"XLM:NATIVE",
         "targetAmount":"243.3928192",
         "blockchainTransactions":[]
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (SWAP_FAILED). false
.data object Contains an object of type swap. false
.swap object An object of type swap with a FAILED state as documented in GET swap false

WEBHOOK EVENTtransfer-completed

To zdarzenie webhooka jest wyzwalane po pomyślnym zakończeniu transferu.

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"TRANSFER_COMPLETED",
   "data":{
      "transfer":{
         "id":"8947deb6a087",
         "type":"TRANSFER",
         "state":"COMPLETED",
         "origin":"API",
         "network":"BITCOIN",
         "timestamp":"2023-05-22 03:06:34+03:00",
         "note":null,
         "sourceAmountGross":"0.5000000",
         "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "networkFeeAmount":"0.0002010",
         "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "targetAmountNet":"0.4997990",
         "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "blockchainTransactions":[
            {
               "type":"TRANSFER_PAYOUT",
               "typeDescription":"Transaction transferring funds from Whalestack to target account.",
               "network":"STELLAR",
               "networkName":"Stellar",
               "timestamp":"2022-10-14T20:06:34+00:00",
               "tx":"9be365f2a550ef83cb0bdab6a606e9a892a896e69a44393e177b7537872d4688",
               "amount":"0.5000000",
               "amountAssetCode":"BTC"
            },
            {
               "type":"TRANSFER_PAYOUT",
               "typeDescription":"Transaction transferring funds from Whalestack to target account.",
               "network":"BITCOIN",
               "networkName":"Bitcoin",
               "timestamp":"2022-10-14T20:06:39+00:00",
               "tx":"f0ddcd0cc9f989c75ce5141f5b85a81d762fb7a8754243e6de977cfa91dd7cb6",
               "amount":"0.4997990",
               "amountAssetCode":"BTC"
            }
         ],
         "targetAccount":{
            "network":"BITCOIN",
            "label":"Bitcoin (bc1qj)",
            "fields":{
               "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
            },
            "fieldConfig":[
               {
                  "key":"address",
                  "label":"Bitcoin Address",
                  "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
               }
            ],
            "state":"ACTIVE",
            "timestamp":"2023-05-21T21:00:26+00:00",
            "beneficiaryId":null
         },
         "webhook":"https://www.your-server.com/path/to/webhook"
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (TRANSFER_COMPLETED). false
.data object Contains an object of type transfer. false
.transfer object An object of type transfer with a COMPLETED state as documented in GET transfer false

WEBHOOK EVENTtransfer-failed

To zdarzenie webhooka jest wyzwalane, gdy transfer nie powiódł się (i nie wystąpiło żadne saldo wpływające na transakcję).

Przeczytaj o pojęciach dotyczących webhooków, aby dowiedzieć się więcej o pracy z webhookami.

Treść Webhooka

{
   "eventType":"TRANSFER_FAILED",
   "data":{
      "transfer":{
         "id":"8947deb6a087",
         "type":"TRANSFER",
         "state":"FAILED",
         "origin":"API",
         "network":"BITCOIN",
         "timestamp":"2023-05-22 03:06:34+03:00",
         "note":null,
         "sourceAmountGross":"0.5000000",
         "sourceAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "networkFeeAmount":"0.0002010",
         "networkFeeAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "targetAmountNet":"0.4997990",
         "targetAsset":"BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "blockchainTransactions":[

         ],
         "targetAccount":{
            "network":"BITCOIN",
            "label":"Bitcoin (bc1qj)",
            "fields":{
               "address":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew24"
            },
            "fieldConfig":[
               {
                  "key":"address",
                  "label":"Bitcoin Address",
                  "description":"The Bitcoin address. Can be in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH)."
               }
            ],
            "state":"ACTIVE",
            "timestamp":"2023-05-21T21:00:26+00:00",
            "beneficiaryId":null
         },
         "webhook":"https://www.your-server.com/path/to/webhook"
      }
   }
}

Atrybuty Webhook Payload

Nazwa Rodzaj Opis Zerowalny
.eventType string Indicates the webhook event type (TRANSFER_FAILED). false
.data object Contains an object of type transfer. false
.transfer object An object of type transfer with a FAILED state as documented in GET transfer false
© Whalestack LLC 2018-2024 · Warunki Serwisu · Polityka Prywatności · Polityka KYC/AML · Polityka Przeciwdziałania Oszustwom · Przetwarzanie Danych · Licencja Whalestack LLC (Numer Spółki 0000970546) jest spółką z ograniczoną odpowiedzialnością zarejestrowaną pod adresem ul. Jedności 54, 65-018 Zielona Góra, Polska. Whalestack LLC podlega Generalnemu Inspektorowi Informacji Finansowej i posiada zezwolenie Ministra Finansów na świadczenie usług wymiany walut wirtualnych oraz usług powierniczych pod numerem RDWW-311 Dostawcy Usług Wirtualnych Aktywów. Unia Europejska Licencjonowane i Uregulowane w UE © Whalestack LLC 2018-2024 · Warunki Serwisu · Polityka Prywatności · Polityka KYC/AML · Polityka Przeciwdziałania Oszustwom · Przetwarzanie Danych · Licencja
Space Cat
Kosmiczny Kot! Miau. 🐱🚀