Admin 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:

  • Invoices

This document describes the API for creating, reading, updating and deleting invoices.

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:

  • [GET] /api/v2/invoices.[xml|json]

Returns a list of invoices.

Note:
An invoice represents a request for a financial transaction. The status field indicates that state of the invoice as it is being processed.
Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

The following example returns a listing of invoices.
[GET] https://service_name.synctv.com/api/v2/invoices.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) offset — Used for pagination of response data (default: 25 items per response). Specifies the offset of the next block of data to receive.
  • (Integer) status — Filter invoices by status (0 - Inactive, 1 - Active).
  • (DateTime) updated_at_from — DEPRECATED: updated_at_from is deprecated and may be removed from future releases, use updated_at_greater instead. Filter invoices by updated_at greater than value (e.g: updated_at_from=2012-02-15T02:06:56Z)
  • (DateTime) updated_at_to — DEPRECATED: updated_at_to is deprecated and may be removed from future releases, use updated_at_less instead. Filter invoices by updated_at less than value( e.g. updated_at_to=2012-02-30T02:06:56Z)
  • (DateTime) created_at_greater — Filter invoices by created_at greater than value (e.g: created_at_greater=2012-02-15T02:06:56Z)
  • (DateTime) created_at_less — Filter invoices by created_at less than value (e.g. created_at_less=2012-02-30T02:06:56Z)
  • (DateTime) updated_at_greater — Filter invoices by updated_at greater than value (e.g: updated_at_greater=2012-02-15T02:06:56Z)
  • (DateTime) updated_at_less — Filter invoices by updated_at less than value (e.g. updated_at_less=2012-02-30T02:06:56Z)
  • (Array) any_of_platform_ids — Filter invoices by platform ids (e.g. any_of_platform_ids[]=1&any_of_platform_ids[]=3)
  • (String) sort_order — Defines the sort order of the response. (e.g. sort_order=created_at). Or can be multi-sort (e.g. sort_order[]=created_at&sort_order[]=id. When multi-sorting the url placement determines which is dominant).
  • (String) id — The unique identifier of the invoice.
  • (String) created_at — Timestamp for when the invoice was first created.
  • (String) updated_at — Timestamp for when the invoice was first updated.
  • (String) platform_id — Identifier of the platform.
  • (Boolean) sort_descending — Reverse order of sort_order sorting, make it descending.
Example Response
XML JSON

<response>
  <invoices>
    <invoice>
      <id>1</id>
      <ownership_id>1</ownership_id>
      <status>0</status>
      <uid>MyString</uid>
      <price nil="true"/>
      <currency>USD</currency>
      <tax>0.0</tax>
      <platform_id>2</platform_id>
      <invoice_transactions/>
      <updated_at>2014-05-01T21:29:15Z</updated_at>
      <created_at>2014-05-01T21:29:15Z</created_at>
    </invoice>
    <invoice>
      <id>2</id>
      <ownership_id>2</ownership_id>
      <status>0</status>
      <uid>MyString</uid>
      <price nil="true"/>
      <currency>USD</currency>
      <tax>0.0</tax>
      <platform_id>4</platform_id>
      <invoice_transactions/>
      <updated_at>2014-05-01T21:29:15Z</updated_at>
      <created_at>2014-05-01T21:29:15Z</created_at>
    </invoice>
  </invoices>
</response>
Response Fields:
  • (Integer) invoice[id]
    The unique identifier of invoice
  • (Integer) invoice[ownership_id]
    The invoice created for specific ownership
  • (Integer) invoice[uid]
    Unique id of order, something unique across all our services
  • (Integer) invoice[status]
    The status of the invoice (0 - inactive, 1 - active)
  • (Decimal) invoice[price]
    Amount price of invoice
  • (String) invoice[currency]
    Currency in which this invoice must be processed
  • (Decimal) invoice[tax]
    Tax that should be paid for this price.
  • (Integer) invoice[platform_id]
    Platform that was used to create invoice.
  • (Array) invoice[invoice_transactions]
    A list of transactions associated with the invoice, includes transaction id, status (e.g. 0 = no-status, 1 = success, 2 = pending, 3 = re-submit, -1 failed), action (e.g. "verified"), reference (e.g. credit card transaction ID), transaction_type (e.g. "credit_card_transaction", "xbox_transaction", "ewallet_transaction").

Url:

  • [GET] /api/v2/invoices/:id.[xml|json]

Returns the specified invoice.

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

The following URL returns the invoice information for id == 100.
[GET] https://service_name.synctv.com/api/v2/invoices/100.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <invoices>
    <id>100</id>
    <ownership_id>1</ownership_id>
    <status>0</status>
    <uid>MyString</uid>
    <price nil="true"/>
    <currency>USD</currency>
    <tax>0.0</tax>
    <platform_id>2</platform_id>
    <invoice_transactions/>
    <updated_at>2014-05-01T21:29:16Z</updated_at>
    <created_at>2014-05-01T21:29:16Z</created_at>
  </invoices>
</response>
Response Fields:
  • (Integer) invoice[id]
    The unique identifier of invoice
  • (Integer) invoice[ownership_id]
    The invoice created for specific ownership
  • (Integer) invoice[uid]
    Unique id of order, something unique across all our services
  • (Integer) invoice[status]
    The status of the invoice (0 - inactive, 1 - active)
  • (Decimal) invoice[price]
    Amount price of invoice
  • (String) invoice[currency]
    Currency in which this invoice must be processed
  • (Decimal) invoice[tax]
    Tax that should be paid for this price.
  • (Integer) invoice[platform_id]
    Platform that was used to create invoice.
  • (Array) invoice[invoice_transactions]
    A list of transactions associated with the invoice, includes transaction id, status (e.g. 0 = no-status, 1 = success, 2 = pending, 3 = re-submit, -1 failed), action (e.g. "verified"), reference (e.g. credit card transaction ID), transaction_type (e.g. "credit_card_transaction", "xbox_transaction", "ewallet_transaction").

Url:

  • [POST] /api/v2/invoices.[xml|json]

Creates a new invoice.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
  • (Integer) invoice[ownership_id]
    The ownership for which this invoice was created.
Example Request

The following URL creates an invoice that ownership_id=1
[POST] https://service_name.synctv.com/api/v2/invoices.xml?invoice[ownership_id]=1&access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Example Response
XML JSON

<response>
  <invoices>
    <id>1</id>
    <ownership_id>1</ownership_id>
    <status>0</status>
    <uid>MyString</uid>
    <price nil="true"/>
    <currency>USD</currency>
    <tax>0.0</tax>
    <platform_id>2</platform_id>
    <invoice_transactions/>
    <updated_at>2014-05-01T21:29:17Z</updated_at>
    <created_at>2014-05-01T21:29:17Z</created_at>
  </invoices>
</response>
Response Fields:
  • (Integer) invoice[id]
    The unique identifier of invoice
  • (Integer) invoice[ownership_id]
    The invoice created for specific ownership
  • (Integer) invoice[uid]
    Unique id of order, something unique across all our services
  • (Integer) invoice[status]
    The status of the invoice (0 - inactive, 1 - active)
  • (Decimal) invoice[price]
    Amount price of invoice
  • (String) invoice[currency]
    Currency in which this invoice must be processed
  • (Decimal) invoice[tax]
    Tax that should be paid for this price.
  • (Integer) invoice[platform_id]
    Platform that was used to create invoice.
  • (Array) invoice[invoice_transactions]
    A list of transactions associated with the invoice, which is empty at creation time.

Url:

  • [GET] /api/v2/invoices/count.[xml|json]

Counts a list of invoices.

Note:
An invoice represents a request for a financial transaction. The status field indicates that state of the invoice as it is being processed.
Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

[GET] https://service_name.synctv.com/api/v2/invoices/count.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) status — Filter invoices by status (0 - Inactive, 1 - Active).
  • (DateTime) updated_at_from — Filter invoices by updated_at greater than value (e.g: updated_at_from=2012-02-15T02:06:56Z)
  • (DateTime) updated_at_to — Filter invoices by updated_at less than value( e.g. updated_at_to=2012-02-30T02:06:56Z)
  • (Array) any_of_platform_ids — Filter invoices by platform ids (E.g. any_of_platform_ids[]=1&any_of_platform_ids[]=3)
Example Response
XML JSON

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