Client APIs
At its core, SyncTV is an API driven service. The APIs themselves are easy enough for developers to understand, but understanding the ecosystem is a little trickier. We've created the following tutorials to help you get your head around it.

Topics:

  • Ewallet

This document describes the API for eWallet billing.

Note:
Each call to the SyncTV V2 API described in this section requires a MD5 hash signature.
See the Authorization (User) API for details on generating the MD5 hash signature.
Actions

Url:

  • [POST] /api/v2/billing/ewallet/process_invoice.[xml|json]

Process payment through eWallet gateway using the current account OAuth2 token and Invoice to bill current account.

Required Arguments:
  • (Integer) access_id
    (required) Access id returned from Authorization (User) client_authorize.
  • (String) signature
    (required) MD5 hash encoded string of SORTED query parameters.
Example Request

[POST] https://service_name.synctv.com/api/v2/billing/ewallet/process_invoice.xml?invoice_id=123&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) invoice_id — (required) The id of the invoice to be used for this transaction.
Example Response
XML JSON

On Success: HTTP 200
On Failure: HTTP 400

Response codes:
  code  1   (SUCCESS)               The transaction was successful.
  code  -4  (RECORD_NOT_FOUND)      The invoice cannot be found.
  code  -9  (INVOICE_INVALID)       The invoice has already been used (prevents double billing).
  code  -14 (OAUTH2_ERROR)          TheoAuth2 token is invalid or has expired. If expired then oAuth2 reauthorization is required.

<response>
  <code>1</code>
  <messages>
    <message>Successfully completed.</message>
  </messages>
</response>

<response>
  <code>-4</code>
  <messages>
    <message>Record not found.</message>
  </messages>
</response>

Url:

  • [GET] /api/v2/billing/ewallet/status.[xml|json]

Retrieves status of the last eWallet billing transaction.

Required Arguments:
  • (Integer) access_id
    (required) Access id returned from Authorization (User) client_authorize.
  • (String) signature
    (required) MD5 hash encoded string of SORTED query parameters.
Example Request

[GET] https://service_name.synctv.com/api/v2/billing/ewallet/status.xml?invoice_id=123&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) invoice_id — (required) The id of the invoice to be used for this transaction.
Example Response
XML JSON

On Success: HTTP 200
On Failure: HTTP 400

Response codes:
  code  1   (SUCCESS)               The authorization was successful.
  code  -4  (RECORD_NOT_FOUND)      The invoice cannot be found.

<response>
  <code>1</code>
  <status>1</status>
  <messages>
    <message>Successfully completed.</message>
  </messages>
</response>

<response>
  <code>-4</code>
  <messages>
    <message>Record not found.</message>
  </messages>
</response>
Response Fields:
  • (Integer) status
    Integer value of last invoice transaction status( -1 FAILED, 0 NO_STATUS, 1 SUCCESS, 2 PENDING)

Url:

  • [GET] /api/v2/billing/ewallet/balance.[xml|json]

Retrieves cached balance of eWallet and initiate balance refresh job.

Required Arguments:
  • (Integer) access_id
    (required) Access id returned from Authorization (User) client_authorize.
  • (String) signature
    (required) MD5 hash encoded string of SORTED query parameters.
Example Request

[GET] https://service_name.synctv.com/api/v2/billing/ewallet/balance.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

On Success: HTTP 200
On Failure: HTTP 400

Response codes:
  code  1   (SUCCESS)               The authorization was successful.
  code  -4  (RECORD_NOT_FOUND)      The invoice cannot be found.

<response>
  <code>1</code>
  <balance>1000</balance>
  <messages>
    <message>Successfully completed.</message>
  </messages>
</response>

<response>
  <code>-4</code>
  <messages>
    <message>Record not found.</message>
  </messages>
</response>
Response Fields:
  • (Integer) balance
    Integer value of cents.(Eg. $1.44 = 144 cents)