Preference Endpoints
These endpoints relate getting and setting user preferences
Set Approval Webhook
Approval Callbacks occur when a new pending transaction are created or when this pending transaction is approved, cancelled or rejected.
PUT Url: api/Preference/SetApprovalWebhook/{url}
Response 200 (Success):
Approved Transaction
The following as a sample of a payload will be send to this url when a request payment transaction is approved:
{
"statusType":2,
"status":"Accepted",
"actionedById":1,
"affectedContactIds":[]
"transaction": {
"id":1341,
"createdById":2,
"type":"UUR",
"date":"2021-04-20T20:34:00.7606173+02:00",
"reference":null,
"currencyCode":"USD",
"amount":100.00
}
}
- statusType - This is the status 2 = Accepted
- status - test version of the status "Accepted"
- actionedById - The id on the person who approved the transaction. In the case of a request payment, this would be the payee
- affectedContactIds A list of the contact ids that were involved in this transaction
- Transaction - The actual transaction that was created
- id - The unique Id of the transaction
- createById - Id of the person that create the transaction
- type - The type of transaction (URP = Request Payment)
- date - The date of the transaction
- reference - The reference created on the initial transaction
- currencyCode - The currency of this transaction
- amount - The amount of this transaction
The following as a sample of a payload will be send to this url when a request payment transaction is rejected:
{
"statusType":3,
"status":"Rejected",
"actionedById":1,
"affectedContactIds":[]
"transaction": {
"id":null,
"createdById":null,
"type":null,
"date":null,
"reference":null,
"currencyCode":null,
"amount":null
}
}
The follow is a list of approval status codes that could be returned
- 0 = None - Used for testing
- 1 = New - A new pending transaction has been created
- 2 = Accepted - The transaction was approved and processed
- 3 = Rejected - The transaction was rejected by assigned approvee
- 4 = Cancelled - The transaction was cancelled by the creator
Set Payment Webhook
Use this endpoint to set the payment webhook url
PUT Url: api/Preference/SetPaymentWebhook/{url}
Response 200 (Success):
Payment Callback Example
- Payment Callbacks occur when a payment transaction with and an action set to (callback) is created.
api/Transaction/SendPayment?action=2
- Callbacks are only sent to the profile that created the transaction
- Callbacks will keep sending requests to the platform for 24 hours or until it gets a response.
- If a 200 (success) response is received then transaction will be processed
- If any other response (except a timeout) is received then transaction will be voided
The following as a sample of a payload will be send to this url when a payment transaction is created:
{
"id": <transactionId>,
"currencyCode":"<currency>",
"amount":<amount>,
"reference"<unique-reference>:
}
- id - The id for this transaction
- currencyCode - The currency of this transaction
- amount - The amount of this transaction
- reference - The unique reference created for this transaction