Ledger API

This is deprecated. Please use Reporting Version V2

Introductionback to top

This service allows you to retrieve ledger entries based on your clientId. You can find your clientId under the Account Profile section when you log into to your GPN account.

URLback to top

https://partner-int-api.groupon.com/v1/ledger.json

https://partner-int-api.groupon.com/v1/ledger.csv

Formatsback to top

  • JSON
  • CSV

Timezonesback to top

All timestamps are returned in the timezone selected for the corresponding GPN account.

URL parametersback to top

clientId
  • Required
  • The api key that identifies your client
  • Example: cee15b12a7518bdf220a92234996195db4639614
orderStartDate
  • Optional
  • Date should be formatted as dd-MM-yyyy
  • Requires orderEndDate
  • Order start date must be less than or equal to current date in the affiliate time zone
  • Example: 01-01-2014
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
orderEndDate
  • Optional
  • Date should be formatted as dd-MM-yyyy
  • Requires orderStartDate
  • Order end date must be less than or equal to current date in the affiliate's time zone
  • Example: 31-01-2014
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
transactionStartDate
  • Optional
  • Date should be formatted as dd-MM-yyyy
  • Requires transactionEndDate
  • Transaction start date must be less than or equal to current date in the affiliate's time zone
  • Requires transactionEndDate parameter
  • Example: 31-01-2014
transactionEndDate
  • Optional
  • Date should be formatted as dd-MM-yyyy
  • Requires transactionStartDate
  • Transaction end date must be less than or equal to current date in the affiliate's time zone
  • Requires transactionStartDate parameter
  • Example: 31-01-2014
orderId
  • Optional
  • The Groupon Order ID (or the first few digits of it)
  • Example: 151087914 (151 will also match this order ID)
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
transactionId
  • Optional
  • The Groupon Transaction ID for the ledger entry
  • Example: 231456 (Only exact matches are supported)
sid
  • Optional
  • SID of any of your users who placed an order (or the starting substring of the SID)
  • Example: 4dcdb57209723187da4918d1bcc9091a (4dcdb will also match the above SID)
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
wid
  • Optional
  • Website ID: One of the registered WIDs on your account (or the starting substring of the WID)
  • Example: http://www.foo.com ('http://www.f' will also match the above WID)
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
permalink
  • Optional
  • Groupon permalink of the orders (or the starting substring of the permalink)
  • Example: gl-the-orlando-improv-1 ('gl-the-or' will also match the above permalink)
  • Note, use of this URL parameter will restrict the returned ledger entries in the JSON response to SALE, and REFUND entries only. This is because BONUS, and PAYMENT entries are not associated with any order.
start
  • Optional
  • Pagination parameter for specifying the starting record. Requires end parameter.
  • Example: 0
end
  • Optional
  • Pagination parameter for specifying the ending record. Requires start parameter.
  • Example: 50
column
  • Optional
  • The column number of the response to sort by. Column 0 is date, Column 1 is orderID etc (see the full sequence in the sample response below). Default sort is by date (column 0)
  • Example: 2
ascending
  • Optional
  • true/false to indicate if the sorting on the column is ascending or descending. Default false
  • Example: true
transactionType
  • Optional
  • Type of transaction (currently supported values include SALE, REFUND, BONUS, and PAYMENT transaction types)
  • Example: Sale

Response Elementsback to top

Total (JSON only)

  • Total number of entries in the date range

Summary (JSON only)

  • grossMinorUnits
    Total sales amount in the date range, in minor units (for USD decimal value, divide by 100)
  • commissionMinorUnits
    Total commission amount in the date range, in minor units (for USD decimal value, divide by 100)
  • totalOrders
    Total number of orders in the date range

Records

  • orderDate
    Order timestamp of when the order was placed in the affiliate's time-zone. The format is YYYY-MM-DDThh:mm:ss.. Example 2014:02:27T06:39:25. For BONUS or PAYMENT entries, this field will contain 'null'
  • transactionDate
    Transaction timestamp of the ledger entry in the affiliate’s time-zone.. The format is YYYY-MM-DDThh:mm:ss.. Example 2014:02:27T06:39:25
  • orderId
    Groupon's order ID. String. Example: 151087. For BONUS or PAYMENT entries, this field will contain 'null'
  • transactionId
    The Groupon Transaction ID for the ledger entry. Example: 231456
  • permalink
    The Groupon permalink of the order. Example: gl-the-orlando-improv-1. For BONUS or PAYMENT entries, this field will contain 'null'
  • affiliateId
    Your affiliate ID
  • grossMinorUnits
    Sale amount in minor units in the affiliate's currency. E.g 4025 (divide by 100 to get decimal value). For BONUS or PAYMENT entries, this field will contain 'null'
  • commissionMinorUnits
    Commission amount in minor units in the affiliate's currency. Example: 425 (divide by 100 to get decimal value in USD)
  • sid
    SID corresponding to the order. Example: 4dcdb57209723187da4918d1bcc9091a. For BONUS or PAYMENT entries, this field will contain 'null'
  • wid
    WID corresponding to the order. Example: http://www.foo.com. For BONUS or PAYMENT entries, this field will contain 'null'
  • transactionType
    Type of transaction (currently supported values include SALE, REFUND, BONUS & PAYMENT)
  • orderStatus
    Status of the order (currently supported values include Open & Locked)

Sample JSON Callback to top

Sample JSON Response

Error Messageback to top

Response Elements

All error responses contain at least the top level error object with httpCode and message

  • httpCode
    HTTP status code
  • message
    Human readable message indicating why the API request failed

Sample Response