.. _api_v2_get_balance: /api/v2/get-balance #################### .. toctree:: :maxdepth: 1 .. contents:: :local: .. role:: ex .. role:: code Introduction ^^^^^^^^^^^^ Get Balance is initiated through :code:`HTTPS POST` request by using :ref:`URLs` and the :ref:`parameters` specified below. Use :ref:`OAuth HMAC-SHA1` for authentication. See :ref:`statuses`. Also can be viewed on UI. Please contact support managers to enable this feature. .. _api_v2_get_balance_request_url: API URLs ^^^^^^^^ .. note:: | The path in API URL should not be hardcoded, as it may be changed in future. .. list-table:: :widths: 50, 50 :header-rows: 1 :class: longtable * - Integration - Production * - :ex:`https://sandbox.payneteasy.com/paynet/api/v2/get-balance/ENDPOINTID` - :ex:`https://gate.payneteasy.com/paynet/api/v2/get-balance/ENDPOINTID` .. _api_v2_get_balance_request_parameters: Request Parameters ^^^^^^^^^^^^^^^^^^ .. note:: | Request must have content-type=application/x-www-form-urlencoded and :ref:`Authorization headers`. .. list-table:: :widths: 25, 45, 25 :header-rows: 1 :class: longtable * - Parameter Name - Description - Value * - :code:`balance-provider` - Input your balance provider. - | ``Necessity``: Required | ``Type``: String | ``Length``: 128 .. _get-balance_response_parameters: Response Parameters ^^^^^^^^^^^^^^^^^^^ .. note:: | Response has Content-Type: text/html;charset=utf-8 header. All fields are x-www-form-urlencoded, with (0xA) character at the end of each parameter’s value. .. list-table:: :widths: 25, 75 :header-rows: 1 :class: longtable * - Response Parameters - Description * - :code:`balance-amount` - Current balance. Request Example ^^^^^^^^^^^^^^^^ .. code-block:: guess POST /paynet/api/v2/get-balance/ HTTP/1.1 Host: sandbox.payneteasy.com User-Agent: curl/7.83.0 Accept: */* Authorization: OAuth realm="",oauth_version="1.0",oauth_consumer_key="balance_test_merchant14",oauth_signature_method="HMAC-SHA1",oauth_signature="hSXMSUPP%2FIGYOOWpU4LVx0mu7SA%3D" Content-Length: 108 Content-Type: application/x-www-form-urlencoded Connection: close balance-provider=Test &oauth_consumer_key=balance_test_merchant14 &oauth_nonce=2xGTFuAgetE &oauth_signature_method=HMAC-SHA1 &oauth_timestamp=1686923599 &oauth_version=1.0 Success Response Example ^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: javascript HTTP/1.1 200 Server: server Date: Tue, 16 May 2023 08:06:05 GMT Content-Length: 192 Connection: close X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 Strict-Transport-Security: max-age=31536000 [ { "balance-amount":29.99, } ] Fail Response Example ^^^^^^^^^^^^^^^^^^^^^ .. code-block:: javascript HTTP/1.1 200 Server: server Date: Fri, 16 Jun 2023 13:53:43 GMT Content-Length: 42 Connection: close X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 Strict-Transport-Security: max-age=31536000 error-message=Unknown balance provider saa Postman Collection ^^^^^^^^^^^^^^^^^^ .. raw:: html :file: ../_static/Postman/Postman_get_balance.html Request Builder ^^^^^^^^^^^^^^^ .. raw:: html :file: ../_static/examples/get_balance_Debug.html