Create a Transaction
1 min
POST
https://api.sandbox.tripleup.dev/partner/transactions
Body Parameters
- bodyobject
- amountTransactionAmountrequiredExampleDescription
- card_account_external_idCardAccountExternalIdrequiredDescription
- ExternalId
- card_binCardBINExampleDescription
- card_last_4CardLast4ExampleDescription
- card_program_external_idCardProgramExternalIdrequiredDescription
- ExternalId
- currency_codeCurrencyCodeExampleDescriptionDefaultUSD
- debitTransactionIsDebitrequiredDescription
- descriptionTransactionDescriptionrequiredExampleDescription
- external_idTransactionExternalIdrequiredDescription
- merchant_category_codeMerchantCategoryCodeExampleDescription
- merchant_addressAddressDescription
- citystringExampleDescription
- completeCompleteAddressExampleDescription
- country_codeCountryCodeExampleDescription
- country_subdivision_codestringExampleDescription
- latitudeLatitudeExample
- longitudeLongitudeExample
- postal_codePostalCodeExampleDescription
- street_addressstringExampleDescription
- processor_midProcessorMIDValueExampleDescription
- processor_mid_typeProcessorMIDTypeExampleDescription
- publisher_external_idPublisherExternalIdDescription
- ExternalId
- timestampTimestamprequiredExampleDescription
- transaction_typeTransactionTyperequiredExampleDescription
Responses
201
- Transaction
- amountTransactionAmountrequiredExampleDescription
- card_account_idEntityIdrequiredExampleDescription
- created_atTimestamprequiredExampleDescription
- currency_codeCurrencyCoderequiredExampleDescriptionDefaultUSD
- debitTransactionIsDebitrequiredDescription
- descriptionTransactionDescriptionrequiredExampleDescription
- external_idTransactionExternalIdrequiredDescription
- idEntityIdrequiredExampleDescription
- matching_statusTransactionMatchingStatusrequiredDescription
- merchant_addressAddressrequiredDescription
- citystringExampleDescription
- completeCompleteAddressExampleDescription
- country_codeCountryCodeExampleDescription
- country_subdivision_codestringExampleDescription
- latitudeLatitudeExample
- longitudeLongitudeExample
- postal_codePostalCodeExampleDescription
- street_addressstringExampleDescription
- merchant_categoryMerchantCategory
- codeMerchantCategoryCoderequiredExampleDescription
- descriptionstringrequiredExampleDescription
- processor_midProcessorMIDValueExampleDescription
- processor_mid_typeProcessorMIDTypeExampleDescription
- reward_detailsRewardDetails
- timestampTimestamprequiredExampleDescription
- transaction_typeTransactionTyperequiredExampleDescription
- updated_atTimestamprequiredExampleDescription
400
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request is malformed.
- exceptionstring<TripleBadRequestError>requiredDescription
403
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultClient authentication failed.
- exceptionstring<TripleNotAuthenticatedError>requiredDescription
404
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe url path or path parameter is invalid.
- exceptionstring<TripleInvalidPathError>requiredDescription
409
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request was well-formed but violated entity integrity constraints.
- exceptionstring<TripleIntegrityError>requiredDescription
415
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request defined an unsupported media type.
- exceptionstring<TripleUnsupportedMediaType>requiredDescription
422
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request was well-formed but could not be processed.
- exceptionstring<TripleUnprocessableEntity>requiredDescription
500
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultTriple was unable to process the request due to an internal error.
- exceptionstring<TripleInternalServerError>requiredDescription
501
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request failed because it requires a feature that is not yet implemented.
- exceptionstring<TripleNotImplementedError>requiredDescription
503
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request failed due to a triple service interruption.
- exceptionstring<TripleServiceUnavailable>requiredDescription
curl
curl --request POST \
--url https://api.sandbox.tripleup.dev/partner/transactions \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"amount": 12,
"card_account_external_id": {},
"card_program_external_id": {},
"currency_code": "USD",
"debit": "",
"description": "Pittsburgh Zoo",
"external_id": "",
"publisher_external_id": {},
"timestamp": "2021-12-01T01:59:59.000Z",
"transaction_type": "PURCHASE"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"amount": 12,
"card_account_external_id": {},
"card_program_external_id": {},
"currency_code": "USD",
"debit": "",
"description": "Pittsburgh Zoo",
"external_id": "",
"publisher_external_id": {},
"timestamp": "2021-12-01T01:59:59.000Z",
"transaction_type": "PURCHASE"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.sandbox.tripleup.dev/partner/transactions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.sandbox.tripleup.dev/partner/transactions")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"amount": 12,
"card_account_external_id": {},
"card_program_external_id": {},
"currency_code": "USD",
"debit": "",
"description": "Pittsburgh Zoo",
"external_id": "",
"publisher_external_id": {},
"timestamp": "2021-12-01T01:59:59.000Z",
"transaction_type": "PURCHASE"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.sandbox.tripleup.dev/partner/transactions"
payload = json.dumps({
"amount": 12,
"card_account_external_id": {},
"card_program_external_id": {},
"currency_code": "USD",
"debit": "",
"description": "Pittsburgh Zoo",
"external_id": "",
"publisher_external_id": {},
"timestamp": "2021-12-01T01:59:59.000Z",
"transaction_type": "PURCHASE"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Transaction
{
"amount": {},
"card_account_id": "triple-abc-123",
"created_at": "2021-12-01T01:59:59.000Z",
"currency_code": "USD",
"debit": false,
"description": "Pittsburgh Zoo",
"external_id": "",
"id": "triple-abc-123",
"matching_status": "",
"merchant_address": {
"city": "PITTSBURGH",
"complete": "7370 BAKER ST, STE 100\nPITTSBURGH, PA 15206",
"country_code": "US",
"country_subdivision_code": "PA",
"latitude": 40.440624,
"longitude": -79.995888,
"postal_code": "15206",
"street_address": "7370 BAKER ST, STE 100\n"
},
"merchant_category": {
"code": "7998",
"description": "Aquariums, Dolphinariums, Seaquariums, and Zoos"
},
"processor_mid": "9000012345",
"processor_mid_type": "VISA_VMID",
"reward_details": [
""
],
"timestamp": "2021-12-01T01:59:59.000Z",
"transaction_type": "PURCHASE",
"updated_at": "2021-12-01T01:59:59.000Z"
}400
// TripleBadRequestError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}403
// TripleNotAuthenticatedError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}404
// TripleInvalidPathError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}409
// TripleIntegrityError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}415
// TripleUnsupportedMediaType
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}422
// TripleUnprocessableEntity
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}500
// TripleInternalServerError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}501
// TripleNotImplementedError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}503
// TripleServiceUnavailable
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}Important notes:
- Do not submit authorizations as purchases.
- The amount for a Purchase transaction should not include cashback if it was part of the transaction.
- Transactions must be uploaded within 3 days of when they take place.
- Triple requires below mentioned field to generate rewards on the transaction
- card_bin
- card_last_4
- processor_mid
- processor_mid_type
- merchant_address.postal_code
- merchant_address.country_subdivision_code
- merchant_category_code
Note: Triple will make every effort to match transactions with any information that is submitted. However, without the additional required fields, we make no guarantee that a transaction will be matched and/or submitted for a cardholder reward or marketing fee.