Goblock API
Overview
Go-Network provides a payment solution that accepts a wide range of cryptocurrencies, support almost popular wallets and exchange platforms on the market. Smart contracts are implemented to enable efficient and seamless payment processing for both customers and partners.
Get started
To use the Go-Network API you should do the following:
- Join the Merchant Dashboard: Sign up an account on the Go-Network dashboard. This is your central hub for managing your organization's interactions with the Go-Network platform.
- Set Up Your Business Account: Configure your business information and submit it for review. This information will be displayed to customers during payment.
- Get API Keys: Obtain your API keys from the dashboard. These keys are required to authenticate all API requests and ensure secure communication between your application and Go-Network's services.
Go-Network payment flow
- Customer to select item/items for purchase on Merchant's application
- Call the
Create payment intent
method to create a payment intent and get the checkout url from the response - Return checkout url and redirect user to Go-Network checkout website
- Customer selects the token type and network for payment, Go-Network will display the amount of tokens the customer needs to pay, corresponding to the fiat amount of the order. Go-Network will keep this exchange rate in a session for a maximum of 20 minutes, after which it will update based on the latest market rate.
- The customer selects a wallet or exchange application and completes the payment.
- If
return_url
is configured in the Payment Intent, customer is redirected back to thereturn_url
- Go-Network notifies the merchant's server via the
ipn_url
configured on the dashboard, or the merchant can retrieve the payment status through theGet Payment Status API
.
API Documentation
Instant Payments Notifications
IPN (Instant payment notifications, or callbacks) are used to notify you when transaction status is changed. To use them, you should complete the following steps:
- Login to
Go Network Dashboard
locate the "Merchant Settings", and configure your desired IPN_URL. - When the Payment Intent changes status, you will receive a notification via a POST request to the IPN_URL. The POST request will contain X-go-signature parameter in the header. The body of the request is similiar to a get payment status response body. Example:
{
"type": "checkoutSession.success",
"data":
{
"paymentIntentId": "pi_test_TJ74Z_JsCbQ9",
"paymentStatus": "SUCCESS",
"merchantReference": "25052180019",
"payToken": "SOL",
"payNetwork": "SOLANA",
"payAmount": 0.02,
"tokenRate": 115.5,
"paymentIntentTitle": "Order F4670813NB",
"paymentIntentDescription": "",
"currencyCode": "USD",
"paymentIntentAmount": 2.31,
"at": 1747793578527,
"transactionHistory":
[
{
"fromAddress": "A8JdL7KEdjAfJSYxu2HnaDMRjSNpZaBfuohFqZme8CCs",
"toAddress": "8GU8jDEQtqh3pwRUx4zr4qxBz6hQimYZDaRNS7rVKJJR",
"amount": 0.02,
"signature": "4LePQVGaMaZfRbJcKfuF57nrYxjAE2DPAdLDmSgGbTdpVoDDxUiho5x1qMFBqgkS5JLmJ3wSAZSWsXEuSvXhmuDg"
}
],
"actuallyPaidAmount": 0.02,
"actuallyPaidEstimateFiatAmount": 3.3486
}
}
Sign the request payload with the Secret Key
located in "Merchant Setting" section on dashboard with HmacSHA512 algorithm
Compare the signed string from the previous step with the X-go-signature , which is stored in the header of the callback request.
If these strings are similar, the request is guaranteed to be intact, Merchant continue with processing on their system based on the status of the Payment Intent.
Example of creating a signed string in Java:
public static String hmacSHA512(final String data, final String secretKey) {
Mac sha512Hmac = Mac.getInstance("HmacSHA512");
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA512");
sha512Hmac.init(secretKeySpec);
byte[] hmacBytes = sha512Hmac.doFinal(data.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(hmacBytes);
}
Note: If the merchant's server does not respond with a
200 OK
status code or fails to acknowledge the notification, Go-Network will attempt maximum3 times
with30 seconds
interval. After all attempts failed, no further notifications are sent, merchant must use theGet Payment Status API
to retrieve the status manually.
Several payments for one order
When a customer selects a token and network, Go-Network creates a Checkout Session with a locked token-to-fiat exchange rate for a limited time. If the customer doesn’t complete the payment within this time, the rate is updated to protect merchants from market fluctuations. In the case the customer pays by manually transferring tokens to the wallet address, Go-Network allows the customer to make multiple token transfers. IPN is sent to the merchant for each transfer, accumulating the received amount until the payment is complete, at which point the Payment Intent status becomes SUCCESS.