ECN Documentation
  • Home
  • Quick Start
  • Reference
    • API Reference
      • Connection Test
      • Securities
      • Client
      • Trade
      • Wallet
      • Websocket
        • Portfolio
        • Order Book
      • Security Prices
Powered by GitBook
On this page
  • Put up trade
  • Trade Order List
  • Completed Trade Order List
  • Trade Cancellation
  1. Reference
  2. API Reference

Trade

Put up trade

Use this endpoint to create a buy or sell order

POST https://ecn.afexnigeria.com/AFEXOVS/api/v1/order/create

This endpoint is used to save new trade orders (buy or sell).

Request Body

Name
Type
Description

tid*

String

A unique string of 10 characters. Typical consists of only numbers e.g. 5647382038

cid*

String

The cid of client creating the order e.g. 3300011001

security_code*

String

Code of security to be traded e.g. SMAZ

units*

String

The number of units to be traded

board_type*

String

Board type can be "Spot" or "OTC".

order_type*

String

This can either be "Buy" or "Sell"

order_price*

String

The price per unit to trade at as specified by the client.

brokerage_fee*

String

Brokerage Fee in percentage.

security_location_code

String

discount

String

discount_type

String

deduction

String

deduction_type

String

fees_breakdown*

list

A list of json objects that include the percentage fee to be charged as well as the recipient client (broker) cid of the fee e.g. [{"cid": "1000000001", "fee": 0.5, "type": "percentage"}].

N.B: The sum of fees in the breakdown must be equal to the brokerage_fee value above

is_on_behalf*

bool

A boolean that specifies if the order was created on behalf of the client. Perhaps by a broker

trader_first_name

String

For OTC

trader_last_name

String

For OTC

trader_phone_number

String

For OTC

trader_address

String

For OTC

trader_lga

String

For OTC

trader_state

String

For OTC

[
    {
        'tid': '65748392384',
        'cid': '800002938',
        'security_code': 'SMAZ',
        'units': 1000,
        'board_type': 'Spot',
        'order_type': 'Buy',
        'order_price': 5000.00,
        'brokerage_fee': 2.00,
        'discount': 1.00,
        'discount_type': ,
        'deduction': 2.00,
        'deduction_type': ,
        'fee_per_unit': 2.00,
        'use_vat': true,
        'responseCode': 100,
        'responseMessage': 'Successful',
        'serialErrors': null
    },
    ...
]

Trade Order List

Use this endpoint to pull a list of all orders on the exchange

GET https://ecn.afexnigeria.com/AFEXOVS/api/v1/order/list

This endpoint is used to list saved trade orders

{
    "responseCode": "100",
    "message": "Order List",
    "data": [
        {
            "oms_code": "99001",
            "tid": "304830545331",
            "cid": "9900110137",
            "security_code": "SCSN",
            "commodity_code": "CSN",
            "units": 1,
            "order_type": "Buy",
            "board_type": "Spot",
            "order_price": "42500.00",
            "matched_qty": 1,
            "created": "2021-02-27T09:14:14.214864Z",
            "validation_note": "Order accepted for processing",
            "status": "Matched",
            "is_ovs_validated": true,
            "ovs_validation": "Approved",
            "c_trade_tid": null,
            "location_differential_code": null,
            "security_location_code": null,
            "logistic_differential": "0.00",
            "matched_orders": [
                {
                    "buy_tid": "304830545331",
                    "sell_tid": "596830145540",
                    "security_code": "SCSN",
                    "commodity_code": "CSN",
                    "matched_qty": 1,
                    "matched_price": "42500.00",
                    "matched_date": "2021-02-27T09:14:17.947549Z"
                }
            ],
            "updated": "2021-02-27T09:14:17.949222Z",
            "discount": "0.00",
            "discount_type": null,
            "deduction": "0.00",
            "deduction_type": null,
            "fee_per_unit": "0.00",
            "use_vat": true
        }
    ]
}

Completed Trade Order List

Use this endpoint to pull a list of all completed (Matched) trades on the exchange

GET https://ecn.afexnigeria.com/AFEXOVS/api/v1/order/list/complete

{
    "responseCode": "100",
    "message": "Order List",
    "count": 50,
    "next": "",
    "previous": "",
    "data": [
        {
            "oms_code": "99001",
            "tid": "304830545331",
            "cid": "9900110137",
            "security_code": "SCSN",
            "commodity_code": "CSN",
            "units": 1,
            "order_type": "Buy",
            "board_type": "Spot",
            "order_price": "42500.00",
            "matched_qty": 1,
            "created": "2021-02-27T09:14:14.214864Z",
            "validation_note": "Order accepted for processing",
            "status": "Matched",
            "is_ovs_validated": true,
            "ovs_validation": "Approved",
            "c_trade_tid": null,
            "location_differential_code": null,
            "security_location_code": null,
            "logistic_differential": "0.00",
            "matched_orders": [
                {
                    "buy_tid": "304830545331",
                    "sell_tid": "596830145540",
                    "security_code": "SCSN",
                    "commodity_code": "CSN",
                    "matched_qty": 1,
                    "matched_price": "42500.00",
                    "matched_date": "2021-02-27T09:14:17.947549Z"
                }
            ],
            "updated": "2021-02-27T09:14:17.949222Z",
            "discount": "0.00",
            "discount_type": null,
            "deduction": "0.00",
            "deduction_type": null,
            "fee_per_unit": "0.00",
            "use_vat": true
        }
    ]
}

Trade Cancellation

Use this endpoint to cancel an open trade

GET https://ecn.afexnigeria.com/AFEXOVS/api/v1/order/cancel

This endpoint enables the cancellation of a trade order as long as it has not matched.

Request Body

Name
Type
Description

tid*

String

{
    "responseCode": "100", 
    "status": "success", 
    "affected_units": 5,
    "message": "Operation successful"
}

PreviousClientNextWallet

Last updated 3 years ago