Back to top

LockerX Developers

Introduction

LockerX provides a simple API to access its core functionality. In this page you can find information about authenticating with LockerX and the available endpoints.

Authentication

LockerX uses the OAuth 2 protocol to let users grant access to their LockerX account to third party applications. OAuth 2 works well for web and mobile applications.

LockerX supports the following grant types:

  • Authorisation Code: use this grant type if you are developing applications that will be used by users. This is the grant type typically used by web and mobile applications.

  • Client Credentials: use this grant type if you want to access the account that created the application. Use this to automate your workflow.

You first need to register your application from your account developer settings page.

If you are using a library to connect to the OAuth 2 endpoints, you need to know the following urls:

  • Authorise Url: https://account.lockerx.co.uk/connect/authorize

  • Token Url: https://account.lockerx.co.uk/connect/token

Request user permission

GET https://account.lockerx.co.uk/connect/authorize?response_type=code&state={state}&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}

  • Parameters
    • state: A random string, used to protect against CSRF attacks.
    • client_id: Your application Client Id.
    • redirect_uri: The url your user will be sent after authorisation. Must match the redirect uri you specified when creating the application.
    • scope: List of scopes required by your application, separated by space.

LockerX redirects to your application

GET https://example.org/oidc-redirect?state={state}&code={code}

State has the same value passed previously and code is a short-lived code that you can exchange for an access token.

Token exchange

POST https://account.lockerx.co.uk/connect/token?grant_type=authorization_code&code={code}&redirect_uri={redirect_uri}

This request must be authenticated using your application Client Id as the username, and its Client Secret as the password.

  • Parameters
    • code: The short-lived code from the previous step.
    • redirect_uri: Your application redirect uri.

Scopes

Scopes let you specify how you intend to access a user’s account. LockerX scopes contain the resource you intend to access, followed by the class of actions. The available scopes are:

  • https://api.lockerx.co.uk/auth/pof.read: Read-only access to the user’s Proof of Funds contracts.

  • https://api.lockerx.co.uk/auth/pof.admin: Add/create Proof of Funds contracts.

  • https://api.lockerx.co.uk/auth/sp.read: Read-only access to the user’s Smart Payment contracts.

  • https://api.lockerx.co.uk/auth/sp.admin: Add/create Smart Payment contracts.

  • https://api.lockerx.co.uk/auth/wallet.read: Read-only access to the user’s wallet. You can list the user’s balances and recent transactions.

  • https://api.lockerx.co.uk/auth/wallet.admin: You can update the user wallet’s trustlines.

  • https://api.lockerx.co.uk/auth/wallet.withdraw: You can withdraw funds from the user’s wallet.

Example Code

This example contains a small Python example that:

  • Requests user permission to access their account.

  • Exchanges the code for an access token.

  • Queries for the user’s Proof of Funds contracts.

You need to have flask and requests installed.

Before running the example, you need to create an application with grant type code, redirect uri http://localhost:65010/oidc-callback, and Proof of Funds Reader and Wallet Reader scopes.

#!/usr/bin/env python
from flask import Flask, abort, request, redirect
from uuid import uuid4
import requests
import requests.auth
import urllib


# Fill this in with your client ID
CLIENT_ID = ''

# Fill this in with your client secret
CLIENT_SECRET = ''

REDIRECT_URI = 'http://localhost:65010/oidc-callback'

# Your application user agent.
USER_AGENT = 'your-application'

def base_headers():
    return {
        'User-Agent': USER_AGENT,
    }


app = Flask(__name__)

state = None


def store_state(new_state):
    """Store state to datastore. For this example we use a global variable."""
    global state
    state = new_state


def get_state():
    """Retrieve stored state."""
    global state
    return state


def is_valid_state(state):
    existing_state = get_state()
    return existing_state == state and state is not None


@app.route('/')
def homepage():
    text = '<a href="%s">Authenticate with LockerX</a>'
    return text % make_authorization_url()


def make_authorization_url():
    state = str(uuid4())
    store_state(state)
    params = {
        'client_id': CLIENT_ID,
        'response_type': 'code',
        'state': state,
        'redirect_uri': REDIRECT_URI,
        'scope': 'openid email profile https://api.lockerx.co.uk/auth/pof.read https://api.lockerx.co.uk/auth/wallet.read'
}
    url = "https://account.lockerx.co.uk/connect/authorize?" + urllib.parse.urlencode(params)
    return url


access_token = None

def store_token(token):
    """Store user access token."""
    global access_token
    access_token = token


@app.route('/oidc-callback')
def oidc_callback():
    error = request.args.get('error', '')
    if error:
        return 'Error: '  + error
    state = request.args.get('state', '')
    if not is_valid_state(state):
        # CSRF attack!
        abort(403)
    code = request.args.get('code')
    access_token = get_token(code)
    store_token(access_token)
    return redirect('/my-app')


@app.route('/my-app')
def my_app():
    return '''
    <a href="/get-pof">Get Proof of Funds Contracts</a>
    <p>Your token is {}</p>
    '''.format(access_token)


@app.route('/get-pof')
def get_pof():
    headers = base_headers()
    headers.update({
        'Authorization': 'Bearer ' + access_token
    })
    response = requests.get(
        'https://api.lockerx.co.uk/v1/guarantees', headers=headers
    )
    guarantees = response.json()
    return '''
    <p>You have {} contracts</p>
    '''.format(guarantees['total'])


def get_token(code):
    client_auth = requests.auth.HTTPBasicAuth(CLIENT_ID, CLIENT_SECRET)
    post_data = {
        'grant_type': 'authorization_code',
        'code': code,
        'redirect_uri': REDIRECT_URI
    }
    headers = base_headers()
    response = requests.post(
        'https://account.lockerx.co.uk/connect/token',
        auth=client_auth,
        headers=headers,
        data=post_data
    )
    token_json = response.json()
    return token_json["access_token"]


if __name__ == '__main__':
    app.run(debug=True, port=65010)

Resource Group

Wallet

List all user wallets
GET/wallets

Retrieve a list of the user’s available wallets. At the moment, LockerX limits the number of wallets to one per user but this value can change in the future.

Scope: https://api.lockerx.co.uk/auth/wallet.read

Example URI

GET /wallets
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "My Wallet",
    "accountId": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO",
    "accountName": "flying_fly*stellar.lockerx.co.uk",
    "owner": {
      "name": "John",
      "email": "[email protected]",
      "company": "Example Co."
    },
    "balances": [
      {
        "asset": {
          "type": "credit",
          "code": "USD",
          "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
        },
        "limit": 0,
        "balance": 10234.1
      }
    ],
    "trustlines": [
      {
        "asset": {
          "type": "credit",
          "code": "USD",
          "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
        },
        "created": true
      }
    ],
    "payments": [
      {
        "asset": {
          "type": "credit",
          "code": "USD",
          "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
        },
        "fromAccountId": "GBBHHGVARFT2NV6MQCBSZ25VIEH4YANH3NAHJNPHDVWSVSVWEOCYYE2Z",
        "toAccountId": "GBPXFEHI2SEDNMBON3EFUKD2BBAYB3PPXPERTLKQRCUJVZGBWIYRSIOV",
        "amount": 100,
        "timestamp": "2019-11-16T20:39:31+00:00",
        "transactionHash": "dec0178f3bab6275837eaa9eedb05294a3f72654ba42a51644cf23644529f637"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get user wallet
GET/wallets/

Retrieve the user wallet with the specified accountId.

Scope: https://api.lockerx.co.uk/auth/wallet.read

Example URI

GET /wallets/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "My Wallet",
  "accountId": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO",
  "accountName": "flying_fly*stellar.lockerx.co.uk",
  "owner": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "balances": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "limit": 0,
      "balance": 10234.1
    }
  ],
  "trustlines": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "created": true
    }
  ],
  "payments": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "fromAccountId": "GBBHHGVARFT2NV6MQCBSZ25VIEH4YANH3NAHJNPHDVWSVSVWEOCYYE2Z",
      "toAccountId": "GBPXFEHI2SEDNMBON3EFUKD2BBAYB3PPXPERTLKQRCUJVZGBWIYRSIOV",
      "amount": 100,
      "timestamp": "2019-11-16T20:39:31+00:00",
      "transactionHash": "dec0178f3bab6275837eaa9eedb05294a3f72654ba42a51644cf23644529f637"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "accountId": {
      "type": "string"
    },
    "accountName": {
      "type": "string"
    },
    "owner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "balances": {
      "type": "array"
    },
    "trustlines": {
      "type": "array"
    },
    "payments": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "accountId",
    "accountName",
    "owner",
    "balances",
    "trustlines",
    "payments"
  ]
}

Create user wallet
POST/wallets

Create the initial user wallet. User can specify the wallet name, their name, and an optional company name.

Scope: https://api.lockerx.co.uk/auth/wallet.admin

Example URI

POST /wallets
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "My wallet",
  "ownerName": "John",
  "ownerCompany": "Example Co."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The wallet name"
    },
    "ownerName": {
      "type": "string",
      "description": "The wallet owner name"
    },
    "ownerCompany": {
      "type": "string",
      "description": "The wallet owner company"
    }
  },
  "required": [
    "name",
    "ownerName"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "My Wallet",
  "accountId": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO",
  "accountName": "flying_fly*stellar.lockerx.co.uk",
  "owner": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "balances": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "limit": 0,
      "balance": 10234.1
    }
  ],
  "trustlines": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "created": true
    }
  ],
  "payments": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "fromAccountId": "GBBHHGVARFT2NV6MQCBSZ25VIEH4YANH3NAHJNPHDVWSVSVWEOCYYE2Z",
      "toAccountId": "GBPXFEHI2SEDNMBON3EFUKD2BBAYB3PPXPERTLKQRCUJVZGBWIYRSIOV",
      "amount": 100,
      "timestamp": "2019-11-16T20:39:31+00:00",
      "transactionHash": "dec0178f3bab6275837eaa9eedb05294a3f72654ba42a51644cf23644529f637"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "accountId": {
      "type": "string"
    },
    "accountName": {
      "type": "string"
    },
    "owner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "balances": {
      "type": "array"
    },
    "trustlines": {
      "type": "array"
    },
    "payments": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "accountId",
    "accountName",
    "owner",
    "balances",
    "trustlines",
    "payments"
  ]
}

Update user wallet
POST/wallets/

Update information about the user wallet.

The content of the trustlines key will determine the wallet trustlines.

Scope: https://api.lockerx.co.uk/auth/wallet.admin

Example URI

POST /wallets/
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "trustlines": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "created": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {},
  "oneOf": [
    {
      "properties": {
        "trustlines": {
          "type": "array"
        }
      }
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "My Wallet",
  "accountId": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO",
  "accountName": "flying_fly*stellar.lockerx.co.uk",
  "owner": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "balances": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "limit": 0,
      "balance": 10234.1
    }
  ],
  "trustlines": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "created": true
    }
  ],
  "payments": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "fromAccountId": "GBBHHGVARFT2NV6MQCBSZ25VIEH4YANH3NAHJNPHDVWSVSVWEOCYYE2Z",
      "toAccountId": "GBPXFEHI2SEDNMBON3EFUKD2BBAYB3PPXPERTLKQRCUJVZGBWIYRSIOV",
      "amount": 100,
      "timestamp": "2019-11-16T20:39:31+00:00",
      "transactionHash": "dec0178f3bab6275837eaa9eedb05294a3f72654ba42a51644cf23644529f637"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "accountId": {
      "type": "string"
    },
    "accountName": {
      "type": "string"
    },
    "owner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "balances": {
      "type": "array"
    },
    "trustlines": {
      "type": "array"
    },
    "payments": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "accountId",
    "accountName",
    "owner",
    "balances",
    "trustlines",
    "payments"
  ]
}

Withdraw funds from user wallet
POST/wallets/withdraw

Withdraw the funds from the user wallet to the specified account.

Scope: https://api.lockerx.co.uk/auth/wallet.withdraw

Example URI

POST /wallets/withdraw
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "toAddress": "GBSMAAHG2U3H25PGZLR3RVAVJ65FKYAND2XPMYRHWHPWAMJXL2BDZTEW",
  "asset": {
    "type": "credit",
    "code": "USD",
    "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
  },
  "amount": "123.45"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "toAddress": {
      "type": "string",
      "description": "The destination address"
    },
    "asset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Asset type. Either `native` or `credit`"
        },
        "code": {
          "type": "string",
          "description": "Asset code if asset type is `credit`"
        },
        "issuer": {
          "type": "string",
          "description": "Asset issuer if asset type is `credit`"
        }
      },
      "required": [
        "type"
      ],
      "description": "The payment asset"
    },
    "amount": {
      "type": "string",
      "description": "The payment amount"
    }
  },
  "required": [
    "toAddress",
    "asset",
    "amount"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "My Wallet",
  "accountId": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO",
  "accountName": "flying_fly*stellar.lockerx.co.uk",
  "owner": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "balances": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "limit": 0,
      "balance": 10234.1
    }
  ],
  "trustlines": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "created": true
    }
  ],
  "payments": [
    {
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "fromAccountId": "GBBHHGVARFT2NV6MQCBSZ25VIEH4YANH3NAHJNPHDVWSVSVWEOCYYE2Z",
      "toAccountId": "GBPXFEHI2SEDNMBON3EFUKD2BBAYB3PPXPERTLKQRCUJVZGBWIYRSIOV",
      "amount": 100,
      "timestamp": "2019-11-16T20:39:31+00:00",
      "transactionHash": "dec0178f3bab6275837eaa9eedb05294a3f72654ba42a51644cf23644529f637"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "accountId": {
      "type": "string"
    },
    "accountName": {
      "type": "string"
    },
    "owner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "balances": {
      "type": "array"
    },
    "trustlines": {
      "type": "array"
    },
    "payments": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "accountId",
    "accountName",
    "owner",
    "balances",
    "trustlines",
    "payments"
  ]
}

Proof of Funds

List all user Proof of Funds
GET/guarantees?page={page}&sortBy={sortBy}

List all the user Proof of Funds contracts.

Scope: https://api.lockerx.co.uk/auth/pof.read

Example URI

GET /guarantees?page=1&sortBy="UpdatedNewest"
URI Parameters
HideShow
page
number (optional) Example: 1

The page number, defaults to 1.

sortBy
string (optional) Example: "UpdatedNewest"

How the contracts should be sorted. Possible values are UpdatedNewest, CreatedNewest, UpdatedOldest, CreatedOldest.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "records": [
    {
      "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
      "status": "locked",
      "reference": "Test Reference",
      "from": {
        "name": "John",
        "email": "[email protected]",
        "company": "Example Co."
      },
      "to": {
        "name": "John",
        "email": "[email protected]",
        "company": "Example Co."
      },
      "asset": {
        "type": "credit",
        "code": "USD",
        "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
      },
      "amount": {
        "amount": 100,
        "fee": 0.1,
        "total": 100.1
      },
      "account": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
      "createdAt": "2019-09-01T18:22:22+00:00",
      "unlockAt": "2019-09-08T18:22:00+00:00",
      "fundingAccount": "GB3A2HHUTFILAXP3XMOYRJY2XGXTWLZERSTRG2CHXSBPAGIOIXNRQ6PP",
      "events": [
        {
          "type": "created",
          "description": "Proof of Funds created",
          "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
          "timestamp": "2019"
        }
      ]
    }
  ],
  "total": 45,
  "current": 2,
  "pageSize": 20,
  "prev": 1,
  "next": 3
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "records": {
      "type": "array"
    },
    "total": {
      "type": "number"
    },
    "current": {
      "type": "number"
    },
    "pageSize": {
      "type": "number"
    },
    "prev": {
      "type": "number"
    },
    "next": {
      "type": "number"
    }
  }
}

Create new Proof of Funds
POST/guarantees

Create and issue a new Proof of Funds contract. The locked funds will be transferred from the specified user wallet to the contract and the other party will be contacted by email. The asset and amount must be available in the specified user wallet.

Scope: https://api.lockerx.co.uk/auth/pof.admin

Example URI

POST /guarantees
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "reference": "Test Reference",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "unlockAt": "2019-12-08T18:22:00+00:00",
  "asset": {
    "type": "credit",
    "code": "USD",
    "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
  },
  "amount": "100.2",
  "WalletAccountId": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "reference": {
      "type": "string",
      "description": "The Proof of Funds reference"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ],
      "description": "The send personal details"
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ],
      "description": "The receiver personal details. An email will be sent to the email address here specified"
    },
    "unlockAt": {
      "type": "string",
      "description": "The contract unlock date and time"
    },
    "asset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Asset type. Either `native` or `credit`"
        },
        "code": {
          "type": "string",
          "description": "Asset code if asset type is `credit`"
        },
        "issuer": {
          "type": "string",
          "description": "Asset issuer if asset type is `credit`"
        }
      },
      "required": [
        "type"
      ],
      "description": "The contract asset"
    },
    "amount": {
      "type": "string",
      "description": "The locked amount"
    },
    "WalletAccountId": {
      "type": "string",
      "description": "The wallet account id from which the funds will be taken"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "asset": {
    "type": "credit",
    "code": "USD",
    "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
  },
  "amount": {
    "amount": 100,
    "fee": 0.1,
    "total": 100.1
  },
  "account": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "createdAt": "2019-09-01T18:22:22+00:00",
  "unlockAt": "2019-09-08T18:22:00+00:00",
  "fundingAccount": "GB3A2HHUTFILAXP3XMOYRJY2XGXTWLZERSTRG2CHXSBPAGIOIXNRQ6PP",
  "events": [
    {
      "type": "created",
      "description": "Proof of Funds created",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "asset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Asset type. Either `native` or `credit`"
        },
        "code": {
          "type": "string",
          "description": "Asset code if asset type is `credit`"
        },
        "issuer": {
          "type": "string",
          "description": "Asset issuer if asset type is `credit`"
        }
      },
      "required": [
        "type"
      ]
    },
    "amount": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "The locked amount"
        },
        "fee": {
          "type": "number",
          "description": "The fee paid"
        },
        "total": {
          "type": "number",
          "description": "The total amount paid"
        }
      }
    },
    "account": {
      "type": "string",
      "description": "The contract Stellar account"
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "unlockAt": {
      "type": "string",
      "description": "When it will unlock"
    },
    "fundingAccount": {
      "type": "string",
      "description": "The account that created the contract"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Get Proof of Funds public information
GET/guarantees/{id}/summary

Retrieve the public information available for the specified Proof of Funds Contract.

Example URI

GET /guarantees/id/summary
URI Parameters
HideShow
id
string (required) 

The contract unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "asset": {
    "type": "credit",
    "code": "USD",
    "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
  },
  "amount": {
    "amount": 100,
    "fee": 0.1,
    "total": 100.1
  },
  "account": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "createdAt": "2019-09-01T18:22:22+00:00",
  "unlockAt": "2019-09-08T18:22:00+00:00",
  "fundingAccount": "GB3A2HHUTFILAXP3XMOYRJY2XGXTWLZERSTRG2CHXSBPAGIOIXNRQ6PP",
  "events": [
    {
      "type": "created",
      "description": "Proof of Funds created",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "asset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Asset type. Either `native` or `credit`"
        },
        "code": {
          "type": "string",
          "description": "Asset code if asset type is `credit`"
        },
        "issuer": {
          "type": "string",
          "description": "Asset issuer if asset type is `credit`"
        }
      },
      "required": [
        "type"
      ]
    },
    "amount": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "The locked amount"
        },
        "fee": {
          "type": "number",
          "description": "The fee paid"
        },
        "total": {
          "type": "number",
          "description": "The total amount paid"
        }
      }
    },
    "account": {
      "type": "string",
      "description": "The contract Stellar account"
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "unlockAt": {
      "type": "string",
      "description": "When it will unlock"
    },
    "fundingAccount": {
      "type": "string",
      "description": "The account that created the contract"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Get Proof of Funds information
GET/guarantees/{id}

Retrieve the Proof of Funds information.

Scope: https://api.lockerx.co.uk/auth/pof.read

Example URI

GET /guarantees/id
URI Parameters
HideShow
id
string (required) 

The contract unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "asset": {
    "type": "credit",
    "code": "USD",
    "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
  },
  "amount": {
    "amount": 100,
    "fee": 0.1,
    "total": 100.1
  },
  "account": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "createdAt": "2019-09-01T18:22:22+00:00",
  "unlockAt": "2019-09-08T18:22:00+00:00",
  "fundingAccount": "GB3A2HHUTFILAXP3XMOYRJY2XGXTWLZERSTRG2CHXSBPAGIOIXNRQ6PP",
  "events": [
    {
      "type": "created",
      "description": "Proof of Funds created",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "asset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Asset type. Either `native` or `credit`"
        },
        "code": {
          "type": "string",
          "description": "Asset code if asset type is `credit`"
        },
        "issuer": {
          "type": "string",
          "description": "Asset issuer if asset type is `credit`"
        }
      },
      "required": [
        "type"
      ]
    },
    "amount": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "The locked amount"
        },
        "fee": {
          "type": "number",
          "description": "The fee paid"
        },
        "total": {
          "type": "number",
          "description": "The total amount paid"
        }
      }
    },
    "account": {
      "type": "string",
      "description": "The contract Stellar account"
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "unlockAt": {
      "type": "string",
      "description": "When it will unlock"
    },
    "fundingAccount": {
      "type": "string",
      "description": "The account that created the contract"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Resend Verification request email
POST/guarantees/{id}/resend_verification

Resend the verification request to the email address specified in the contract.

Scope: https://api.lockerx.co.uk/auth/pof.admin

Example URI

POST /guarantees/id/resend_verification
URI Parameters
HideShow
id
string (required) 

The contract unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
"Ok"

Verify Proof of Funds
POST/verify/guarantee

Mark the Proof of Funds contract as verified. If the secret token is valid, the contract will be considered as valid and the funds released.

Example URI

POST /verify/guarantee
Request
HideShow
Body
{
  "guaranteeId": "8970242c-132a-4dea-aae9-8a647f80829a",
  "token": "H7QX6siY...8WAKrszR"
}
Schema
{
  "type": "object",
  "properties": {
    "guaranteeId": {
      "type": "string",
      "description": "The Proof of Funds contract unique id"
    },
    "token": {
      "type": "string",
      "description": "The secret token that was included in the verification request email"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
"Ok"

Smart Payment

List all user Smart Payment
GET/payment?page={page}&sortBy={sortBy}

List all the user Smart Payment contracts.

Scope: https://api.lockerx.co.uk/auth/sp.read

Example URI

GET /payment?page=1&sortBy="UpdatedNewest"
URI Parameters
HideShow
page
number (optional) Example: 1

The page number, defaults to 1.

sortBy
string (optional) Example: "UpdatedNewest"

How the contracts should be sorted. Possible values are UpdatedNewest, CreatedNewest, UpdatedOldest, CreatedOldest.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "records": [
    {
      "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
      "status": "locked",
      "reference": "Test Reference",
      "destination": {
        "type": "Hello, world!",
        "accountId": "Hello, world!"
      },
      "documentId": "Hello, world!",
      "from": {
        "name": "John",
        "email": "[email protected]",
        "company": "Example Co."
      },
      "to": {
        "name": "John",
        "email": "[email protected]",
        "company": "Example Co."
      },
      "walletAccountId": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
      "payment": {
        "asset": {
          "type": "credit",
          "code": "USD",
          "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
        },
        "amount": 100
      },
      "fee": {
        "asset": {
          "type": "credit",
          "code": "USD",
          "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
        },
        "amount": 100
      },
      "createdAt": "2019-09-01T18:22:22+00:00",
      "expiresAt": "2019-09-08T18:22:00+00:00",
      "events": [
        {
          "type": "initialized",
          "description": "Smart Payment Initialized",
          "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
          "timestamp": "2019"
        }
      ]
    }
  ],
  "total": 45,
  "current": 2,
  "pageSize": 20,
  "prev": 1,
  "next": 3
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "records": {
      "type": "array"
    },
    "total": {
      "type": "number"
    },
    "current": {
      "type": "number"
    },
    "pageSize": {
      "type": "number"
    },
    "prev": {
      "type": "number"
    },
    "next": {
      "type": "number"
    }
  }
}

Create new Smart Payment
POST/payments

Create and issue a new Smart Payment contract. The locked funds will be transferred from the specified user wallet to the contract and the other party will be contacted by email. The asset and amount must be available in the specified user wallet.

Scope: https://api.lockerx.co.uk/auth/sp.admin

Example URI

POST /payments
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "reference": "Test Reference",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "documentId": "Hello, world!",
  "destination": {
    "type": "Hello, world!",
    "accountId": "Hello, world!"
  },
  "expiresAt": "2019-12-08T18:22:00+00:00",
  "payment": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "WalletAccountId": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "reference": {
      "type": "string",
      "description": "The Smart Payment reference"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ],
      "description": "The send personal details"
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ],
      "description": "The receiver personal details. An email will be sent to the email address here specified"
    },
    "documentId": {
      "type": "string",
      "description": "Optionally attach a document with the given id"
    },
    "destination": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "description": "The payment destination account. Can send to a stellar wallet or directly to the receiver email"
    },
    "expiresAt": {
      "type": "string",
      "description": "The contract unlock date and time"
    },
    "payment": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ],
      "description": "The payment amount and asset"
    },
    "WalletAccountId": {
      "type": "string",
      "description": "The wallet account id from which the funds will be taken"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "destination": {
    "type": "Hello, world!",
    "accountId": "Hello, world!"
  },
  "documentId": "Hello, world!",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "walletAccountId": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "payment": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "fee": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "createdAt": "2019-09-01T18:22:22+00:00",
  "expiresAt": "2019-09-08T18:22:00+00:00",
  "events": [
    {
      "type": "initialized",
      "description": "Smart Payment Initialized",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "destination": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "documentId": {
      "type": "string",
      "description": "The optional document attachment"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "walletAccountId": {
      "type": "string",
      "description": "The stellar wallet that created the smart contract"
    },
    "payment": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "fee": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "expiresAt": {
      "type": "string",
      "description": "When it will expire and unlock"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Get Smart Payment public information
GET/payments/{id}/summary

Retrieve the public information available for the specified Smart Payment Contract.

Example URI

GET /payments/id/summary
URI Parameters
HideShow
id
string (required) 

The contract unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "destination": {
    "type": "Hello, world!",
    "accountId": "Hello, world!"
  },
  "documentId": "Hello, world!",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "walletAccountId": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "payment": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "fee": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "createdAt": "2019-09-01T18:22:22+00:00",
  "expiresAt": "2019-09-08T18:22:00+00:00",
  "events": [
    {
      "type": "initialized",
      "description": "Smart Payment Initialized",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "destination": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "documentId": {
      "type": "string",
      "description": "The optional document attachment"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "walletAccountId": {
      "type": "string",
      "description": "The stellar wallet that created the smart contract"
    },
    "payment": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "fee": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "expiresAt": {
      "type": "string",
      "description": "When it will expire and unlock"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Get Smart Payment information
GET/payments/{id}

Retrieve the Smart Payment information.

Scope: https://api.lockerx.co.uk/auth/sp.read

Example URI

GET /payments/id
URI Parameters
HideShow
id
string (required) 

The contract unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "602d1a9e-5878-43ed-97a0-1064c8291dd7",
  "status": "locked",
  "reference": "Test Reference",
  "destination": {
    "type": "Hello, world!",
    "accountId": "Hello, world!"
  },
  "documentId": "Hello, world!",
  "from": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "to": {
    "name": "John",
    "email": "[email protected]",
    "company": "Example Co."
  },
  "walletAccountId": "GALXM5DAPUJICUT25DWILI2OEOJ5Z7CHIE5MZDB6HC3H37QJFZYJ3IEI",
  "payment": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "fee": {
    "asset": {
      "type": "credit",
      "code": "USD",
      "issuer": "GAVC3TROM6IK4CIT2EPNH3L2WOIV2JDVGNLZUTIKUSX3Y4X34UZZAVSO"
    },
    "amount": 100
  },
  "createdAt": "2019-09-01T18:22:22+00:00",
  "expiresAt": "2019-09-08T18:22:00+00:00",
  "events": [
    {
      "type": "initialized",
      "description": "Smart Payment Initialized",
      "transactionId": "335df544073ad521c422b860d092db79ba9568b14f846eaa68de5ef95b74c4ae",
      "timestamp": "2019"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The contract unique id"
    },
    "status": {
      "type": "string",
      "description": "The contract status"
    },
    "reference": {
      "type": "string",
      "description": "The contract reference"
    },
    "destination": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "documentId": {
      "type": "string",
      "description": "The optional document attachment"
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "company": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "walletAccountId": {
      "type": "string",
      "description": "The stellar wallet that created the smart contract"
    },
    "payment": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "fee": {
      "type": "object",
      "properties": {
        "asset": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Asset type. Either `native` or `credit`"
            },
            "code": {
              "type": "string",
              "description": "Asset code if asset type is `credit`"
            },
            "issuer": {
              "type": "string",
              "description": "Asset issuer if asset type is `credit`"
            }
          },
          "required": [
            "type"
          ]
        },
        "amount": {
          "type": "number"
        }
      },
      "required": [
        "asset",
        "amount"
      ]
    },
    "createdAt": {
      "type": "string",
      "description": "When it was created"
    },
    "expiresAt": {
      "type": "string",
      "description": "When it will expire and unlock"
    },
    "events": {
      "type": "array"
    }
  },
  "required": [
    "id"
  ]
}

Documents

Create a new document attachment
POST/documents

Create a new document attachment with the specified properties. The response will contain an url to upload the file to. You should send a POST request to this url with the file content in the body.

Scope: https://api.lockerx.co.uk/auth/pof.admin or https://api.lockerx.co.uk/auth/sp.admin

Example URI

POST /documents
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "title": "Test Document"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "The document human readable name"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "ea66d710-33d5-4b21-bb65-12d827c2fddc",
  "title": "Test Document",
  "status": "committed",
  "hash": "e5960da809e38a4104a7e68a9f56ad5003b5681513ef21f82fc4cb00ecc6580e",
  "hashBase64Hash": "5ZYNqAnjikEEp+aKn1atUAO1aBUT7yH4L8TLAOzGWA4=",
  "downloadUrl": "https://api.lockerx.co.uk/v1/documents/cd5ba30a-8333-434c-88b5-d100deb2c476/download",
  "createdAt": "2020",
  "expiresAt": "2020"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The document id"
    },
    "title": {
      "type": "string",
      "description": "The document title"
    },
    "status": {
      "type": "string",
      "description": "The document status. `created` means the document was created but no file was uploaded, `uploaded` means a file was uploaded, and `committed` means the file was attached to a smart contract"
    },
    "hash": {
      "type": "string",
      "description": "The document sha256 hash"
    },
    "hashBase64Hash": {
      "type": "string",
      "description": "The document sha256 hash encoded as base64"
    },
    "downloadUrl": {
      "type": "string",
      "description": "The download url to get the file"
    },
    "createdAt": {
      "type": "string",
      "description": "05-28T11:23:50.745859+01:00 (string) - When the document was created"
    },
    "expiresAt": {
      "type": "string",
      "description": "06-04T11:23:50.745859+01:00 (string) - The deadline before which you have to upload a file"
    }
  }
}

Get information about a document attachment
GET/documents/{documentId}

Get information about a document attachment.

Scope: none

Example URI

GET /documents/documentId
URI Parameters
HideShow
documentId
string (required) 

The document unique id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "ea66d710-33d5-4b21-bb65-12d827c2fddc",
  "title": "Test Document",
  "status": "committed",
  "hash": "e5960da809e38a4104a7e68a9f56ad5003b5681513ef21f82fc4cb00ecc6580e",
  "hashBase64Hash": "5ZYNqAnjikEEp+aKn1atUAO1aBUT7yH4L8TLAOzGWA4=",
  "downloadUrl": "https://api.lockerx.co.uk/v1/documents/cd5ba30a-8333-434c-88b5-d100deb2c476/download",
  "createdAt": "2020",
  "expiresAt": "2020"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The document id"
    },
    "title": {
      "type": "string",
      "description": "The document title"
    },
    "status": {
      "type": "string",
      "description": "The document status. `created` means the document was created but no file was uploaded, `uploaded` means a file was uploaded, and `committed` means the file was attached to a smart contract"
    },
    "hash": {
      "type": "string",
      "description": "The document sha256 hash"
    },
    "hashBase64Hash": {
      "type": "string",
      "description": "The document sha256 hash encoded as base64"
    },
    "downloadUrl": {
      "type": "string",
      "description": "The download url to get the file"
    },
    "createdAt": {
      "type": "string",
      "description": "05-28T11:23:50.745859+01:00 (string) - When the document was created"
    },
    "expiresAt": {
      "type": "string",
      "description": "06-04T11:23:50.745859+01:00 (string) - The deadline before which you have to upload a file"
    }
  }
}