We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

Billing REST API

This API allows Transactions to be created against Accounts within the Cxense Advertising platform.

This API can be accessed by users with the appropriate permissions to manage Accounts.  Please see the Parameters section below for details on the types of Transactions which can be created.

Transactions

A new Transaction is created using an HTTP POST call to a URL of the form:

https://{cxadbaseurl}/api/secure/transactions/{accountId}?type={transactionType}&code={transactionCode}&date={YYYYmmDDhhmmssSSS}&amount={amount}&amountCurrency={cur}&externalReference={exref}

Parameters

  • cxadbaseurl the base URL of the Cxense Advertising system

  • accountId the id of the Account on which the transaction is to be made

  • type the transaction type specifier, one of:

    Transaction Code

    Description

    CR

    To make a credit transaction

    DR

    To make a debit transaction

  • code the transaction code specifier, one of:

    Transaction Code

    Description

    ADJUSTMENT_CR

    To make a credit adjustment

    ADJUSTMENT_DR

    To make a debit adjustment

    COMMISSION

    A debit transaction - indicates that a commission is to be paid by the broker (typically towards a publisher)

    COMMISSION_PAYMENT

    A credit transaction - to make a commission payment

    FEE

    A credit transaction - to indicate that a fee is payable to the broker (typically by an advertiser)

    FEE_PAYMENT

    A debit transaction - to make a fee payment

  • date the transaction date specifier, should be in the form "YYYYmmDDhhmmssSSS", the broker's timezone is assumed.

    • note: the transaction date must be greater than or equal to the creation date of the account, it is invalid to create transactions for an account at a point in time prior to the existence of the account.

  • amount the absolute (positive) value of the transaction.

  • amountCurrency the three-letter currency code.

  • externalReference an optional string which can be used to reference the transaction in an external accounting system.

Example command

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X POST "https://cxad.cxense.com/api/secure/transactions/0000000000004752?type=CR&code=FEE&date=20110907004145891&amount=102.12&amountCurrency=AUD&externalReference=ext123"

Example response payload

<?xml version="1.0"?>
<cx:transaction xmlns:cx="http://cxense.com/cxad/api/cxad" id="476e8e5a1b014ff2909a2172d1dbdd12">
  <cx:transactionDate>2011-09-07T00:41:45.891+10:00</cx:transactionDate>
  <cx:timeCreated>2011-09-08T14:14:39.676+10:00</cx:timeCreated>
  <cx:amount currencyCode="AUD" value="102.12" type="CR"/>
  <cx:code>FEE</cx:code>
  <cx:externalReference>ext123</cx:externalReference>
  <cx:commentType>CLICK_CHARGE</cx:commentType>
  <cx:commentParams/>
</cx:transaction>


Last updated: