NAV Navbar

Introduction

Welcome to the Nocks API documentation! You can use our API to access Nocks API endpoints. Nocks API is a product of Nocks, which gives developers access to many great financial and Nocks-related services to integrate these into their own applications or services. Find out more at nocks.com/api

Sandbox

A public sandbox is available for testing API connectivity. The sandbox provides all of the functionality of the production API but allows you to add fake funds for testing.

Login sessions and API keys are separate from production. Use the sandbox website to create a user account and API keys in the sandbox environment.

To add fake funds, use the website Deposit/Withdraw button as you would on the production website.

Sandbox URL

When testing your API connectivity, make sure to use the following URLs.

Website

https://sandbox.nocks.com

API

https://sandbox.nocks.com/api/v2

Fake funds

To send and receive funds with the sandbox, we are using testing networks. Therefore it won’t accept payments from live/production networks.

Please check the instructions below on how to work with them.

Gulden

The sandbox uses the official Gulden testnet settings to process Gulden payments.

-testnet=C1511943855:60 -addnode=178.62.195.19 -addnode=45.32.253.142 -addnode=199.247.1.84 -addnode=104.238.189.72 -addnode=149.210.165.218

Euro

The sandbox uses the bunq sandbox to process euro payments.

Localization

Nocks API supports localization for error messages and other strings. Localization is defined in the user settings. Accepted values are currently:

Numbers, currency and datetime don’t rely on localization so they will always be returned in standard format.

Requests

    # Required headers
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

All requests must contain a Content-Type and Accept header with a value of application/json. Responses are application/json content type and follow typical HTTP response status codes for success and failure.

As per RESTful design patterns, Nocks API implements following HTTP verbs:

Most resources are bound to a specific authenticated user. As the user can control which scopes are accessible for OAuth applications, you should make sure you have access to the right scopes. Otherwise a 404 will be returned.

Success

A successful response is indicated by HTTP status code 200 OK, 201 Created or 204 Deleted and may contain an optional body. If the response has a body it will be documented under each resource below.

Errors

The Nocks API uses the following error codes:

Error Code Meaning
400 Bad Request – Returns JSON with the error message
401 Unauthorized – Your API key is wrong
403 Forbidden – The resource requested is hidden for administrators only
404 Not Found – The resource could not be found
405 Method Not Allowed – You tried to access a resource with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The resource requested has been removed from our servers
429 Too Many Requests – You’re requesting too many resources! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.

CORS

Nocks API supports cross-origin HTTP requests which is commonly referred as CORS. This means that you can call API resources using Javascript from any browser. While this allows many interesting use cases, it’s important to remember that you should never expose private API keys to 3rd parties. CORS is mainly useful with public endpoints (e.g. Gulden price information) and OAuth2 client side applications.

Rate limiting

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1498484370

The Nocks API is rate limited to prevent abuse that would degrade our ability to maintain consistent API performance for all users. By default, each IP is rate limited at 120 requests per minute. If your requests are being rate limited, HTTP response code 429 Too Many Requests will be returned.

We’ll return a couple HTTP headers with each API request to let you know how you’re doing:

If your application requires higher rate limits, please email us a request at support@nocks.com.

If you continue to exceed our rate limits, your access may be blocked without notice.

Fields

IDs and referencing other resources

{
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "resource": "user"
}

All resource IDs are represented in UUID format.

Money

{
  "amount": {
    "amount": "1680.2440",
    "currency": "NLG"
  }
}

Money values are represented by an object which contains amount and currency fields. Amount is always returned as a string which you should be careful when parsing to have correct decimal precision. Gulden value will have 4 decimal points and fiat currencies will have two.

Timestamps

{
    "created_at": {
      "datetime": "2017-03-09 18:29:05",
      "timestamp": 1489084145
    }
}

Date values are represented by an object which contains a ISO 8601 datetime and timestamp format with fields ending in postfix _at.

Scopes

OAuth2 authentication require that you obtain correct permissions (scopes) to access different API endpoints.

All authenticated endpoints require a specific scope to access them. Some endpoints might also have additional scopes for additional information or access. In general, permissions follow the resource.action pattern.

Scopes should be considered as grants: Users can select which scopes they grant access to for the application. The application might need to request new scopes over the lifecycle of the authorization. To see which permissions the user has granted, you can use the GET /oauth/token-scopes endpoint.

As a general rule, you should only ask for scopes which your application needs and avoid asking for access to unnecessary ones. Users more readily grant access to limited, clearly described scopes.

To retrieve all available scopes, you can use the GET /oauth/scopes endpoint.

Accepted values are currently:

Scope Description
user.read List or view detailed user information
funding-source.read List or view user’s funding sources
funding-source.create Create user’s funding sources
funding-source.delete Delete user’s funding sources
balance.read List or view user’s balances
deposit.read List or view user’s deposits
deposit.create Create user’s deposit
withdrawal.read List or view user’s withdrawals
withdrawal.create Create user’s withdrawals
transaction.read List or view user’s transactions
transaction.create Create user’s transactions
contact.read List or view user’s contacts
contact.create Create user’s contacts
contact.update Update user’s contacts
contact.delete Delete user’s contacts
contact.address.read List or view user’s contact addresses
contact.address.create Create user’s contact addresses
contact.address.update Update user’s contact addresses
contact.address.delete Delete user’s contact addresses
merchant.read List or view user’s merchants
merchant.create Create user’s merchants
merchant.update Update user’s merchants
merchant.delete Delete user’s merchants
merchant.profile.read List or view merchant’s profiles
merchant.profile.create Create merchant’s profiles
merchant.profile.delete Delete merchant’s profiles
merchant.refund.read List or view merchant’s refunds
merchant.refund.create Create merchant’s refunds
merchant.refund.update Update merchant’s refunds
merchant.invoice.read List or view merchant’s invoices
merchant.clearing.read List or view merchant’s clearings
trade.order.read List or view user’s trades
trade.order.create Create user’s trades
trade.order.delete Delete user’s trades
bill.read List or view user’s bills
bill.create Create user’s bills
bill.update Update user’s bills
bill.delete Delete user’s bills

Pagination

{
  "data": [
    {},
    ...
  ],
  "meta": {
    "pagination": {
      "total": 56,
      "count": 25,
      "per_page": 25,
      "current_page": 1,
      "total_pages": 3,
      "links": {
        "next": "https://api.nocks.com/api/v2/transaction?page=2"
      }
    }
  },
  "status": 200
}

All GET endpoints which return an object list support cursor based pagination. This means that to get all objects, you need to paginate through the results. The API will construct the next call into next together with all the currently used pagination parameters. You know that you have paginated all the results when the response’s next is empty.

Arguments

Parameter Required Description
page Optional Number of the current page

Payment methods

Accepted values are currently:

Name Code Expiration time (seconds) Type Usage
Gulden gulden 1800 deposit deposit,withdrawal,transaction
SEPA (wire transfer) sepa 604800 deposit deposit,withdrawal,transaction,verification

Currencies

Accepted values are currently:

Authentication

curl "https://api.nocks.com/api/v2/user"
    -H 'Authorization: Bearer {token}'

Make sure to replace {token} with your token.

Private requests must be authenticated with a valid access token passed as bearer token. To use the bearer token, construct a normal HTTPS request and include an Authorization header with the value of Bearer. Signing is not required.

Personal Access Tokens

Creating your API token begins by logging into your Nocks account and going to “API”. Once you’re on that page you click on the tab “Personal access tokens”.

Here you create your token, click “Create New Token” and a screen pops up.

Now give your token a name, for example your domain or project name and select the scopes you would like to use.

Once you create a token, it’ll be shown only once to you. Make sure to store it safely, after this it can only be revoked and you can generate a new token for use.

OAuth applications

The Nocks API allows developers to use the OAuth2 protocol to allow a Nocks user to grant a 3rd party application full or partial access to his/her account, without sharing the account’s API key or login credentials. It is a slightly more complex integration than the Personal Access Token method, but is more flexible. OAuth2 works well for web applications, as well as desktop and mobile apps.

Integrating Nocks API with your web application

Before integrating the Nocks API, you’ll need to register a new OAuth2 application under your API settings. If you’re using a previous OAuth2 implementation, you may need to configure the following settings:

To integrate your third-party web server application with Nocks, use the following flow:

1. Redirect users to request Nocks access

GET https://www.nocks.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URL&scope=SCOPES

When redirecting a user to Nocks to authorize access to your application, you’ll need to construct the authorization URL with the correct parameters and scopes. Here’s a list of parameters you should always specify:

Parameter Required Description
response_type Required code
client_id Required The client ID you received after registering your application.
redirect_uri Required The URL in your app where users will be sent after authorization
scope Required Space-delimited list of permissions (scopes) your application requests access to.

2. Nocks redirects back to your site

If the user approves your application, Nocks will redirect them back to your redirect_uri with a temporary code parameter.

Example of the redirect:

GET https://example.com/oauth/callback?code=CODE

After a successful request, a valid access token will be returned in the response:

{
  "token_type": "Bearer",
  "expires_in": 31536000,
  "access_token": "{acces_token}",
  "refresh_token": "{refresh_token}"
}

3. Exchange code for an access token

After you have received the temporary code, you can exchange it for valid access and refresh tokens. This can be done by making a POST call:

POST https://www.nocks.com/oauth/token

With following parameters:

Parameter Required Description
grant_type Required authorization_code
code Required Value from step 2
client_id Required The client ID you received after registering your application.
client_secret Required The client secret you received after registering your application.
redirect_uri Required Your application’s redirect URI

After a successful request, a valid access token will be returned in the response:

{
  "token_type": "Bearer",
  "expires_in": 31536000,
  "access_token": "{acces_token}",
  "refresh_token": "{refresh_token}"
}

4. Refreshing tokens

Because the Nocks API issues short-lived access tokens, you will need to refresh access tokens via the refresh token that was provided when the access token was issued.

POST https://www.nocks.com/oauth/token

With following parameters:

Parameter Required Description
grant_type Required refresh_token
refresh_token Required The refresh token that was provided when the access token was issued
client_id Required The client ID you received after registering your application.
client_secret Required The client secret you received after registering your application.

Revoking tokens (optional)

Active access tokens can be revoked at any time. This request needs to be made authenticated like any other regular API request (Authorization header with bearer token). 204 No Content is returned for both successful and unsuccessful request. This can be useful, for example, when implementing log-out feature.

DELETE https://www.nocks.com/oauth/token

Tokens can also be revoked by hand, visiting the API page.

Two-factor authentication

    # Required headers
    -H 'X-Nocks-2FA: {token}'

Make sure to replace {token} with the user’s 2fa token.

For users with two-factor authentication enabled, authentication requires an extra step.

In addition to the access token, you must send the user’s 2fa token (i.e., one-time password) in the X-Nocks-2FA header.

Two factor authentication is required for the following private API endpoints:

Trade Matching Engine

Nocks operates a continuous first-come, first-serve order book. Orders are executed in price-time priority as received by the matching engine.

Self-Trade Prevention

Self-trading is not allowed. Two orders from the same user will not fill one another. When two orders from the same user cross, both orders will be cancelled.

Price Improvement

Orders are matched against existing order book orders at the price of the order on the book, not at the price of the taker order.

Example

User A places a buy order for 100 NLG at 1 EUR. User B then wishes to sell 100 NLG at 0.80 EUR. Because User A’s order was first to the trading engine, they will have price priority and the trade will occur at 1 EUR.

Colocation

Our primary data sources and servers run in the Amazon EU Ireland data center.

To minimize latency for API access, we recommend making requests from servers located near the AWS eu-west-1 data center.

Public resources

User create

curl "https://api.nocks.com/api/v2/user"
    -X POST
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "gender": "male",
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@nocks.co",
        "password": "S3cretPassw0rd",
        "locale": "nl"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "0e00054a-9089-4401-9800-ad63ca56c64c",
        "email": "john@nocks.co",
        "email_verified": false,
        "gender": "male",
        "first_name": "John",
        "last_name": "Doe",
        "mobile": "",
        "mobile_verified": false,
        "is_active": true,
        "is_verified": false,
        "2fa_enabled": false,
        "identity_verified": false,
        "locale": "nl",
        "created_at": {
            "datetime": "2017-06-27 12:18:40",
            "timestamp": 1498565920
        },
        "updated_at": {
            "datetime": "2017-06-27 12:18:40",
            "timestamp": 1498565920
        },
        "resource": "user"
    },
    "status": 201
}

Create a user

HTTP Request

POST https://api.nocks.com/api/v2/user

Scopes

Arguments

Parameter Type Required Description
gender string Optional Gender of the user
first_name string Required First name
last_name string Required Last name
email string Required Valid email address that is not registered with us yet
password string Required Strong password with a minimum of 6 characters
locale string Optional Valid Locatization code

Trade markets

curl "https://api.nocks.com/api/v2/trade-market"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "code": "NLG-EUR",
            "last": {
                "amount": "0.08668167",
                "currency": "EUR"
            },
            "volume": {
                "amount": "130381.89052524",
                "currency": "EUR"
            },
            "low": {
                "amount": "0.08132732",
                "currency": "EUR"
            },
            "high": {
                "amount": "0.08921418",
                "currency": "EUR"
            },
            "buy": {
                "amount": "0.08668167",
                "currency": "EUR"
            },
            "sell": {
                "amount": "0.08714216",
                "currency": "EUR"
            },
            "is_active": true,
            "resource": "trade-market"
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve active trade markets

HTTP Request

GET https://api.nocks.com/api/v2/trade-market

Trade market get

curl "https://api.nocks.com/api/v2/trade-market/{code}"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "code": "NLG-EUR",
        "last": {
            "amount": "0.08668167",
            "currency": "EUR"
        },
        "volume": {
            "amount": "130381.89052524",
            "currency": "EUR"
        },
        "low": {
            "amount": "0.08132732",
            "currency": "EUR"
        },
        "high": {
            "amount": "0.08921418",
            "currency": "EUR"
        },
        "buy": {
            "amount": "0.08668167",
            "currency": "EUR"
        },
        "sell": {
            "amount": "0.08714216",
            "currency": "EUR"
        },
        "is_active": true,
        "resource": "trade-market"
    },
    "status": 200
}

Retrieve single trade market

HTTP Request

GET https://api.nocks.com/api/v2/trade-market/{code}

Trade market book

curl "https://api.nocks.com/api/v2/trade-market/{code}/book"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "buy": [
            {
                "rate": "0.0766",
                "size": "567.2324",
                "total": "43.4500",
                "sum": "43.4500"
            },
            ...
        ],
        "sell": [
            {
                "rate": "0.0803",
                "size": "1118.4756",
                "total": "89.8135",
                "sum": "89.8135"
            },
            ...
        ]
    },
    "status": 200
}

Retrieve order book of trade market

HTTP Request

GET https://api.nocks.com/api/v2/trade-market/{code}/book

Trade market history

curl "https://api.nocks.com/api/v2/trade-market/{code}/history"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "f9c2f977-eea6-4235-a4a5-52626d6d8f88",
            "amount": "30.9701",
            "rate": "0.0804",
            "cost": "2.4999",
            "side": "buy",
            "fee": "0.0100",
            "eur_value": "2.4899",
            "liquidity": "maker",
            "timestamp": "1509700929",
            "trade_market": "NLG-EUR",
            "created_at": {
                "datetime": "2017-11-03 10:22:09",
                "timestamp": 1509700929
            },
            "updated_at": {
                "datetime": "2017-11-03 10:22:09",
                "timestamp": 1509700929
            },
            "resource": "trade-order-transaction"
        },
        ...
    ],
    "status": 200
}

Retrieve history of trade market

HTTP Request

GET https://api.nocks.com/api/v2/trade-market/{code}/history

Trade market distribution

curl "https://api.nocks.com/api/v2/trade-market/{code}/distribution/{positions}"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "NLG": [
            {
                "amount": "381661"
            },
            ...
        ],
        "EUR": [
            {
                "amount": "9563"
            },
            ...
        ]
    },
    "status": 200
}

Retrieve distribution of trade market

HTTP Request

GET https://api.nocks.com/api/v2/trade-market/{code}/distribution/{positions}

Trade market candles

curl "https://api.nocks.com/api/v2/trade-market/{code}/candles/{start}/{end}/{interval}"
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "timestamp": 1506988800,
            "volume": "189461.56020000007",
            "average": "0.11318254420497459",
            "open": "0.1100",
            "high": "0.1254",
            "low": "0.1000",
            "close": "0.1000"
        },
        ...
    ],
    "status": 200
}

Retrieve candles (OHLC) of trade market

HTTP Request

GET https://api.nocks.com/api/v2/trade-market/{code}/candles/{start}/{end}/{interval}

Available intervals are:

Transaction quote

curl "https://api.nocks.com/api/v2/transaction/quote"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "source_currency": "EUR",
        "target_currency": "NLG",
        "amount": {
            "amount": "250",
            "currency": "NLG"
        },
        "payment_method": {
            "method":"ideal"
        }
    }'

The above command returns JSON structured like this:

{
    "data": {
        "source_amount": {
            "amount": "132.16",
            "currency": "EUR"
        },
        "target_amount": {
            "amount": "250.0000",
            "currency": "NLG"
        },
        "fee_amount": {
            "amount": "0.91",
            "currency": "EUR"
        }
    },
    "status": 200
}

Get a transaction price quote

HTTP Request

POST https://api.nocks.com/api/v2/transaction/quote

Arguments

Parameter Type Required Description
merchant_profile string Required Valid Merchant profile uuid
source_currency string Required Valid Currency code
target_currency string Required without merchant_profile Valid Currency code
amount array Required Amount to transact
payment_method string Required Transaction able Payment method

Address validate

curl "https://api.nocks.com/api/v2/address/validate"
    -X POST
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "currency": "EUR",
        "address": "NL16ABNA0602167736"
    }'

The above command returns JSON structured like this:

{
    "validation": true,
    "status": 200
}

Validate address

HTTP Request

POST https://api.nocks.com/api/v2/address/validate

Arguments

Parameter Type Required Description
currency string Required Valid Currency code
address string Required Address to be validated

Address validate (array)

curl "https://api.nocks.com/api/v2/address/validate"
    -X POST
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "addresses": [
            {
                "currency": "EUR",
                "address": "NL16ABNA0602167736"
            },
            {
                "currency": "EUR",
                "address": "NL16ABNA06021677316"
            }
        ]
    }'

The above command returns JSON structured like this:

{
    "validation": {
        "NL16ABNA0602167736": true,
        "NL16ABNA06021677316": false
    },
    "status": 200
}

Validate multiple addresses

HTTP Request

POST https://api.nocks.com/api/v2/address/validate

Arguments

Parameter Type Required Description
addresses array Required Array of addresses and currency codes

Private resources

Users

curl "https://api.nocks.com/api/v2/user"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "0e00054a-9089-4401-9800-ad63ca56c64c",
            "email": "john@nocks.co",
            "email_verified": false,
            "gender": "male",
            "first_name": "John",
            "last_name": "Doe",
            "mobile": "",
            "mobile_verified": false,
            "is_active": true,
            "is_verified": false,
            "2fa_enabled": false,
            "identity_verified": false,
            "locale": "nl",
            "created_at": {
                "datetime": "2017-06-27 12:18:40",
                "timestamp": 1498565920
            },
            "updated_at": {
                "datetime": "2017-06-27 12:18:40",
                "timestamp": 1498565920
            },
            "resource": "user"
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve authorized user

HTTP Request

GET https://api.nocks.com/api/v2/user

Scopes

User get

curl "https://api.nocks.com/api/v2/users/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "0e00054a-9089-4401-9800-ad63ca56c64c",
        "email": "john@nocks.co",
        "email_verified": false,
        "gender": "male",
        "first_name": "John",
        "last_name": "Doe",
        "mobile": "",
        "mobile_verified": false,
        "is_active": true,
        "is_verified": false,
        "2fa_enabled": false,
        "identity_verified": false,
        "locale": "nl",
        "created_at": {
            "datetime": "2017-06-27 12:18:40",
            "timestamp": 1498565920
        },
        "updated_at": {
            "datetime": "2017-06-27 12:18:40",
            "timestamp": 1498565920
        },
        "resource": "user"
    },
    "status": 200
}

Retrieve authorized user

HTTP Request

GET https://api.nocks.com/api/v2/user/{uuid}

Scopes

User update

curl "https://api.nocks.com/api/v2/user/{uuid}"
    -X PUT
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -H 'X-Nocks-2FA: {token}'
    -d '{
        "locale": "en"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "0e00054a-9089-4401-9800-ad63ca56c64c",
        "email": "john.doe@nocks.co",
        "email_verified": false,
        "gender": "male",
        "first_name": "John",
        "last_name": "Doe",
        "mobile": "+31612345678",
        "mobile_verified": false,
        "is_active": true,
        "is_verified": false,
        "2fa_enabled": false,
        "identity_verified": false,
        "locale": "en",
        "created_at": {
            "datetime": "2017-06-27 12:18:40",
            "timestamp": 1498565920
        },
        "updated_at": {
            "datetime": "2017-06-27 12:33:53",
            "timestamp": 1498566833
        },
        "resource": "user"
    },
    "status": 200
}

Update a user

HTTP Request

PUT https://api.nocks.com/api/v2/user/{uuid}

Scopes

Arguments

Parameter Type Required Description
gender string Optional Gender of the user
first_name string Optional First name
last_name string Optional Last name
locale string Optional Valid Locatization code

User delete

curl "https://api.nocks.com/api/v2/user/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -H 'X-Nocks-2FA: {token}'

Delete a user

HTTP Request

DELETE https://api.nocks.com/api/v2/user/{uuid}

Scopes

User verification

Before you can use our services with your created user account, you must first complete all verification steps, which are:

To see which of the verification steps are not completed yet you can check the User resource and find the email_verified, mobile_verified and identity_verified fields.

When all verification processes are completed, the is_verified field will return true. Only then you have access to our services.

Email

curl "https://api.nocks.com/api/v2/user/{uuid}"
    -X PUT
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "email_secret": "293175"
    }'

After creating your user account, you will need to confirm a six figure code that has been send to the provided email address.

HTTP Request

PUT https://api.nocks.com/api/v2/user/{uuid}

Scopes

Arguments

Parameter Type Required Description
email_secret string Required six figure code that is send to you upon email field update to complete verification process

Mobile

curl "https://api.nocks.com/api/v2/user/{uuid}"
    -X PUT
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "mobile_secret": "820361"
    }'

After Updating your user account with your mobile phone number, you will need to confirm a six figure code that has been send to the provided mobile phone number.

HTTP Request

PUT https://api.nocks.com/api/v2/user/{uuid}

Scopes

Arguments

Parameter Type Required Description
mobile_secret string Required six figure code that is send to you upon mobile field update to complete verification process

Identity document

curl "https://api.nocks.com/api/v2/user/{uuid}"
    -X PUT
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "identity_document": {
            "front": "/9j/4AAQSkZJRgABAQAAAQABAAD/sABFEdWNreQABAAQAAAAyAAD==",
            "back": "/9j/iVBORw0KGgoAAAANSUhEUgAAA/4AAAJ8CAIAAADI8e39AAnNn0lEQVR4XsR9a5PkvG4eQKpn9rWP8zH==",
            "type": "idcard"
        }
    }'

A copy of your government ID or passport in a base64 encoded string

HTTP Request

PUT https://api.nocks.com/api/v2/user/{uuid}

Scopes

Arguments

Parameter Type Required
identity_document array Required

Identity document arguments

Parameter Type Required Description
front string Required base64 encoded string of identity document front
back string Optional base64 encoded string of identity document back. Required only when type is idcard
type string Required passport or idcard. Driver license is not allowed

Funding sources

curl "https://api.nocks.com/api/v2/funding-source"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "29a548ef-648b-4bc1-9411-625daec26498",
            "address": "NL16ABNA0602167736",
            "type": "iban",
            "holder": "NOCKS BV",
            "is_verified": true,
            "is_active": true,
            "currency": "EUR",
            "created_at": {
                "datetime": "2017-06-27 13:10:33",
                "timestamp": 1498569033
            },
            "updated_at": {
                "datetime": "2017-06-27 15:10:33",
                "timestamp": 1498576233
            },
            "resource": "funding-source"
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve funding sources of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/funding-source

Scopes

Funding source get

curl "https://api.nocks.com/api/v2/funding-sources/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "29a548ef-648b-4bc1-9411-625daec26498",
        "address": "NL16ABNA0602167736",
        "type": "iban",
        "holder": "NOCKS BV",
        "is_verified": true,
        "is_active": true,
        "currency": "EUR",
        "created_at": {
            "datetime": "2017-06-27 13:10:33",
            "timestamp": 1498569033
        },
        "updated_at": {
            "datetime": "2017-06-27 15:10:33",
            "timestamp": 1498576233
        },
        "resource": "funding-source"
    },
    "status": 200
}

Retrieve single funding source of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/funding-source/{uuid}

Scopes

Funding source create

curl "https://api.nocks.com/api/v2/funding-source"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -H 'X-Nocks-2FA: {token}'
    -d '{
        "payment_method": {
            "method":"ideal",
            "metadata":{
                "issuer":"ABNANL2A"
            }
        },
        "currency": "EUR"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "3c469bf4-b592-43e8-b692-23d9cd4dc611",
        "status": "pending",
        "type": "funding-source",
        "method_type": "redirect",
        "description": "3c469bf4 Verification",
        "created_at": {
            "datetime": "2017-06-27 12:40:09",
            "timestamp": 1498567209
        },
        "updated_at": {
            "datetime": "2017-06-27 12:40:10",
            "timestamp": 1498567210
        },
        "resource": "payment",
        "amount": {
            "amount": "0.01",
            "currency": "EUR"
        },
        "metadata": {
            "url": "https://api.nocks.com/payment/url/3c469bf4-b592-43e8-b692-23d9cd4dc611"
        }
    },
    "status": 201
}

Create a funding source

HTTP Request

POST https://api.nocks.com/api/v2/funding-source

Scopes

Arguments

Parameter Type Required Description
number string Optional (required for NLG) Valid Gulden receiving address
method string Optional (required for EUR) Verification able Payment method
metadata string Optional method specific metadata

Funding source delete

curl "https://api.nocks.com/api/v2/funding-source/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a funding source

HTTP Request

DELETE https://api.nocks.com/api/v2/funding-source/{uuid}

Scopes

Transactions

curl "https://api.nocks.com/api/v2/transaction"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "7b1d4e3c-7bdf-4598-8537-031a731ee4d0",
            "status": "pending",
            "source_amount": {
                "amount": "25.99000000",
                "currency": "EUR"
            },
            "target_amount": {
                "amount": "245.09499759",
                "currency": "NLG"
            },
            "received_amount": {
                "amount": "0.00000000",
                "currency": "EUR"
            },
            "tip_amount": {
                "amount": "0.00000000",
                "currency": "EUR"
            },
            "target_address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8",
            "refund_address": "NL16ABNA0602167736",
            "description": "",
            "redirect_url": "https://nocks.com/redirect",
            "callback_url": "https://nocks.com/callback",
            "metadata": {
                "your_data_example_reference": "012345",
                "your_data_example_customer_name": "NOCKS BV"
            },
            "locale": "nl",
            "expire_at": {
                "datetime": "2017-06-28 11:34:27",
                "timestamp": 1498649667
            },
            "merchant_profile": null,
            "merchant_clearing": null,
            "created_at": {
                "datetime": "2017-06-28 11:04:27",
                "timestamp": 1498647867
            },
            "updated_at": {
                "datetime": "2017-06-28 11:04:28",
                "timestamp": 1498647868
            },
            "resource": "transaction",
            "payments": {
                "data": [
                    {
                        "uuid": "cf746fc8-c162-4b79-b981-6266f02f86c8",
                        "status": "pending",
                        "type": "transaction-source",
                        "method_type": "redirect",
                        "description": "cf746fc8 Transaction",
                        "created_at": {
                            "datetime": "2017-06-28 11:04:27",
                            "timestamp": 1498647867
                        },
                        "updated_at": {
                            "datetime": "2017-06-28 11:04:28",
                            "timestamp": 1498647868
                        },
                        "resource": "payment",
                        "amount": {
                            "amount": "25.99",
                            "currency": "EUR"
                        },
                        "metadata": {
                            "url": "https://api.nocks.com/payment/url/cf746fc8-c162-4b79-b981-6266f02f86c8"
                        }
                    }
                ]
            },
            "status_transitions": {
                "data": [
                    {
                        "status": "open",
                        "created_at": {
                            "datetime": "2017-10-11 15:34:06",
                            "timestamp": 1507728846
                        },
                        "resource": "transaction-status-transition"
                    },
                    ...
                ]
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 6,
            "count": 6,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve transactions of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/transaction

Scopes

Transaction get

curl "https://api.nocks.com/api/v2/transaction/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7b1d4e3c-7bdf-4598-8537-031a731ee4d0",
        "status": "pending",
        "source_amount": {
            "amount": "25.99000000",
            "currency": "EUR"
        },
        "target_amount": {
            "amount": "245.09499759",
            "currency": "NLG"
        },
        "received_amount": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "tip_amount": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "target_address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8",
        "refund_address": "NL16ABNA0602167736",
        "description": "",
        "redirect_url": "https://nocks.com/redirect",
        "callback_url": "https://nocks.com/callback",
        "metadata": {
            "your_data_example_reference": "012345",
            "your_data_example_customer_name": "NOCKS BV"
        },
        "locale": "nl",
        "expire_at": {
            "datetime": "2017-06-28 11:34:27",
            "timestamp": 1498649667
        },
        "merchant_profile": null,
        "merchant_clearing": null,
        "created_at": {
            "datetime": "2017-06-28 11:04:27",
            "timestamp": 1498647867
        },
        "updated_at": {
            "datetime": "2017-06-28 11:04:28",
            "timestamp": 1498647868
        },
        "resource": "transaction",
        "payments": {
            "data": [
                {
                    "uuid": "cf746fc8-c162-4b79-b981-6266f02f86c8",
                    "status": "pending",
                    "type": "transaction-source",
                    "method_type": "redirect",
                    "description": "cf746fc8 Transaction",
                    "created_at": {
                        "datetime": "2017-06-28 11:04:27",
                        "timestamp": 1498647867
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 11:04:28",
                        "timestamp": 1498647868
                    },
                    "resource": "payment",
                    "amount": {
                        "amount": "25.99",
                        "currency": "EUR"
                    },
                    "metadata": {
                        "url": "https://api.nocks.com/payment/url/cf746fc8-c162-4b79-b981-6266f02f86c8"
                    }
                }
            ]
        },
        "status_transitions": {
            "data": [
                {
                    "status": "open",
                    "created_at": {
                        "datetime": "2017-10-11 15:34:06",
                        "timestamp": 1507728846
                    },
                    "resource": "transaction-status-transition"
                },
                ...
            ]
        }
    },
    "status": 200
}

Retrieve single transaction of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/transaction/{uuid}

Scopes

Transaction create

curl "https://api.nocks.com/api/v2/transaction"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "source_currency": "EUR",
        "target_currency": "NLG",
        "target_address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8",
        "refund_address": "NL16ABNA0602167736",
        "amount": {
            "amount": "250",
            "currency": "NLG"
        },
        "payment_method": {
            "method":"ideal",
            "metadata":{
                "issuer":"ABNANL2A"
            }
        },
        "metadata": {
            "your_data_example_reference": "012345",
            "your_data_example_customer_name": "NOCKS BV"
        },
        "redirect_url": "https://nocks.com/redirect",
        "callback_url": "https://nocks.com/callback",
        "locale": "nl"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7b1d4e3c-7bdf-4598-8537-031a731ee4d0",
        "status": "pending",
        "source_amount": {
            "amount": "25.99000000",
            "currency": "EUR"
        },
        "target_amount": {
            "amount": "245.09499759",
            "currency": "NLG"
        },
        "received_amount": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "tip_amount": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "target_address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8",
        "refund_address": "NL16ABNA0602167736",
        "description": "",
        "redirect_url": "https://nocks.com/redirect",
        "callback_url": "https://nocks.com/callback",
        "metadata": {
            "your_data_example_reference": "012345",
            "your_data_example_customer_name": "NOCKS BV"
        },
        "locale": "nl",
        "expire_at": {
            "datetime": "2017-06-28 11:34:27",
            "timestamp": 1498649667
        },
        "merchant_profile": null,
        "merchant_clearing": null,
        "created_at": {
            "datetime": "2017-06-28 11:04:27",
            "timestamp": 1498647867
        },
        "updated_at": {
            "datetime": "2017-06-28 11:04:28",
            "timestamp": 1498647868
        },
        "resource": "transaction",
        "payments": {
            "data": [
                {
                    "uuid": "cf746fc8-c162-4b79-b981-6266f02f86c8",
                    "status": "pending",
                    "type": "transaction-source",
                    "method_type": "redirect",
                    "description": "cf746fc8 Transaction",
                    "created_at": {
                        "datetime": "2017-06-28 11:04:27",
                        "timestamp": 1498647867
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 11:04:28",
                        "timestamp": 1498647868
                    },
                    "resource": "payment",
                    "amount": {
                        "amount": "25.99",
                        "currency": "EUR"
                    },
                    "metadata": {
                        "url": "https://api.nocks.com/payment/url/cf746fc8-c162-4b79-b981-6266f02f86c8"
                    }
                }
            ]
        },
        "status_transitions": {
            "data": [
                {
                    "status": "open",
                    "created_at": {
                        "datetime": "2017-10-11 15:34:06",
                        "timestamp": 1507728846
                    },
                    "resource": "transaction-status-transition"
                },
                ...
            ]
        }
    },
    "status": 201
}

Create a transaction

HTTP Request

POST https://api.nocks.com/api/v2/transaction

Scopes

Arguments

Parameter Type Required Description
merchant_profile string Optional Valid Merchant profile uuid
source_currency string Required Valid Currency code
target_currency string Required without merchant_profile Valid Currency code
target_address string Required without merchant_profile Valid receiving address
refund_address string Optional Valid refund address in case of a transaction refund
amount array Required Amount to transact (including tip_amount)
tip_amount array Optional Amount of the amount which is tipped
fee_type string Optional Charge fee on source or target payment
payment_method string Required Transaction able Payment method
expiration_time int Optional Amount of seconds to expire this transaction (min: 60, max: see Payment methods)
metadata array Optional Additional data for own reference
redirect_url url Optional Redirect URL after payment is completed
callback_url url Optional Will be called when the transaction updates with a POST value of the transaction UUID
locale string Optional Valid Locatization code
clearing_distribution array Optional Overrides default clearing distribution of merchant for this transaction only

Transaction cancel

curl "https://api.nocks.com/api/v2/transaction/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Cancel a transaction

HTTP Request

DELETE https://api.nocks.com/api/v2/transaction/{uuid}

Scopes

Deposits

curl "https://api.nocks.com/api/v2/deposit"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "e54c738c-04f3-4ce8-aa67-3bff6599a677",
            "status": "open",
            "type": "deposit",
            "method_type": "deposit",
            "description": "e54c738c Deposit",
            "created_at": {
                "datetime": "2017-06-28 11:12:52",
                "timestamp": 1498648372
            },
            "updated_at": {
                "datetime": "2017-06-28 11:12:54",
                "timestamp": 1498648374
            },
            "resource": "payment",
            "amount": {
                "amount": "500.00",
                "currency": "EUR"
            },
            "metadata": {
                "address": "NL28BUNQ2291037323"
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 6,
            "count": 6,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve deposits of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/deposit

Scopes

Deposit get

curl "https://api.nocks.com/api/v2/deposit/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "e54c738c-04f3-4ce8-aa67-3bff6599a677",
        "status": "open",
        "type": "deposit",
        "method_type": "deposit",
        "description": "e54c738c Deposit",
        "created_at": {
            "datetime": "2017-06-28 11:12:52",
            "timestamp": 1498648372
        },
        "updated_at": {
            "datetime": "2017-06-28 11:12:54",
            "timestamp": 1498648374
        },
        "resource": "payment",
        "amount": {
            "amount": "500.00",
            "currency": "EUR"
        },
        "metadata": {
            "address": "NL28BUNQ2291037323"
        }
    },
    "status": 200
}

Retrieve single deposit of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/deposit/{uuid}

Scopes

Deposit create

curl "https://api.nocks.com/api/v2/deposit"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "amount": "500.00",
        "currency": "EUR",
        "payment_method": {
            "method":"sepa"
        }
    }'

The above command returns JSON structured like this:

{
    "data": {
        "method_type": "deposit",
        "metadata": {
            "address": "NL28BUNQ2291037323"
        }
    },
    "status": 201
}

Create a deposit

HTTP Request

POST https://api.nocks.com/api/v2/deposit

Scopes

Arguments

Parameter Type Required Description
balance string Optional UUID of the balance you want to deposit to (defaults to Trade cash account)
balanceable_type string Optional (required with balanceable_uuid) user or merchant
balanceable_uuid string Optional (required with balanceable_type) UUID of user or merchant
type string Optional trade-cash, merchant. Defaults to trade-cash
amount string Required/Optional Optional for ‘deposit’ method type Payment methods
currency string Required Valid Currency code
method string Optional Deposit able Payment method
metadata string Optional method specific metadata

Withdrawals

curl "https://api.nocks.com/api/v2/withdrawal"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "6e225b37-dce6-4c31-b009-752de6c2eb66",
            "status": "open",
            "type": "withdrawal",
            "method_type": "deposit",
            "description": "6e225b37 Withdrawal",
            "created_at": {
                "datetime": "2017-06-28 11:59:50",
                "timestamp": 1498651190
            },
            "updated_at": {
                "datetime": "2017-06-28 11:59:50",
                "timestamp": 1498651190
            },
            "resource": "payment",
            "amount": {
                "amount": "1544.00000000",
                "currency": "NLG"
            },
            "metadata": {
                "address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8"
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve withdrawals of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/withdrawal

Scopes

Withdrawal get

curl "https://api.nocks.com/api/v2/withdrawal/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "6e225b37-dce6-4c31-b009-752de6c2eb66",
        "status": "open",
        "type": "withdrawal",
        "method_type": "deposit",
        "description": "6e225b37 Withdrawal",
        "created_at": {
            "datetime": "2017-06-28 11:59:50",
            "timestamp": 1498651190
        },
        "updated_at": {
            "datetime": "2017-06-28 11:59:50",
            "timestamp": 1498651190
        },
        "resource": "payment",
        "amount": {
            "amount": "1544.00000000",
            "currency": "NLG"
        },
        "metadata": {
            "address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8"
        }
    },
    "status": 200
}

Retrieve single withdrawal of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/withdrawal/{uuid}

Scopes

Withdrawal create

curl "https://api.nocks.com/api/v2/withdrawal"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -H 'X-Nocks-2FA: {token}'
    -d '{
        "currency": "NLG",
        "amount": "1544.00",
        "address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "6e225b37-dce6-4c31-b009-752de6c2eb66",
        "status": "open",
        "type": "withdrawal",
        "method_type": "deposit",
        "description": "6e225b37 Withdrawal",
        "created_at": {
            "datetime": "2017-06-28 11:59:50",
            "timestamp": 1498651190
        },
        "updated_at": {
            "datetime": "2017-06-28 11:59:50",
            "timestamp": 1498651190
        },
        "resource": "payment",
        "amount": {
            "amount": "1544.00000000",
            "currency": "NLG"
        },
        "metadata": {
            "address": "TF7LzGAcCxYxoFjfJwxswua24s9wsMpwY8"
        }
    },
    "status": 201
}

Create a withdrawal

HTTP Request

POST https://api.nocks.com/api/v2/withdrawal

Scopes

Arguments

Parameter Type Required Description
balance string Optional UUID of the balance you want to withdrawal from (defaults to Trade cash account)
balanceable_type string Optional (required with balanceable_uuid) user or merchant
balanceable_uuid string Optional (required with balanceable_type) UUID of user or merchant
type string Optional trade-cash, merchant. Defaults to trade-cash
amount string Required Amount to withdraw, may not exceed current balance
currency string Required Valid Currency code
address string Required Valid withdrawal address

Contacts

curl "https://api.nocks.com/api/v2/contact"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "7864ab2f-7d6a-4384-b633-fa793c130392",
            "name": "Nocks B.V.",
            "description": "Coolest company ever",
            "is_favorite": true,
            "created_at": {
                "datetime": "2017-06-28 12:04:38",
                "timestamp": 1498651478
            },
            "updated_at": {
                "datetime": "2017-06-28 12:04:38",
                "timestamp": 1498651478
            },
            "resource": "contact",
            "addresses": {
                "data": []
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve contacts of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/contact

Scopes

Contact get

curl "https://api.nocks.com/api/v2/contact/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "name": "Nocks B.V.",
        "description": "Coolest company ever",
        "is_favorite": true,
        "created_at": {
            "datetime": "2017-06-28 12:04:38",
            "timestamp": 1498651478
        },
        "updated_at": {
            "datetime": "2017-06-28 12:04:38",
            "timestamp": 1498651478
        },
        "resource": "contact",
        "addresses": {
            "data": []
        }
    },
    "status": 200
}

Retrieve single contact of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/contact/{uuid}

Scopes

Contact create

curl "https://api.nocks.com/api/v2/contact"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "name":"Nocks B.V.",
        "description":"Coolest company ever",
        "is_favorite":true
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "name": "Nocks B.V.",
        "description": "Coolest company ever",
        "is_favorite": true,
        "created_at": {
            "datetime": "2017-06-28 12:04:38",
            "timestamp": 1498651478
        },
        "updated_at": {
            "datetime": "2017-06-28 12:04:38",
            "timestamp": 1498651478
        },
        "resource": "contact",
        "addresses": {
            "data": []
        }
    },
    "status": 201
}

Create a contact

HTTP Request

POST https://api.nocks.com/api/v2/contact

Scopes

Arguments

Parameter Type Required Description
name string Required Label of the contact
description string Optional Short description (max. 255 characters)
is_favorite boolean Optional Adds this contact to your favorites

Contact update

curl "https://api.nocks.com/api/v2/contact/{uuid}"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "description":"Coolest company in the whole world"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "name": "Nocks B.V.",
        "description": "Coolest company in the whole world",
        "is_favorite": true,
        "created_at": {
            "datetime": "2017-06-28 12:04:38",
            "timestamp": 1498651478
        },
        "updated_at": {
            "datetime": "2017-06-28 12:06:25",
            "timestamp": 1498651585
        },
        "resource": "contact",
        "addresses": {
            "data": []
        }
    },
    "status": 200
}

Update a contact

HTTP Request

PUT https://api.nocks.com/api/v2/contact/{uuid}

Scopes

Arguments

Parameter Type Required Description
name string Required Label of the contact
description string Optional Short description (max. 255 characters)
is_favorite boolean Optional Adds this contact to your favorites

Contact delete

curl "https://api.nocks.com/api/v2/contact/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a contact

HTTP Request

DELETE https://api.nocks.com/api/v2/contact/{uuid}

Scopes

Contact addresses

curl "https://api.nocks.com/api/v2/contact-address"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
            "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
            "address": "NL16ABNA0602167736",
            "currency": "EUR",
            "description": "European bank account",
            "created_at": {
                "datetime": "2017-06-28 12:08:27",
                "timestamp": 1498651707
            },
            "updated_at": {
                "datetime": "2017-06-28 12:08:27",
                "timestamp": 1498651707
            },
            "resource": "contact-address"
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve contact address of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/contact-address

Scopes

Contact address get

curl "https://api.nocks.com/api/v2/contact-address/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
        "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "address": "NL16ABNA0602167736",
        "currency": "EUR",
        "description": "European bank account",
        "created_at": {
            "datetime": "2017-06-28 12:08:27",
            "timestamp": 1498651707
        },
        "updated_at": {
            "datetime": "2017-06-28 12:08:27",
            "timestamp": 1498651707
        },
        "resource": "contact-address"
    },
    "status": 200
}

Retrieve single contact address of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/contact-address/{uuid}

Scopes

Contact address create

curl "https://api.nocks.com/api/v2/contact-address"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "contact": "4baa773c-1e5e-4dd5-ad22-b357c9ad58a2",
        "currency":"EUR",
        "address":"NL16ABNA0602167736",
        "description":"European bank account"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
        "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "address": "NL16ABNA0602167736",
        "currency": "EUR",
        "description": "European bank account",
        "created_at": {
            "datetime": "2017-06-28 12:08:27",
            "timestamp": 1498651707
        },
        "updated_at": {
            "datetime": "2017-06-28 12:08:27",
            "timestamp": 1498651707
        },
        "resource": "contact-address"
    },
    "status": 201
}

Create a contact address

HTTP Request

POST https://api.nocks.com/api/v2/contact-address

Scopes

Arguments

Parameter Type Required Description
address string Required valid receiving address of contact
description string Optional Short description (max. 255 characters)
currency string Required Valid Currency code
contact string Required Valid Contact UUID

Contact address update

curl "https://api.nocks.com/api/v2/contact-address/{uuid}"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "description":"Savings account"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
        "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
        "address": "NL16ABNA0602167736",
        "currency": "EUR",
        "description": "Savings account",
        "created_at": {
            "datetime": "2017-06-28 12:08:27",
            "timestamp": 1498651707
        },
        "updated_at": {
            "datetime": "2017-06-28 12:10:20",
            "timestamp": 1498651820
        },
        "resource": "contact-address"
    },
    "status": 200
}

Update a contact address

HTTP Request

PUT https://api.nocks.com/api/v2/contact-address/{uuid}

Scopes

Arguments

Parameter Type Required Description
address string Required valid receiving address of contact
description string Optional Short description (max. 255 characters)
currency string Required Valid Currency code
contact string Required Valid Contact UUID

Contact address delete

curl "https://api.nocks.com/api/v2/contact-address/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a contact address

HTTP Request

DELETE https://api.nocks.com/api/v2/contact-address/{uuid}

Scopes

Merchants

curl "https://api.nocks.com/api/v2/merchant"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "85468de6-3875-4968-9259-2399ca7b207e",
            "name": "Nocks B.V.",
            "email": "support@nocks.co",
            "website": "https://nocks.co",
            "address": "Dorpstraat",
            "number": "24",
            "zip_code": "1234 AB",
            "city": "Zoetermeer",
            "country": "NL",
            "phone": "+31612345678",
            "coc": "64502260",
            "vat": "NL855693915B01",
            "created_at": {
                "datetime": "2017-06-28 13:57:02",
                "timestamp": 1498658222
            },
            "updated_at": {
                "datetime": "2017-06-28 13:57:02",
                "timestamp": 1498658222
            },
            "clearing_distribution": {
                "data": [
                    {
                        "percentage": 80,
                        "address": "NL16ABNA0602167736",
                        "currency": "EUR"
                    },
                    {
                        "percentage": 20,
                        "address": "TNZQU2V1K3qu8ntzHuJ5336AAUuG8WC6JD",
                        "currency": "NLG"
                    }
                ]
            },
            "merchant_profiles": {
                "data": [
                    {
                        "uuid": "643a6879-d552-496e-bbba-d3095de6dbf2",
                        "name": "Nocks B.V.",
                        "is_active": true,
                        "created_at": {
                            "datetime": "2017-06-28 13:57:02",
                            "timestamp": 1498658222
                        },
                        "updated_at": {
                            "datetime": "2017-06-28 13:57:02",
                            "timestamp": 1498658222
                        }
                    }
                ]
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve merchants of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant

Scopes

Merchant get

curl "https://api.nocks.com/api/v2/merchants/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "85468de6-3875-4968-9259-2399ca7b207e",
        "name": "Nocks B.V.",
        "email": "support@nocks.co",
        "website": "https://nocks.co",
        "address": "Dorpstraat",
        "number": "24",
        "zip_code": "1234 AB",
        "city": "Zoetermeer",
        "country": "NL",
        "phone": "+31612345678",
        "coc": "64502260",
        "vat": "NL855693915B01",
        "created_at": {
            "datetime": "2017-06-28 13:57:02",
            "timestamp": 1498658222
        },
        "updated_at": {
            "datetime": "2017-06-28 13:57:02",
            "timestamp": 1498658222
        },
        "clearing_distribution": {
            "data": [
                {
                    "percentage": 80,
                    "address": "NL16ABNA0602167736",
                    "currency": "EUR"
                },
                {
                    "percentage": 20,
                    "address": "TNZQU2V1K3qu8ntzHuJ5336AAUuG8WC6JD",
                    "currency": "NLG"
                }
            ]
        },
        "merchant_profiles": {
            "data": [
                {
                    "uuid": "643a6879-d552-496e-bbba-d3095de6dbf2",
                    "name": "Nocks B.V.",
                    "is_active": true,
                    "created_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    }
                }
            ]
        }
    },
    "status": 200
}

Retrieve single merchant of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{uuid}

Scopes

Merchant create

curl "https://api.nocks.com/api/v2/merchant"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "name": "Nocks B.V.",
        "email": "support@nocks.co",
        "website": "https://nocks.co",
        "address": "Dorpstraat",
        "number": "24",
        "zip_code": "1234 AB",
        "city": "Zoetermeer",
        "country": "NL",
        "phone": "+31612345678",
        "coc": "64502260",
        "vat": "NL855693915B01",
        "clearing_distribution": [
            {
                "currency": "EUR",
                "percentage": 80,
                "address": "NL16ABNA0602167736"
            },
            {
                "currency": "NLG",
                "percentage": 20,
                "address": "TNZQU2V1K3qu8ntzHuJ5336AAUuG8WC6JD"
            }
        ]
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "85468de6-3875-4968-9259-2399ca7b207e",
        "name": "Nocks B.V.",
        "email": "support@nocks.co",
        "website": "https://nocks.co",
        "address": "Dorpstraat",
        "number": "24",
        "zip_code": "1234 AB",
        "city": "Zoetermeer",
        "country": "NL",
        "phone": "+31612345678",
        "coc": "64502260",
        "vat": "NL855693915B01",
        "created_at": {
            "datetime": "2017-06-28 13:57:02",
            "timestamp": 1498658222
        },
        "updated_at": {
            "datetime": "2017-06-28 13:57:02",
            "timestamp": 1498658222
        },
        "clearing_distribution": {
            "data": [
                {
                    "percentage": 80,
                    "address": "NL16ABNA0602167736",
                    "currency": "EUR"
                },
                {
                    "percentage": 20,
                    "address": "TNZQU2V1K3qu8ntzHuJ5336AAUuG8WC6JD",
                    "currency": "NLG"
                }
            ]
        },
        "merchant_profiles": {
            "data": [
                {
                    "uuid": "643a6879-d552-496e-bbba-d3095de6dbf2",
                    "name": "Nocks B.V.",
                    "is_active": true,
                    "created_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    }
                }
            ]
        }
    },
    "status": 201
}

Create a merchant

HTTP Request

POST https://api.nocks.com/api/v2/merchant

Scopes

Arguments

Parameter Type Required Description
name string Required Business name of the merchant
email string Required Email address
website string Optional Website url
address string Required Street name
number string Required House number
zip_code string Required Zipcode
city string Required City
country string Required Valid Country code
phone string Required Telephone number
coc string Required Valid Chamber of Commerce number
vat string Required Valid VIES VAT number
clearing_distribution array Required How you would like to receive your fund clearings (view example code)

Merchant countries

Merchant update

curl "https://api.nocks.com/api/v2/merchant/{uuid}"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "address": "Dorpstraat",
        "number": "1",
        "zip_code": "4321 ZA",
        "city": "Groningen"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "85468de6-3875-4968-9259-2399ca7b207e",
        "name": "Nocks B.V.",
        "email": "support@nocks.co",
        "website": "https://nocks.co",
        "address": "Dorpstraat",
        "number": "1",
        "zip_code": "4321 ZA",
        "city": "Groningen",
        "country": "NL",
        "phone": "+31612345678",
        "coc": "64502260",
        "vat": "NL855693915B01",
        "created_at": {
            "datetime": "2017-06-28 13:57:02",
            "timestamp": 1498658222
        },
        "updated_at": {
            "datetime": "2017-06-28 14:00:52",
            "timestamp": 1498658452
        },
        "clearing_distribution": {
            "data": [
                {
                    "percentage": 80,
                    "address": "NL16ABNA0602167736",
                    "currency": "EUR"
                },
                {
                    "percentage": 20,
                    "address": "TNZQU2V1K3qu8ntzHuJ5336AAUuG8WC6JD",
                    "currency": "NLG"
                }
            ]
        },
        "merchant_profiles": {
            "data": [
                {
                    "uuid": "643a6879-d552-496e-bbba-d3095de6dbf2",
                    "name": "Nocks B.V.",
                    "is_active": true,
                    "created_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 13:57:02",
                        "timestamp": 1498658222
                    }
                }
            ]
        }
    },
    "status": 200
}

Update a merchant

HTTP Request

PUT https://api.nocks.com/api/v2/merchant/{uuid}

Scopes

Arguments

Parameter Type Required Description
name string Required Business name of the merchant
email string Required Email address
website string Optional Website url
address string Required Street name
number string Required House number
zip_code string Required Zipcode
city string Required City
country string Required Valid Country code
phone string Required Telephone number
coc string Required Valid Chamber of Commerce number
vat string Required Valid VIES VAT number
clearing_distribution array Required How you would like to receive your fund clearings (view example code)

Merchant countries

Merchant delete

curl "https://api.nocks.com/api/v2/merchant/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a merchant

HTTP Request

DELETE https://api.nocks.com/api/v2/merchant/{uuid}

Scopes

Merchant profiles

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "23535977-98c9-49e3-a06c-6dc97459f0cd",
            "name": "Nocks B.V.",
            "is_active": true,
            "created_at": {
                "datetime": "2017-06-28 13:48:28",
                "timestamp": 1498650508
            },
            "updated_at": {
                "datetime": "2017-06-28 13:48:28",
                "timestamp": 1498650508
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 25,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve merchant profiles of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile

Scopes

Merchant profile get

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profiles/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "ac7171d3-a912-411e-bd39-dfeb912b866c",
        "name": "Nocks B.V. - Location Groningen",
        "is_active": true,
        "created_at": {
            "datetime": "2017-08-24 09:49:01",
            "timestamp": 1503560941
        },
        "updated_at": {
            "datetime": "2017-08-24 09:49:01",
            "timestamp": 1503560941
        }
    },
    "status": 200
}

Retrieve single merchant profile of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile/{uuid}

Scopes

Merchant profile create

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "name": "Nocks B.V. - Location Groningen"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "ac7171d3-a912-411e-bd39-dfeb912b866c",
        "name": "Nocks B.V. - Location Groningen",
        "is_active": true,
        "created_at": {
            "datetime": "2017-08-24 09:49:01",
            "timestamp": 1503560941
        },
        "updated_at": {
            "datetime": "2017-08-24 09:49:01",
            "timestamp": 1503560941
        }
    },
    "status": 201
}

Create a merchant profile

HTTP Request

POST https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile

Scopes

Arguments

Parameter Type Required Description
name string Required Name of the merchant profile

Merchant profile delete

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a merchant profile

HTTP Request

DELETE https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile/{uuid}

Scopes

Merchant profile turnover

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile/{uuid}/turnover"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "start": "2018-01-01 00:00:00",
        "end": "2018-12-31 23:59:59"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "period": {
            "start": {
                "datetime": "2018-01-01 00:00:00",
                "timestamp": 1514761200
            },
            "end": {
                "datetime": "2018-12-31 23:59:59",
                "timestamp": 1546297199
            }
        },
        "amount": {
            "amount": "18.50",
            "currency": "EUR"
        },
        "tip": {
            "amount": "4.49",
            "currency": "EUR"
        },
        "fee": {
            "amount": "0.00",
            "currency": "EUR"
        },
        "total": {
            "amount": "4.49",
            "currency": "EUR"
        }
    },
    "status": 200
}

Retrieve turnover of merchant profile within a given period

HTTP Request

POST https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-profile/{uuid}/turnover

Scopes

Arguments

Parameter Type Required Description
start string Required Datetime string period start
end string Required Datetime string period end

Merchant clearings

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-clearing"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
  "data": [
    {
      "uuid": "467014b2-7833-4083-bb38-fa7e17011ff6",
      "reference": "CLEARING-20170615-7953b9",
      "status": "paid",
      "amount": {
        "amount": "9.94",
        "currency": "EUR"
      },
      "fee": {
        "amount": "0.52",
        "currency": "EUR"
      },
      "created_at": {
        "datetime": "2017-05-15 01:08:08",
        "timestamp": 1494810488
      },
      "updated_at": {
        "datetime": "2017-06-15 01:08:08",
        "timestamp": 1497488888
      },
      "resource": "merchant-clearing",
      "merchant_clearing_items": {
        "data": [
          {
            "uuid": "7452d5e9-6467-4a09-8259-bedc7ddbc207",
            "amount": {
              "amount": "5.21",
              "currency": "EUR"
            },
            "address": "NL16ABNA0602167736",
            "currency": "EUR",
            "status": "paid",
            "created_at": {
              "datetime": "2017-06-15 01:08:08",
              "timestamp": 1497488888
            },
            "updated_at": {
              "datetime": "2017-06-15 01:08:08",
              "timestamp": 1497488888
            },
            "resource": "merchant-clearing-item"
          },
          {
            "uuid": "d648e680-7f51-4c7b-93b2-192f0f14dffc",
            "amount": {
              "amount": "89.46000000",
              "currency": "NLG"
            },
            "address": "TQS5eGuUdwFxCctPi4rbtaSL1smkT3bHJK",
            "currency": "NLG",
            "status": "paid",
            "created_at": {
              "datetime": "2017-06-15 01:08:08",
              "timestamp": 1497488888
            },
            "updated_at": {
              "datetime": "2017-06-15 01:08:08",
              "timestamp": 1497488888
            },
            "resource": "merchant-clearing-item"
          }
        ]
      }
    },
    ...
  ],
  "meta": {
    "pagination": {
      "total": 8,
      "count": 8,
      "per_page": 25,
      "current_page": 1,
      "total_pages": 1,
      "links": [
      ]
    }
  },
  "status": 200
}

Retrieve merchant clearings of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-clearing

Scopes

Merchant clearing get

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-clearing/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
  "data": {
    "uuid": "467014b2-7833-4083-bb38-fa7e17011ff6",
    "reference": "CLEARING-20170615-7953b9",
    "status": "paid",
    "amount": {
      "amount": "9.94",
      "currency": "EUR"
    },
    "fee": {
      "amount": "0.52",
      "currency": "EUR"
    },
    "created_at": {
      "datetime": "2017-05-15 01:08:08",
      "timestamp": 1494810488
    },
    "updated_at": {
      "datetime": "2017-06-15 01:08:08",
      "timestamp": 1497488888
    },
    "resource": "merchant-clearing",
    "merchant_clearing_items": {
      "data": [
        {
          "uuid": "7452d5e9-6467-4a09-8259-bedc7ddbc207",
          "amount": {
            "amount": "5.21",
            "currency": "EUR"
          },
          "address": "NL16ABNA0602167736",
          "currency": "EUR",
          "status": "paid",
          "created_at": {
            "datetime": "2017-06-15 01:08:08",
            "timestamp": 1497488888
          },
          "updated_at": {
            "datetime": "2017-06-15 01:08:08",
            "timestamp": 1497488888
          },
          "resource": "merchant-clearing-item"
        },
        {
          "uuid": "d648e680-7f51-4c7b-93b2-192f0f14dffc",
          "amount": {
            "amount": "89.46000000",
            "currency": "NLG"
          },
          "address": "TQS5eGuUdwFxCctPi4rbtaSL1smkT3bHJK",
          "currency": "NLG",
          "status": "paid",
          "created_at": {
            "datetime": "2017-06-15 01:08:08",
            "timestamp": 1497488888
          },
          "updated_at": {
            "datetime": "2017-06-15 01:08:08",
            "timestamp": 1497488888
          },
          "resource": "merchant-clearing-item"
        }
      ]
    }
  },
  "status": 200
}

Retrieve single merchant clearing of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-clearing/{uuid}

Scopes

Merchant invoices

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-invoice"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
  "data": [
    {
      "uuid": "53ee0868-89f7-4d2d-8648-0eb5534e7de9",
      "reference": "2017-0001",
      "vat": "21",
      "amount_net": "0.41",
      "amount_vat": "0.11",
      "amount_gross": "0.52",
      "issued_at": "2017-06-19 08:44:25",
      "paid_at": "2017-06-19 08:44:25",
      "due_at": "2017-06-19 08:44:25",
      "status": "paid",
      "created_at": {
        "datetime": "2017-06-19 08:44:25",
        "timestamp": 1497861865
      },
      "updated_at": {
        "datetime": "2017-06-19 08:44:25",
        "timestamp": 1497861865
      },
      "resource": "merchant-invoice",
      "merchant_clearings": {
        "data": [
          {
            "uuid": "abb010e2-19c5-4a6a-a7c2-d9f7660238a6",
            "reference": "CLEARING-20170615-mc7953b9",
            "status": "paid",
            "amount": {
              "amount": "9.94",
              "currency": "EUR"
            },
            "fee": {
              "amount": "0.52",
              "currency": "EUR"
            },
            "created_at": {
              "datetime": "2017-05-15 01:08:08",
              "timestamp": 1494810488
            },
            "updated_at": {
              "datetime": "2017-06-19 08:44:25",
              "timestamp": 1497861865
            },
            "resource": "merchant-clearing",
            "merchant_clearing_items": {
              "data": [
                {
                  "uuid": "34f0ac0e-4749-45ef-8ca1-eb41cb815868",
                  "amount": {
                    "amount": "0.99",
                    "currency": "EUR"
                  },
                  "address": "NL16ABNA0602167736",
                  "currency": "EUR",
                  "status": "paid",
                  "created_at": {
                    "datetime": "2017-06-15 01:31:08",
                    "timestamp": 1497490268
                  },
                  "updated_at": {
                    "datetime": "2017-06-15 01:31:08",
                    "timestamp": 1497490268
                  },
                  "resource": "merchant-clearing-item"
                },
                {
                  "uuid": "70ed3630-cfa6-463b-ba6a-223ac2de70af",
                  "amount": {
                    "amount": "89.46000000",
                    "currency": "NLG"
                  },
                  "address": "TQS5eGuUdwFxCctPi4rbtaSL1smkT3bHJK",
                  "currency": "NLG",
                  "status": "paid",
                  "created_at": {
                    "datetime": "2017-06-15 01:31:08",
                    "timestamp": 1497490268
                  },
                  "updated_at": {
                    "datetime": "2017-06-15 01:31:10",
                    "timestamp": 1497490270
                  },
                  "resource": "merchant-clearing-item"
                }
              ]
            }
          },
          ...
        ]
      }
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 25,
      "current_page": 1,
      "total_pages": 1,
      "links": [
      ]
    }
  },
  "status": 200
}

Retrieve merchant invoices of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-invoice

Scopes

Merchant invoice get

curl "https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-invoice/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
  "data": {
    "uuid": "53ee0868-89f7-4d2d-8648-0eb5534e7de9",
    "reference": "2017-0001",
    "vat": "21",
    "amount_net": "0.41",
    "amount_vat": "0.11",
    "amount_gross": "0.52",
    "issued_at": "2017-06-19 08:44:25",
    "paid_at": "2017-06-19 08:44:25",
    "due_at": "2017-06-19 08:44:25",
    "status": "paid",
    "created_at": {
      "datetime": "2017-06-19 08:44:25",
      "timestamp": 1497861865
    },
    "updated_at": {
      "datetime": "2017-06-19 08:44:25",
      "timestamp": 1497861865
    },
    "resource": "merchant-invoice",
    "merchant_clearings": {
      "data": [
        {
          "uuid": "abb010e2-19c5-4a6a-a7c2-d9f7660238a6",
          "reference": "CLEARING-20170615-mc7953b9",
          "status": "paid",
          "amount": {
            "amount": "9.94",
            "currency": "EUR"
          },
          "fee": {
            "amount": "0.52",
            "currency": "EUR"
          },
          "created_at": {
            "datetime": "2017-05-15 01:08:08",
            "timestamp": 1494810488
          },
          "updated_at": {
            "datetime": "2017-06-19 08:44:25",
            "timestamp": 1497861865
          },
          "resource": "merchant-clearing",
          "merchant_clearing_items": {
            "data": [
              {
                "uuid": "34f0ac0e-4749-45ef-8ca1-eb41cb815868",
                "amount": {
                  "amount": "0.99",
                  "currency": "EUR"
                },
                "address": "NL16ABNA0602167736",
                "currency": "EUR",
                "status": "paid",
                "created_at": {
                  "datetime": "2017-06-15 01:31:08",
                  "timestamp": 1497490268
                },
                "updated_at": {
                  "datetime": "2017-06-15 01:31:08",
                  "timestamp": 1497490268
                },
                "resource": "merchant-clearing-item"
              },
              {
                "uuid": "70ed3630-cfa6-463b-ba6a-223ac2de70af",
                "amount": {
                  "amount": "89.46000000",
                  "currency": "NLG"
                },
                "address": "TQS5eGuUdwFxCctPi4rbtaSL1smkT3bHJK",
                "currency": "NLG",
                "status": "paid",
                "created_at": {
                  "datetime": "2017-06-15 01:31:08",
                  "timestamp": 1497490268
                },
                "updated_at": {
                  "datetime": "2017-06-15 01:31:10",
                  "timestamp": 1497490270
                },
                "resource": "merchant-clearing-item"
              }
            ]
          }
        },
        ...
      ]
    }
  },
  "status": 200
}

Retrieve single merchant invoice of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/merchant/{merchant-uuid}/merchant-invoice/{uuid}

Scopes

Balance

curl "https://api.nocks.com/api/v2/balance"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "49f27d70-c577-45df-8252-4af5509c0b2b",
            "available": {
                "amount": "100.00",
                "currency": "EUR"
            },
            "reserved": {
                "amount": "0.02",
                "currency": "EUR"
            },
            "total": {
                "amount": "100.02",
                "currency": "EUR"
            },
            "resource": "balance"
        },
        {
            "uuid": "ab79700f-a8d4-44e2-8aac-94665e1318e5",
            "available": {
                "amount": "753.00000000",
                "currency": "NLG"
            },
            "reserved": {
                "amount": "0.00000000",
                "currency": "NLG"
            },
            "total": {
                "amount": "753.00000000",
                "currency": "NLG"
            },
            "resource": "balance"
        }
    ],
    "meta": {
        "pagination": {
            "total": 3,
            "count": 3,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve balances from authorized user

HTTP Request

GET https://api.nocks.com/api/v2/balance

Scopes

Balance get

curl "https://api.nocks.com/api/v2/balance/{currency}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "49f27d70-c577-45df-8252-4af5509c0b2b",
        "available": {
            "amount": "100.01",
            "currency": "EUR"
        },
        "reserved": {
            "amount": "0.02",
            "currency": "EUR"
        },
        "total": {
            "amount": "100.03",
            "currency": "EUR"
        },
        "resource": "balance"
    },
    "status": 200
}

Retrieve balance of a single currency from authorized user

HTTP Request

GET https://api.nocks.com/api/v2/balance/{currency}

Scopes

Balance create

curl "https://api.nocks.com/api/v2/balance"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
       "type": "merchant",
        "currency": "EUR",
        "merchant": "830b49ff-29b7-49c2-9fde-2c184ee6f643"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "a93cfd76-d775-4f20-ae99-9147f190ed74",
        "available": {
            "amount": "0.00",
            "currency": "EUR"
        },
        "reserved": {
            "amount": "0.00",
            "currency": "EUR"
        },
        "total": {
            "amount": "0.00",
            "currency": "EUR"
        },
        "deposit_transaction_reference": "Da93cfd76",
        "type": "merchant",
        "resource": "balance",
        "currency": {
            // Currency resource
        },
        "balanceable": {
            // User or Merchant resource
        }
    },
    "status": 201
}

Create a balance

HTTP Request

POST https://api.nocks.com/api/v2/balance

Scopes

Arguments

Parameter Type Required Description
type string Required trade-cash or merchant
currency string Required Valid Currency code
merchant string Optional (required for merchant type) Valid Merchant UUID

Balance transfer

curl "https://api.nocks.com/api/v2/balance/transfer"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
       "balance_from": "551f3b76-4581-4766-9dde-d1b668462562",
       "balance_to": "3f5a1be9-7f6c-4d46-96de-32a40ed49519",
       "amount": "10"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "75046b28-68cf-489a-a0ac-7d201a32cafb",
        "status": "open",
        "type": "withdrawal",
        "method_type": "deposit",
        "description": "D3f5a1be9",
        "created_at": {
            "datetime": "2018-08-07 13:55:42",
            "timestamp": 1533642942
        },
        "updated_at": {
            "datetime": "2018-08-07 13:55:42",
            "timestamp": 1533642942
        },
        "resource": "payment",
        "amount": {
            "amount": "10.00",
            "currency": "EUR"
        },
        "payment_method": {
            "data": {
                "code": "sepa",
                "name": "SEPA",
                "description": "",
                "amount_minimum": 0.01,
                "amount_maximum": 0,
                "fee_fixed": 0.25,
                "fee_percentage": 0,
                "is_verification_method": true,
                "is_transaction_method": false,
                "is_deposit_method": true,
                "is_withdrawal_method": true,
                "is_refund_method": true,
                "is_default": false,
                "metadata": [],
                "currency": "EUR",
                "resource": "payment-method"
            }
        }
    },
    "status": 201
}

Transfer funds from one balance to another

HTTP Request

POST https://api.nocks.com/api/v2/balance/transfer

Scopes

Arguments

Parameter Type Required Description
balance_from string Required Balance UUID to sent from
balance_to string Required Balance UUID to sent to
amount string Required Amount to transfer

Trade orders

curl "https://api.nocks.com/api/v2/trade-order"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "5f7bda37-5dac-4525-bd72-14df3fbc6f82",
            "amount": {
                "amount": "1.00000000",
                "currency": "NLG"
            },
            "amount_filled": {
                "amount": "0.00000000",
                "currency": "NLG"
            },
            "amount_cost": {
                "amount": "0.00000000",
                "currency": "EUR"
            },
            "amount_fee": {
                "amount": "0.00000000",
                "currency": "NLG"
            },
            "amount_fillable": {
                "amount": "1.00000000",
                "currency": "NLG"
            },
            "rate": "0.01635866",
            "rate_actual": "0.00000000",
            "side": "buy",
            "type": "limit",
            "status": "open",
            "stop": "",
            "stop_hit": "0",
            "stop_rate": "",
            "created_at": {
                "datetime": "2017-06-28 14:18:24",
                "timestamp": 1498659504
            },
            "updated_at": {
                "datetime": "2017-06-28 14:18:24",
                "timestamp": 1498659504
            },
            "cancelled_at": {
                "datetime": "",
                "timestamp": null
            },
            "filled_at": {
                "datetime": "",
                "timestamp": null
            },
            "trade_market": "NLG-EUR",
            "resource": "trade-order"
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve trade orders of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/trade-order

Scopes

Filters

Parameter Type Required Description
trade-market string Optional Available Trade market code
side string Optional buy or sell
status string Optional open, filled or/and cancelled
label string Optional Label you assigned to your orders

Filter example request

GET https://api.nocks.com/api/v2/trade-order?trade-market=NLG-EUR&side=buy&status=filled,cancelled

Trade order get

curl "https://api.nocks.com/api/v2/trade-order/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "5f7bda37-5dac-4525-bd72-14df3fbc6f82",
        "amount": {
            "amount": "1.00000000",
            "currency": "NLG"
        },
        "amount_filled": {
            "amount": "0.00000000",
            "currency": "NLG"
        },
        "amount_cost": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "amount_fee": {
            "amount": "0.00000000",
            "currency": "NLG"
        },
        "amount_fillable": {
            "amount": "1.00000000",
            "currency": "NLG"
        },
        "rate": "0.01635866",
        "rate_actual": "0.00000000",
        "side": "buy",
        "type": "limit",
        "status": "open",
        "stop": "",
        "stop_hit": "0",
        "stop_rate": "",
        "created_at": {
            "datetime": "2017-06-28 14:18:24",
            "timestamp": 1498659504
        },
        "updated_at": {
            "datetime": "2017-06-28 14:18:24",
            "timestamp": 1498659504
        },
        "cancelled_at": {
            "datetime": "",
            "timestamp": null
        },
        "filled_at": {
            "datetime": "",
            "timestamp": null
        },
        "trade_market": "NLG-EUR",
        "resource": "trade-order"
    },
    "status": 200
}

Retrieve single trade order of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/trade-order/{uuid}

Scopes

Trade order create

curl "https://api.nocks.com/api/v2/trade-order"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "trade-market":"NLG-EUR",
        "amount":"1",
        "side":"buy",
        "rate":"0.01635866"
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "5f7bda37-5dac-4525-bd72-14df3fbc6f82",
        "amount": {
            "amount": "1.00000000",
            "currency": "NLG"
        },
        "amount_filled": {
            "amount": "0.00000000",
            "currency": "NLG"
        },
        "amount_cost": {
            "amount": "0.00000000",
            "currency": "EUR"
        },
        "amount_fee": {
            "amount": "0.00000000",
            "currency": "NLG"
        },
        "amount_fillable": {
            "amount": "1.00000000",
            "currency": "NLG"
        },
        "rate": "0.01635866",
        "rate_actual": "0.00000000",
        "side": "buy",
        "type": "limit",
        "status": "open",
        "stop": "",
        "stop_hit": "0",
        "stop_rate": "",
        "created_at": {
            "datetime": "2017-06-28 14:18:24",
            "timestamp": 1498659504
        },
        "updated_at": {
            "datetime": "2017-06-28 14:18:24",
            "timestamp": 1498659504
        },
        "cancelled_at": {
            "datetime": "",
            "timestamp": null
        },
        "filled_at": {
            "datetime": "",
            "timestamp": null
        },
        "trade_market": "NLG-EUR",
        "resource": "trade-order"
    },
    "status": 201
}

Create a trade order

HTTP Request

POST https://api.nocks.com/api/v2/trade-order

Scopes

Arguments

Parameter Type Required Description
trade-market string Required Available Trade market code
amount string Required Amount to buy or sell
side string Required buy or sell
rate string Optional Price per unit, if provided this order will be created as a limit order.
stop string Optional entry or loss
stop_rate string Required with stop Price at which this order will be placed
label string Optional Something to describe this order for yourself (like the name of your trade bot and/or strategy)

Trade order cancel

curl "https://api.nocks.com/api/v2/trade-order/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Cancel a trade order

HTTP Request

DELETE https://api.nocks.com/api/v2/trade-order/{uuid}

Scopes

Bills

curl "https://api.nocks.com/api/v2/bill"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": [
        {
            "uuid": "4dcc516a-1e02-441e-be01-dfccba074784",
            "name": "John Doe",
            "address": "NL16ABNA0602167736",
            "amount": {
                "amount": "250.00000000",
                "currency": "EUR"
            },
            "date_start": "2017-06-30",
            "date_end": "2018-06-30",
            "date_next": "2017-06-30",
            "frequence": "month",
            "description": "Rent",
            "metadata": {
                "house_number": "106"
            },
            "payment_reference": null,
            "payment_method": {
                "method": "ideal",
                "metadata": {
                    "issuer": "ABNANL2A"
                }
            },
            "created_at": {
                "datetime": "2017-06-29 07:31:48",
                "timestamp": 1498721508
            },
            "updated_at": {
                "datetime": "2017-06-29 07:31:48",
                "timestamp": 1498721508
            },
            "resource": "bill",
            "contact_address": {
                "data": {
                    "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
                    "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
                    "address": "NL16ABNA0602167736",
                    "currency": "EUR",
                    "description": "Savings account",
                    "created_at": {
                        "datetime": "2017-06-28 12:08:27",
                        "timestamp": 1498651707
                    },
                    "updated_at": {
                        "datetime": "2017-06-28 12:10:20",
                        "timestamp": 1498651820
                    },
                    "resource": "contact-address"
                }
            }
        },
        ...
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    },
    "status": 200
}

Retrieve bills of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/bill

Scopes

Bill get

curl "https://api.nocks.com/api/v2/bill/{uuid}"
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "4dcc516a-1e02-441e-be01-dfccba074784",
        "name": "John Doe",
        "address": "NL16ABNA0602167736",
        "amount": {
            "amount": "250.00000000",
            "currency": "EUR"
        },
        "date_start": "2017-06-30",
        "date_end": "2018-06-30",
        "date_next": "2017-06-30",
        "frequence": "month",
        "description": "Rent",
        "metadata": {
            "house_number": "106"
        },
        "payment_reference": null,
        "payment_method": {
            "method": "ideal",
            "metadata": {
                "issuer": "ABNANL2A"
            }
        },
        "created_at": {
            "datetime": "2017-06-29 07:31:48",
            "timestamp": 1498721508
        },
        "updated_at": {
            "datetime": "2017-06-29 07:31:48",
            "timestamp": 1498721508
        },
        "resource": "bill",
        "contact_address": {
            "data": {
                "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
                "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
                "address": "NL16ABNA0602167736",
                "currency": "EUR",
                "description": "Savings account",
                "created_at": {
                    "datetime": "2017-06-28 12:08:27",
                    "timestamp": 1498651707
                },
                "updated_at": {
                    "datetime": "2017-06-28 12:10:20",
                    "timestamp": 1498651820
                },
                "resource": "contact-address"
            }
        }
    },
    "status": 200
}

Retrieve single bill of authorized user

HTTP Request

GET https://api.nocks.com/api/v2/bill/{uuid}

Scopes

Bill create

curl "https://api.nocks.com/api/v2/bill"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "name": "John Doe",
        "frequence": "month",
        "currency": "EUR",
        "address": "NL16ABNA0602167736",
        "date_start": "2017-06-30",
        "date_end": "2018-06-30",
        "description": "Rent",
        "amount": {
            "amount": "250.00",
            "currency": "EUR"
        },
        "payment_method": {
            "method":"ideal",
            "metadata":{
                "issuer":"ABNANL2A"
            }
        },
        "metadata": {
            "house_number": "106"
        }
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "4dcc516a-1e02-441e-be01-dfccba074784",
        "name": "John Doe",
        "address": "NL16ABNA0602167736",
        "amount": {
            "amount": "250.00000000",
            "currency": "EUR"
        },
        "date_start": "2017-06-30",
        "date_end": "2018-06-30",
        "date_next": "2017-06-30",
        "frequence": "month",
        "description": "Rent",
        "metadata": {
            "house_number": "106"
        },
        "payment_reference": null,
        "payment_method": {
            "method": "ideal",
            "metadata": {
                "issuer": "ABNANL2A"
            }
        },
        "created_at": {
            "datetime": "2017-06-29 07:31:48",
            "timestamp": 1498721508
        },
        "updated_at": {
            "datetime": "2017-06-29 07:31:48",
            "timestamp": 1498721508
        },
        "resource": "bill",
        "contact_address": {
            "data": {
                "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
                "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
                "address": "NL16ABNA0602167736",
                "currency": "EUR",
                "description": "Savings account",
                "created_at": {
                    "datetime": "2017-06-28 12:08:27",
                    "timestamp": 1498651707
                },
                "updated_at": {
                    "datetime": "2017-06-28 12:10:20",
                    "timestamp": 1498651820
                },
                "resource": "contact-address"
            }
        }
    },
    "status": 201
}

Create a bill

HTTP Request

POST https://api.nocks.com/api/v2/bill

Scopes

Arguments

Parameter Type Required Description
type string Optional send or receive (default send)
name string Required Name of receiving person or company
frequence string Required One of the following values: now, once, day, week, month, year
currency string Optional Valid Currency code
address string Required without merchant_profile Valid receiving address
merchant_profile string Optional Valid Merchant profile uuid
date_start string Required Starting date of this bill in date format YYYY-MM-DD
date_end string Optional Ending date of this (recurring) bill in date format YYYY-MM-DD
amount array Required Amount to transact
payment_method array Optional Transaction able Payment method
metadata array Optional Additional data for own reference
redirect_url url Optional Redirect URL after payment is completed
callback_url url Optional Will be called when the transaction updates with a POST value of the transaction UUID
locale string Optional Valid Locatization code
description string Optional Short description (max. 255 characters)
payment_reference string Optional 16 digit payment reference
fee_type string Optional Charge fee on source or target payment
recipient_name string Optional Name of the recipient
recipient_address string Required when recipient_address_type is not manual E-mail or mobile phone number of recipient
recipient_address_type string Required when type is receive manual, mobile, mail

Bill update

curl "https://api.nocks.com/api/v2/bill/{uuid}"
    -X POST
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -d '{
        "amount": {
            "amount": "275.00",
            "currency": "EUR"
        }
    }'

The above command returns JSON structured like this:

{
    "data": {
        "uuid": "4dcc516a-1e02-441e-be01-dfccba074784",
        "name": "John Doe",
        "address": "NL16ABNA0602167736",
        "amount": {
            "amount": "275.00000000",
            "currency": "EUR"
        },
        "date_start": "2017-06-30",
        "date_end": "2018-06-30",
        "date_next": "2017-06-30",
        "frequence": "month",
        "description": "Rent",
        "metadata": {
            "house_number": "106"
        },
        "payment_reference": null,
        "payment_method": {
            "method": "ideal",
            "metadata": {
                "issuer": "ABNANL2A"
            }
        },
        "created_at": {
            "datetime": "2017-06-29 07:31:48",
            "timestamp": 1498721508
        },
        "updated_at": {
            "datetime": "2017-06-29 07:42:59",
            "timestamp": 1498722179
        },
        "resource": "bill",
        "contact_address": {
            "data": {
                "uuid": "7b689e8d-f9f5-4151-868e-a8c3e4da56b0",
                "contact": "7864ab2f-7d6a-4384-b633-fa793c130392",
                "address": "NL16ABNA0602167736",
                "currency": "EUR",
                "description": "Savings account",
                "created_at": {
                    "datetime": "2017-06-28 12:08:27",
                    "timestamp": 1498651707
                },
                "updated_at": {
                    "datetime": "2017-06-28 12:10:20",
                    "timestamp": 1498651820
                },
                "resource": "contact-address"
            }
        }
    },
    "status": 200
}

Update a bill

HTTP Request

PUT https://api.nocks.com/api/v2/bill/{uuid}

Scopes

Arguments

Parameter Type Required Description
name string Required Name of receiving person or company
frequence string Required One of the following values: once, day, week, month, year
currency string Required Valid Currency code
address string Required Valid receiving address
date_start string Required Starting date of this bill in date format YYYY-MM-DD
date_end string Optional Ending date of this (recurring) bill in date format YYYY-MM-DD
amount array Required Amount to transact
payment_method array Optional Transaction able Payment method
metadata array Optional Additional data for own reference
redirect_url url Optional Redirect URL after payment is completed
callback_url url Optional Will be called when the transaction updates with a POST value of the transaction UUID
locale string Optional Valid Locatization code
description string Optional Short description (max. 255 characters)
payment_reference string Optional 16 digit payment reference
fee_type string Optional Charge fee on source or target payment

Bill delete

curl "https://api.nocks.com/api/v2/bill/{uuid}"
    -X DELETE
    -H 'Authorization: Bearer {token}'
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'

Delete a bill

HTTP Request

DELETE https://api.nocks.com/api/v2/bill/{uuid}

Scopes

WebSocket API

What is WebSocket?

WebSocket is a protocol providing full-duplex communications channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C.

How to connect?

Example code to connect with Pusher:

var Pusher = require('pusher-client');

var pusher = new Pusher('0f7508884e879b116714', {
    cluster: 'eu',
    encrypted: true,
    authEndpoint : 'https://www.nocks.com/broadcasting/oauth', // Required for private channels
    auth: {
        headers: {
            'Authorization': 'Bearer {token}'  // Required for private channels
        }
    }
});

Example code to listen to broadcasts:

channel = pusher.subscribe('{channel}');
channel.bind('{event}', function (data) {
    console.log(data);
});

Nocks uses Pusher for real time websocket streaming. Please refer to the Pusher documentation and libraries to connect to our websocket stream.

Environment Pusher app key Cluster Auth URL
Production 0f7508884e879b116714 eu https://www.nocks.com/broadcasting/oauth
Sandbox 83a55cbb082c74ad7923 eu https://sandbox.nocks.com/broadcasting/oauth

Public channels

Public channels don’t require a authEndpoint or auth header in the Pusher client config.

Trade market

Broadcast returns JSON structured like this:

{
    "code": "NLG-EUR",
    "last": "0.1459",
    "volume": "174272.1410",
    "low": "0.1408",
    "high": "0.1552",
    "buy": "0.1443",
    "sell": "0.1459"
}

Retrieve updates on trade market stats.

Channel Event
trade-market.{code} trade-market.update

Trade market book

Broadcast returns JSON structured like this:

{
    "rate": "0.1460",
    "size": "3012.8844",
    "total": "439.8811",
    "sum": "566.8811",
    "base_sum": "3883.3436"
}

Retrieve updates on order book rows.

Channel Event
trade-market.{code}.book.{buy/sell} trade-market.book.update

Trade market candle

Broadcast returns JSON structured like this:

{
    "code": "NLG-EUR",
    "timestamp": 1525337100,
    "volume": "5.305",
    "quote_volume": "10.0249",
    "base_volume": "5.305",
    "average": "0.1254",
    "open": "0.1221",
    "high": "0.1460",
    "low": "0.1032",
    "close": "0.1538",
    "interval": 900
}

Retrieve updates on trade market candles (OHLC).

Channel Event
trade-market.{code}.candle.{interval} trade-market.candle.update

Available intervals are:

Trade market order

Broadcast returns JSON structured like this:

{
    "uuid": "9beba3ae-4755-4f06-82be-60b2a3452926",
    "amount": "10.0000",
    "rate": "0.1450",
    "cost": "1.4500",
    "side": "buy",
    "fee": "0.0000",
    "eur_value": "1.4500",
    "liquidity": "taker",
    "timestamp": "1514473189",
    "trade_market": "NLG-EUR",
    "created_at": {
        "datetime": "2017-12-28 15:59:49",
        "timestamp": 1514473189
    },
    "updated_at": {
        "datetime": "2017-12-28 15:59:49",
        "timestamp": 1514473189
    },
    "resource": "trade-order-transaction"
}

Retrieve updates on market history

Channel Event
trade-market.{code}.trade-order-transaction trade-order-transaction.create

Private channels

Private channels require a authEndpoint and auth header in the Pusher client config.

Notification

Broadcast returns JSON structured like this:

{
    "message_type": "warning",
    "title": "Title of the notification",
    "message": "Message of the notification",
    "data": {},
    "id": "{notification-id}",
    "type": "{notification-type}"
}

Retrieve notifications

Channel Event
private-user.{user-uuid} notification

Balance

Broadcast returns JSON structured like this:

{
    "name": "Euro",
    "code": "EUR",
    "amount": "100.95",
    "reserved": "0.00"
}

Retrieve balance updates

Channel Event
private-balance.{user-uuid} balance.update

Scopes

Trade order

Broadcast returns JSON structured like this:

{
    "uuid": "1bbb246a-459c-4876-a44b-047c56c1b7af",
    "amount": {
        "amount": "10.0000",
        "currency": "NLG"
    },
    "amount_filled": {
        "amount": "0.0000",
        "currency": "NLG"
    },
    "amount_cost": {
        "amount": "0.0000",
        "currency": "EUR"
    },
    "amount_fee": {
        "amount": "0.0000",
        "currency": "NLG"
    },
    "amount_fillable": {
        "amount": "0.0000",
        "currency": "NLG"
    },
    "rate": "1.0000",
    "rate_actual": "0.0000",
    "label": "",
    "side": "buy",
    "type": "limit",
    "status": "cancelled",
    "stop": "",
    "stop_rate": "0.0000",
    "stop_hit": "0",
    "created_at": {
        "datetime": "2018-05-03 10:13:17",
        "timestamp": 1525335197
    },
    "updated_at": {
        "datetime": "2018-05-03 10:13:32",
        "timestamp": 1525335212
    },
    "cancelled_at": {
        "datetime": "2018-05-03 10:13:31",
        "timestamp": 1525335211
    },
    "filled_at": {
        "datetime": "2018-05-03 10:13:32",
        "timestamp": 1525335212
    },
    "trade_market": "NLG-EUR",
    "resource": "trade-order"
}

Retrieve trade order updates

Channel Event
private-trade-order.{user-uuid} trade-order.create
private-trade-order.{user-uuid} trade-order.update

Scopes

Payment

Broadcast returns JSON structured like this:

{
    "uuid": "cf746fc8-c162-4b79-b981-6266f02f86c8",
    "status": "pending",
    "type": "transaction-source",
    "method_type": "redirect",
    "description": "cf746fc8 Transaction",
    "created_at": {
        "datetime": "2017-06-28 11:04:27",
        "timestamp": 1498647867
    },
    "updated_at": {
        "datetime": "2017-06-28 11:04:28",
        "timestamp": 1498647868
    },
    "resource": "payment",
    "amount": {
        "amount": "25.99",
        "currency": "EUR"
    },
    "metadata": {
        "url": "https://api.nocks.com/payment/url/cf746fc8-c162-4b79-b981-6266f02f86c8"
    }
}

Retrieve payment updates

Channel Event
private-payment.{user-uuid} payment.update

Scopes

Transaction

Broadcast returns JSON structured like this:

{
  "uuid": "82132988-12e2-4ef0-a289-99b1498ae590",
  "status": "open",
  "amount": {
    "amount": "10.00",
    "currency": "EUR"
  },
  "source_amount": {
    "amount": "10.00",
    "currency": "EUR"
  },
  "target_amount": {
    "amount": "97.0000",
    "currency": "NLG"
  },
  "received_amount": {
    "amount": "0.00",
    "currency": "EUR"
  },
  "tip_amount": null,
  "target_address": "TYGbdcZ8L6dUb5LFY6ZP1LtxVW3r9BMQCn",
  "refund_address": "",
  "description": "",
  "redirect_url": "",
  "callback_url": "",
  "metadata": [],
  "locale": "en",
  "expire_at": {
    "datetime": "2018-05-17 14:45:56",
    "timestamp": 1526561156
  },
  "merchant_profile": null,
  "merchant_clearing": null,
  "created_at": {
    "datetime": "2018-05-17 14:15:56",
    "timestamp": 1526559356
  },
  "updated_at": {
    "datetime": "2018-05-17 14:15:56",
    "timestamp": 1526559356
  },
  "resource": "transaction"
}

Retrieve transaction updates

Channel Event
private-transaction.{user-uuid} transaction.update

Scopes