5001: Register a transaction
| Endpoint ID: | 5001 | |||||||||||||||||||||||||
| Method: | POST | |||||||||||||||||||||||||
| URL: | /entity/id/{entity-id}/transactions/{transaction-group-id} /entity/ext-key/{ext-key}/{ext-type}/transactions/{transaction-group-id} | |||||||||||||||||||||||||
| entity-id | Rubiq entity ID that uniquely identifies an account to register transaction for | |||||||||||||||||||||||||
| ext-key | External key that uniquely identifies an account to register transaction for | |||||||||||||||||||||||||
| ext-type | Type of external key | |||||||||||||||||||||||||
| transaction-group-id | Numeric value identifying the transaction group in which to register the transaction. This ID is documented in the contract between dialogportal™ and the application | |||||||||||||||||||||||||
| Request body: | JSON data with information about the transaction. Most of the values must be agreed upon in advance with Express, and will be documented in the contract between dialogportal™ and the application.
Example 1 – Register a transaction of type 9 with a value of -5. Transaction type 9 is configured to require latitude and longitude as extra data: {
"transactionTypeID": 9,
"transactionDate": "2013-03-25T09:40:22.418Z",
"value": -5,
"reference": "SomeCouponID",
"text": "Redeemed coupon with a value of 5",
"extra": {
"latitude": 55.692814,
"longitude": 12.599205
}
}
Example 2 – Register a transaction of type 22 with a value of 1. Transaction type 22 requires no extra data: {
"transactionTypeID": 22,
"transactionDate": "2013-03-25T09:40:22.418Z",
"value": 1,
"reference": "RegisterSomeVoucherID"
}
| |||||||||||||||||||||||||
Response body: | JSON data with an ID for the newly registered transaction along with the posted information about the transaction. Example 1 – Transaction specified in example 2 above was just created with success: {
"transactionID": 12478636,
"transactionGroupID": 12478636,
"transactionGroupName": "SomeGroupName",
"transactionTypeID": 22,
"transactionTypeName": "SomeTypeName",
"transactionDate": "2013-03-25T09:40:22.418Z",
"value": 1,
"reference": "RegisterSomeVoucherID"
}
| |||||||||||||||||||||||||
| Status codes: | 200 | Transaction registered with success | ||||||||||||||||||||||||
| 400 | Request is valid but validation of transaction data failed. This may be because the fields in the payload do not correspond to the contract between dialogportal™ and the application | |||||||||||||||||||||||||
| 404 | Account, transaction group or transaction type were not found The following sub codes may be returned:
| |||||||||||||||||||||||||