Introduction
The Bitspark API is designed for anyone to leverage Bitspark’s many payment destinations and methods – particularly in countries and areas traditionally under-served by existing payment channels and integrate easily into whatever product or service you intend to build with it.
General
URL
https://api.bitspark.io
Authentication
Bitspark uses API keys to allow access to the API. You can generate your keys at our API page.
Bitspark expects for the Key and Sign to be included in all auth API requests to the server in a
Headers that looks like the following:
Headers
REQUEST
GET /v1/call_example HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "http://api.bitspark.io/v1/call_example" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE (fail)
{
"errors": [
{
"code": 401,
"error_code": "request_unauthorized",
"message": [
"Unauthorized"
]
}
]
}
| Key | Value | Description |
|---|---|---|
| Key | YOUR_API_KEY | Your personal API-KEY length of 40 hex characters. |
| Sign | COMPUTED_HMAC | Genarated with your API-SECRET HMAC-SHA512 Signature in Hex format. |
Signature
You can use some programming language to generate HMAC signature:
Ruby example:
# ----- URL encoding -----
require 'cgi'
require 'openssl'
class String
def to_query(key)
"#{CGI.escape(key.to_s)}=#{CGI.escape(to_s)}"
end
end
class Hash
def to_query(namespace = nil)
collect do |key, value|
unless (value.is_a?(Hash) || value.is_a?(Array)) && value.empty?
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
end
end.compact.sort! * '&'
end
end
def calculate_hmac(api_secret, data)
OpenSSL::HMAC.new(api_secret, OpenSSL::Digest::SHA512.new).update(data).to_s
end
# ----- URL encoding -----
api_secret = 'your_api_secret'
request_url = 'http://api.bitspark.io/v1/call_example?attribute=value1&attributes[attribute]=v@lue'
encoded_form_data = ''
# ----- POST requests only -----
form_data = {
attribute: 'value',
attributes: {
attribute: 'v@lue'
}
}
encoded_form_data = form_data.to_query # => "attribute=value&attributes%5Battribute%5D=v%40lue"
# ----- POST requests only -----
calculate_hmac(api_secret, encoded_form_data + request_url)
# => "bb4882ac67b7815b4bf36b1fa99d95c95237db21353b95873fff008e76c2c204
# 95d746ae47cedf766d8cf6ee72eab25bac7972d3ebf397a84586e0fb0f371306"
# OR vice versa, both are correct
calculate_hmac(api_secret, request_url + encoded_form_data)
# => "64110ab16e3efed24e2f7bdd11c3682c477b09e9d38dcc7438d2ea15cc895134
# 4990ad5301748c60c64489ca463ad526d50aa75230846a3898554f8b8f4d98f1"
To generate COMPUTED_HMAC follow next steps:
- Copy your request URL, e.g.:
http://api.bitspark.io/v1/call_example
- For GET request combine your request URL with parameters, like this:
http://api.bitspark.io/v1/call_example?attribute=value1&attributes[attribute]=v@lue
- For POST request first encode your form-data, like this:
| Key | Value | Encoded key-value pairs |
|---|---|---|
| attribute | value | attribute=value |
| attributes[attribute] | v@lue | attributes%5Battribute%5D=v%40lue |
- Sort and combine all form-data encoded key-value pairs into one string with
&symbols, like this:
attribute=value&attributes%5Battribute%5D=v%40lue
- Combine your request URL with encoded form-data string, like this:
attribute=value&attributes%5Battribute%5D=v%40luehttp://api.bitspark.io/v1/call_example?attribute=value1&attributes[attribute]=v@lue
OR this:
http://api.bitspark.io/v1/call_example?attribute=value1&attributes[attribute]=v@lueattribute=value&attributes%5Battribute%5D=v%40lue
- Finally, encrypt combined string with HMAC-SHA512 method using your
API-SECRET
Postman
This pre-request script allows you easily generate
COMPUTED_HMACand use it for all authenticated API requests.
function toHex(str) {
var hex = encodeURIComponent(str);
hex = hex.replace(/!/, '%21')
.replace("'", '%27')
.replace('(', '%28')
.replace(')', '%29')
.replace('*', '%2A')
.replace('~', '%7E')
.replace(/%20/g, '+');
return hex;
}
function parseParams(params) {
var result = "";
for (var key in params) {
if (result !== '') {
result += "&";
}
result += encodeURI(key) + "=" + toHex(params[key]);
}
return alphabeticalSort(result);
}
function alphabeticalSort(str) {
return str.split('&').sort().join('&');
}
function generateAuthSign(request, secret) {
if (request.method == 'GET' || !request.data) {
request.data = '';
} else {
request.data = parseParams(request.data);
}
var requestData = [request.url, request.data].join('');
return CryptoJS.HmacSHA512(requestData, secret).toString();
}
SECRET_KEY = pm.request.headers.find(header => header.key == 'Secret').value;
pm.environment.set("SIGNATURE", generateAuthSign(request, SECRET_KEY));
To simplify API using you can import Postman Bitspark Public Collection:
Key, Secret and Sign should be included in all authenticated API requests to the server in a Headers that look like the following:
| Key | Value | Description |
|---|---|---|
| Key | YOUR_CLIENT_API_KEY | Your personal API-KEY length of 40 hex characters. |
| Secret | YOUR_SECRET_API_KEY | Your personal SECRET-KEY length of 40 hex characters. |
| Sign | {{SIGNATURE}} |
Genarated with your API-SECRET HMAC-SHA512 Signature in Hex format.Already defined by pre-request script |
Pagination
REQUEST
GET /v1/call_example?pagination[offset]=1&pagination[limit]=20 HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "http://api.bitspark.io/v1/call_example?pagination[offset]=1&pagination[limit]=20"
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "call_examples",
"attributes": {
"attribute": "string",
"empty": null
}
},
"..."
],
"meta": {
"total_count": 100,
"total_pages": 5,
"prev_page": null,
"next_page": 2
}
}
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| pagination[offset] | true | [integer] | 1 | Number of current page |
| pagination[limit] | false | [integer] | 20 | Number of records per pages |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| total_count | [integer] | Total count of all records |
| total_pages | [integer] | Total count of pages |
| prev_page | [integer] | Number of previous page ( returns null if there is no previous page ) |
| next_page | [integer] | Number of next page ( returns null if there is no next page ) |
Public
Money Shops
All Money Shops
REQUEST
GET /v1/money_shops?location[lat]=40.7143528&location[lng]=-74.0059731 HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/money_shops?location[lat]=40.7143528&location[lng]=-74.0059731" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "money_shops",
"attributes": {
"name": "Company Name One",
"address": "350 5th Ave, New York, NY 10118, USA",
"lat": 40.7484401,
"lng": -73.9856639,
"image_url": "example.com",
"distance": "2.8389379740525107"
}
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "money_shops",
"attributes": {
"name": "Company Name Two",
"address": "183 Queen's Rd E, Wan Chai, Hong Kong",
"lat": 22.2744158,
"lng": 114.1711181,
"image_url": null,
"distance": "2.8389379740525107"
}
},
"..."
]
}
ENDPOINT
/money_shops
DESCRIPTION
This endpoint retrieves all money shops sorted by distance to your location. If location is not specified, it is sorted by distance to Hong Kong.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| location[lat] | false | [decimal] | 22.2799146 | Latitude coordinate of your location |
| location[lng] | false | [decimal] | 114.1715395 | Longitude coordinate of your location |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][name] | [string] | Money shop company name |
| data[attributes][address] | [string] | Money shop adress |
| data[attributes][lat] | [decimal] | Latitude coordinate of money shop location |
| data[attributes][lng] | [decimal] | Longitude coordinate of money shop location |
| data[attributes][image_url] | [string] | URL to money shop image |
| data[attributes][distance] | [decimal] | distance between shop location and your location (in kilometers) |
Specific Money Shop
REQUEST
GET /v1/money_shops/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/money_shops/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "money_shops",
"attributes": {
"name": "Company Name One",
"address": "350 5th Ave, New York, NY 10118, USA",
"lat": 40.7484401,
"lng": -73.9856639,
"image_url": "example.com",
"topup_commissions": [
{
"currency": "HKD",
"fee": "0.0"
},
{
"currency": "USD",
"fee": "1.1"
}
]
}
}
}
ENDPOINT
/money_shops/:money_shop_id
DESCRIPTION
This endpoint retrieves a specific money shop.
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][topup_commissions] | [array of hashes] | Top up commissions of this shop for every available currencies |
Destinations
Available Destinations
REQUEST
GET /v1/static/destination_data?include=destination_info HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/static/destination_data?include=destination_info" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "destinations",
"attributes": {
"code": "destination_code",
"name": "Destination Name",
"currency_name": "PHP",
"available": true,
"fields": [
"province",
"provider",
"validations",
"delivery_method"
]
},
"relationships": {
"destination_info": {
"data": {
"id": "destination_code",
"type": "destination_infos"
}
}
}
}
]
}
ENDPOINT
/v1/static/destination_data
DESCRIPTION
This endpoint retrieves all available destinations with all info about it.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: destination_info |
| name | false | [string] | none | Filter by destination name |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][code] | [string] | Destination name code |
| data[attributes][name] | [string] | Destination name |
| data[attributes][currency_name] | [string] | Destination currency name |
| data[attributes][available] | [boolean] | Returns true if destination available, so always returns true |
| data[attributes][fields] | [array] | List of required fields for validations |
| data[relationships][destination_info][provinces] | [array of hashes] | List of all available provinces with delivery_methods |
| data[relationships][destination_info][delivery_methods] | [array of hashes] | List of all available delivery_methods with providers |
| data[relationships][destination_info][providers] | [array of hashes] | List of all available providers |
| data[relationships][destination_info][account_types] | [array of hashes] | List of all available bank account types for this Destinaiton |
Currencies
Available Currencies
REQUEST
GET /v1/static/currencies HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/static/currencies" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies",
"attributes": {
"code": "hkd",
"name": "HKD",
"account": true,
"currency_type": "banknote",
"banknote": true,
"bitspark_deposit_credentials": {
"iban": "CZ8801000001152130170277",
"bank_name": "Komercni Banka, a.s.",
"reference": "9120255451",
"swift_code": "KOMBCZPP",
"bank_address": "Na Prikope 33 cp. 969 114 07 Praha 1",
"account_number": "",
"beneficiary_name": "Valoris HK Limited",
"account_holder_address": "5- 109 Argyle Street Richmond Commercial , Kowloon, 00000, Hong Kong"
},
"precision": 2,
"humanized_name": "Hong Kong Dollar"
},
"relationships": {
"cash_fiat_countries": {
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
}
]
}
}
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies",
"attributes": {
"code": "zeph",
"name": "ZEPH",
"account": true,
"currency_type": "cryptocurrency",
"banknote": false,
"bitspark_deposit_credentials": {},
"precision": 4,
"humanized_name": "Zeph Token"
},
"relationships": {
"cash_fiat_countries": {
"data": []
}
}
},
"..."
]
}
ENDPOINT
/v1/static/currencies
DESCRIPTION
This endpoint retrieves all available currencies.
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][code] | [string] | Currency name code |
| data[attributes][name] | [string] | Currency name |
| data[attributes][account] | [boolean] | true if currency available, so always returns true |
| data[attributes][currency_type] | [string] | Specifies currency type. Can be cryptocurrency or banknote. |
| data[attributes][banknote] | [boolean] | true if currency is of banknote type. |
| data[attributes][bitspark_deposit_credentials] | [hash] | Bitspark deposit credentials for this currency |
| data[attributes][precision] | [integer] | Currency precision |
| data[attributes][humanized_name] | [string] | Humanized name of currency |
| data[relationships][cash_fiat_countries][data] | [hash] | Cash fiat countries for this currency |
Send Money Info
Validation Rules
REQUEST
GET /v1/static/validation_rules?filter[destination]=ffffffff-ffff-ffff-ffff-ffffffffffff&filter[province]=province_code&filter[delivery_method]=delivery_method_code&filter[provider]=provider_code HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/static/validation_rules?filter[destination]=ffffffff-ffff-ffff-ffff-ffffffffffff&filter[province]=province_code&filter[delivery_method]=delivery_method_code&filter[provider]=provider_code" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fields_data",
"attributes": {
"object_type": "transfer",
"level": "level_code",
"code": "bank",
"dependency_levels": [
{
"destinations": [
"ffffffff-ffff-ffff-ffff-ffffffffffff"
]
},
{
"delivery_methods": [
"delivery_method_code"
]
}
],
"lower_levels": [
"lower_level_code"
],
"fields_info": {
"validation_rules": [
{
"field": "field_name",
"data": {
"required": true,
"decimal": true,
"integer": true,
"minvalue": 100
}
},
{
"field": "relation.field_name",
"data": {
"letters": true,
"phone": true,
"email": true
}
},
"..."
],
"possible_fields": [
"field_name",
"relation.field_name",
"..."
],
"required_fields": [
"field_name",
"..."
]
}
}
},
"..."
]
}
ENDPOINT
/v1/static/validation_rules
DESCRIPTION
This endpoint retrieves validation rules for Send Money endpoint.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| filter[destination] | false | [string] | none | Destination ID |
| filter[province] | false | [string] | none | Province code |
| filter[delivery_method] | false | [string] | none | Delivery method code |
| filter[provider] | false | [string] | none | Provider code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][object_type] | [string] | Validation object type, "transfer" in this case |
| data[attributes][level] | [string] | Validation level code (can be one of: "destinations", "providers", "delivery_methods") |
| data[attributes][code] | [string] | Delivery method code (can be one of: "pickup", "bank", "") |
| data[attributes][dependency_levels] | [array of hashes] | Validation dependency levels ( can be an empty array []) |
| data[attributes][dependency_levels][][destinations] | [array] | List of destination IDs |
| data[attributes][dependency_levels][][delivery_methods] | [array] | List of delivery method codes |
| data[attributes][lower_levels] | [array of strings] | Validation dependency levels ( can be one of: [], ["delivery_methods"], ["providers"]) |
| data[attributes][fields_info] | [hash] | Validation info for each Send Money form-data field |
| data[attributes][fields_info][possible_fields] | [array of strings] | Possible form-data fields for Send Money endpoint |
| data[attributes][fields_info][required_fields] | [array of strings] | Required form-data fields for Send Money endpoint |
| data[attributes][fields_info][validation_rules] | [array of hashes] | Validation rules for each Send Money form-data field |
| data[attributes][fields_info][validation_rules][field] | [string] | Field name, can be a field of ralation (with dot) |
| data[attributes][fields_info][validation_rules][data] | [hash] | Actual validation rules of form-data field, can be any subhash of next key-value pairs |
| data[attributes][fields_info][validation_rules][data][required] | [boolean] | Returns true if field is required |
| data[attributes][fields_info][validation_rules][data][decimal] | [boolean] | Returns true if field must be decimal format |
| data[attributes][fields_info][validation_rules][data][integer] | [boolean] | Returns true if field must be integer format |
| data[attributes][fields_info][validation_rules][data][minvalue] | [integer] | Returns minimum value for decimal or integer fields |
| data[attributes][fields_info][validation_rules][data][letters] | [boolean] | Returns true if field must be include only letters |
| data[attributes][fields_info][validation_rules][data][phone] | [boolean] | Returns true if field must be phone format |
| data[attributes][fields_info][validation_rules][data][email] | [boolean] | Returns true if field must be email format |
Amount to Pay
REQUEST
GET /v1/static/amount_to_pay?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff&transfer[delivery_method]=delivery_method_code&transfer[provider]=provider_code&transfer[province]=province_code HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/static/amount_to_pay?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff&transfer[delivery_method]=delivery_method_code&transfer[provider]=provider_code&transfer[province]=province_code" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "99999999999999",
"type": "payment_data",
"attributes": {
"total_amount_to_pay": 0.99,
"transaction_fee": 0.0
}
}
}
ENDPOINT
/v1/static/amount_to_pay
DESCRIPTION
This endpoint retrieves precalculated amount to pay for Send Money endpoint. Please check Authnticated section for similar endpoint with more information.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| account_currency | true | [string] | nope | Account currency to calculate amount in ( should be one of Available Currencies codes ) |
| transfer[amount] | true | [decimal] | nope | Amount of money to be payed ( should be greater than 0.0) |
| transfer[amount_to_send] | true | [decimal] | nope | Amount of money that user wants to transact in user currency |
| transfer[destination_id] | true | [uuid] | nope | Destination ID for send money to |
| transfer[delivery_method] | true | [string] | nope | Delivery method code |
| transfer[provider] | true | [string] | nope | Provider code |
| transfer[province] | true | [string] | nope | Province code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][total_amount_to_pay] | [decimal] | Total amount to pay |
| data[attributes][transaction_fee] | [decimal] | transaction fee |
Authenticated
Currencies
Show Currency
REQUEST
GET /v1/currencies/hkd HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/currencies/hkd?include=pegged_currency" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies",
"attributes": {
"code": "hkd",
"name": "HKD",
"account": true,
"currency_type": "banknote",
"banknote": true,
"bitspark_deposit_credentials": {
"iban": "CZ8801000001152130170277",
"bank_name": "Komercni Banka, a.s.",
"reference": "9120255451",
"swift_code": "KOMBCZPP",
"bank_address": "Na Prikope 33 cp. 969 114 07 Praha 1",
"account_number": "",
"beneficiary_name": "Valoris HK Limited",
"account_holder_address": "5- 109 Argyle Street Richmond Commercial , Kowloon, 00000, Hong Kong"
},
"precision": 2,
"humanized_name": "Hong Kong Dollar",
"humanized_asset_prefix": "peg",
"pegged_multiplier": "1.0",
"asset_name": "PEG.HKD"
},
"relationships": {
"cash_fiat_countries": {
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
},
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
}
]
}
},
"pegged_currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
ENDPOINT
/v1/currencies/:currency_code
DESCRIPTION
This endpoint retrieves specific currency.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: pegged_currency, cash_fiat_countries, cash_fiat_countries.personal_pickups |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][code] | [string] | Currency name code |
| data[attributes][name] | [string] | Currency name |
| data[attributes][account] | [boolean] | true if currency available, so always returns true |
| data[attributes][currency_type] | [string] | Specifies currency type. Can be cryptocurrency or banknote. |
| data[attributes][banknote] | [boolean] | true if currency is of banknote type. |
| data[attributes][bitspark_deposit_credentials] | [hash] | Bitspark deposit credentials for this currency |
| data[attributes][precision] | [integer] | Currency precision |
| data[attributes][humanized_name] | [string] | Humanized name of currency |
| data[attributes][humanized_asset_prefix] | [string] | Asset prefix |
| data[attributes][pegged_multiplier] | [decimal] | Pegged currency multiplier |
| data[attributes][asset_name] | [string] | Currency asset name in Bitshares blockchain |
| data[relationships][cash_fiat_countries][data] | [hash] | Cash fiat countries for this currency |
| data[relationships][pegged_currency][data] | [hash] | Pegged currency |
Feature Policies
All Feature Policies
REQUEST
GET /v1/feature_policies HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/feature_policies" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "feature_policies",
"attributes": {
"feature_code": "receive_money",
"required_fields": [
"first_name",
"last_name",
"contact_number",
"address"
],
"required_docs": [
"identity_document"
],
"global_enabled": true,
"allowed": true
}
},
"..."
]
}
ENDPOINT
/v1/feature_policies
DESCRIPTION
This endpoint retrieves all feature policies related to your user.
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][feature_code] | [string] | Feature policy name |
| data[attributes][required_fields] | [array of strings] | Required profile fields which should be filled to use current feature |
| data[attributes][required_docs] | [array of strings] | Required documents which should be approved to use current feature |
| data[attributes][global_enabled] | [boolean] | Is feature enabled |
| data[attributes][allowed] | [boolean] | Is allowed to use current feature. Depends on filled required_fields and approved required_docs |
Show Feature Policy
REQUEST
GET /v1/feature_policies/ffffffff-ffff-ffff-ffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/feature_policies/ffffffff-ffff-ffff-ffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "feature_policies",
"attributes": {
"feature_code": "receive_money",
"required_fields": [
"first_name",
"last_name",
"contact_number",
"address"
],
"required_docs": [
"identity_document"
],
"global_enabled": true,
"allowed": true
}
}
]
}
ENDPOINT
/v1/feature_policies/:feature_policy_id
DESCRIPTION
This endpoint retrieves specific feature policies related to your user by ID.
RESPONSE DETAILS
Show Missed Fields and Documents
REQUEST
GET /v1/feature_policies/missed_fields_and_docs HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/feature_policies/missed_fields_and_docs" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"missed_info": [],
"not_approved_docs": []
}
ENDPOINT
/v1/feature_policies/missed_fields_and_docs
DESCRIPTION
This endpoint retrieves missed profile fields and approved documents for using specific feature.
Available feature codes: send_money, receive_money, senders, history, commission, reports, exchange_money, banknote_deposit, cryptocurrency_deposit, withdraw_btc, withdraw_usd, withdraw_eur, withdraw_hkd, top_up, approve_top_up, api_v1, recipients, btc, referrals, ip_whitelisting, withdraw_gbp, bitshares, withdraw_bts, withdraw_zeph, withdraw_eth, withdraw_aud, withdraw_sgd, user_base_verification
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| feature | false | [string] | none | Feature code (list of all feature codes you can find in description) |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| missed_info | [array of strings] | Missed required fields + missed required documents for using specific feature |
| not_approved_docs | [array of strings] | List of uploaded, but not approved documents |
Personal Info
Account
REQUEST
GET /v1/accounts/me?account_currency=usd&include=currency HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/accounts/me?account_currency=usd&include=currency" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts",
"attributes": {
"balance": "0.0",
"shop_commission": "0.0",
"balance_threshold": "0.0"
},
"relationships": {
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Invalid Account Currency"
]
}
]
}
ENDPOINT
/v1/accounts/me
DESCRIPTION
This endpoint retrieves info about one of your accounts.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: currency, currency.cash_fiat_countries,currency.cash_fiat_countries.personal_pickups |
| account_currency | true | [string] | none | Currency of account you want to retrieve ( should be one of Available Currencies codes ) |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][balance] | [decimal] | Account balance |
| data[attributes][shop_commission] | [decimal] | Shop commission |
| data[attributes][balance_threshold] | [decimal] | Balance threshold |
Update Account
REQUEST
PUT /v1/accounts/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bshop_commission%5D=0.0data%5Battributes%5D%5Bbalance_threshold%5D=0.0
curl -X PUT "https://api.bitspark.io/v1/accounts/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bshop_commission%5D=0.0&data%5Battributes%5D%5Bbalance_threshold%5D=0.0'
RESPONSE (success)
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts",
"attributes": {
"balance": "0.0",
"shop_commission": "0.0",
"balance_threshold": "0.0"
},
"relationships": {
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Balance threshold is not a number",
"Shop commission is not a number"
]
}
]
}
ENDPOINT
/accounts/:account_id
DESCRIPTION
This endpoint updates account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: currency, currency.cash_fiat_countries,currency.cash_fiat_countries.personal_pickups |
FORM DATA
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| data[attributes][shop_commission] | false | [decimal] | Additional commission that will be applied to Top Up and Send Money ( should be greater than or equal to 0.0) |
|
| data[attributes][balance_threshold] | false | [decimal] | Indicator of low balance ( should be greater than or equal to 0.0). It will send email notification when account.balance < account balance_threshold. Disabled when equal to 0.0. |
Profile
REQUEST
GET /v1/users/me?include=profile.identity_document,active_account.currency HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/users/me?include=profile.identity_document,active_account.currency" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "users",
"attributes": {
"login": "[email protected]",
"role": {},
"confirmed": true,
"gauth_enabled": false,
"gauth_tmp": "ffffffffffff"
},
"relationships": {
"profile": {
"data": {
"id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee",
"type": "profiles"
}
},
"active_account": {
"data": {
"id": "dddddddd-dddd-dddd-dddd-dddddddddddd",
"type": "accounts"
}
}
},
"links": {
"self": "http://api.bitspark.io/v1/users/me"
}
}
}
ENDPOINT
/v1/users/me
DESCRIPTION
This endpoint retrieves info about your profile.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: profile ,profile.identity_document, profile.personal_address_document, active_account, active_account.currency, active_account.currency.cash_fiat_countries, accounts, accounts.currency, accounts.currency.cash_fiat_countries |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][login] | [string] | Your login ( can be email or contact_number) |
| data[attributes][role] | [string] | Your role |
| data[attributes][confirmed] | [boolean] | Is your profile comfirmed |
| data[attributes][gauth_enabled] | [boolean] | Is Google Auth enabled |
| data[attributes][gauth_tmp] | [string] | Google Auth temporary code |
| data[relationships][profile][first_name] | [string] | Your first name |
| data[relationships][profile][middle_name] | [string] | Your middle name |
| data[relationships][profile][last_name] | [string] | Your last name |
| data[relationships][profile][residence_country] | [string] | Your residence country ( should be one of ISO 3166-1 ALPHA-3 country codes ) |
| data[relationships][profile][contact_number] | [string] | Your contact number |
| data[relationships][profile][company_name] | [string] | Your company name |
| data[relationships][profile][address] | [string] | Your address |
| data[relationships][profile][referral_code] | [string] | Referral Code |
| data[relationships][profile][reference_code] | [string] | Reference Code |
| data[relationships][profile][show_on_map] | [boolean] | Show on map |
| data[relationships][profile][image] | [hash] | Profile image |
| data[relationships][document_name][id_number] | [string] | Your ID number |
| data[relationships][document_name][value] | [string] | Your ID type ( can be id_card or passport) |
| data[relationships][document_name][proof_url] | [string] | URL to your ID proof |
| data[relationships][document_name][approved] | [boolean] | Returns true if document approved by admin |
| data[relationships][document_name][reject_reason] | [string] | Document reject reason |
| data[relationships][active_account][balance] | [decimal] | Account balance |
| data[relationships][active_account][shop_commission] | [decimal] | Shop commission |
| data[relationships][active_account][balance_threshold] | [decimal] | Balance threshold |
| data[relationships][currency][code] | [string] | Account currency name |
| data[relationships][currency][name] | [string] | Account currency code |
| data[relationships][currency][account] | [boolean] | Returns true if currency available |
| data[relationships][currency][currency_type] | [string] | currency_type |
| data[relationships][currency][banknote] | [boolean] | Returns true if currency is of banknote type. |
| data[relationships][currency][bitspark_deposit_credentials] | [hash] | Returns Bitspark deposit credentials for this currency |
| data[relationships][currency][precision] | [integer] | Currency precision |
| data[relationships][currency][humanized_name] | [string] | Humanized currency name |
Update Profile
REQUEST
POST /v1/users HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Btype%5D=profilesdata%5Battributes%5D%5Bfirst_name%5D=Firstdata%5Battributes%5D%5Blast_name%5D=Lastdata%5Brelationships%5D%5Bidentity_document%5D%5Bdata%5D%5Btype%5D=identity_documentsdata%5Brelationships%5D%5Bidentity_document%5D%5Bdata%5D%5Battributes%5D%5Bvalue%5D=passportdata%5Brelationships%5D%5Buser%5D%5Bdata%5D%5Btype%5D=usersdata%5Brelationships%5D%5Buser%5D%5Bdata%5D%5Battributes%5D%5Bcurrent_password%5D=12345678
curl -X POST "https://api.bitspark.io/v1/users" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Btype%5D=profiles&data%5Battributes%5D%5Bfirst_name%5D=First&data%5Battributes%5D%5Blast_name%5D=Last&data%5Brelationships%5D%5Bidentity_document%5D%5Bdata%5D%5Btype%5D=identity_documents&data%5Brelationships%5D%5Bidentity_document%5D%5Bdata%5D%5Battributes%5D%5Bvalue%5D=passport&data%5Brelationships%5D%5Buser%5D%5Bdata%5D%5Btype%5D=users&data%5Brelationships%5D%5Buser%5D%5Bdata%5D%5Battributes%5D%5Bcurrent_password%5D=12345678'
RESPONSE is the same as for Profile with all included data
ENDPOINT
/v1/users
DESCRIPTION
With this endpoint you can update your profile info.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[type] | true | [string] | Profile’s type ( must be profiles) |
| data[attributes][first_name] | false | [string] | Your first name |
| data[attributes][middle_name] | false | [string] | Your middle name |
| data[attributes][last_name] | false | [string] | Your last name |
| data[attributes][residence_country] | false | [string] | Your residence country ( should be one of ISO 3166-1 ALPHA-3 country codes ) |
| data[attributes][contact_number] | false | [string] | Your contact number |
| data[attributes][company_name] | false | [string] | Your company name |
| data[attributes][currency_id] | false | [string] | Account currency ID ( should be one of Available Currencies ID’s ) |
| data[attributes][address] | false | [string] | Your address |
| data[relationships][identity_document][data][attributes][id_number] | false | [string] | Your ID number |
| data[relationships][identity_document][data][attributes][value] | false | [string] | Your ID type ( should be one of: id_card, passport) |
| data[relationships][identity_document][data][attributes][proof] | false | [file] | Your ID proof ( file should be one of next types: jpg, jpeg, gif, png, bmp, pdf) |
| data[relationships][user][data][attributes][current_password] | false | [string] | Your current password |
| data[relationships][user][data][attributes][password] | false | [string] | New password |
| data[relationships][user][data][attributes][password_confirmation] | false | [string] | New password confirmation |
RESPONSE DETAILS
Detailed Amount to Pay
Amount to Pay V2
REQUEST
GET /v2/static/amount_to_pay?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET \
'https://api.bitspark.io/v2/static/amount_to_pay?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff' \
-H 'Key: YOUR_CLIENT_KEY' \
-H 'Secret: YOUR_SECRET_KEY' \
-H 'Sign: COMPUTED_HMAC' \
-H 'cache-control: no-cache'
RESPONSE
{
"data": {
"id": "99999999999999",
"type": "payment_data",
"attributes": {
"total_amount_to_pay_in_user_currency": 78.12,
"total_amount_to_pay_in_destination_currency": 105,
"transaction_fee_in_user_currency": 74.4,
"transaction_fee_in_destination_currency": 100
}
}
}
ENDPOINT
/v2/static/amount_to_pay
DESCRIPTION
This endpoint retrieves precalculated amount to pay for Send Money endpoint.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| account_currency | true | [string] | nope | Account currency to calculate amount in ( should be one of Available Currencies codes ) |
| transfer[amount] | true | [decimal] | nope | Amount of money to be payed ( should be greater than 0.0) |
| transfer[amount_to_send] | true | [decimal] | nope | Amount of money that user wants to transact in user currency |
| transfer[destination_id] | true | [uuid] | nope | Destination ID for send money to |
| transfer[delivery_method] | true | [string] | nope | Delivery method code |
| transfer[provider] | true | [string] | nope | Provider code |
| transfer[province] | true | [string] | nope | Province code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][total_amount_to_pay_in_user_currency] | [decimal] | Total amount to pay as is in user currency |
| data[attributes][total_amount_to_pay_in_destination_currency] | [decimal] | Total amount to pay as is in destination currency |
| data[attributes][transaction_fee_in_user_currency] | [decimal] | Transaction fee as is in user currency |
| data[attributes][transaction_fee_in_destination_currency] | [decimal] | Transaction fee as is in destination currency |
Amount to Pay V3
REQUEST
GET /v3/calculations/amount_to_pay/calculate?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET \
'https://api.bitspark.io/v3/calculations/amount_to_pay/calculate?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff' \
-H 'Key: YOUR_CLIENT_KEY' \
-H 'Secret: YOUR_SECRET_KEY' \
-H 'Sign: COMPUTED_HMAC' \
-H 'cache-control: no-cache'
RESPONSE
{
"data": {
"id": "99999999999999",
"type": "payment_data",
"attributes": {
"total_amount_to_pay_in_user_currency": 78.12,
"total_amount_to_pay_in_destination_currency": 105,
"transaction_fee_in_user_currency": 74.4,
"transaction_fee_in_destination_currency": 100,
"payment_service_fee_in_destination_currency": 0,
"payment_service_fee_in_user_currency": 0,
"destination_amount": 5,
"payment_provider_rate": 1.3440860215053763
}
}
}
ENDPOINT
/v3/calculations/amount_to_pay/calculate
DESCRIPTION
This endpoint retrieves precalculated amount to pay for Send Money endpoint.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| account_currency | true | [string] | nope | Account currency to calculate amount in ( should be one of Available Currencies codes ) |
| transfer[amount] | true | [decimal] | nope | Amount of money to be payed ( should be greater than 0.0) |
| transfer[amount_to_send] | true | [decimal] | nope | Amount of money that user wants to transact in user currency |
| transfer[destination_id] | true | [uuid] | nope | Destination ID for send money to |
| transfer[delivery_method] | true | [string] | nope | Delivery method code |
| transfer[provider] | true | [string] | nope | Provider code |
| transfer[province] | true | [string] | nope | Province code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][total_amount_to_pay_in_user_currency] | [decimal] | Total amount to pay as is in user currency |
| data[attributes][total_amount_to_pay_in_destination_currency] | [decimal] | Total amount to pay as is in destination currency |
| data[attributes][transaction_fee_in_user_currency] | [decimal] | Transaction fee as is in user currency |
| data[attributes][transaction_fee_in_destination_currency] | [decimal] | Transaction fee as is in destination currency |
| data[attributes][payment_service_fee_in_destination_currency] | [decimal] | Transaction cable fee as is in destination currency |
| data[attributes][payment_service_fee_in_user_currency] | [decimal] | Transaction cable fee as is in destination currency |
| data[attributes][destination_amount] | [decimal] | Amount to be sent to destination point |
| data[attributes][payment_provider_rate] | [decimal] | Payment provider rate |
Amount to Pay V4
REQUEST
GET /v4/calculations/amount_to_pay/calculate?account_currency=usd&transfer[amount]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Cache-Control: no-cache
curl -X GET \
'https://api.bitspark.io/v4/calculations/amount_to_pay/calculate?account_currency=usd&transfer[amount]=11.11&transfer[amount_to_send]=11.11&transfer[destination_id]=ffffffff-ffff-ffff-ffff-ffffffffffff' \
-H 'Key: YOUR_CLIENT_KEY' \
-H 'Secret: YOUR_SECRET_KEY' \
-H 'Sign: COMPUTED_HMAC' \
-H 'cache-control: no-cache'
RESPONSE
{
"data": {
"id": "99999999999999",
"type": "payment_data",
"attributes": {
"total_amount_to_pay_in_user_currency": 78.12,
"total_amount_to_pay_in_destination_currency": 105,
"transaction_fee_in_user_currency": 74.4,
"transaction_fee_in_destination_currency": 100,
"payment_service_fee_in_destination_currency": 0,
"payment_service_fee_in_user_currency": 0,
"destination_amount": 5,
"limits_info": "200 000 PHP per day"
}
}
}
ENDPOINT
/v4/calculations/amount_to_pay/calculate
DESCRIPTION
This endpoint retrieves precalculated amount to pay for Send Money endpoint.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| account_currency | true | [string] | nope | Account currency to calculate amount in ( should be one of Available Currencies codes ) |
| transfer[amount] | true | [decimal] | nope | Amount of money to be payed ( should be greater than 0.0) |
| transfer[amount_to_send] | true | [decimal] | nope | Amount of money that user wants to transact in user currency |
| transfer[destination_id] | true | [uuid] | nope | Destination ID for send money to |
| transfer[delivery_method] | true | [string] | nope | Delivery method code |
| transfer[provider] | true | [string] | nope | Provider code |
| transfer[province] | true | [string] | nope | Province code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][total_amount_to_pay_in_user_currency] | [decimal] | Total amount to pay as is in user currency |
| data[attributes][total_amount_to_pay_in_destination_currency] | [decimal] | Total amount to pay as is in destination currency |
| data[attributes][transaction_fee_in_user_currency] | [decimal] | Transaction fee as is in user currency |
| data[attributes][transaction_fee_in_destination_currency] | [decimal] | Transaction fee as is in destination currency |
| data[attributes][payment_service_fee_in_destination_currency] | [decimal] | Transaction cable fee as is in destination currency |
| data[attributes][payment_service_fee_in_user_currency] | [decimal] | Transaction cable fee as is in destination currency |
| data[attributes][destination_amount] | [decimal] | Amount to be sent to destination point |
| data[attributes][limits_info] | [string] | Provider_limits_info |
Fees
DESCRIPTION
Fees is used in system for calculating commission per transaction. Currently supported transaction types are deposit, withdaw, top_up.
Each transaction type has specific fees which also can be global or individual per user.
User can set only individual fees, global fees set by admin. Currently it makes sense to set individual fee for top_up as it will be profit for top_up agent user. Also there is commission profit split(by default 50%) with Bitspark and top_up agent user.
A percentage type fees calculates commission as percentage of transaction amount.
Base commission calculation logic is sum of all active global and individual(that related to user) fees.
All Fees
REQUEST
GET /v1/fees HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/fees" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_top_ups",
"attributes": {
"fee_type": "static",
"from": "0.0",
"to": "1000000000000000.0",
"amount": "0.0",
"active": false,
"global": true,
"created_at": "2018-10-16T11:47:25.474Z",
"updated_at": "2018-10-16T11:47:25.474Z"
},
"relationships": {
"currency": {
"data": {
"id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
"type": "currencies"
}
},
"user": {
"data": null
}
}
},
"..."
]
}
ENDPOINT
/v1/fees
DESCRIPTION
This endpoint retrieves all fees related to your user.
Currently supported fees type: top_up, deposit, bitshares_blockchain_deposit, cash_deposit, withdraw, bitshares_blockchain_withdraw, cash_withdraw, internal_transfer, money_exchange.
REQUEST PARAMS
| Key | Required | Type | Description |
|---|---|---|---|
| include | false | [string] | Include additional info to response. Possible objects: currency, currency.cash_fiat_countries, currency.cash_fiat_countries.personal_pickups |
| filter[currency] | false | [string] | Can be any of available currencies in system. It is allowed to specify the currency id or code. |
| filter[active] | false | [boolean] | Can be any true or false. It will return only currently active if true. |
| filter[fee_model_type] | false | [string] | One of supported fee type |
| filter[amount] | false | [decimal] | This will return only records which cover the amount. |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][fee_type] | [string] | Fee type. Could be static or percentage. |
| data[attributes][from] | [decimal] | Start range amount. Transaction amount must be bigger than or equal to from and less than to for applying a fee object to transaction. |
| data[attributes][to] | [decimal] | End range amount. Transaction amount must be bigger than or equal to from and less than to for applying a fee object to transaction. |
| data[attributes][amount] | [decimal] | Fee amount that will be applied to transaction. In case of percentage fee_type it will indicate the percentage fee(min: 0%, max: 100%). |
| data[attributes][active] | [boolean] | Indicator of active/disabled. If false – object will not be involved in fee calculation process. |
| data[attributes][global] | [boolean] | Indicator of global/individual. If false – object related only for specific user from object’s relationships. User can only fetch global fees and fees that belongs to his account. |
| data[relationships][currency] | [hash] | Currency than belong to fee |
Show Fee
REQUEST
GET /v1/fees/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/fees/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_top_ups",
"attributes": {
"fee_type": "static",
"from": "0.0",
"to": "1000000000000000.0",
"amount": "0.0",
"active": false,
"global": true,
"created_at": "2018-10-16T11:47:25.474Z",
"updated_at": "2018-10-16T11:47:25.474Z"
},
"relationships": {
"currency": {
"data": {
"id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
"type": "currencies"
}
},
"user": {
"data": null
}
}
}
}
ENDPOINT
/v1/fees/:fee_id
DESCRIPTION
This endpoint retrieves a specific fee object.
REQUEST PARAMS
| Key | Required | Type | Description |
|---|---|---|---|
| include | false | [string] | Include additional info to response. Possible objects: currency, currency.cash_fiat_countries, currency.cash_fiat_countries.personal_pickups |
RESPONSE DETAILS
Create Fee
REQUEST
POST /v1/fees HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=10data%5Battributes%5D%5Bcurrency%5D=usddata%5Battributes%5D%5Bfee_model_type%5D=top_up
curl -X POST "http://api.bitspark.io/v1/fees" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=10&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Battributes%5D%5Bfee_model_type%5D=top_up'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_top_ups",
"attributes": {
"fee_type": "static",
"from": "0.0",
"to": "1000000000000000.0",
"amount": "10.0",
"active": true,
"global": false,
"created_at": "2018-10-16T11:47:25.474Z",
"updated_at": "2018-10-16T11:47:25.474Z"
},
"relationships": {
"currency": {
"data": {
"id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
"type": "currencies"
}
},
"user": {
"data": null
}
}
}
}
ENDPOINT
/v1/fees
DESCRIPTION
This endpoint creates new fee.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [string] | Fee amount. By default(only one supported through API currently) fee type is static, this means that this amount will be applied to transaction as fee. |
| data[attributes][currency] | true | [string] | Can be any of available currencies in system. It is allowed to specify the currency id or code. |
| data[attributes][fee_model_type] | true | [string] | Any supported fee type. See All Fees for more info |
RESPONSE DETAILS
Recipients
All Recipients
REQUEST
GET /v1/recipients HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/recipients" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "recipients",
"attributes": {
"first_name": "First",
"middle_name": "mid",
"last_name": "Last",
"email": "[email protected]",
"phone_number": "+123456789012",
"alt_phone_number": null,
"address": "350 5th Ave, New York, NY 10118, USA",
"bank_branch": "Bank Branch Name",
"beneficiary_name": "Beneficiary Name",
"bank_account_number": "111111111111",
"cnic": null,
"iban": null
}
},
"..."
]
}
ENDPOINT
/v1/recipients
DESCRIPTION
This endpoint retrieves all your send money recipients.
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][first_name] | [string] | Recipient’s first name |
| data[attributes][middle_name] | [string] | Recipient’s middle name |
| data[attributes][last_name] | [string] | Recipient’s last name |
| data[attributes][email] | [string] | Recipient’s email |
| data[attributes][phone_number] | [string] | Recipient’s valid phone number |
| data[attributes][alt_phone_number] | [string] | Recipient’s alternative phone number |
| data[attributes][address] | [string] | Recipient’s adsress |
| data[attributes][bank_branch] | [string] | Recipient’s bank branch |
| data[attributes][beneficiary_name] | [string] | Recipient’s beneficiary |
| data[attributes][bank_account_number] | [string] | Recipient’s bank account number |
| data[attributes][bank_account_type] | [string] | Recipient’s bank account type, should be one of [current, saving] |
| data[attributes][cnic] | [string] | Computerized National Identity Card |
| data[attributes][iban] | [string] | International bank account number |
Show Recipient
REQUEST
GET /v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_recipients",
"attributes": {
"first_name": "First",
"middle_name": "mid",
"last_name": "Last",
"email": "[email protected]",
"phone_number": "+8611444455555",
"alt_phone_number": "+8622444455555",
"address": "350 5th Ave, New York, NY 10118, USA",
"bank_branch": "Bank Branch name",
"beneficiary_name": "Beneficiary Name",
"bank_account_number": "111111111111",
"cnic": null,
"iban": null
}
}
}
ENDPOINT
/v1/recipients/:recipient_id
DESCRIPTION
This endpoint retrieves a specific recipient.
RESPONSE DETAILS
Create Recipient
REQUEST
POST /v1/recipients HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Btype%5D=user_recipientsdata%5Battributes%5D%5Bfirst_name%5D=Firstdata%5Battributes%5D%5Blast_name%5D=Lastdata%5Battributes%5D%5Bphone_number%5D=%2B8611444455555data%5Battributes%5D%5Bbank_branch%5D=Bank+Branch+namedata%5Battributes%5D%5Bbeneficiary_name%5D=Beneficiary+Namedata%5Battributes%5D%5Bbank_account_number%5D=111111111111
curl -X POST "https://api.bitspark.io/v1/recipients"
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Btype%5D=user_recipients&data%5Battributes%5D%5Bfirst_name%5D=First&data%5Battributes%5D%5Blast_name%5D=Last&data%5Battributes%5D%5Bphone_number%5D=%2B8611444455555&data%5Battributes%5D%5Bbank_branch%5D=Bank%20Branch%20name&data%5Battributes%5D%5Bbeneficiary_name%5D=Beneficiary%20Name&data%5Battributes%5D%5Bbank_account_number%5D=111111111111'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_recipients",
"attributes": {
"first_name": "First",
"middle_name": "mid",
"last_name": "Last",
"email": "[email protected]",
"phone_number": "+8611444455555",
"alt_phone_number": "+8622444455555",
"address": "350 5th Ave, New York, NY 10118, USA",
"bank_branch": "Bank Branch name",
"beneficiary_name": "Beneficiary Name",
"bank_account_number": "111111111111",
"cnic": null,
"iban": null
}
}
}
ENDPOINT
/v1/recipients
DESCRIPTION
This endpoint creates new recipient.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[type] | true | [string] | Recipient’s type ( must be user_recipients) |
| data[attributes][first_name] | true | [string] | Recipient’s first name |
| data[attributes][middle_name] | false | [string] | Recipient’s middle name |
| data[attributes][last_name] | true | [string] | Recipient’s last name |
| data[attributes][email] | false | [string] | Recipient’s email |
| data[attributes][phone_number] | true | [string] | Recipient’s valid phone number |
| data[attributes][alt_phone_number] | false | [string] | Recipient’s alternative phone number |
| data[attributes][address] | false | [string] | Recipient’s address |
| data[attributes][bank_branch] | true (only for bank transfers) | [string] | Recipient’s bank branch |
| data[attributes][beneficiary_name] | true (only for bank transfers) | [string] | Recipient’s beneficiary |
| data[attributes][bank_account_number] | true (only for bank transfers) | [string] | Recipient’s bank account number |
| data[attributes][cnic] | false | [string] | Computerized National Identity Card |
| data[attributes][iban] | false | [string] | International bank account number |
RESPONSE DETAILS
Update Recipient
REQUEST
PUT /v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Btype%5D=user_recipientsdata%5Battributes%5D%5Bfirst_name%5D=Firstdata%5Battributes%5D%5Blast_name%5D=Lastdata%5Battributes%5D%5Bphone_number%5D=%2B8611444455555data%5Battributes%5D%5Bbank_branch%5D=Bank+Branch+namedata%5Battributes%5D%5Bbeneficiary_name%5D=Beneficiary+Namedata%5Battributes%5D%5Bbank_account_number%5D=111111111111
curl -X PUT "https://api.bitspark.io/v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Btype%5D=user_recipients&data%5Battributes%5D%5Bfirst_name%5D=First&data%5Battributes%5D%5Blast_name%5D=Last&data%5Battributes%5D%5Bphone_number%5D=%2B8611444455555&data%5Battributes%5D%5Bbank_branch%5D=Bank%20Branch%20name&data%5Battributes%5D%5Bbeneficiary_name%5D=Beneficiary%20Name&data%5Battributes%5D%5Bbank_account_number%5D=111111111111'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_recipients",
"attributes": {
"first_name": "First One1",
"middle_name": "mid mAn",
"last_name": "Last another",
"email": "[email protected]",
"phone_number": "+8611444455555",
"alt_phone_number": "+8622444455555",
"address": "350 5th Ave, New York, NY 10118, USA",
"bank_branch": "Bank Branch name",
"bank_branch_address": null,
"beneficiary_name": "Beneficiary Name",
"bank_account_number": "111111111111",
"cnic": null,
"iban": null
}
}
}
ENDPOINT
/v1/recipients/:recipient_id
DESCRIPTION
With this endpoint you can update specific recipient info.
FORM DATA
RESPONSE DETAILS
Delete Recipient
REQUEST
DELETE /v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X DELETE "http://api.bitspark.io/v1/recipients/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
ENDPOINT
/v1/recipients/:recipient_id
DESCRIPTION
With this endpoint you can delete specific recipient.
RESPONSE DETAILS
Transactions
All Remmitances V1
REQUEST
GET /v1/transactions/remittances?include=transfer_recipient HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/transactions/remittances?include=transfer_recipient" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "payment_commited_successfully",
"message": "Processing",
"info": ""
},
"amount": "1.0",
"amount_to_send": "0.0",
"currency": "PHP",
"account_currency": "PHP",
"exchange_rate": "0.9803449618238244",
"destination_country": "Philippines",
"receipt_info": {
"principal": "1.02",
"cable_charge": 0,
"pickup_fee": "102.005",
"payment_service_fee": 0,
"amount_due": "103.0",
"landed_amount": "1.0"
},
"transaction_number": "72S4PEAQ",
"tracking_number": null,
"tracking_number_possible": null,
"callback_url": null,
"provider": "allied_bank",
"delivery_method": "bank",
"created_at": "2019-02-28T16:23:04.020Z",
"updated_at": "2019-03-26T10:27:29.487Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfer_recipients"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
]
}
ENDPOINT
/v1/transactions/remittances
DESCRIPTION
This endpoint retrieves all created remmitances with details.
REQUEST PARAMS
RESPONSE DETAILS
All Remmitances V2
REQUEST
GET /v2/transactions/remittances?include=transfer_recipient HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/transactions/remittances?include=transfer_recipient" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "payment_commited_successfully",
"message": "Processing",
"info": ""
},
"amount": "11.11",
"amount_to_send": "0.0",
"currency": "VND",
"account_currency": "USD",
"exchange_rate": "1.0",
"destination_country": "Vietnam",
"receipt_info": {
"principal": null,
"cable_charge": "28.0",
"pickup_fee": null,
"payment_service_fee": null,
"amount_due": "545.0",
"landed_amount": "3000.0"
},
"transaction_number": "FFFFFFFF",
"tracking_number": null,
"tracking_number_possible": null,
"callback_url": null,
"provider": "provider",
"delivery_method": "bank",
"created_at": "2019-02-28T16:23:04.020Z",
"updated_at": "2019-02-28T16:23:14.291Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfer_recipients"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
]
}
ENDPOINT
/v2/transactions/remittances
DESCRIPTION
This endpoint retrieves all created remmitances with details.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: transfer_recipient, partner_reference |
| filter[partner_reference_code] | false | [string] | none | Filter by Partner Reference Code |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][amount] | [decimal] | Sent amount of money |
| data[attributes][amount_to_send] | [decimal] | Amount of money that user wants to transact in user currency |
| data[attributes][currency] | [string] | Destination currency |
| data[attributes][account_currency] | [string] | Account currency to withraw from ( should be one of Available Currencies codes ) |
| data[attributes][exchange_rate] | [decimal] | Send money exchange rate |
| data[attributes][destination_country] | [string] | Destination country |
| data[attributes][receipt_info] | [hash] | Receipt info |
| data[attributes][transaction_number] | [string] | Transaction identifier |
| data[attributes][tracking_number] | [string] | Transaction tracking code |
| data[attributes][tracking_number_possible] | [string] | Returns true if tracking_number will be present |
| data[attributes][provider] | [string] | Provider code |
| data[attributes][delivery_method] | [string] | Delivery method |
| data[attributes][created_at] | [string] | Created at |
| data[attributes][updated_at] | [string] | Updated at |
| data[attributes][relationships][transfer_recipient] | [hash] | See All Recipients for response details. |
| data[attributes][relationships][parnter_reference] | [hash] | Partner Reference object |
All Transactions V1
REQUEST
GET /v1/transactions/history HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/transactions/history" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "mobile_payments",
"attributes": {
"account_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"amount": 1,
"status": {
"code": "finished",
"message": "Finished",
"group": "completed"
},
"payment_type": "ReceivedMoneyExchange",
"currency": "USD",
"slug": "DFA6GCJZ",
"basic_info": {},
"created_at": "2019-04-08T09:16:02.652Z"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
}
}
},
"..."
]
}
ENDPOINT
/v1/transactions/history
DESCRIPTION
This endpoint retrieves all created transactions with details.
REQUEST PARAMS
RESPONSE DETAILS
All Transactions V2
REQUEST
GET /v2/transactions/history HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/transactions/history" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "mobile_payments",
"attributes": {
"account_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"amount": 1,
"status": {
"code": "finished",
"message": "Finished",
"group": "completed"
},
"payment_type": "ReceivedMoneyExchange",
"currency": "USD",
"slug": "DFA6GCJZ",
"basic_info": {},
"created_at": "2019-04-08T09:16:02.652Z"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
}
}
},
"..."
]
}
ENDPOINT
/v2/transactions/history
DESCRIPTION
This endpoint retrieves all created transactions with details.
List on transaction types: deposit, withdraw, send, exchange
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, account.currency.cash_fiat_countries |
| filter[slug] | false | [string] | none | Filter by tracking code |
| filter[currency_id] | false | [uuid] | none | Filter by currency ID |
| filter[type] | false | [string] | none | Filter by transaction type |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transfer status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transfer status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][account_id] | [uuid] | Account ID with which transaction where committed |
| data[attributes][amount] | [decimal] | Sent amount |
| data[attributes][currency] | [string] | Destination currency |
| data[attributes][payment_type] | [string] | Transaction type |
| data[attributes][basic_info] | [hash] | Detailed transaction info |
| data[attributes][slug] | [string] | Transaction tracking code |
| data[attributes][created_at] | [string] | Created at |
Show Remmitance V2
REQUEST
GET /v2/transactions/remittances/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/transactions/remittances/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "payment_commited_successfully",
"message": "Payment commited",
"info": ""
},
"amount": "151.0",
"amount_to_send": "0.0",
"currency": "PHP",
"account_currency": "USD",
"exchange_rate": "1.0",
"destination_country": "Philippines",
"receipt_info": {},
"transaction_number": "TF-180315-668-X9YZ",
"tracking_number": null,
"tracking_number_possible": true,
"created_at": "2018-03-15T14:24:26.689Z",
"updated_at": "2018-03-15T14:25:01.359Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee",
"type": "transfer_recipients"
}
}
}
}
}
ENDPOINT
/v2/transactions/remittances/:remittance_id
DESCRIPTION
This endpoint retrieves a specific remittance.
RESPONSE DETAILS
Show Remmitance V3
REQUEST
GET /v3/transactions/remittances/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v3/transactions/remittances/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "payment_commited_successfully",
"message": "Payment commited",
"info": ""
},
"amount": "151.0",
"amount_to_send": "0.0",
"currency": "PHP",
"account_currency": "USD",
"exchange_rate": "1.0",
"destination_country": "Philippines",
"receipt_info": {},
"transaction_number": "TF-180315-668-X9YZ",
"tracking_number": null,
"tracking_number_possible": true,
"created_at": "2018-03-15T14:24:26.689Z",
"updated_at": "2018-03-15T14:25:01.359Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee",
"type": "transfer_recipients"
}
}
}
}
}
ENDPOINT
/v3/transactions/remittances/:remittance_id
DESCRIPTION
This endpoint retrieves a specific remittance.
RESPONSE DETAILS
Send Money
REQUEST
POST /v1/transactions/send_money HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
account_currency=usddata%5Btype%5D=transfersdata%5Battributes%5D%5Bamount%5D=100data%5Battributes%5D%5Bdelivery_method%5D=delivery_method_codedata%5Battributes%5D%5Bprovider%5D=province_codedata%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Btype%5D=destinationsdata%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Battributes%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffffdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Btype%5D=recipientsdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbank_account_number%5D=bank_account_numberdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Btype%5D=sendersdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bmiddle_name%5D=middle_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bid_number%5D=id_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=addressdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Balt_phone_number%5D=alt_phone_number
curl -X POST "https://api.bitspark.io/v1/transactions/send_money" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'account_currency=usd&data%5Btype%5D=transfers&data%5Battributes%5D%5Bamount%5D=100&data%5Battributes%5D%5Bdelivery_method%5D=delivery_method_code&data%5Battributes%5D%5Bprovider%5D=province_code&data%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Btype%5D=destinations&data%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Battributes%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Btype%5D=recipients&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbank_account_number%5D=bank_account_number&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Btype%5D=senders&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bmiddle_name%5D=middle_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bid_number%5D=id_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=address&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Balt_phone_number%5D=alt_phone_number'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "unknown",
"message": "Processing",
"info": ""
},
"amount": "1.0",
"amount_to_send": "0.0",
"currency": "IDR",
"account_currency": "USD",
"exchange_rate": null,
"destination_country": "Indonesia",
"receipt_info": {},
"transaction_number": "FFFFFFFF",
"tracking_number": null,
"tracking_number_possible": false,
"callback_url": "example.com",
"provider": "m_lhuillier",
"delivery_method": "pickup",
"created_at": "2018-06-22T10:18:30.046Z",
"updated_at": "2018-06-22T10:18:30.046Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfer_recipients"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
}
ENDPOINT
/v1/transactions/send_money
DESCRIPTION
This endpoint creates new transaction.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| account_currency | true | [string] | Account currency for send money from (should be one of Available Currencies codes) |
| data[type] | true | [string] | Transaction type ( must be transfers) |
| data[attributes][amount] | true | [decimal] | Amount of Destination currency to be sent ( should be greater than 0.0) |
| data[attributes][delivery_method] | true | [string] | Delivery method code |
| data[attributes][provider] | true | [string] | Provider code |
| data[attributes][province] | true | [string] | Province code |
| data[attributes][callback_url] | false | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[relationships][destination][data][attributes][id] | true | [uuid] | Destination ID for send money to |
| data[relationships][destination][data][attributes][code] | true | [string] | Destination code for send money to ( not required if ID specified ) |
| data[relationships][recipient][data][type] | true | [string] | Recipient’s type ( must be recipients) |
| data[relationships][recipient][data][attributes] | true/false | [hash] | See Create Recipient for Recipient’s FORM DATA details. |
| data[relationships][sender][data][type] | true/false | [string] | Sender’s type ( must be senders) |
| data[relationships][sender][data][attributes][first_name] | true/false | [string] | Sender’s first name |
| data[relationships][sender][data][attributes][middle_name] | true/false | [string] | Sender’s middle name |
| data[relationships][sender][data][attributes][last_name] | true/false | [string] | Sender’s last name |
| data[relationships][sender][data][attributes][id_number] | true/false | [string] | Sender’s ID number |
| data[relationships][sender][data][attributes][address] | true/false | [string] | Sender’s address |
| data[relationships][sender][data][attributes][phone_number] | true/false | [string] | Sender’s phone number |
| data[relationships][sender][data][attributes][alt_phone_number] | true/false | [string] | Sender’s alternative phone number |
| data[relationships][partner_reference][data][attributes][code] | false | [string] | Partner Reference Code which can be used to identify transaction (max 64 symbols) |
RESPONSE DETAILS
Send Domestic Money
REQUEST
POST /v1/transactions/send_domestic_money HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
account_currency=usddata%5Btype%5D=transfersdata%5Battributes%5D%5Bamount%5D=100data%5Battributes%5D%5Bdelivery_method%5D=delivery_method_codedata%5Battributes%5D%5Bprovider%5D=province_codedata%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Btype%5D=destinationsdata%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Battributes%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffffdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Btype%5D=recipientsdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbank_account_number%5D=bank_account_numberdata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_namedata%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Btype%5D=sendersdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bmiddle_name%5D=middle_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_namedata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bid_number%5D=id_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=addressdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_numberdata%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Balt_phone_number%5D=alt_phone_numberdata%5Battributes%5D%5Bdomestic_payment_id%5D=ffffffff-ffff-ffff-ffffffffffff
curl -X POST "https://api.bitspark.io/v1/transactions/send_domestic_money" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'account_currency=usd&data%5Btype%5D=transfers&data%5Battributes%5D%5Bamount%5D=100&data%5Battributes%5D%5Bdelivery_method%5D=delivery_method_code&data%5Battributes%5D%5Bprovider%5D=province_code&data%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Btype%5D=destinations&data%5Brelationships%5D%5Bdestination%5D%5Bdata%5D%5Battributes%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Btype%5D=recipients&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbank_account_number%5D=bank_account_number&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_name&data%5Brelationships%5D%5Brecipient%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Btype%5D=senders&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bfirst_name%5D=first_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bmiddle_name%5D=middle_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Blast_name%5D=last_name&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bid_number%5D=id_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=address&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Bphone_number%5D=phone_number&data%5Brelationships%5D%5Bsender%5D%5Bdata%5D%5Battributes%5D%5Balt_phone_number%5D=alt_phone_number&data%5Battributes%5D%5Bdomestic_payment_id%5D=ffffffff-ffff-ffff-ffffffffffff'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfers",
"attributes": {
"status": {
"group": "pending",
"code": "unknown",
"message": "Processing",
"info": ""
},
"amount": "1.0",
"amount_to_send": "0.0",
"currency": "IDR",
"account_currency": "USD",
"exchange_rate": null,
"destination_country": "Indonesia",
"receipt_info": {},
"transaction_number": "FFFFFFFF",
"tracking_number": null,
"tracking_number_possible": false,
"created_at": "2018-06-22T10:18:30.046Z",
"updated_at": "2018-06-22T10:18:30.046Z"
},
"relationships": {
"transfer_recipient": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "transfer_recipients"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
}
ENDPOINT
/v1/transactions/send_domestic_money
DESCRIPTION
This endpoint creates new domestic transaction.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][domestic_payment_id] | [string] | Domestic Payment ID |
RESPONSE DETAILS
Payments
All Domestic Payments
REQUEST
GET /v1/domestic_payments HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/transactions/payments/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 1,
"amount_to_receive": 1,
"fee": 0,
"status": "finished",
"type": "InternalDomesticTransfer",
"receiver_currency_name": "EUR",
"receiver_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_currency_name": "EUR",
"sender_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_name": "rewrrteee H. fsdfsf",
"receiver_name": "FirstFriend"
},
"relationships": {
"receiver_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": null
}
}
}
]
}
ENDPOINT
/v1/domestic_payments
DESCRIPTION
This endpoint retrieves all domestic payments.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: receiver_account, receiver_account.currency, receiver_account.currency.cash_fiat_countries, sender_account, sender_account.currency, sender_account.currency.cash_fiat_countries, receiver, sender, partner_reference |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount_to_send] | [decimal] | Amount of money to send |
| data[attributes][amount_to_receive] | [decimal] | Amount of money to receive |
| data[attributes][fee] | [decimal] | Transaction fee |
| data[attributes][status] | [string] | Transaction status |
| data[attributes][type] | [string] | Transaction status |
| data[attributes][receiver_currency_name] | [string] | Receiver currency |
| data[attributes][receiver_currency_id] | [string] | Receiver currency ID |
| data[attributes][sender_currency_name] | [string] | Sender currency |
| data[attributes][sender_currency_id] | [string] | Sender currency ID |
| data[attributes][sender_name] | [string] | Sender name |
| data[attributes][receiver_name] | [string] | Receiver name |
| data[relationships][receiver_account][data] | [uuid] | Receiver account that belong to domestic payment |
| data[relationships][sender_account][data] | [uuid] | Sender account that belong to domestic payment |
| data[relationships][receiver][data] | [uuid] | Receiver profile that belong to domestic payment |
| data[relationships][sender][data] | [uuid] | Sender profile that belong to domestic payment |
| data[relationships][partner_reference][data] | [uuid] | Partner reference that belong to domestic payment |
Show Payment V1
REQUEST
GET /v1/transactions/payments/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/transactions/payments/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "bank_deposits",
"attributes": {
"amount": "1.0",
"txid": "123",
"callback_url": "example.com",
"slug": "FFFF",
"received_funds": "0.8",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2018-12-26T09:14:19.350Z",
"group": "processing"
},
"created_at": "2018-12-26T09:14:19.350Z"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "bank_details"
}
}
}
}
}
ENDPOINT
/v1/transactions/payments/:id
DESCRIPTION
This endpoint retrieves a specific payment.
REQUEST PARAMS
RESPONSE DETAILS
Show Payment V2
REQUEST
GET /v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "bank_deposits",
"attributes": {
"amount": "1.0",
"txid": "123",
"callback_url": "example.com",
"slug": "FFFF",
"received_funds": "0.8",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2018-12-26T09:14:19.350Z",
"group": "processing"
},
"created_at": "2018-12-26T09:14:19.350Z"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "bank_details"
}
}
}
}
}
ENDPOINT
/v2/payments/:id
DESCRIPTION
This endpoint retrieves a specific payment.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: bank_details, account, account.currency, account.currency.cash_fiat_countries |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Amount of money |
| data[attributes][txid] | [decimal] | Payment transaction ID |
| data[attributes][callback_url] | [decimal] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][slug] | [string] | Payment tracking code |
| data[attributes][received_funds] | [string] | Amount of money after all fees |
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[relationships][account][data] | [hash] | Account that belong to payment |
| data[relationships][bank_detail][data] | [hash] | Bank details that belong to payment |
Show Domestic Payment
REQUEST
GET /v1/domestic_payments/ffffffff-ffff-ffff-ffff-ffffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/domestic_payments/ffffffff-ffff-ffff-ffff-ffffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 0.2,
"amount_to_receive": 0.2,
"fee": 0,
"status": "finished",
"type": "InternalDomesticTransfer",
"receiver_currency_name": "PHP",
"receiver_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_currency_name": "PHP",
"sender_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_name": "Sender Name",
"receiver_name": ""
},
"relationships": {
"receiver_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
}
ENDPOINT
/v1/domestic_payments/:id
DESCRIPTION
This endpoint retrieves a specific domestic payment.
REQUEST PARAMS
RESPONSE DETAILS
Create Domestic Payment
REQUEST
POST /v1/domestic_payments HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X POST "https://api.bitspark.io/v1/domestic_payments" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 0.2,
"amount_to_receive": 0.2,
"fee": 0,
"status": "finished",
"type": "InternalDomesticTransfer",
"receiver_currency_name": "PHP",
"receiver_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_currency_name": "PHP",
"sender_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"sender_name": "Sender Name",
"receiver_name": ""
},
"relationships": {
"receiver_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "partner_references"
}
}
}
}
}
ENDPOINT
/v1/domestic_payments
DESCRIPTION
This endpoint create domestic payment.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount_to_send] | true | [decimal] | Amount of money that user wants to transact |
| data[attributes][amount_to_receive] | true | [decimal] | Amount of money that user wants to receive |
| data[attributes][receiver_currency] | true | [string] | Receiver currency. For internal should be same as sender |
| data[attributes][sender_currency] | true | [string] | Sender currency. For internal should be same as receiver |
| data[attributes][receiver_id] | true | [uuid] | Can be login (email/phone) or ID |
| data[relationships][partner_reference][data][attributes][code] | false | [string] | Partner Reference Code which can be used to identify transaction (max 64 symbols) |
RESPONSE DETAILS
Deposits
All Deposit Addresses
REQUEST
GET /v1/deposit_addresses HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/deposit_addresses" \
-H "Cache-Control: no-cache" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "memos",
"attributes": {
"code": "fffffffffffff",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": "example.com",
"wallet_address": null
},
"relationships": {
"user": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "users"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
},
"..."
]
}
ENDPOINT
/v1/deposit_addresses
DESCRIPTION
This endpoint retrieves all user addresses for BTC & ETH currencies.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency, currency |
| is_used | false | [boolean] | none | Filter by is_used field |
| currency | false | [string] | none | Filter by currency |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][code] | [string] | Your address for selected currency |
| data[attributes][is_used] | [boolean] | Returns true if address already in use |
| data[attributes][qr_code] | [date] | QR code URL for address |
| data[attributes][created_at] | [date] | Creation date of address |
| data[relationships][user] | [hash] | User that belongs to address |
| data[relationships][currency] | [hash] | Currency that belongs to address |
All Deposit Memos
REQUEST
GET /v1/memos HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/memos" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "fffffffff-ffff-ffff-ffff-fffffffffff",
"type": "memos",
"attributes": {
"code": "ffffffff",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": null,
"wallet_address": "wallet_address"
},
"relationships": {
"user": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-fffffffffff",
"type": "users"
}
},
"currency": {
"data": null
}
}
},
"..."
]
}
ENDPOINT
/v1/memos
DESCRIPTION
This endpoint retrieves all user memos for BTS and ZEPH currencies.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency |
| is_used | false | [boolean] | none | Filter by is_used field |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][code] | [string] | Your memo code |
| data[attributes][is_used] | [boolean] | Returns true if memo already in use |
| data[attributes][wallet_address] | [string] | Destitation address |
| data[attributes][created_at] | [date] | Creation date of memo |
| data[relationships][user] | [hash] | User that belongs to memo |
All Pending BTC Deposits
REQUEST
GET /v2/payments/pending_btc_deposits HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/payments/pending_btc_deposits" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "btc_deposits",
"attributes": {
"amount": null,
"txid": null,
"slug": "FFFF",
"callback_url": null,
"status": {
"code": "unknown",
"message": "Unknown",
"updated_at": null,
"group": "processing"
},
"created_at": "2016-10-04T10:36:29.332Z",
"received_funds": null,
"bitcoin_address": "1KYjqpDx6LnyuQFQ5591iTMJgASUdju5uM",
"address": "1KYjqpDx6LnyuQFQ5591iTMJgASUdju5uM"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
}
}
}
]
}
ENDPOINT
/v2/payments/pending_btc_deposits
DESCRIPTION
Return all BTC deposits where status pending.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Deposit amount |
| data[attributes][txid] | [string] | Deposit txID |
| data[attributes][slug] | [string] | Deposit tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][received_funds] | [decimal] | Deposit amount to receive |
| data[attributes][bitcoin_address] | [string] | Deposit address |
| data[attributes][address] | [string] | Deposit address (same as bitcoin_address) |
| data[relationships][account] | [hash] | Account that belongs to deposit |
Show Deposit Address
REQUEST
POST /v1/deposit_addresses/btc HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X POST "https://api.bitspark.io/v1/deposit_addresses/:currency \
-H "Cache-Control: no-cache" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "memos",
"attributes": {
"code": "1KYjqpDx6LnyuQFQ5591iTMJgASUdju5uM",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": "example.com",
"wallet_address": null
},
"relationships": {
"user": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "users"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
ENDPOINT
/v1/deposit_addresses/:currency
DESCRIPTION
Return your last active deposit address for selected currency or create new if you don’t have any
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency, currency |
RESPONSE DETAILS
Show Deposit Memo
REQUEST
POST /v1/memos/bts HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X POST "https://api.bitspark.io/v1/memos/bts" \
-H "Cache-Control: no-cache" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN"
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "memos",
"attributes": {
"code": "ffffffff",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": null,
"wallet_address": "address"
},
"relationships": {
"user": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "users"
}
},
"currency": {
"data": null
}
}
}
}
ENDPOINT
/v1/memos/:currency
DESCRIPTION
Return your last active memo code or create new if you don’t have any
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency |
RESPONSE DETAILS
Create Deposit V3
REQUEST
POST /v3/payments/deposit HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
account_currency=usddata%5Btype%5D=depositsdata%5Battributes%5D%5Bamount%5D=100
curl -X POST "https://api.bitspark.io/v3/payments/deposit" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'account_currency=usd&data%5Btype%5D=deposits&data%5Battributes%5D%5Bamount%5D=100'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "deposits",
"attributes": {
"amount": "1.0",
"txid": "FFFFFFFF",
"callback_url": "example.com",
"slug": "FFFFFFFF",
"received_funds": "0.9466",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2019-02-27T12:50:44.483Z",
"group": "processing"
},
"deposit_credentials": {
"iban": "CZ8801000001152130170277",
"bank_name": "Komercni Banka, a.s.",
"reference": "9120255451",
"swift_code": "KOMBCZPP",
"bank_address": "Na Prikope 33 cp. 969 114 07 Praha 1",
"account_number": "",
"beneficiary_name": "Valoris HK Limited",
"account_holder_address": "5- 109 Argyle Street Richmond Commercial , Kowloon, 00000, Hong Kong"
}
},
"relationships": {
"account": {
"data": {
"type": "accounts",
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
}
}
}
}
ENDPOINT
/v3/payments/deposit
DESCRIPTION
Bank Deposit to specified account.
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be deposited ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Account currency to deposit to ( should be one of Available Currencies codes ) |
| data[attributes][callback_url] | false | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
Create Crypto Deposit
REQUEST (BTC & ETH)
POST /v1/deposit_addresses/ HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
currency=btc
curl -X POST "https://api.bitspark.io/v1/deposit_addresses" \
-H "Cache-Control: no-cache" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-d 'currency=btc
REQUEST (BTS & ZEPH)
POST /v1/memos HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X POST "https://api.bitspark.io/v1/memos" \
-H "Cache-Control: no-cache" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN"
RESPONSE (BTC & ETH)
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "memos",
"attributes": {
"code": "1KYjqpDx6LnyuQFQ5591iTMJgASUdju5uM",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": "example.com",
"wallet_address": null
},
"relationships": {
"user": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "users"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
RESPONSE (BTS & ZEPH)
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "memos",
"attributes": {
"code": "ffffffff",
"is_used": false,
"created_at": "2019-01-11T11:38:30.622Z",
"qr_code_url": null,
"wallet_address": "address"
},
"relationships": {
"user": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "users"
}
},
"currency": {
"data": null
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "Too many unused memos generated"
}
]
}
ENDPOINT
/v1/deposit_addresses (BTC & ETH)
/v1/memos (BTS & ZEPH)
DESCRIPTION
Cryptocurrency deposit to specified account.
BTC / ETH: this endpoint will generate new personal address for deposit. After that send selected currency to this address
BTS / ZEPH: this endpoint will generate new memo for deposit. After that send BTS or ZEPH to destination address, with your personal memo key.
Once the blockchain has confirmed the transaction, your balance will appear in your account.
Estimated time to arrive: 10-15 minutes, depending on the digital currency
BTC & ETH
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency, currency |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| currency | true | [string] | Account currency for which will be created address |
RESPONSE DETAILS
BTS & ZEPH
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user, user.profile, user.profile.identity_document, user.profile.personal_address_document, user.active_account, user.active_account.currency, user.accounts, user.accounts.currency |
RESPONSE DETAILS
Create Bank Deposit
REQUEST
POST /v3/payments/bank_deposit HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=1data%5Battributes%5D%5Bcurrency%5D=usddata%5Btype%5D=deposits
curl -X POST "https://api.bitspark.io/v3/payments/bank_deposit" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Btype%5D=deposits'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "bank_deposits",
"attributes": {
"amount": "1",
"txid": "FFFFFFFF",
"slug": "FFFFFFFF",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2019-01-10T16:11:11.016Z",
"group": "processing"
},
"created_at": "2019-01-10T16:11:10.990Z",
"received_funds": "0.0198",
"callback_url": null,
"deposit_credentials": {
"iban": "CZ8801000001152130170277",
"bank_name": "Komercni Banka, a.s.",
"reference": "9120255451",
"swift_code": "KOMBCZPP",
"bank_address": "Na Prikope 33 cp. 969 114 07 Praha 1",
"account_number": "",
"beneficiary_name": "Valoris HK Limited",
"account_holder_address": "5- 109 Argyle Street Richmond Commercial , Kowloon, 00000, Hong Kong"
}
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
}
}
}
}
ENDPOINT
/v3/payments/bank_deposit
DESCRIPTION
Bank Deposit to specified account
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be deposited ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any deposit available currency |
| data[attributes][callback_url] | false | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Deposit amount |
| data[attributes][txid] | [string] | Deposit txID |
| data[attributes][slug] | [string] | Deposit tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][received_funds] | [decimal] | Deposit amount to receive |
| data[attributes][deposit_credentials] | [hash] | Bank credentials |
| data[relationships][account] | [hash] | Account that belongs to deposit |
Create Personal Cash Deposit
REQUEST
POST /v3/payments/personal_cash_deposit HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=1data%5Battributes%5D%5Bcurrency%5D=usddata%5Brelationships%5D%5Bpersonal_pickup%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff
curl -X POST "https://api.bitspark.io/v3/payments/personal_cash_deposit" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Brelationships%5D%5Bpersonal_pickup%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "personal_cash_deposits",
"attributes": {
"amount": "100.0",
"txid": "FFFFFFFF",
"slug": "FFFFFFFF",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2019-01-10T16:51:38.366Z",
"group": "processing"
},
"created_at": "2019-01-10T16:51:38.352Z",
"received_funds": "100.0"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"personal_pickup": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "personal_pickups"
}
},
"cash_fiat_country": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
}
}
}
}
}
ENDPOINT
/v3/payments/personal_cash_deposit
DESCRIPTION
Personal Cash Deposit to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, personal_pickup, cash_fiat_countries |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be deposited ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any available currency for Personal Cash Deposit |
| data[relationships][personal_pickup][data][id] | true | [string] | Personal pickup ID (should be related to your currency) |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Deposit amount |
| data[attributes][txid] | [string] | Deposit txID |
| data[attributes][slug] | [string] | Deposit tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][received_funds] | [decimal] | Deposit amount to receive |
| data[relationships][account] | [hash] | Account that belongs to deposit |
| data[relationships][personal_pickup] | [hash] | Personal pickups that belongs to deposit and currency |
| data[relationships][cash_fiat_countries] | [hash] | Cash fiat countries that belongs to deposit and currency |
Create Secure Cash Deposit
REQUEST
POST /v3/payments/secure_cash_deposit HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=1data%5Battributes%5D%5Bcurrency%5D=usddata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bnote%5D=note_textdata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bstreet_address%5D=streetdata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bsuburb%5D=suburbdata%5Brelationships%5D%5Bcash_fiat_country%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff
curl -X POST "https://api.bitspark.io/v3/payments/secure_cash_deposit" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bnote%5D=note_text&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bstreet_address%5D=street&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bsuburb%5D=suburb&data%5Brelationships%5D%5Bcash_fiat_country%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "secure_cash_deposits",
"attributes": {
"amount": "100.0",
"txid": "FFFFFFFF",
"slug": "FFFFFFFF",
"status": {
"code": "pending",
"message": "Pending",
"updated_at": "2019-01-11T09:35:39.797Z",
"group": "processing"
},
"created_at": "2019-01-11T09:35:39.781Z",
"received_funds": "12.0"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"secure_pickup": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "secure_pickups"
}
},
"cash_fiat_country": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "cash_fiat_countries"
}
}
}
}
}
ENDPOINT
/v3/payments/secure_cash_deposit
DESCRIPTION
Secure Cash Deposit to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, secure_pickup, cash_fiat_country |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be deposited ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any secure_cash_deposit available currency |
| data[attributes][secure_pickup_attributes][street_address] | true | [string] | Your address street |
| data[attributes][secure_pickup_attributes][suburb] | true | [string] | Suburb |
| data[attributes][secure_pickup_attributes][note] | true | [string] | Any notes that help us locate this address |
| data[relationships][cash_fiat_country][data][id] | true | [string] | Cash Fiat Country ID |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[relationships][personal_pickup] | [hash] | Personal pickups that belongs to deposit and currency |
Upload Deposit Proof
REQUEST
PUT /v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff/upload HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X PUT "https://api.bitspark.io/v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff/upload" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{ "Success": "200 OK" }
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"BTC deposits has no proofs to be uploaded",
"Proff can't be empty",
"Payment proof proof You are not allowed to upload \"log\" files, allowed types: jpg, jpeg, gif, png, bmp, pdf"
]
}
]
}
ENDPOINT
/v2/payments/:payment_id/upload
DESCRIPTION
This endpoint gives you ability to upload document proof for deposit with ID.
REQUEST PARAMS
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][data_proof_attributes][proof] | true | [file] | Your Deposit proof ( file should be one of next types: jpg, jpeg, gif, png, bmp, pdf) |
Cancel Pending Deposit
REQUEST
PUT /v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff/cancel HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X PUT "https://api.bitspark.io/v2/payments/ffffffff-ffff-ffff-ffff-ffffffffffff/cancel" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{ "Success": "200 OK" }
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Payment can not be canceled",
"Payment cancel: Something went wrong."
]
}
]
}
ENDPOINT
/v2/payments/:payment_id/cancel
DESCRIPTION
This endpoint cancels existing pending deposit by it’s ID.
RESPONSE DETAILS
Withdraws
Create Bank Withdraw
REQUEST
POST /v3/payments/withdraw HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bcurrency%5D=usddata%5Btype%5D=withdrawdata%5Battributes%5D%5Btxid%5D=txiddata%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bname%5D=bank_namedata%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_namedata%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Baccount_number%5D=account_numberdata%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bswift_code%5D=swift_codedata%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=address
curl -X POST "https://api.bitspark.io/v3/payments/withdraw" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bcurrency%5D=usd&data%5Btype%5D=withdraw&data%5Battributes%5D%5Btxid%5D=txid&data%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bname%5D=bank_name&data%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bbeneficiary_name%5D=beneficiary_name&data%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Baccount_number%5D=account_number&data%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Bswift_code%5D=swift_code&data%5Brelationships%5D%5Bbank_detail%5D%5Bdata%5D%5Battributes%5D%5Baddress%5D=address'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "withdraws",
"attributes": {
"amount": "100.0",
"txid": "FFFFFFFF",
"callback_url": "example.com",
"slug": "FFFFFFFF",
"received_funds": "80.0",
"status": {
"code": "pending",
"message": "Pending"
}
},
"relationships": {
"bank_detail": {
"data": {
"type": "bank_details",
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
},
"account": {
"data": {
"type": "accounts",
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "error_messages"
}
]
}
ENDPOINT
/v3/payments/withdraw
DESCRIPTION
Withdraw money to specified bank account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: accounts, accounts.currency, bank_details |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[type] | true | [string] | Withdraw’s type ( should be withdraws) |
| data[attributes][currency] | true | [string] | Account currency to withraw from (should be one of Available Currencies codes) |
| data[attributes][txid] | true | [string] | User’s Txid |
| data[attributes][amount] | true | [string] | Amount of money to be withdraw ( should be greater than 0.0) |
| data[attributes][callback_url] | false | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][gauth_token] | false | [string] | Google Auth token (only if GAuth enabled) |
| data[relationships][bank_detail][data][attributes][name] | true | [string] | Bank name |
| data[relationships][bank_detail][data][attributes][beneficiary_name] | true | [string] | User’s Beneficiary Name |
| data[relationships][bank_detail][data][attributes][account_number] | true | [string] | User’s Account Number |
| data[relationships][bank_detail][data][attributes][swift_code] | true | [string] | User’s Swift Code |
| data[relationships][bank_detail][data][attributes][address] | true | [string] | User’s Address |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Withdraw amount |
| data[attributes][txid] | [string] | Withdraw txID |
| data[attributes][slug] | [string] | Withdraw tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][group] | [string] | Group of code status |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[attributes][status][info] | [string] | Additional status message |
| data[attributes][received_funds] | [decimal] | Deposit amount to receive |
| data[relationships][account] | [hash] | Account that belongs to withdraw |
| data[relationships][bank_detail] | [hash] | Bank details that belongs to withdraw |
Create Personal Cash Withdraw
REQUEST
POST /v3/payments/personal_cash_withdraw HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=1data%5Battributes%5D%5Bcurrency%5D=eurdata%5Brelationships%5D%5Bpersonal_pickup%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffffdata%5Btype%5D=withdraws
curl -X POST "https://api.bitspark.io/v3/payments/personal_cash_withdraw" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bcurrency%5D=eur&data%5Brelationships%5D%5Bpersonal_pickup%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff&data%5Btype%5D=withdraws'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "personal_cash_withdraws",
"attributes": {
"amount": "0.99",
"txid": "S245YAFN",
"status": {
"code": "pending",
"message": "Pending"
},
"callback_url": null
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": null
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "error_messages"
}
]
}
ENDPOINT
/v3/payments/personal_cash_withdraw
DESCRIPTION
Personal Cash Withdraw to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, account.currency.cash_fiat_countries, account.currency.cash_fiat_countries.personal_pickups |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be withdrawed ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any currency available for Personal Cash Withdraw |
| data[relationships][personal_pickup][data][id] | true | [string] | Personal pickup ID |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Withdraw amount |
| data[attributes][txid] | [string] | Withdraw txID |
| data[attributes][slug] | [string] | Withdraw tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[relationships][account] | [hash] | Account that belongs to withdraw |
Create Secure Cash Withdraw
REQUEST
POST /v3/payments/secure_cash_withdraw HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bamount%5D=1data%5Battributes%5D%5Bcurrency%5D=usddata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bnote%5D=note_textdata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bstreet_address%5D=streetdata%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bsuburb%5D=suburbdata%5Brelationships%5D%5Bcash_fiat_country%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff
curl -X POST "https://api.bitspark.io/v3/payments/secure_cash_withdraw" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bnote%5D=note_text&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bstreet_address%5D=street&data%5Battributes%5D%5Bsecure_pickup_attributes%5D%5Bsuburb%5D=suburb&data%5Brelationships%5D%5Bcash_fiat_country%5D%5Bdata%5D%5Bid%5D=ffffffff-ffff-ffff-ffffffffffff'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "secure_cash_withdraws",
"attributes": {
"amount": "0.99",
"txid": "S245YAFN",
"status": {
"code": "pending",
"message": "Pending"
},
"callback_url": null
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": null
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "error_messages"
}
]
}
ENDPOINT
/v3/payments/secure_cash_withdraw
DESCRIPTION
Secure Cash Withdraw to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, account.currency.cash_fiat_countries |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be withdrawed ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any currency available for Secure Cash Withdraw |
| data[attributes][secure_pickup_attributes][street_address] | true | [string] | Your address street |
| data[attributes][secure_pickup_attributes][suburb] | true | [string] | Suburb |
| data[attributes][secure_pickup_attributes][note] | true | [string] | Any notes that help us locate this address |
| data[relationships][cash_fiat_country][data][id] | true | [string] | Cash Fiat Country ID |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Withdraw amount |
| data[attributes][txid] | [string] | Withdraw txID |
| data[attributes][slug] | [string] | Withdraw tracking code |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[relationships][account] | [hash] | Account that belongs to withdraw |
Create Crypto Withdraw
REQUEST
POST /v3/payments/crypto_withdraw HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bcurrency%5D=ethdata%5Battributes%5D%5Bwallet_address%5D=eth_accountdata%5Battributes%5D%5Bamount%5D=1
data%5Battributes%5D%5Bwithdraw_fee_level_attributes%5D%5Blevel%5D=urgent
curl -X POST "https://api.bitspark.io/v3/payments/crypto_withdraw" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bcurrency%5D=eth&data%5Battributes%5D%5Bwallet_address%5D=eth_account&
data%5Battributes%5D%5Bamount%5D=1&data%5Battributes%5D%5Bwithdraw_fee_level_attributes%5D%5Blevel%5D=urgent'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "crypto_withdraws",
"attributes": {
"amount": "3",
"txid": "",
"status": {
"code": "pending",
"message": "Pending"
},
"callback_url": null,
"wallet_address": "account"
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": null
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "error_messages"
}
]
}
ENDPOINT
/v3/payments/crypto_withdraw
DESCRIPTION
Crypto Withdraw to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, account.currency.cash_fiat_countries |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be withdrawed (should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any currency available for Crypto Withdraw (BTC, BTS, ETH, ZEPH) |
| data[attributes][wallet_address] | true | [string] | Your valid wallet address |
| data[attributes][withdraw_fee_level_attributes][level] | true | [string] | Fee level (should be one of: urgent, priority, normal). Only for BTC, ETH withdraws |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Withdraw amount |
| data[attributes][txid] | [string] | Withdraw txID |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][wallet_address] | [string] | Withdraw address |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[relationships][account] | [hash] | Account that belongs to withdraw |
Create Bitshares Blockchain Withdraw
REQUEST
POST /v3/payments/bitshares_blockchain_withdraw HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Bcurrency%5D=ethdata%5Battributes%5D%5Bwallet_address%5D=bitshares_addressdata%5Battributes%5D%5Bamount%5D=1
curl -X POST "https://api.bitspark.io/v3/payments/secure_cash_withdraw" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Bcurrency%5D=hkd&data%5Battributes%5D%5Bwallet_address%5D=bitshares_address&data%5Battributes%5D%5Bamount%5D=1'
RESPONSE
{
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "bitshares_blockchain_withdraws",
"attributes": {
"amount": "0.789",
"txid": "",
"status": {
"code": "pending",
"message": "Pending"
},
"callback_url": null
},
"relationships": {
"account": {
"data": {
"id": "ffffffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"bank_detail": {
"data": null
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": "error_messages"
}
]
}
ENDPOINT
/v3/payments/bitshares_blockchain_withdraw
DESCRIPTION
Bitshares Blockchain Withdraw to specified account.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: account, account.currency, account.currency.cash_fiat_countries |
FORM DATA
| Key | Required | Type | Description |
|---|---|---|---|
| data[attributes][amount] | true | [decimal] | Amount of money to be withdrawed ( should be greater than 0.0) |
| data[attributes][currency] | true | [string] | Any currency available for Bitshares Blockchain Withdraw (USD, PHP, CNY, EUR, HKD, AUD, SGD, GBP, BTC, ETH, BTS, ZEPH) |
| data[attributes][wallet_address] | true | [string] | Your bitshares wallet address |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount] | [decimal] | Withdraw amount |
| data[attributes][txid] | [string] | Withdraw txID |
| data[attributes][callback_url] | [string] | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
| data[attributes][wallet_address] | [string] | Bitshares wallet address |
| data[attributes][status][code] | [string] | Transaction status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status][message] | [string] | Transaction status message |
| data[relationships][account] | [hash] | Account that belongs to withdraw |
Exchanges
All Exchanges V1
REQUEST
GET /v1/exchanges HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/exchanges"
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "money_exchanges",
"attributes": {
"base_amount": "100.0",
"quoted_amount": "938.96713",
"rate": "9.3896713",
"status": "failed",
"fee": "0.0",
"commission": "0.0",
"created_at": "2019-02-28T14:12:08.124Z"
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Insufficient funds on account",
"Invalid value for transaction"
]
}
]
}
ENDPOINT
/v1/exchanges
DESCRIPTION
This endpoint retrieves all created exchanges with details.
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][base_amount] | [decimal] | Base currency amount |
| data[attributes][quoted_amount] | [decimal] | Quote currency amount |
| data[attributes][rate] | [decimal] | Actual exchange rate in wich exchange was performed |
| data[attributes][status] | [string] | Current status of exchange |
| data[attributes][fee] | [decimal] | Exchange fee |
| data[attributes][commission] | [decimal] | Exchange commission |
| data[attributes][created_at] | [date] | Creation date of exchange |
All Exchanges V2
REQUEST
GET /v2/exchanges HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/exchanges"
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "money_exchanges",
"attributes": {
"base_amount": "100.0",
"quoted_amount": "938.96713",
"slug": "JP748FVR",
"rate": "9.3896713",
"status": {
"code": "failed",
"message": "Failed",
"group": "declined"
},
"created_at": "2019-02-28T14:12:08.124Z"
},
"relationships": {
"invoice_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"payment_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"transaction_fee": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "fees_transactions"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Insufficient funds on account",
"Invalid value for transaction"
]
}
]
}
ENDPOINT
/v2/exchanges
DESCRIPTION
This endpoint retrieves all created exchanges with details.
REQUEST PARAMS
| KEY | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: invoice_currency, payment_currency, transaction_fee |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][base_amount] | [decimal] | Base currency amount |
| data[attributes][quoted_amount] | [decimal] | Quote currency amount |
| data[attributes][slug] | [string] | Exchange tracking code |
| data[attributes][rate] | [decimal] | Actual exchange rate in wich exchange was performed |
| data[attributes][status] | [string] | Current status of exchange |
| data[attributes][created_at] | [date] | Creation date of exchange |
| data[relationships][invoice_currency] | [hash] | Base currency object |
| data[relationships][payment_currency] | [hash] | Quote currency object |
| data[relationships][transaction_fee] | [hash] | Transaction fee object |
Show Exchange V1
REQUEST
GET /v1/exchanges/fffffffff-ffff-ffff-ffff-ffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/exchanges/fffffffff-ffff-ffff-ffff-ffffffffff"
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "money_exchanges",
"attributes": {
"base_amount": "100.0",
"quoted_amount": "938.96713",
"rate": "9.3896713",
"status": "failed",
"fee": "0.0",
"commission": "0.0",
"created_at": "2019-02-28T14:12:08.124Z"
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 404,
"error_code": "not_found",
"message": [
"Could not find record"
]
}
]
}
ENDPOINT
/v1/exchanges/:id
DESCRIPTION
This endpoint retrieves specific exchange with details by ID.
RESPONSE DETAILS
Show Exchange V2
REQUEST
GET /v2/exchanges/fffffffff-ffff-ffff-ffff-ffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/exchanges/fffffffff-ffff-ffff-ffff-ffffffffff"
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "money_exchanges",
"attributes": {
"base_amount": "100.0",
"quoted_amount": "938.96713",
"slug": "JP748FVR",
"rate": "9.3896713",
"status": {
"code": "failed",
"message": "Failed",
"group": "declined"
},
"created_at": "2019-02-28T14:12:08.124Z"
},
"relationships": {
"invoice_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"payment_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"transaction_fee": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "fees_transactions"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 404,
"error_code": "not_found",
"message": [
"Could not find record"
]
}
]
}
ENDPOINT
/v1/exchanges/:id
DESCRIPTION
This endpoint retrieves specific exchange with details by ID.
REQUEST PARAMS
RESPONSE DETAILS
Show Exchange Money Rate V2
REQUEST
GET /v2/exchanges/exchange_rate?currency_from=usdcurrency_to=bts HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
curl -X GET 'https://api.bitspark.io/v2/exchanges/exchange_rate?currency_from=usd¤cy_to=bts'
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "47122510714880",
"type": "exchange_rate",
"attributes": {
"invoice_currency": "USD",
"payment_currency": "BTS",
"rate": "9.992",
"base_amount": "100.0",
"quoted_amount": "984.212",
"uphold_commission": "14.988",
"commission": "14.988",
"btc_commission": 0
},
"relationships": {
"base_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"quote_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Amount is not a number",
"Currency from can't be blank",
"Currency to can't be blank"
]
}
]
}
ENDPOINT
/v2/exchanges/exchange_rate
DESCRIPTION
This endpoint retrieves specific exchange rate
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: base_account base_account.currency, quote_account, quote_account.currency |
| currency_from | true | [string] | none | Currency from ( should be one of Available Currencies codes ) |
| currency_to | true | [string] | none | Currency to ( should be one of Available Currencies codes ) |
| amount_to_send | false | [decimal] | 100 | Amount to exchange |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][invoice_currency] | [string] | Currency from |
| data[attributes][payment_currency] | [string] | Currency to |
| data[attributes][rate] | [decimal] | Exchange rate |
| data[attributes][base_amount] | [decimal] | Base currency amount |
| data[attributes][quoted_amount] | [decimal] | Quote currency amount |
| data[attributes][commision] | [decimal] | Exchange commision |
| data[attributes][btc_commision] | [decimal] | Bitcoin commision |
| data[relationships][base_account] | [hash] | Base currency account object |
| data[relationships][quote_account] | [hash] | Quote currency account object |
Show Exchange Money Rate V3
REQUEST
GET /v3/exchanges/exchange_rate?currency_from=usdcurrency_to=bts HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
curl -X GET 'https://api.bitspark.io/v3/exchanges/exchange_rate?currency_from=usd¤cy_to=bts'
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "47122511812280",
"type": "exchange_rate",
"attributes": {
"invoice_currency": "PHP",
"payment_currency": "BTS",
"rate": "0.3685939229917579"
},
"relationships": {
"base_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"quote_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Amount is not a number",
"Currency from can't be blank",
"Currency to can't be blank"
]
}
]
}
ENDPOINT
/v3/exchanges/exchange_rate
DESCRIPTION
This endpoint retrieves specific exchange rate
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: base_account base_account.currency, quote_account, quote_account.currency |
| currency_from | true | [string] | none | Currency from ( should be one of Available Currencies codes ) |
| currency_to | true | [string] | none | Currency to ( should be one of Available Currencies codes ) |
| amount | false | [decimal] | 100 | Amount to exchange |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][invoice_currency] | [string] | Currency from |
| data[attributes][payment_currency] | [string] | Currency to |
| data[attributes][rate] | [decimal] | Exchange rate |
| data[relationships][base_account] | [hash] | Base currency account object |
| data[relationships][quote_account] | [hash] | Quote currency account object |
Show Exchange Money Rate V4
REQUEST
GET /v4/exchanges/exchange_rate?currency_from=usdcurrency_to=bts HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
curl -X GET 'https://api.bitspark.io/v4/exchanges/exchange_rate?currency_from=usd¤cy_to=bts'
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "47122511812280",
"type": "exchange_rate",
"attributes": {
"base_amount": "PHP",
"quoted_amount": "BTS",
"rate": "0.3685939229917579"
},
"relationships": {
"invoice_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"payment_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"transaction_fee": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "fees_transactions"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Amount is not a number",
"Currency from can't be blank",
"Currency to can't be blank"
]
}
]
}
ENDPOINT
/v4/exchanges/exchange_rate
DESCRIPTION
This endpoint retrieves specific exchange rate
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: invoice_currency payment_currency, transaction_fee |
| currency_from | true | [string] | none | Currency from ( should be one of Available Currencies codes ) |
| currency_to | true | [string] | none | Currency to ( should be one of Available Currencies codes ) |
| amount | false | [decimal] | 100 | Amount to exchange |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][base_amount] | [decimal] | Base currency amount |
| data[attributes][quoted_amount] | [decimal] | Quote currency amount |
| data[attributes][rate] | [decimal] | Exchange rate |
| data[relationships][invoice_currency] | [hash] | Base currency object |
| data[relationships][payment_currency] | [hash] | Quote currency object |
| data[relationships][transaction_fee] | [hash] | Transaction Fee object |
Show Locked Rate
REQUEST
GET /v1/exchanges/locked_rate?currency_from=btc¤cy_to=bts HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
curl -X GET 'https://api.bitspark.io/v1/exchanges/locked_rate?currency_from=btc¤cy_to=bts'
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_HMAC" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "exchange_money_locked_rates",
"attributes": {
"bid": "2.0",
"ask": "3.0",
"locked": true
},
"relationships": {
"currency_to": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"currency_from": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
}
}
}
}
ENDPOINT
/v1/exchanges/locked_rate
DESCRIPTION
This endpoint retrieves locked rate for currencies pair
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: currency_from currency_to |
| currency_from | true | [string] | none | Currency from ( should be one of Available Currencies codes ) |
| currency_to | true | [string] | none | Currency to ( should be one of Available Currencies codes ) |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][ask] | [decimal] | Ask locked rate |
| data[attributes][bid] | [decimal] | Bid locked rate |
| data[attributes][locked] | [boolean] | Is locked (always return true) |
| data[relationships][currency_from] | [hash] | Currency from object |
| data[relationships][currency_to] | [hash] | Currency to object |
Create Exchange
REQUEST
POST /v2/exchanges HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_HMAC
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
amount=0.01currency_from=usdcurrency_to=zeph
curl -X POST "https://api.bitspark.io/v2/exchanges" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Key: API_KEY' \
-H 'Sign: COMPUTED_HMAC' \
-H 'cache-control: no-cache' \
-d 'amount=0.01¤cy_from=usd¤cy_to=zeph'
RESPONSE (success)
{
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "money_exchanges",
"attributes": {
"base_amount": "100.0",
"quoted_amount": "938.96713",
"slug": "JP748FVR",
"rate": "9.3896713",
"status": {
"code": "proccesing",
"message": "Processing",
"group": "processing"
},
"created_at": "2019-02-28T14:12:08.124Z"
},
"relationships": {
"invoice_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"payment_currency": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "currencies"
}
},
"transaction_fee": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "fees_transactions"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 404,
"error_code": "not_found",
"message": [
"Amount is not a number",
"Currency from can't be blank",
"Currency to can't be blank"
]
}
]
}
ENDPOINT
/v2/exchanges
DESCRIPTION
This endpoint create exchange.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: transaction_fee, payment_currency, invoice_currency |
FORM DATA
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| amount | true | [decimal] | none | Amount of money for exchange ( should be greater than 0.0 ) |
| currency_from | true | [string] | none | Currency from ( should be one of Available Currencies codes ) |
| currency_to | true | [string] | none | Currency to ( should be one of Available Currencies codes ) |
| callback_url | false | [string] | none | URL which will get object after his status update. You should respond with text OK and success status 20* to callback, in other case it will re-send callback again in 2, 4, 6, 8, 10 minutes |
RESPONSE DETAILS
Internal Transfers
All Internal Transfers
REQUEST
GET /v1/internal_transfers HTTP/1.1
Host: api.bitspark.io
KEY: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark/v1/internal_transfers" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 1,
"amount_to_receive": 1,
"fee": 0,
"status": {
"code": "finished",
"message": "Finished",
"group": "completed"
},
"type": "InternalDomesticTransfer",
"slug": null,
"receiver_currency_name": "EUR",
"receiver_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_currency_name": "EUR",
"sender_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_name": "name",
"receiver_name": "name",
"created_at": "2017-12-14T15:27:25.956Z"
},
"relationships": {
"receiver_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": null
}
}
},
"..."
]
}
ENDPOINT
/v1/internal_transfers
DESCRIPTION
This endpoint retrieves all created internal transfers with details.
REQUEST PARAMS
| KEY | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: receiver_account, receiver_account.currency, sender_account, sender_account.currency, receiver, sender |
| scope | false | [string] | none | Can be any one of: sent, received |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][amount_to_send] | [decimal] | Amount of money to send |
| data[attributes][amount_to_receive] | [decimal] | Amount of money to receive |
| data[attributes][fee] | [decimal] | Transaction fee |
| data[attributes][status] | [string] | Transaction status |
| data[attributes][type] | [string] | Transaction status |
| data[attributes][receiver_currency_name] | [string] | Receiver currency |
| data[attributes][receiver_currency_id] | [string] | Receiver currency ID |
| data[attributes][sender_currency_name] | [string] | Sender currency |
| data[attributes][sender_currency_id] | [string] | Sender currency ID |
| data[attributes][sender_name] | [string] | Sender name |
| data[attributes][receiver_name] | [string] | Receiver name |
| data[relationships][receiver_account][data] | [uuid] | Receiver account that belong to internal payment |
| data[relationships][sender_account][data] | [uuid] | Sender account that belong to internal payment |
| data[relationships][receiver][data] | [uuid] | Receiver profile that belong to internal payment |
| data[relationships][sender][data] | [uuid] | Sender profile that belong to internal payment |
Show Internal Transfer
REQUEST
GET /v1/internal_transfers/fffffffff-ffff-ffff-ffff-ffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "http://api.bitspark.io/v1/internal_transfers/fffffffff-ffff-ffff-ffff-ffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data":
{
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 1,
"amount_to_receive": 1,
"fee": 0,
"status": {
"code": "finished",
"message": "Finished",
"group": "completed"
},
"type": "InternalDomesticTransfer",
"slug": null,
"receiver_currency_name": "EUR",
"receiver_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_currency_name": "EUR",
"sender_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_name": "name",
"receiver_name": "name",
"created_at": "2017-12-14T15:27:25.956Z"
},
"relationships": {
"receiver_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": null
}
}
}
ENDPOINT
/v1/internal_transfers/:internal_transfer_id
DESCRIPTION
This endpoint get existing internal transfer by it’s ID.
REQUEST PARAMS
| KEY | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: receiver_account, receiver_account.currency, sender_account, sender_account.currency, receiver, sender |
RESPONSE DETAILS
Create Internal Transfer
REQUEST
POST /v1/internal_transfers HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
data%5Battributes%5D%5Breceiver%5D=ffffffff-ffff-ffff-ffffffffffffdata%5Battributes%5D%5Bcurrency%5D=usddata%5Battributes%5D%5Bamount%5D=10
curl -X POST "http://api.bitspark.io/v1/internal_transfers" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'data%5Battributes%5D%5Breceiver%5D=ffffffff-ffff-ffff-ffffffffffff&data%5Battributes%5D%5Bcurrency%5D=usd&data%5Battributes%5D%5Bamount%5D=10'
RESPONSE (success)
{
"data":
{
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "domestic_payment",
"attributes": {
"amount_to_send": 1,
"amount_to_receive": 1,
"fee": 0,
"status": {
"code": "finished",
"message": "Finished",
"group": "completed"
},
"type": "InternalDomesticTransfer",
"slug": null,
"receiver_currency_name": "EUR",
"receiver_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_currency_name": "EUR",
"sender_currency_id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"sender_name": "name",
"receiver_name": "name",
"created_at": "2017-12-14T15:27:25.956Z"
},
"relationships": {
"receiver_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"sender_account": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "accounts"
}
},
"receiver": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"sender": {
"data": {
"id": "fffffffff-ffff-ffff-ffff-ffffffffff",
"type": "user_profile_general"
}
},
"partner_reference": {
"data": null
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Amount can't be blank",
"Receiver can't be blank",
"Currency can't be blank",
]
}
]
}
ENDPOINT
/v1/internal_transfers
DESCRIPTION
This endpoint creates new internal transfer
REQUEST PARAMS
| KEY | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: receiver_account, receiver_account.currency, sender_account, sender_account.currency, receiver, sender |
FORM DATA
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| data[attributes][receiver] | true | [string] | none | Receiver Identifier. Can be user’s email, phone number or ID |
| data[attributes][currency] | true | [string] | none | Internal Transfer currency ( should be one of Available Currencies codes ) |
| data[attributes][amount] | true | [decimal] | none | Amount of money to be sent ( should be greater than 0.0 ) |
RESPONSE DETAILS
Top Ups
All Top Ups V1
REQUEST
GET /v1/top_ups HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v1/top_ups" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "declined",
"status_message": "Declined",
"amount": "9.0",
"currency": "USD",
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
},
"..."
]
}
ENDPOINT
/v1/top_ups
DESCRIPTION
This endpoint retrieves all created top ups with details.
REQUEST PARAMS
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][currency] | [string] | Top up currency name |
All Top Ups V2
REQUEST
GET /v2/top_ups HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "https://api.bitspark.io/v2/top_ups" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data": [
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "declined",
"status_message": "Declined",
"amount": "9.0",
"currency": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"code": "usd",
"account": true,
"destination": true,
"type": "banknote",
"payment_service": "uphold",
"precision": 2,
"bitspark_deposit_credentials": {
"bank_name": "HSBC",
"swift_code": "HSBCHKHHHKH",
"bank_address": "HSBC- No.1, Queens road, Central, Hong Kong",
"account_number": "848-844601-838",
"beneficiary_name": "Design Thinking Asia",
"account_holder_address": "RM B, 1/F, GLENEALY MANSION, 7 GLENEALY ST, CENTRAL HK"
},
"created_at": "2017-01-30T14:37:58.638Z",
"updated_at": "2019-03-22T13:06:50.890Z",
"national": true,
"asset_name": "PEGSTAGE.USD",
"pegged_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"pegged_multiplier": "1.0"
},
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
},
"..."
]
}
ENDPOINT
/v2/top_ups
DESCRIPTION
This endpoint retrieves all created top ups with details.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user_account, user_account.currency, shop_account, shop_account.currency, currency, transaction_fee |
| filter[top_up_type] | false | [string] | requested | Can be any one of: requested, owned |
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][status_code] | [string] | Top up status code ( should be one of Transfer statuses list codes ) |
| data[attributes][status_message] | [string] | Top up status message |
| data[attributes][amount] | [decimal] | Top up amount |
| data[attributes][currency] | [hash] | Top up currency object |
| data[attributes][shop_id] | [uuid] | Shop ID |
| data[attributes][receipt_url] | [string] | Receipt URL |
| data[attributes][created_at] | [date] | Created at |
| data[attributes][updated_at] | [date] | Updated at |
| data[attributes][performed_by_shop] | [boolean] | Is performed by shop |
| data[attributes][transaction_number] | [string] | Top up transaction number |
| data[attributes][relationships][user_account] | [hash] | See All Recipients for response details. |
| data[attributes][relationships][shop_account] | [hash] | Partner Reference object |
| data[attributes][relationships][transaction_fee] | [hash] | See All Recipients for response details. |
| data[attributes][relationships][currency] | [hash] | Partner Reference object |
Show Top Up V1
REQUEST
GET /v1/top_ups/fffffffff-ffff-ffff-ffff-ffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "http://api.bitspark.io/v1/top_ups/fffffffff-ffff-ffff-ffff-ffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data":
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "declined",
"status_message": "Declined",
"amount": "9.0",
"currency": "USD",
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
ENDPOINT
/v2/top_ups/:top_up_id
DESCRIPTION
This endpoint get existing top_up by it’s ID.
REQUEST PARAMS
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][currency] | [string] | Top up currency name |
Show Top Up V2
REQUEST
GET /v2/top_ups/fffffffff-ffff-ffff-ffff-ffffffffff HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X GET "http://api.bitspark.io/v2/top_ups/fffffffff-ffff-ffff-ffff-ffffffffff" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE
{
"data":
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "declined",
"status_message": "Declined",
"amount": "9.0",
"currency": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"code": "usd",
"account": true,
"destination": true,
"type": "banknote",
"payment_service": "uphold",
"precision": 2,
"bitspark_deposit_credentials": {
"bank_name": "HSBC",
"swift_code": "HSBCHKHHHKH",
"bank_address": "HSBC- No.1, Queens road, Central, Hong Kong",
"account_number": "848-844601-838",
"beneficiary_name": "Design Thinking Asia",
"account_holder_address": "RM B, 1/F, GLENEALY MANSION, 7 GLENEALY ST, CENTRAL HK"
},
"created_at": "2017-01-30T14:37:58.638Z",
"updated_at": "2019-03-22T13:06:50.890Z",
"national": true,
"asset_name": "PEGSTAGE.USD",
"pegged_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"pegged_multiplier": "1.0"
},
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
ENDPOINT
/v2/top_ups/:top_up_id
DESCRIPTION
This endpoint get existing top_up by it’s ID.
REQUEST PARAMS
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| include | false | [string] | none | Include additional info to response. Possible objects: user_account, user_account.currency, shop_account, shop_account.currency, currency, transaction_fee |
RESPONSE DETAILS
Create Top Up V1
REQUEST
POST /v1/top_ups HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
shop_code=ffffffff-ffff-ffff-ffffffffffffcurrency=usddata%5Btype%5D=top_upsdata%5Battributes%5D%5Bamount%5D=10.0
curl -X POST "https://api.bitspark.io/v2/top_ups" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'shop_code=ffffffff-ffff-ffff-ffffffffffff¤cy=usd&data%5Btype%5D=top_ups&data%5Battributes%5D%5Bamount%5D=10.0'
RESPONSE (success)
{
"data":
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "pending",
"status_message": "Pending",
"amount": "9.0",
"currency": "USD",
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"User account already been taken with 'pending' status in scope of specified shop account"
]
}
]
}
ENDPOINT
/v1/top_ups
DESCRIPTION
This endpoint creates new top_up.
REQUEST PARAMS
FORM DATA
RESPONSE DETAILS
| Key | Type | Description |
|---|---|---|
| data[attributes][currency] | [string] | Top up currency name |
Create Top Up V2
REQUEST
POST /v2/top_ups HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
shop_code=ffffffff-ffff-ffff-ffffffffffffcurrency=usddata%5Btype%5D=top_upsdata%5Battributes%5D%5Bamount%5D=10.0
curl -X POST "https://api.bitspark.io/v2/top_ups" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'shop_code=ffffffff-ffff-ffff-ffffffffffff¤cy=usd&data%5Btype%5D=top_ups&data%5Battributes%5D%5Bamount%5D=10.0'
RESPONSE (success)
{
"data":
{
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "top_ups",
"attributes": {
"status_code": "pending",
"status_message": "Pending",
"amount": "9.0",
"currency": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"code": "usd",
"account": true,
"destination": true,
"type": "banknote",
"payment_service": "uphold",
"precision": 2,
"bitspark_deposit_credentials": {
"bank_name": "HSBC",
"swift_code": "HSBCHKHHHKH",
"bank_address": "HSBC- No.1, Queens road, Central, Hong Kong",
"account_number": "848-844601-838",
"beneficiary_name": "Design Thinking Asia",
"account_holder_address": "RM B, 1/F, GLENEALY MANSION, 7 GLENEALY ST, CENTRAL HK"
},
"created_at": "2017-01-30T14:37:58.638Z",
"updated_at": "2019-03-22T13:06:50.890Z",
"national": true,
"asset_name": "PEGSTAGE.USD",
"pegged_currency_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"pegged_multiplier": "1.0"
},
"shop_id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"receipt_url": null,
"performed_by_shop": false,
"transaction_number": "T2B6"
},
"relationships": {
"user_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"shop_account": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "accounts"
}
},
"transaction_fee": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "fees_transactions"
}
},
"currency": {
"data": {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"type": "currencies"
}
}
}
}
}
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"User account already been taken with 'pending' status in scope of specified shop account"
]
}
]
}
ENDPOINT
/v2/top_ups
DESCRIPTION
This endpoint creates new top_up.
REQUEST PARAMS
FORM DATA
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
| shop_code | true | [uuid] | Shop Identifier from shop’s QR code | |
| currency | true | [string] | Top Up currency ( should be one of Available Currencies codes ) | |
| data[type] | true | [string] | Top Up’s type ( must be top_ups) |
|
| data[attributes][amount] | true | [decimal] | Amount of money to be received by user ( should be greater than 0.0) |
RESPONSE DETAILS
Cancel Top Up
REQUEST
PUT /v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/cancel HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X PUT "https://api.bitspark.io/v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/cancel" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{ "Success": "200 OK" }
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Top-up can not be canceled"
]
}
]
}
ENDPOINT
/v2/top_ups/:top_up_id/cancel
DESCRIPTION
This endpoint cancels existing pending top_up by it’s ID.
RESPONSE DETAILS
Approve Top Up
REQUEST
PUT /v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/approve HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X PUT "http://api.bitspark.io/v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/approve" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache"
RESPONSE (success)
{ "Success": "200 OK" }
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Top-up can not be approved"
]
}
]
}
ENDPOINT
/v2/top_ups/:top_up_id/approve
DESCRIPTION
This endpoint approve existing top_up by it’s ID.
RESPONSE DETAILS
Decline Top Up
REQUEST
PUT /v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/decline HTTP/1.1
Host: api.bitspark.io
Key: YOUR_API_KEY
Sign: COMPUTED_SIGN
Cache-Control: no-cache
curl -X PUT "http://api.bitspark.io/v2/top_ups/ffffffff-ffff-ffff-ffff-ffffffffffff/decline" \
-H "Key: YOUR_API_KEY" \
-H "Sign: COMPUTED_SIGN" \
-H "Cache-Control: no-cache" \
RESPONSE (success)
{ "Success": "200 OK" }
RESPONSE (fail)
{
"errors": [
{
"code": 422,
"error_code": "unprocessable_request",
"message": [
"Top-up can not be declined"
]
}
]
}
ENDPOINT
/v2/top_ups/:top_up_id/decline
DESCRIPTION
This endpoint declines existing top_up by it’s ID.
RESPONSE DETAILS
Transfer statuses list
The Bitspark API uses following status codes for transfers:
| Status | Meaning | From statuses |
|---|---|---|
| unknown | Initial status, presented only a few seconds after a new transfer is initialized | |
| performing | Async worker starts to perform a transfer. | unknown |
| remittance_received_successfully | Success remittance calculation response that is received external payment provider. | performing |
| remittance_received_unsuccessfully | Unsuccess remittance calculation. | performing |
| payment_created_successfully | Payment created successfully on external payment provider side. | remittance_received_successfully |
| payment_created_unsuccessfully | Payment created unsuccessfully on external payment provider side(can be presented because of some additional validation on external provider side or external provider currently unavailable). | remittance_received_successfully |
| insufficient_funds | Not enough funds to perform a transfer. | performing, payment_created_successfully, proved, confirmed |
| payment_commited_successfully | Successfully confirmed previously created payment on external payment provider. | payment_created_successfully |
| payment_commited_unsuccessfully | Unsuccessfully confirmed previously created payment on external payment provider. | payment_created_successfully |
| declined | Cancelled/declined by external service or admin. | payment_commited_successfully, accepted, refund |
| accepted | Transfer is successfully accepted by external payment service. | payment_commited_successfully |
| confirmed | Transfer is confirmed by external service or by admin. | payment_commited_successfully, accepted |
| proved | Transfer is successfully finalized. After 10 days confirmed and accepted transfers will be changed to proved status automatically. |
confirmed, accepted |
| failed | Transfer finalization fails. | |
| payout_failed | Error when external service successfully received payment but cannot perform send money to selected the origin. | |
| refund_requested | Refund requested. | payment_created_successfully, payment_commited_successfully, accepted, confirmed |
| refund_response_received | Bitspark system receive a callback with refund created from external service(not all external services send callbacks about refund). | refund_requested |
| refund_confirmed | Refund is confirmed by admin or external service(if possible). It means that funds refunded to Bitspark user’s balance. | refund_requested, refund_response_received |
| refund_rejected | Refund is rejected by admin or external service. Funds are not returned, for details contact admin. | refund_requested, refund_response_received |
| suspicious | Transfer is detected as suspicious. For /v1/transactions/remittances Transfers History this status is payment_created_successfully |
payment_created_successfully, payment_commited_successfully, accepted confirmed |
| amount_too_small | An amount is too small to make a transfer. | performing |
Errors
The Bitspark API uses the following error codes:
| Code | Error Code | Meaning |
|---|---|---|
| 400 | bad_request | Bad Request – Invalid request body. |
| 400 | money_exchange_error | Transaction failed. |
| 400 | payment_cancel_error | Payment cancel: Something went wrong. |
| 400 | payment_deposit_error | Deposit: Something went wrong. Please check request body. |
| 400 | payment_withdraw_error | Withdraw: Something went wrong. Please check request body. |
| 400 | payment_cancel_error | Payment cancel: Something went wrong. |
| 400 | top_up_error | Top-up: Something went wrong. Please check request body. |
| 400 | send_money_error | Send Money: Something went wrong. Please check request body. |
| 400 | send_domestic_money_error | Send Domestic Money: Something went wrong. Please check request body. |
| 401 | unauthorized | YOUR_API_KEY or COMPUTED_HMAC is wrong |
| 403 | forbidden | Access Denied |
| 403 | insufficient_permissions | You have insufficient permissions to access this endpoint. |
| 404 | not_found | Could not find record |
| 406 | not_acceptable | Specified request format not matches Json-API specifications |
| 422 | unprocessable_entity | The record with specified attributes could not be processed. |
| 500 | internal_server_error | We had a problem with our server. Try again later. |
| 501 | invalid_logger_error | Invalid logger |
| 501 | not_specified_error | Not specified |
| 503 | service_unavailable | We’re temporarially offline for maintanance. Please try again later. |