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:

  • Creditcard

This document describes the API for CreditCard 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/credit_card/process_invoice.[xml|json]

Process payments through Credit Card 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/credit_card/process_invoice.xml?invoice_id=123&transaction_reference=123456789&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) invoice_id — (required) The ID of the invoice to be used for this transaction.
  • (Integer) transaction_reference — (required) Transaction ID reference from a payment gateway.
Example Response
XML JSON

On Success: HTTP 200
On Failure: HTTP 400

Response codes:
  code  1   (SUCCESS)               The transaction was successful.
  code  -2  (ARGUMENT_MISSING)      A transaction ID as transaction_reference was not passed in.
  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/credit_card/status.[xml|json]

Retrieves status of a credit card billing transaction for an invoice.

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/credit_card/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  2   (PENDING)               The transaction is still pending to be verified.
  code  1   (SUCCESS)               The authorization was successful.
  code  0   (NO_STATUS)             There is no transaction associated to the invoice, yet, due to not processing the invoice before this call.
  code  -1  (FAILED)                The transaction could not be verified successfuly.
  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)