NAV
shell php python java

Introduction

Welcome to the Merchant Platform API reference.

The Merchant Platform is organized according to REST principles and provides the following functionalities:

Environment

This API is available in 2 environments: production and pre-production(Sandbox), reachable via HTTPS.

Versioning

Endpoints of the API are prefixed with a corresponding version number. This documentation describes version 1 of the API.

This method of versioning provides complete isolation between implementations and ensures that subsequent major changes to the API will not affect existing integrations. No breaking changes will be introduced within a major version.

The endpoints of the API will respond with various header fields.

Authentication

All APIs require you to authenticate yourself using your a bearer token to authenticate. If authentication fails, server may return status codes 401, 403, 422 or 404.

Authorization: bearer token

Sample of request with authorization token:

require 'kittn'

api = Kittn::APIClient.authorize!('access_token')
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
  -H "Authorization: token"
const kittn = require('kittn');

let api = kittn.authorize('token');
const kittn = require('kittn');

let api = kittn.authorize('token');

Make sure to replace token with your Access Token key.

Accounts

Create Account

require 'kittn'

api = Kittn::APIClient.authorize!('access_token')
api.kittens.get
import kittn

api = kittn.authorize('access_token')
api.kittens.get()
curl "http://example.com/api/kittens" \
  -H "Authorization: access_token"
const kittn = require('kittn');

let api = kittn.authorize('access_token');
let kittens = api.kittens.get();

The above command returns JSON structured like this:

[
  {
    "id": 1,
    "name": "Fluffums",
    "breed": "calico",
    "fluffiness": 6,
    "cuteness": 7
  },
  {
    "id": 2,
    "name": "Max",
    "breed": "unknown",
    "fluffiness": 5,
    "cuteness": 10
  }
]

This endpoint retrieves all kittens.

HTTP Request

GET http://example.com/api/kittens

Query Parameters

Parameter Default Description
include_cats false If set to true, the result will also include cats.
available true If set to false, the result will include kittens that have already been adopted.

Verify Email

Send Verify email

Forgotten password

Check reset password code

Reset password

update password

Generate 2FA

Activate 2FA

Validate Totp

Get token

Refresh token

Revoke token

Get user info

Logout

require 'kittn'

api = Kittn::APIClient.authorize!('access_token')
api.kittens.get(2)
import kittn

api = kittn.authorize('access_token')
api.kittens.get(2)
curl "http://example.com/api/kittens/2" \
  -H "Authorization: access_token"
const kittn = require('kittn');

let api = kittn.authorize('access_token');
let max = api.kittens.get(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "name": "Max",
  "breed": "unknown",
  "fluffiness": 5,
  "cuteness": 10
}

This endpoint retrieves a specific kitten.

HTTP Request

GET http://example.com/kittens/<ID>

URL Parameters

Parameter Description
ID The ID of the kitten to retrieve

Delete a Specific Kitten

require 'kittn'

api = Kittn::APIClient.authorize!('access_token')
api.kittens.delete(2)
import kittn

api = kittn.authorize('access_token')
api.kittens.delete(2)
curl "http://example.com/api/kittens/2" \
  -X DELETE \
  -H "Authorization: access_token"
const kittn = require('kittn');

let api = kittn.authorize('access_token');
let max = api.kittens.delete(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "deleted" : ":("
}

This endpoint deletes a specific kitten.

HTTP Request

DELETE http://example.com/kittens/<ID>

URL Parameters

Parameter Description
ID The ID of the kitten to delete

Business

Errors

The Kittn API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! 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.