Track basic info publicly
POST/v1/pub/company/pre-transactions
The purpose of the pre-transactions API call is to address situations where the cause selection cannot be directly passed to the regular /V1/auth/transactions call due to certain limitations in the front-end. This limitation arises when it is not feasible to transmit the cause selection information to the normal transaction call, which typically occurs after the payment for a donation has been processed. In such cases, when a cause is selected in the front end and the transmission of selection information is hindered, a pre-transaction call is made. This call includes the cause selection, consumer user information (if available), and the reconciliation ID, which is generated by the company. The pre-transaction call serves as a means to handle the cause selection and associated information when passing them to the subsequent steps becomes impractical due to front-end constraints. If no 'reconcilation_id' is passed a random one will be generated by cents.
Request
- application/json
Body
Id of the company which created pre-transaction
Transaction amount (in the smallest currency unit, so 1000 is 10.00€)
Donation amount (in the smallest currency unit, so 1000 is 10.00€)
Donation percentage if available (in integer format, so 3% is 3)
Total (transaction+donation) amount (in the smallest currency unit, so 1000 is 10.00€)
Transaction currency
Donation currency
Cents id of the charity
Cause unique name (in the namespace of the charity)
Consumer user name (if we have data of it)
Consumer user email (if we have data of it)
Consumer user email anonymized flag (if email is anonymized or not)
Consumer user phone number (if we have data of it)
billable_address
object
Payment method id to be used for this transactions. This field is needed only in the scenarios where there are multiple payment options available and the payment method to be used has to be stored in cents.
External ID (generated by the company) used to reconcilate transaction with the pre_transaction
Responses
- 201
- 401
- 422
successful operation
- application/json
- Schema
- Example (from schema)
Schema
cents id of the transaction
Payment gateway id, the payment gateway unique name identifier is put at the begining of the string (this is inserted by cents according to the logged user)
Cents id of the company
Transaction amount
Transaction amount
Transaction currency
Cents id of the charity
Cause unique name (in the namespace of the charity)
Donation amount (in the smallest currency unit, so 1000 is 10.00€)
Donation percentage if available (in integer format, so 3% is 3)
Donation currency
Transaction created date
Transaction updated date
Cents id of consumer user (if we have data of it)
Consumer user name (if we have data of it)
Consumer user email (if we have data of it)
Consumer user email anonymized flag (if email is anonymized or not)
Consumer user phone number (if we have data of it)
billable_address
object
required
Payment method id used for this transactions.
Possible values: [pre_transaction, draft, to_be_payed, paid, refunded, disputed, failed]
Transaction status
Refunded amount
External ID (generated by the company) used to reconcilate transaction with the pre_transaction
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"external_id": "STRIPE_59782679127678169827",
"company_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"order_amount": 153.86,
"total_amount": 155.66,
"currency": "EUR",
"charity_id": "123e4567-e89b-12d3-a456-426614174000",
"donation_cause": "cause1",
"donation_amount": 250,
"donation_percentage": 3,
"donation_currency": "EUR",
"created_date": "2023-05-13",
"updated_date": "2023-05-17",
"consumer_user_id": "3f33b5e7-a94b-4f86-92e5-b1f7c1a7c68b",
"consumer_user_full_name": "John Doe",
"consumer_user_email": "john@email.com",
"consumer_user_email_anonymized": false,
"consumer_user_phone": 393334445555,
"billable_address": {
"street_address": "via Roma 5",
"city": "Milan",
"region_state": "Lombardia",
"zip_code": "20100",
"country": "Italy"
},
"payment_method": "0f63c9aa-35cc-48f9-af7d-30bfb62172ad",
"transaction_status": "paid",
"refunded_amount": 0,
"reconciliation_id": "COMPANY_458732297419738721976"
}
Unauthorized
Invalid input