BeginTransaction

Overview - Step 2 of 4 Upload Steps

More Than Rewards logs every single "line item" for the overall transaction / invoices within our system.  This is done by posting 1000 records at a time to the logpartsale, logvehiclesale,logservicesale,logcustomer, and loginventory api.  All requests are done in "batches".   These batches are are called Transactions,  so the idea is that you get a transaction id,  you upload as many 1000 record posts as you need, then you end the transaction.  The end transaction tells us that your done uploading records to.  

See the entire upload process explained here


BeginTransaction
You'll call this to get a unique transaction ID that can be used when your uploading the files to us.    DO NOT use the same transaction ID for multiple feed types.  (aka Parts, Service, Sales, Bikes, Customers ext.).   Instead it's 1 transaction Id per feed upload batch, we also strongly recommend you upload each feed type in sequence rather than trying to do them all at once.  For example you upload all the part sales, commit the transaction, then start a new transaction and upload service sales, then commit that transaction.    


VERY IMPORTANT

  • DO NOT use the same transaction ID for each feed type, instead it's just 1 transaction per feed.  
  • When your posting the transactions please try to do them in sequence, meaning do not post part sales at the same time as service sales,  instead get a transactionid post all the part sales, endthetransaction,  then begin the transaction again post the service sales under the new transaction, and so on. 
  • If after 8 hours hours any records posted which are missing "end transaction" record are purged.  
  • The sales data that is imported in MTR does not import "Time" since a lot of the Dealer Systems do not store the exact time of the transaction.   Therefore you should always always assume the start date and end date of the data requests will must have the ENTIRE DAY worth of transactions regardless of the time used.  
  • The MTR system assumes your uploading data daily, so in most cases your start date and end date will be a single date range, however be advised that we do run "week" runs on the weekends, so the date range may be larger than 24 hours that are returned to you when calling this on a Sunday.  

Post Url

  https://api.riderrewards.com/begintransaction

- SSL is required

Headers

Name  Required      Empty Allowed   Notes
PartnerAPIKeyYesNoAPI Key for approved partners, to be provided by More Than Rewards. To become an approved partner call More Than Rewards at 414-326-4100.
RRStoreAPIKeyYesNoStore's API key within the Rider Rewards system. Retrieved via the  GetMyDealerList  API endpoint.
RRStoreIDYesNoUnique store identifier within the Rider Rewards system. Retrieved via the GetMyDealerList  API endpoint.

* An error will not result if Max Length is exceeded. Data will be trimmed to this length.
+ These are set in the header WITHOUT base64, just regular header values.

Expected JSON Body To POST

{
  "transactionsummary": {
    "partnertransactionid": "12154",
    "feedtype": "P",
    "ExpectedTransactionRecordCount": "12154",  
    "startdate": "05/01/2018",
    "enddate": "05/15/2018"
  }
}



Body Description

Field  Required      Empty Allowed   Notes
transactionsummary


Object containing fields described below.
partnertransactionid
NoYesProvides ability for API user (Partner) to pass their own identifier for a given transaction. Strongly recommended for possible debugging, and future API endpoints.
partnerstoreid
NoYesProvides ability for API user (Partner) to pass their own identifier for a given store. Strongly recommended for possible debugging, and future API endpoints.
feedtype
YesNoS = Service Sales
V = Vehicle / Bike Sales
P = Parts / Store Sales
ExpectedTransactionRecordCount
YesNoThis is the total number of records to be passed to the API in the specified transaction.  If this number does not match the total count at the end of the transaction the transaction will return an ERROR CODE and will NOT be processed.  
startdate
YesNoStart date of data set. This date is obtained from the ReadyFeedUpload endpoint response.
enddate
YesNo
End date of data set. This date is obtained from the ReadyFeedUpload endpoint response.

* An error will not result if Max Length is exceeded. Data will be trimmed to this length.

Sample Results

Success Message

{
  "results": {
    "message": "Success",
    "transactionid": "asdfas234234234h323guid1232",
    "partnertransactionid": "12154",
    "partnerstoreid": "12154",
    "feedtype": "P",
    "expectedtotalcount": "50000",
    "startdate": "05/01/2018",  
    "enddate": "05/15/2018"
  }
}

The startdate and enddate are the same date ranges returned in the ReadyFeedUpload api so make sure you follow the feed upload process that is defined in the GettingStartedGuide here.

Sample Failure Message

{
  "results": { "error": "Authentication failed" }
}