Publish spend data

With spend information, the Productiv platform enables software discovery and generates insights about purchased applications and their associated costs.

This API can be used to push spend data to Productiv from one or more existing systems.

Prerequisites

  • Before this API can be queried, you should have already set up the application for which you will be publishing spend data. Once thats done you should have a unique appId that can be used to query these APIs. Visit the Set up an Application section for more details.

  • In order to query this API, you would also need to send an access_token as part of the Authorization header. Visit the Authorization section to see the steps for generating an access token.

Endpoint

POST https://public-api.productiv.com/services/push/v1/customer/apps/{appId}/finance
Required Scope https://api.productiv.com/connector.write

Request headers

Parameter Value
content-type application/json
Authorization Bearer access_token

Path params

Parameter Description
appId appId represents the App from which the spend data are being pushed. (See Set up an Application)

Request body

Property Datatype Description Optional
records array List of SpendDataRecord objects to be published (see definition below) No

Example request body

{
  "records": [
    {
      "signatureId": "T00000123",
      "created": 1577836800000,
      "amount": 200.15,
      "currency": "USD",
      "type": "expense",
      "vendor": "GitHub",
      "identifier": "user@example.com",
      "name": "Example User",
      "category": "IT Expense:Software & Web Services",
      "additionalData1": "Sample value 1",
      "additionalData2": "Sample value 2",
      "additionalData3": "Sample value 3"
    }
  ]
}

Response

If the request is successful, a JSON response will be returned. This JSON object will contain the following parameters:

Parameter Description
success Will be set to true in case of a successful response.

Example response

{
  "success": true
}

API limitations

  • A maximum of 1000 spend records can be uploaded in a single request

Objects

SpendDataRecord

Property Datatype Description Optional
signatureId String Unique id of the transaction in the source system. This property is used to dedupe transactions if they are sent twice. No
created Number Unix timestamp in milliseconds of when the transaction was created in the sources system. No
amount Number Amount of the transaction. No
currency String Currency code for the amount based on the ISO 4217 standard (ex. USD, CAD, EUR). No
type String Type of the transaction. Either expense or invoice. No
vendor String Name of the vendor to whom the transaction was paid. No
description String Description/memo of the transaction. Yes
identifier String Identifier of the user associated with the transaction like email. Yes
name String Name of the user associated with the transaction. Yes
category String Category/GL Account for the transaction. Yes
transactionNumber String Identifying number for the transaction. Yes
invoiceNumber String Identifying number for the invoice. Yes
poNumber String Identifying number for the purchase order. Yes
costCenter String Cost center or department for the transaction. Yes
lastModifiedTs String Unix timestamp in milliseconds of when the transaction was last modified in the source system. Yes

You can add any other fields in the record in which case those fields will be showing up as Additional Details for the transaction.