Track subscription basic info publicly
POST/v1/pub/company/:company_id/pre-subscriptions
The purpose of the pre-subscriptions API call is to address situations where the subscription cannot be directly created by the regular /V1/auth/consumer-user/company/{company_id}/subscriptions call due to certain limitations. This limitation arises when it is not feasible to transmit the registered user information to the normal subscription call (can't authorize user). In such cases, a pre-subscription call is made. This call includes the subscription type, recurring donation amount (for monthly subscriptions), round-up source (for round-up subscriptions), recurring donation percentage (for saving account subscriptions), billing day (if available), payment method (if available), donation currency (if available), charity's id receiving the donation, donation cause (must match with charity available causes), consumer user information (if available: full name, email, phone), billable address, reconcillation id (used to reconcile with subscription, generated by the company). If no 'reconcilation_id' is passed a random one will be generated by cents.
Request
Path Parameters
Unique ID of the company in scope.
- application/json
Body
Possible values: [monthly, round_up, saving_account]
The type of the subscription to be created
Donation amount (in the smallest currency unit, so 1000 is 10.00€). This field is mandatory if the subscription_type = monthly
Id of the round up source to be used to calculate round amount. This field is mandatory if the subscription_type = round_up
Donation percentage if available (in integer format, so 3% is 3). This field is mandatory if the subscription_type = saving_account
Default value: today
Day of the month when perform the billing.
Id of the payment method to be used to pay the donation.
Default value: EUR
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
External ID (generated by the company) used to reconcilate subscription with the pre-subscription
Responses
- 201
- 401
- 422
successful operation
- application/json
- Schema
- Example (from schema)
Schema
Cents id of the transaction
Cents id of the company
Possible values: [monthly, round_up, saving_account]
The type of the subscription
Donation amount (in the smallest currency unit, so 1000 is 10.00€).
Id of the round up source to be used to calculate round amount.
Donation percentage if available (in integer format, so 3% is 3).
Default value: today
Day of the month when perform the billing.
Date of the next billing.
Id of the payment method to be used to pay the donation.
Donation currency
Cents id of the charity
Cause unique name (in the namespace of the charity)
Subscription created date
Subscription updated date
Cents id of consumer user (if we have data of it)
Consumer user full 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
Possible values: [pre_subscription, draft, active, inactive, failed]
Subscription status
External ID (generated by the company) used to reconcilate transaction with the pre_transaction
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"company_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"subscription_type": "monthly",
"recurring_donation_amount": 250,
"round_up_source_id": "1f88b345-e78a-460d-a268-37291a799f71",
"recurring_donation_percentage": 3,
"billing_day": 3,
"next_billing_date": "2023-05-13",
"payment_method_id": "220cd606-55ff-4d66-8531-4d6ac15e8240",
"donation_currency": "EUR",
"charity_id": "123e4567-e89b-12d3-a456-426614174000",
"donation_cause": "cause1",
"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"
},
"subscription_status": "active",
"reconciliation_id": "COMPANY_458732297419738721976"
}
Unauthorized
Invalid input