Resource: Transactions

Topics:

Actions

  • - (Object) index(method = GET)

Url:

  • [GET] /rest/v1/account/transactions? (user access)
  • [GET] /rest/v1/accounts/:account_id/transactions? (admin access)
Note:

This action requires a cookie session with either admin or user rights. See the documentation for REST Sessions for more information.

Returns a list of account transactions

Arguments:

  • (DateTime) created_at_from

    (optional) Filters by created at date of transaction.

  • (DateTime) created_at_to

    (optional) Filters by created_at date of transaction.

Example Request:

[User Access]
The following URL returns the information for all transactions on the current user account 
https://service_name.synctv.com/rest/v1/account/transactions

Example Response:

[User Access]
<ssap>
  <response>
    <count>1</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <transactions>
    <transaction>
      <id>100</id>
      <created_at>2010-12-09T10:27:41Z</created_at>
      <account_id>18668</account_id>
      <transaction_type>Subscription</transaction_type>
      <transaction_id>1146</transaction_id>
      <reason>create</reason>
      <cost>4.99</cost>
      <billing_id>67</billing_id>
      <billing_state>charge completed</billing_state>
      <billing_date>2011-04-04T18:11:37Z</billing_date>
      <billing_message>Successful transaction</billing_message>
    </transaction>
  </transactions>
  <version>0.5</version>
</ssap>

Response Fields:

  • (Array) transactions

    A list of account transactions. See below for a description of transaction fields.

  • - (Object) index(method = GET)

Url:

  • [GET] /rest/v1/account/transactions/:id (user access)
  • [GET] /rest/v1/accounts/:account_id/transactions/:id (admin access)
Note:

This action requires a cookie session with either admin or user rights. See the documentation for REST Sessions for more information.

Returns information for an account transaction

Example Request:

[User Access]
The following URL returns the transaction information for the current user account with transaction id == 100 
https://service_name.synctv.com/rest/v1/account/transactions/100

Example Response:

[User Access]
<ssap>
  <response>
    <count>1</count>
    <code>1</code>
    <message>Successfully completed.</message>
  </response>
  <version>0.5</version>
  <transaction>
    <id>100</id>
    <created_at>2010-12-09T10:27:41Z</created_at>
    <account_id>18668</account_id>
    <transaction_type>Subscription</transaction_type>
    <transaction_id>1146</transaction_id>
    <reason>create</reason>
    <cost>4.99</cost>
    <billing_id>67</billing_id>
    <billing_state>charge completed</billing_state>
    <billing_date>2011-04-04T18:11:37Z</billing_date>
    <billing_message>Successful transaction</billing_message>
  </transaction>
</ssap>

Response Fields:

  • (Number) id

    The id of the account transaction.

  • (Timestamp) created_at

    The date/time the account transaction was created (in iso8601 format).

  • (Number) account_id

    The id of the account.

  • (String) transaction_type

    The type of the transaction (e.g. ‘Subscription’ or ‘Rental’).

  • (Number) transaction_id

    The id of the transaction specified by transaction_type.

  • (String) reason

    The reason for the transaction (e.g. ‘create’ or ‘renew’).

  • (Number) cost

    The cost associated with the transaction.

  • (Number) billing_id

    The id of the billing. This value can be used to identify the merchant billing event (e.g. order_id or order_number).

  • (String) billing_state

    The billing state for the transaction (e.g. ‘charge pending’, ‘charge completed’ or ‘charge failed’).

  • (Timestamp) billing_date

    The date/time of the billing event (in iso8601 format). This field will be empty if the billing state is pending.

  • (String) billing_message

    The response message from the billing gateway. This field will be empty if the billing state is pending.