NAV Navbar
python cURL

OceanEx Pay REST Introduction

Welcome to the OceanEx Pay API! You can use our API to access OceanEx Pay services

Currently, we only have language bindings in Python. Other languages like Shell, Ruby, and JavaScript are coming soon. You can view code examples in the dark area to the right.

#base url
base_url = "https://pay.oceanex.pro/v1"
#X_API_KEY eg
X_API_KEY = "L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu"
API endpoint:
https://pay.oceanex.pro/v1

The base URL for all REST API is: https://pay.oceanex.pro/v1.

OceanEx Pay API use X-API-KEY to identify users. Get the X-API-KEY by contacting us.

Trading API

Checkout Endpoints

Create Checkout post

import requests

url = "http://pay.oceanex.pro/api/v1/checkouts"

payload = 'currency=vet&amount=1&name=Hello&description=World&requested_info[]=email&requested_info[]=name'
headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request POST 'http://pay.oceanex.pro/api/v1/checkouts' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'currency=vet' \
--data-urlencode 'amount=1' \
--data-urlencode 'name=Hello' \
--data-urlencode 'description=World' \
--data-urlencode 'requested_info[]=email' \
--data-urlencode 'requested_info[]=name'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "id": "9bf1a4fd-c2c4-42f2-adac-11f59cfeb113",
    "name": "Hello",
    "description": "World",
    "created_at": 1598017141,
    "expired_at": 1598022540,
    "price_type": "fixed_price",
    "pricing": [{
      "vechain": {
        "amount": "1.0",
        "currency": "VET"
      }
    }]
  }
}

This API is to create a new checkout

Parameters:

Name Description Required Schema
currency currency of the checkout Required String
amount the volume in currency to be charged Optional Float
name name of this checkout Optional String
description description of this checkout Optional String
requested_info information of payer Optional String Array

Get Order via Checkout get

import requests

url = "http://pay.oceanex.pro/api/v1/orders/checkout/d038f4ac-98a0-4b40-9572-dddaf9ec0dda"

payload = {}
headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request GET 'http://pay.oceanex.pro/api/v1/orders/checkout/d038f4ac-98a0-4b40-9572-dddaf9ec0dda' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "id": "29212a08-c266-49c5-b72e-707cb3210f5f",
    "reference_code": "qMZyHDuD",
    "name": "Hello",
    "description": "World!",
    "hosted_url": "https://pay.oceanex.pro/api/v1/orders/qMZyHDuD",
    "created_at": 1598017141,
    "expired_at": 1598022540,
    "checkout": "d038f4ac-98a0-4b40-9572-dddaf9ec0dda",
    "timeline": [{
      "status": "new",
      "content": "na",
      "time": 1598017141
    }],
    "metadata": "{}",
    "price_type": "fixed_price",
    "pricing": [{
      "vechain": {
        "amount": "1.0",
        "confirmed": "0.0",
        "currency": "VET"
      }
    }],
    "addresses": [{
      "vet": "0x71b267623ACf123D968d4098CDa0eF30B2A416DA"
    }],
    "payments": []
  }
}

This API is to get given checkout related orders

Parameter

Name Description Required Schema
checkout_uid checkout_uid. Set in path Required String

List Checkouts get

import requests

url = "http://pay.oceanex.pro/api/v1/checkouts?limit=2&page=1&order_by=desc"

payload = 'product_uid=a952531c-131a-45af-bd1e-713668da9f8e'
headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request GET 'http://pay.oceanex.pro/api/v1/checkouts?limit=2&page=1&order_by=desc' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'product_uid=a952531c-131a-45af-bd1e-713668da9f8e'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "num_of_resources": 1,
    "resources": [{
      "id": "9bf1a4fd-c2c4-42f2-adac-11f59cfeb113",
      "name": "Hello",
      "description": "World!",
      "created_at": 1598017141,
      "expired_at": 1598022540,
      "price_type": "fixed_price",
      "pricing": [{
        "vechain": {
            "amount": "1.0",
            "currency": "VET"
        }
      }]
    }]
  }
}

This API is to list all checkout in give requirements

Parameter

Name Description Required Schema
order_by specify returned deposits in orders. [desc or asc] Optional String
limit limit the number of returned records. Default to 20 Optional Integer
page specify the page of paginated results. Optional Integer

Get Checkout get

import requests

url = "https://pay.oceanex.pro/api/v1/checkouts/9bf1a4fd-c2c4-42f2-adac-11f59cfeb113"

headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu',
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
curl --location --request GET 'https://pay.oceanex.pro/api/v1/checkouts/9bf1a4fd-c2c4-42f2-adac-11f59cfeb113' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "id": "9bf1a4fd-c2c4-42f2-adac-11f59cfeb113",
    "name": "Hello",
    "description": "World!",
    "created_at": 1598017141,
    "expired_at": 1598022540,
    "price_type": "fixed_price",
    "pricing": [{
      "vechain": {
        "amount": "1.0",
        "currency": "VET"
      }
    }]
  }
}

This API is to get a checkout

Parameter

Name Description Required Schema
checkout_uid checkout_uid. Set in path Required String

Order Endpoints

Place Order post

import requests

url = "https://pay.oceanex.pro/api/v1/orders"

headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu',
  'Content-Type': 'application/x-www-form-urlencoded'
}

payload = {
  'currency': 'oce',
  'amount': '20',
  'name': 'first',
  'description': 'hello',
  'metadata': ['vpn':1]
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
curl --location --request POST 'https://pay.oceanex.pro/api/v1/orders' \
  --header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'currency=vet' \
  --data-urlencode 'amount=1' \
  --data-urlencode 'name=first' \
  --data-urlencode 'description=hello' \
  --data-urlencode 'metadata={"vpn":1}'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "id": "b080a8e1-9812-476f-9734-2f8d4d4e0a81",
    "reference_code": "TtXvNRm8",
    "name": "first",
    "description": "hello",
    "hosted_url": "https://pay.oceanex.pro/api/v1/orders/TtXvNRm8",
    "created_at": 1598017001,
    "expired_at": 1598022401,
    "timeline": [{
      "status": "new",
      "content": "na",
      "time": 1598017001
    }],
    "metadata": {"vpn": 1},
    "price_type": "fixed_price",
    "pricing": [{
      "vechain": {
        "amount": "1.0",
        "confirmed": "0.0",
        "currency": "VET"
      }
    }],
    "addresses": [{"vet": "0x726254a8b233D766262aDe1B24Cce2Ed3da6d89E"}],
    "payments": []
  }
}

This API place a new order

Parameters:

Name Description Required Schema
currency currency of the order Required String
amount the volume in currency to be charged Optional Float
name name of this order Optional String
description description of this order Optional String
ref_order_id reference_code of the order Optional String
metadata cutomized information Optional JSON

Get Order get

import requests

url = "https://pay.oceanex.pro/api/v1/orders/"

reference_code = 'TtXvNRm8'

url = url + reference_code

headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
curl --location --request GET 'https://pay.oceanex.pro/api/v1/orders/TtXvNRm8' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'

The above command returns JSON structured like this:

{
  "code": 0,
  "message": "operation is successful",
  "data": {
    "id": "b080a8e1-9812-476f-9734-2f8d4d4e0a81",
    "reference_code": "TtXvNRm8",
    "name": "first",
    "description": "hello",
    "hosted_url": "https://pay.oceanex.pro/api/v1/orders/TtXvNRm8",
    "created_at": 1598017001,
    "expired_at": 1598022401,
    "timeline": [{
      "status": "new",
      "content": "na",
      "time": 1598017001
    }],
    "metadata": {"vpn": 1},
    "price_type": "fixed_price",
    "pricing": [{
      "vechain": {
        "amount": "1.0",
        "confirmed": "0.0",
        "currency": "VET"
      }
    }],
    "addresses": [{"vet": "0x726254a8b233D766262aDe1B24Cce2Ed3da6d89E"}],
    "payments": []
  }
}

This API gets specified order information

Name Description Required Schema
reference_code the reference code of order. Set in url path Required String

List Orders get

import requests

url = "https://pay.oceanex.pro/api/v1/orders"

params = {
  "order_by": "desc",
  "limit": 1,
  "page": 2,
}

headers = {
  'x-api-key': 'L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu'
}

response = requests.request("GET", url, headers=headers, params=params)
print(response.text.encode('utf8'))
curl --location --request GET 'https://pay.oceanex.pro/api/v1/orders?limit=1&page=2&order_by=desc' \
--header 'x-api-key: L7jSb7FdWXXHxBz8oFyKGgjTERaMboAu' \
--header 'Content-Type: application/x-www-form-urlencoded' \

The above command returns JSON structured like this:

{
  "code":0,
  "message":"operation is successful",
  "data":{
    "num_of_resources":4,
    "resources":[{
      "id":"c389f2aa-4feb-42dc-925f-f0e102abdfa2",
      "reference_code":"7ELQMTwu",
      "name":"hello",
      "description":"world",
      "hosted_url":"https://altantis.oceanex.pro/api/v1/orders/7ELQMTwu",
      "created_at":1596212181,
      "expired_at":1596217581,
      "timeline":[],
      "metadata":{"ref_order_id":""},
      "price_type":"fixed_price",
      "pricing":[{
        "onecoin equity":{
          "amount":"210.0",
          "confirmed":"0.0",
          "currency":"OCET"}
        }],
      "addresses":[{"ocet":"0x91063c66e981891ad2a41f0075ee0b60c439d207"}],
      "state":"under_payment",
      "payments":[]
    }]
  }
}

This API gets all orders

Parameters:

Name Description Required Schema
order_by specify returned deposits in orders. [desc or asc] Optional String
limit limit the number of returned records. Default to 20 Optional Integer
page specify the page of paginated results. Optional Integer