Bill your first B2C customer
By the end of this tutorial a customer will have an active subscription and a finalized, paid first invoice. Solvimon will automatically generate and charge subsequent invoices each billing period.
The full flow looks like this:
- Tokenize the card in Adyen to get a stored payment method ID
- Create the customer in Solvimon, linked to that Adyen shopper
- Initialize the subscription, recording the first payment so the first invoice is immediately finalized and paid
- Set up webhooks to handle future invoices and payment events
What you’ll need:
- A Solvimon sandbox API key — see Send your first API request
- A pricing plan already created in your sandbox — set one up in Desk first
- A billing entity configured under Settings → Billing entities
- An Adyen test account with a merchant account configured for recurring payments
Step 1: Tokenize the card in Adyen
Before creating the subscription, tokenize the customer’s card details in Adyen. This stores the card and gives you a recurring_detail_reference you’ll pass to Solvimon later.
1a. Submit the card payment to create the token
shopperReference: Your identifier for this customer in Adyen. You’ll use this same value as the Solvimoncustom_fieldsreference in Step 2.storePaymentMethod: true: Tells Adyen to store the card for future recurring charges.recurringProcessingModel: "Subscription": Required for subscription-type recurring payments.
1b. Retrieve the stored payment method ID
Response:
Note the id — this is the recurring_detail_reference you’ll use in Step 3.
Step 2: Create the customer
Create the customer in Solvimon and link them to the Adyen shopper via custom_fields. Solvimon uses this to know which PSP payment methods belong to this customer.
Parameter notes:
reference: Your identifier for this customer. Used to reference them in subsequent API calls.custom_fields.reference: The key identifying which PSP this links to.PAYMENT_GATEWAY:ADYEN:SHOPPER_REFERENCE— for AdyenPAYMENT_GATEWAY:STRIPE:CUSTOMER_ID— for Stripe (use the Stripecus_...ID as the value)
custom_fields.value: The customer’s identifier in the PSP system — must match theshopperReferenceused in Step 1.
📘 You can only use payment methods that were created under the
shopperReferenceset incustom_fields. Solvimon will reject payment attempts using methods belonging to a different shopper.
📘 See the Customers API reference for all available fields.
Step 3: Initialize the subscription
/init creates the subscription and its first schedule in a single call. Providing first_payment tells Solvimon that the customer already paid (e.g. as part of checkout), which automatically finalizes the first invoice as paid. The payment_method stores the card so Solvimon can auto-charge future invoices.
Parameter notes:
pricing_plan_subscription:
reference: Your identifier for this subscription.customer_reference: The reference of the customer created in Step 2.billing_entity_reference: The billing entity this subscription is invoiced from.billing_time: "EXACT": Billing occurs on the same day of the month asstart_at— e.g. if the subscription starts on the 15th, every subsequent invoice is on the 15th. Recommended for B2C.billing_currency: The currency used for all invoices on this subscription.
pricing_plan_schedules:
pricing_plan_version_selector.pricing_plan_reference: The pricing plan to use. By default the latestACTIVEversion is used.start_at: Set to the date the customer paid and activated the subscription.end_at: Optional. When set, the subscription ends and no further invoices are generated after this date.
first_payment:
- Use this when the first payment was collected outside of Solvimon (e.g. during your checkout flow). Providing it causes Solvimon to automatically finalize the first invoice as paid.
external_reference: The transaction reference from your PSP for this payment.result: "AUTHORIZED": Confirms the payment succeeded.
payment_method:
integration_reference: The reference to the payment provider integration configured in Solvimon.integration_details.adyen.recurring_detail_reference: The stored payment method ID from Step 1b. Solvimon uses this to charge the customer’s card for future invoices.
👍 Default billing terms: Instead of specifying
billing_time,billing_currency, andbilling_periodon every subscription, you can configure defaults under Settings → Default platform settings. They apply automatically when those fields are omitted.
👍 Skipping payment collection? Omit
first_paymentandpayment_method. The subscription and schedule are still created and invoices will be generated — just not auto-charged.
Alternative: Create customer and subscription in one call
If you want to create or update the customer at the same time as initializing the subscription, pass a customer object directly in the init request instead of a customer_reference:
Note that customer_reference is omitted from pricing_plan_subscription — the customer is identified via the customer.reference field instead. If a customer with that reference already exists, it will be updated.
Step 4: Handle invoice and payment webhooks
Solvimon calls your endpoint when invoices and payments change state. Configure a webhook under Settings → Webhooks.
For a B2C subscription, handle these two events:
You can use a single webhook endpoint for both events.
📘 See the Webhooks guide for payload shapes and verification.
Step 5: Manage the subscription over time
Cancel at period end — set end_at on the current schedule:
Upgrade to a new plan — add a second schedule starting at the changeover date:
Update the payment method — patch the subscription with the new payment_method_id when a customer updates their card. The updated method will be used for all subsequent invoices.