Off System Transactions
Not all workflows happen on the Q2 marketplace. For example your product may not be purchased on the Q2 marketplace but within your own system. Or the product may not have a up front cost to the end user. In certain scenarios like these, this API would be used to make those transactions show up in the Q2 marketplace dashboard and reports.
Authentication
The Q2 Marketplace API uses Bearer tokens to authenticate requests. You can view and manage your application token credentials within the developer portal. You will exchange your application credentials for a Bearer token at runtime.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Example Request
curl --request POST \ --url 'https://q2developer.com/oauth2/token' \ --data grant_type=client_credentials \ --data client_id={client_id_here} \ --data client_secret={client_secret_here} \ --data 'scope=com.q2.marketplace.audits com.q2.isv.{vendor} com.q2.environment.{environment}'The following 3 scopes are required.
com.q2.marketplace.audits
,com.q2.isv.{vendor}
, where vendorname is replaced, andcom.q2.environment.{environment}
. The third scope will differ depending on which financial institution you’re recording the transaction under.Example:
Your company is Super Cool Apps Co. and you’re recording a transaction made by a user from Local Credit Union. Your scopes would be
com.q2.marketplace.audits
,com.q2.isv.supercoolappsco
, andcom.q2.environment.localcreditunion
.Application scopes are managed under each application in the developer portal.
Response will look like below, with the
access_token
being a JWT.{ "access_token": "<Bearer token>", "token_type": "Bearer", "expires_in": 3600 }
Transaction
HTTP POST /audits
REQUEST PARAMS
- appShortName: (required)
str
Short Name
- timestamp: (required)
datetime
ISO 8601 timestamp that the transaction occurred on
- action: (required)
PURCHASE | ENROLL | UNENROLL
The action that occurred
- amount: (required for purchase)
decimal(places=2)
The amount of the transaction
- description:
str
Description
- userId: (required)
int
Q2 Online Banking UserID
- thirdPartyData:
object
Additional fields, such as an external transaction ID
Example Request
curl https://marketplace.q2api.com/prod/v2/audits \
--header 'Authorization: Bearer {jwt}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appShortName": "sample_app_sso_free",
"timestamp": "2022-12-05T12:35:00Z",
"userId": 2,
"action": "PURCHASE",
"description": "User purchased the app",
"amount": 12.34,
"thirdPartyData": {
"externalId": "1234567890"
}
}'
A code in the 2xx range indicate a success.