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', 'ro' }
Available currencies
{ 'VES', 'ARS', 'DKK', 'BGN', 'ELI VIP', 'CZK', 'CNY', 'EUR', 'NZD', 'PHP', 'ZAR', 'HUF', 'COP', 'ISK', 'RUB', 'BRL', 'NGN', 'SGD', 'THB', 'CHF', 'HKD', 'IDR', 'ILS', 'INR', 'KRW', 'MXN', 'MYR', 'HRK', 'TRY', 'USD', 'GBP', 'JPY', 'PLN', 'SEK', 'NOK', 'AUD', 'CAD', 'CLP', 'CRC', 'EGP', 'GEL', 'GHS', 'KES', 'MAD', 'PEN', 'LKR', 'AED', 'UYU', 'XOF', 'XCD', '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
reference_number string Optional Reference number
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"
         },
		 "reference_number": "XX-YYYY",
		 "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"
          },
		  "reference_number": "XX-YYYY",
          "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 went wrong when cancelling payment