Paymium API (1.1.1)

Download OpenAPI specification:Download

General information

The Paymium API allows developers to extend the capabilities of the Paymium platform, from reading the latest ticker to automating trades with bots.

It is possible to, among other things:

  • Access public data (ticker, asks, bids, trades, etc...)
  • Authenticate users with their permission using OAuth2 *
  • Access authenticated user balances, trades, and other data *
  • Automate trading *

* Authenticating users is only available to developers that have a fully verified and approved Paymium account. On the other hand, public data is available to everyone.

API Changes

The official changelog is currently on GitHub. You can be notified of the latest changes by watching our official documentation repository.

Formats and required HTTP request headers

The API will only answer with JSON or empty responses. It expects parameters to be passed in JSON with the correct Content-Type: application/json being set.

Localization

The relevant results and error messages will be localized to the language associated to the user, currently English and French are supported.

Datetime formats

Datetime values will be returned as regular JSON format and Unix timestamps, the timestamps are suffixed with _int.

Error handling

Whenever an error is encountered, the answer to a JSON API call will have:

  • An HTTP 422 status (Unprocessable entity) or HTTP 400 (Bad request)
  • A JSON array of localized error messages in the errors attribute of the response body

Example

  {
    "errors": [
    "Operations account operations amount is greater than your available balance (1781.96 EUR)"
    "Amount can't be greater than your limit (1781.96 EUR)"
    ]
  }

Authentication

ApiKey

Api-key is the token that is displayed when listing your currently active tokens must be used with Api-Signature and Api-Nonce.

Security Scheme Type: API Key
Header parameter name: Api-Key

ApiSignature

Api-Signature is the hexdigest of the HMAC-SHA256 hash of the nonce concatenated with the full URL and body of the HTTP request, encoded using your API secret key. Must be used with Api-Key and Api-Nonce

Security Scheme Type: API Key
Header parameter name: Api-Signature

ApiNonce

The nonce is a positive integer number that must increase with every request you make. Must be used with Api-key and Api-Signature

Security Scheme Type: API Key
Header parameter name: Api-Nonce

OAuth2

Security Scheme Type: OAuth2
Flow type: authorizationCode
Token URL: https://paymium.com/api/oauth/token
Scopes:
  • basic -

    Read account number, language, and balances (default)

  • activity -

    Read trade orders, deposits, withdrawals, and other operations

  • trade -

    Create and cancel trade orders

  • withdraw -

    Request EUR and BTC withdrawals (requires email confirmation from users upon withdrawing)

  • payment_request -

    Used to requesting money by e-mail

  • deposit -

    List bitcoin deposit addresses and create a new one if needed

  • merchant -

    Create and manage an account's invoices

Successful calls

If the API call was successful, the platform will answer with:

  • An HTTP 200 status (OK) or HTTP 201 (Created),
  • A JSON representation of the entity being created or updated if relevant

Rate-limiting

API calls are rate-limited by IP to 86400 calls per day (one per second on average). Information about the status of the limit can be found in the X-RateLimit-Limit and X-RateLimit-Remaining HTTP headers.

Example response with rate-limit headers

HTTP/1.1 200
Content-Type: application/json; charset=utf-8
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4982
Date: Wed, 30 Jan 2013 12:08:58 GMT

Examples

Examples in the documentation are using the ccxt library, which supports Paymium's API and is available for Python, JavaScript and PHP.

Installation instructions can be found on GitHub.

Public data

Public data (ticker, asks, bids, trades) can be accessed without authentication.

Get countries

Get list of countries

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.publicGetCountries())
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Get currencies

Get list of currencies

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.publicGetCurrencies())
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Get OHLCV

Read open high low close volume data

path Parameters
currency
required
string
Value: "eur"
query Parameters
interval
string
Enum: "1m" "3m" "5m" "15m" "30m" "1h" "2h" "4h" "6h" "8h" "12h" "1d" "3d" "1w" "1M"

Interval between each ohlcv compute. Iteration can not exceed 1000 (default 500)

startTime
integer

Number of seconds since the Unix Epoch of the oldest ohlcv to fetch. Can be filled if endTime is filled too.

endTime
integer

Number of seconds since the Unix Epoch of the last ohlcv to fetch. Can be filled if startTime is filled too.

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
let paymium = new ccxt.paymium({
apiKey: 'YOUR_PUBLIC_API_KEY',
secret: 'YOUR_SECRET_PRIVATE_KEY',
})

console.log(paymium.id, await paymium.fetchOHLCV("eur","1m",undefined,undefined))
})();

Response samples

Content type
application/json; charset=utf-8
[
  • 1615816800000,
  • "47440.0",
  • "50000.0",
  • "42000.0",
  • "43000.0",
  • "0.05321696"
]

Get latest ticker data

Read latest ticker data

path Parameters
currency
required
string
Enum: "eur" "btc"

Responses

Request samples

'use strict';
const ccxt = require('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.publicGetDataCurrencyTicker({ "currency": "eur" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "high": "45998.99",
  • "low": "37210.0",
  • "volume": "39.77651173",
  • "bid": "40600.0",
  • "ask": "40783.75",
  • "midpoint": "40691.875",
  • "vwap": "40509.86537845",
  • "at": 1619184394,
  • "price": "40600.0",
  • "open": "45998.99",
  • "variation": "-11.7372",
  • "currency": "EUR",
  • "trade_id": "0a31a001-2deb-48f1-b413-f1a31a9f97c1",
  • "size": "0.0052"
}

List latest trades

Read the latest executed trades

path Parameters
currency
required
string
Enum: "eur" "btc"
query Parameters
since
integer

Number of seconds since the Unix Epoch of the oldest trade to fetch.

Responses

Request samples

'use strict';
const ccxt = require('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.publicGetDataCurrencyTrades({ "currency": "eur" }))
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Get market depth

Read the market depth, bids and asks are grouped by price.

path Parameters
currency
required
string
Enum: "eur" "btc"

Responses

Request samples

'use strict';
const ccxt = require('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.publicGetDataCurrencyDepth({ "currency": "eur" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "bids": [
    ],
  • "asks": [
    ]
}

User

Get user info

Read the latest user info.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateGetUser())
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "name": "BC-U123456",
  • "email": "string",
  • "locale": "en",
  • "channel_id": "string",
  • "meta_state": "string",
  • "balance_eur": "1893.96",
  • "locked_eur": "300.00743886",
  • "balance_btc": "25.78866278",
  • "locked_btc": "1.0",
  • "balance_lbtc": "0.8",
  • "locked_lbtc": "0.5",
  • "balance_bch": "0.0",
  • "locked_bch": "0.0",
  • "balance_eth": "0.0",
  • "locked_eth": "0.0",
  • "balance_ltc": "0.0",
  • "locked_ltc": "0.0",
  • "balance_bcio": "0.0",
  • "locked_bcio": "0.0",
  • "balance_bat": "0.0",
  • "locked_bat": "0.0",
  • "balance_dai": "0.0",
  • "locked_dai": "0.0",
  • "balance_etc": "0.0",
  • "locked_etc": "0.0"
}

List deposit addresses

Retrieve your Bitcoin deposit addresses along with their expiration timestamp.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateGetUserAddresses())
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Create deposit address

Create a new deposit address unless 5 other one are already active. Currencies available are the ones which support a deposit.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
currency
string
Example: currency=BTC

The currency for which the deposit address will be created

label
string
Example: label=Savings

A label for the wallet address

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privatePostUserAddresses({ currency: 'BTC' }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
  • "valid_until": 1620041926,
  • "label": "Savings",
  • "currency": "BTC"
}

Get deposit address

Retrieve details for a single address

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
path Parameters
address
required
string
Example: 1FPDBXNqSkZMsw1kSkkajcj8berxDQkUoc

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateGetUserAddressesAddress({"address": "1HdjGr5WCHcnmW1tNNsHX7fh4Jr6C3PeKe" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
  • "valid_until": 1620041926,
  • "label": "Savings",
  • "currency": "BTC"
}

Order

List orders

List user'orders (market or limit)

In previous API versions, this endpoint was also used to read other types of transfers, this is no longer the case.

There are two types of pagination (exclusive) :

  • one that works with an offset/limit window (enabled if offset is set)
  • and another based on a page number and a number of items per_page (enabled by default or when per_page is set)

Pagination is not eligible for active orders (orders in order book).

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
active
boolean

only show active orders

offset
integer
Default: 0

pagination offset (must be set to enable offset/limit pagination)

limit
integer
Default: 50
Examples:
  • limit=20 - To list 20 orders from the second order (set 'offset' to 2)

pagination limit

page
integer >= 1
Default: 1

Page number

per_page
integer [ 5 .. 100 ]
Default: 20

Item per page

types
Array of strings
Deprecated
Items Enum: "LimitOrder" "MarketOrder" "BitcoinDeposit" "WireDeposit" "Payment" "EmailTransfer" "EmailDeposit"

(see filter by types

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateGetUserOrders())
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Create order

Create an order

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
Request Body schema: application/json
required
type
string
Enum: "LimitOrder" "MarketOrder"
currency
string

must be EUR

direction
string
Enum: "buy" "sell"
price
number

price per BTC, must be omitted for market orders

amount
number or null

BTC amount to trade. Either one of amount or currency_amount must be specified. When the amount is specified, the engine will buy or sell this amount of Bitcoins. When the currency_amount is specified, the engine will buy as much Bitcoins as possible for currency_amount or sell as much Bitcoins as necessary to obtain currency_amount.

currency_amount
number or null

Currency amount to trade. Either one of amount or currency_amount must be specified. When the amount is specified, the engine will buy or sell this amount of Bitcoins. When the currency_amount is specified, the engine will buy as much Bitcoins as possible for currency_amount or sell as much Bitcoins as necessary to obtain currency_amount.

Responses

Request samples

Content type
application/json
{
  • "type": "LimitOrder",
  • "currency": "string",
  • "direction": "buy",
  • "price": 1,
  • "amount": 0.001,
  • "currency_amount": 0
}

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
  • "currency_amount": "string",
  • "state": "executed",
  • "btc_fee": "0.0",
  • "currency_fee": "0.0",
  • "created_at": "2013-10-24T10:34:37Z",
  • "updated_at": "2013-10-24T10:34:37Z",
  • "currency": "BTC",
  • "comment": "string",
  • "amount": "1.0",
  • "type": "BitcoinTransfer",
  • "traded_btc": "string",
  • "traded_currency": "string",
  • "direction": "buy",
  • "price": "string",
  • "account_operations": [
    ]
}

Get order

Read details from a specific order.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
path Parameters
uuid
required
string
Example: d64e6450-bf17-44a7-9bc1-bb830610293a

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateGetUserOrdersUuid({ "uuid": "20f8dd15-ae87-4617-a353-d0996be60010" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
  • "currency_amount": "string",
  • "state": "executed",
  • "btc_fee": "0.0",
  • "currency_fee": "0.0",
  • "created_at": "2013-10-24T10:34:37Z",
  • "updated_at": "2013-10-24T10:34:37Z",
  • "currency": "BTC",
  • "comment": "string",
  • "amount": "1.0",
  • "type": "BitcoinTransfer",
  • "traded_btc": "string",
  • "traded_currency": "string",
  • "direction": "buy",
  • "price": "string",
  • "account_operations": [
    ]
}

Cancel order

Only active trade orders and email transfers may be canceled (an email notification will be sent)

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
path Parameters
uuid
required
string
Example: d64e6450-bf17-44a7-9bc1-bb830610293a

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privateDeleteUserOrdersUuid({ "uuid": "20f8dd15-ae87-4617-a353-d0996be60010" }))
})();

Transfer

Create withdrawal

Request BTC or fiat withdrawals. A confirmation is sent by email to the user before it can be executed.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
currency
required
string
Enum: "BTC" "EUR"
Example: currency=EUR
amount
required
number
Example: amount=0.001

amount to transfer

address
string

BTC address if withdrawing BTC

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privatePostUserWithdrawals({ "currency": "BTC", "amount": "1.0", "withdrawal_address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
  • "currency_amount": "string",
  • "state": "executed",
  • "btc_fee": "0.0",
  • "currency_fee": "0.0",
  • "created_at": "2013-10-24T10:34:37Z",
  • "updated_at": "2013-10-24T10:34:37Z",
  • "currency": "BTC",
  • "comment": "string",
  • "amount": "1.0",
  • "type": "BitcoinTransfer",
  • "traded_btc": "string",
  • "traded_currency": "string",
  • "direction": "buy",
  • "price": "string",
  • "account_operations": [
    ]
}

List withdrawals

List withdrawals

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
page
integer >= 1
Default: 1

Page number

per_page
integer [ 5 .. 100 ]
Default: 20

Item per page

currencies
Array of strings
Items Enum: "BTC" "EUR"

Responses

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Create email transfer

Initiate a money transfer to an e-mail address. The transfer is immediately executed if the user have a valid account. Otherwise, an e-mail is sent with a registration invitation. This transfer expire after 1 month if it is not collected. In this case, the order is cancelled and the sender re-credited.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
amount
number

amount to transfer

currency
string
Enum: "BTC" "EUR"
email
string

an e-mail address

comment
string

a small note explaining the transfer

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privatePostUserEmailTransfers({ "currency": "BTC", "amount": "1.0", "email": "johnsmith@example.com", "comment": "For your savings" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
  • "currency_amount": "string",
  • "state": "executed",
  • "btc_fee": "0.0",
  • "currency_fee": "0.0",
  • "created_at": "2013-10-24T10:34:37Z",
  • "updated_at": "2013-10-24T10:34:37Z",
  • "currency": "BTC",
  • "comment": "string",
  • "amount": "1.0",
  • "type": "BitcoinTransfer",
  • "traded_btc": "string",
  • "traded_currency": "string",
  • "direction": "buy",
  • "price": "string",
  • "account_operations": [
    ]
}

Create payment request

This functionality allows one to create a payment request that is sent by e-mail to the designated recipient, when the link contained in the e-mail is clicked, the recipient is presented with a Bitcoin address to which he is instructed to direct his payment. Once the Bitcoin payment is confirmed, the payee is credited in the originally requested currency.

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
currency
string
Enum: "BTC" "EUR"
amount
number

amount to transfer

email
string

an e-mail address

payment_split
number

Percentage of the payment the merchant will get in currency expressed as a two-decimal places float between 0 and 1 (required). Warning, when one request bitcoin, payment split must be 0.

comment
string

a small note explaining the transfer

Responses

Request samples

'use strict';
const ccxt = require ('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
  })

  console.log(paymium.id, await paymium.privatePostUserPaymentRequests({ "currency": "BTC", "amount": "0.001", "email": "johnsmith@example.com", "comment": "For the restaurant", "payment_split": "0" }))
})();

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Merchant

The Merchant API enables merchants to securely sell goods and services and get paid in Bitcoin. The API makes it possible for the merchant to completely eliminate the risk of market fluctuations when requesting to receive fiat currency in their account. It is also possible to keep a part of the payment in Bitcoin without having it converted at a guaranteed rate. The API allows developers to integrate Bitcoin payments very tightly into their platforms, pre-packaged plugins are also available for a growing list of popular e-commerce frameworks. For merchants that have very simple needs payment buttons are also available, these buttons remove the integration completely by allowing merchants to simply include a code snippet on a static HTML page, or on a blog to receive fixed-amount payments.

Payment creation

Authentication

The 'merchant token' authentication mechanism has been removed please use an API token or an OAuth2 token instead with the 'merchant' scope.

Description

A payment is created by a merchant platform when the customer chooses Bitcoin as his desired checkout option. The merchant platform can then :

  • display the payment Bitcoin address on his own web interface,
  • include the Paymium web interface url in an iframe in order to display a payment pop-up as an overlay,
  • redirect the buyer to the payement's URL (see below), in this case the payment is displayed on a separate screen To display the payment request to the user, the https://paymium.com/invoice/{UUID} can be used, this is used by the e-commerce framework plugins. invoice

Once the payment request is displayed, the customer has 15 minutes to send the appropriate amount. Paymium notifies the merchant of the completion of his payment via the associated callback (for which an URL may be provided when creating the payment request), once one Bitcoin confirmation for the payment is received the funds are credited to the merchant's account, a callback notification is then made.

Create merchant payment

Create merchant payment

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
query Parameters
amount
required
number
Example: amount=0.001

amount requested for the payment

payment_split
required
number
Example: payment_split=0.5

Percentage of the payment the merchant will get in currency expressed as a two-decimal places float between 0 and 1

currency
required
string
Enum: "BTC" "EUR"
callback_url
string
Example: callback_url=http://myonlineshop/payments/order-987978/callback

Merchant callback URL, it is called when the state of the payment changes

redirect_url
string
Example: redirect_url=http://myonlineshop/payments/order-987978/success

URL to which the customer should be redirected at upon payment

cancel_url
string
Example: cancel_url=http://myonlineshop/payments/order-987978/cancel

URL to which the customer should be redirected when cancelling

merchant_reference
string
Example: merchant_reference=order-987978

Arbitrary merchant data associated to the payment

Responses

Request samples

'use strict';
const ccxt = require('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.privatePostMerchantCreatePayment({
    "amount": "0.0001",
    "payment_split": "0",
    "currency": "BTC",
    "callback_url": "https://myonlineshop/payments/order-987978/callback",
    "redirect_url": "http://myonlineshop/payments/order-987978/success",
    "merchant_reference": "order-987978"
  }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "8f60c9df-76da-4618-906d-52af659baddf",
  • "currency": "BTC",
  • "payment_split": 0,
  • "state": "pending_payment",
  • "merchant_name": "PM-U24582195",
  • "expires_at": 1619449070,
  • "merchant_reference": "order-987978",
  • "amount": "0.0001",
  • "btc_amount": "0.0001",
  • "payment_address": "1H7X3bH8r5snj8vqXRCPnQ8Ewn6AHfVd9j",
  • "created_at": 1619447270,
  • "updated_at": 1619447270,
  • "account_operations": {
    }
}

Get merchant payment

Get merchant payment

Authorizations:
(ApiKeyApiSignatureApiNonce) OAuth2
path Parameters
uuid
required
string
Example: 458f4580-e26c-4ad8-8bcd-874d23d55296

payment identifier

Responses

Request samples

'use strict';
const ccxt = require('ccxt');

(async function () {
  let paymium = new ccxt.paymium({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_PRIVATE_API_KEY',
  })

  console.log(paymium.id, await paymium.privateGetMerchantGetPaymentUuid({ "uuid": "0a31a001-2deb-48f1-b413-f1a31a9f97c1" }))
})();

Response samples

Content type
application/json; charset=utf-8
{
  • "uuid": "8f60c9df-76da-4618-906d-52af659baddf",
  • "currency": "BTC",
  • "payment_split": 0,
  • "state": "pending_payment",
  • "merchant_name": "PM-U24582195",
  • "expires_at": 1619449070,
  • "merchant_reference": "order-987978",
  • "amount": "0.0001",
  • "btc_amount": "0.0001",
  • "payment_address": "1H7X3bH8r5snj8vqXRCPnQ8Ewn6AHfVd9j",
  • "created_at": 1619447270,
  • "updated_at": 1619447270,
  • "account_operations": {
    }
}

WebSocket

Overview

A socket.io endpoint is available to receive public data. This allows you to receive new data without having to poll the server. The socket.io socket will emit a stream event when new data is available. The received JSON data contains one or more of the properties listed below, depending on what was updated.

Socket.io configuration

Socket.io must connect to https://paymium.com/<public or user> and the path option must be set to /ws/socket.io.

Node.js example

Assuming you have node.js installed, you can install the socket.io client library by running npm install socket.io-client. The code below shows how to connect to the Paymium socket, and outputs any received data to the console.

  var io = require('socket.io-client');

  var socket = io.connect('https://paymium.com/public', {
  path: '/ws/socket.io'
  });

  console.log('CONNECTING');

  socket.on('connect', function() {
  console.log('CONNECTED');
  console.log('WAITING FOR DATA...');
  });

  socket.on('disconnect', function() {
  console.log('DISCONNECTED');
  });

  socket.on('stream', function(data) {
    console.log('GOT DATA:');
    console.log(data);
  });

Websockets are implemented using socket.io v1.3.

Public socket

Subscribing

You must connect your socket.io client to paymium.com/public, setting the path option to /ws/socket.io. When new data is available, a stream event is triggered.

NodeJS example

  var io = require('socket.io-client');

  var socket = io.connect('https://paymium.com/public', {
  path: '/ws/socket.io'
  });

  console.log('CONNECTING');

  socket.on('connect', function() {
  console.log('CONNECTED');
  console.log('WAITING FOR DATA...');
  });

  socket.on('disconnect', function() {
  console.log('DISCONNECTED');
  });

  socket.on('stream', function(publicData) {
  console.log('GOT DATA:');
  console.log(publicData);
  });

Public data

The stream event will emit an object when new data is available. The object will have properties only for the data that changed.

publicData.ticker

If the ticker changed, publicData.ticker will contains the new ticker information. Example:

  {
  ticker: {
    high: "275",
    low: "275",
    volume: "0.10909089",
    bid: "205",
    ask: "275",
    midpoint: "240",
    vwap: "275",
    at: 1446464202,
    price: "275",
    open: "270",
    variation: "1.8519",
    currency: 'EUR',
    trade_id: '460aff60-8fff-4fb0-8be5-2f8dc67758c2'
    }
  }

publicData.trades

If new trades are executed, publicData.trades will be an array containing the new trades. Example:

  {
      trades: [
          {
          price: "275",
          traded_btc: "0.03636363",
          timestamp: 1446464202000,
          currency: 'EUR'
          }
      ]
  }

publicData.bids

If buy orders have changed (created, changed, or deleted), publicData.bids will be an array containing the modified orders. Orders are aggregated by price. If amount is 0, there are no more orders at this price. Example:

  {
      bids: [
          {
              timestamp: 1424208720,
              amount: "17.43992373",
              price: "265",
              currency: 'EUR'
          }
      ]
  }

publicData.asks

If sell orders have changed (created, changed, or deleted), publicData.asks will be an array containing the modified orders. Orders are aggregated by price. If amount is 0, there are no more orders at this price. Example:

  {
      asks: [
          {
              timestamp: 1424208720,
              amount: 17.43992373,
              price: 275,
              currency: 'EUR'
          }
      ]
  }

User socket

Subscribing

You must connect your socket.io client to https://paymium.com/user, setting the path option to /ws/socket.io. You must emit a channel event with the user channel id. This channel id is available in the user's json (/api/v1/user). When new data is available, a stream event is triggered.

NodeJS example

  var io = require('socket.io-client');

  var socket = io.connect('https://paymium.com/user', {
      path: '/ws/socket.io'
  });

  console.log('CONNECTING');

  socket.on('connect', function() {
      console.log('CONNECTED');
      console.log('WAITING FOR DATA...');
  });

  // Replace USER_CHANNEL_ID with the channel id of the user
  socket.emit('channel', 'USER_CHANNEL_ID');

  socket.on('disconnect', function() {
      console.log('DISCONNECTED');
  });

  socket.on('stream', function(userData) {
      console.log('GOT DATA:');
      console.log(userData);
  });

User data

The stream event will emit an object when new data is available. The object will have properties only for the data that changed.

userData.balance_eur

If the available EUR balance changed, userData.balance_eur will contain the new balance.

  {
      balance_eur: "410.04"
  }

userData.locked_eur

If the locked EUR balance changed, userData.locked_eur will contain the new balance.

  {
      locked_eur: "20.24"
  }

userData.balance_btc

If the available BTC balance changed, userData.balance_btc will contain the new balance.

  {
      balance_btc: "53.29811458"
  }

userData.locked_btc

If the locked BTC balance changed, userData.locked_btc will contain the new balance.

  {
      locked_btc: "0"
  }

userData.orders

If user orders have changed (created, filled, cancelled, etc...), userData.orders will be an array containing the modified orders. You can check the state of the orders to handle them properly. Example:

  {
      orders: [
          {
              uuid: '89d4b612-5e6a-4154-94f3-120d03f4e891',
              amount: "1",
              currency_amount: "10",
              state: "pending_execution",
              btc_fee: "0",
              currency_fee: "0",
              updated_at: '2015-11-02T11:36:41.000Z',
              created_at: '2015-11-02T11:36:41.000Z',
              currency: 'EUR',
              comment: null,
              type: 'MarketOrder',
              traded_btc: "0",
              traded_currency: "0",
              direction: 'buy',
              price: "1000",
              account_operations: []
          }
      ]
  }