Introduction
The GoCrypto Web POS API provides a simple and powerful REST API to integrate cryptocurrency payments into your business or application. This API reference provides information on the available endpoints and how to interact with them.
Available payment types
{ 'DEFAULT' }
Available locales
{ 'en', 'sl', 'hr', 'tr', 'es', 'ja', 'ru', 'hu', 'sk', 'pt', 'it' }
Available currencies
{ 'EUR', 'HRK', 'TRY', 'CHF', 'USD', 'JPY', 'BGN', 'CZK', 'GBP', 'HUF', 'RON' }
Authentication
For EXTERNAL payment type just skip this step.
Most requests to the API must be authenticated with an Access Token.
Access Token API requests should be made with an X-ELI-Client-Id and an X-ELI-Client-Secret header. Your secret values key should be passed as the value.
If the authentication fails, a JSON object with an error message will be returned as a response along with HTTP status 400.
HTTP Request
POST https://ecommerce.staging.gocrypto.com/api/auth
General fields
Parameter |
Type |
Required |
Description |
---|---|---|---|
X-ELI-Client-Id | string | Required | Client ID |
X-ELI-Client-Secret | string | Required | Client Secret |
User-Agent | string | Required | User Agent |
Site-Host | string | Optional | Your site host (domain) for better support |
Example request
curl https://ecommerce.staging.gocrypto.com/api/auth \
-X POST \
-H "Content-Type: application/json" \
-H "X-ELI-Client-Id: <your-client-id>" \
-H "X-ELI-Client-Secret: <your-client-secret>"
-H "Site-Host: https://yourshop.com"
Example response
{
"data": {
"access_token": "YWNjZXNzX3Rva2VuOTI0Y2JiMTUzYTU5M2NhNDhjMjgwNTkxOWE2YTI4Y2FiNTZhYWMxZjNhZDA4MTEzYmEzZTA0YWFmYjBmOTI5NA=="
},
"status": 1,
"message": "Success"
}
Create a charge
To get paid in cryptocurrency, you need to create a charge object. Once the charge is created, the customer must complete the payment before the charge expires.
HTTP Request
POST https://ecommerce.staging.gocrypto.com/api/charges
General fields
Parameter |
Type |
Required |
Description |
---|---|---|---|
payment_type | string | Optional | Payment type |
shop_name | string | Required | Shop name |
shop_description | string | Optional | Shop description |
amount | array | Required | Amount |
amount: total | decimal | Required | Total amount |
amount: display_total | decimal | Optional | Display Total amount |
amount: feeable_part | decimal | Optional | Due to regulations in certain countries we can charge fee only for a part of total |
amount: currency | string | Required | Currency code |
amount: display_currency | string | Optional | Display Currency code |
items | array | Optional | Items |
items: name | string | Required | Item name |
items: description | string | Optional | Item description |
items: qty | number | Required | Item quantity |
items: price | decimal | Required | Item price |
items: ean | number | Optional | Item EAN 13 |
keep_crypto | boolean | Optional | Keep crypto |
return_url | string | Required | Return to shop url when a transaction is successful |
cancel_url | string | Required | Return to shop when a transaction fails |
Additional fields for EXTERNAL payment type
Parameter |
Type |
Required |
Description |
---|---|---|---|
pos_id | string | Required | ID of the device from which the payment originated |
provider_id | string | Required | ID unique to the provider |
location | array | Required | Location |
location: name | string | Required | Location name |
location: address | string | Required | Location address |
location: city | string | Required | Location city |
location: country | string | Required | Location country |
Request example
For EXTERNAL payment type replace X-ELI-Access-Token with X-ELI-Client-Id and X-ELI-Client-Secret.
curl https://ecommerce.staging.gocrypto.com/api/charges \
-X POST \
-H "Content-Type: application/json" \
-H "X-ELI-Access-Token: <access-token>" \
-H "X-ELI-Locale: <locale>"
-d '{
"shop_name": "My Shop",
"shop_description": "This is my shop",
"amount": {
"total": 1.23,
"feeable_part": 0.77,
"currency": "EUR"
},
"items": [
{
"name": "Product name",
"description": "Product description",
"qty": 1,
"price": 1.23,
"ean": "1234567891231"
}
],
"return_url": "https://yourshop.com/success",
"cancel_url": "https://yourshop.com/cancel",
}'
Response example
{
"data": {
"code": "b54f7995-a304-40fa-8c92-30dcf361884f",
"shop_name": "My Shop",
"shop_description": "This is my shop",
"amount": {
"total": 1.23,
"feeable_part": 0.77,
"currency": "EUR"
},
"items": [
{
"name": "Product name",
"description": "Product description",
"qty": 1,
"price": 1.23,
"ean": "1234567891231"
}
],
"locale": "en",
"redirect_url": "https://ecommerce.staging.gocrypto.com/payment/b54f7995-a304-40fa-8c92-30dcf361884f",
"return_url": "https://yourshop.com/success",
"cancel_url": "https://yourshop.com/cancel",
"created_at": 1532511661,
"expires_at": 1532511901
},
"status": 1,
"message": "Success"
}
Errors
All error messages include a human readable message.
Example response
{
"status": 0,
"code": "AUTH_REQUEST"
"message": "Something wrong with requesting auth"
}
Error codes
Error code |
Error message |
---|---|
CANCEL_PAYMENT_FAILED | Something wrong with canceling payment |
The GoCrypto installation into your online shop was successful
You can monitor your transactions at https://pos.gocrypto.com/.
Enter the username and password, received after signing a contract with Eligma Ltd.
GoCrypto test environment at your online shop
- If you wish to test the functioning of GoCrypto, turn on the Enable Sandbox feature.
- After that, enter the following data into the Client ID and Client Secret fields:
- Client ID: c83aa8ac-b29a-41a6-b039-3ed5ac69acff
- Client Secret: xzOOGVskFG2IeV2W3SFFFbEPC8vMDflz2k6LjrNXDCM4BFvH
- If you have an Android phone, you can carry out a test transaction with a test Elly crypto wallet. Download the test wallet to your phone at https://public.gocrypto.com/documents/ERP/elipay-staging.apk. Use the following data to log in:
- Email: wallet@gocrypto.com
- Password: Eli001
- Go into your online shop using the Client ID and Client Secret above. Select GoCrypto as a payment method and pay with the test Elly wallet.
- Check the success of the transaction in the test environment at https://pos.staging.gocrypto.com/, using the following data to log in:
- Username: ecommerce@gocrypto.pos
- Password: Goc001