Chargebee

Chargebee is a subscription billing and revenue management platform. It helps companies offering subscription services automate their billing procedures.

Data integration: Skyvia supports importing data to and from Chargebee, exporting Chargebee data to CSV files, replicating Chargebee data to relational databases, and synchronizing Chargebee data with other cloud apps and relational databases.

Backup: Skyvia Backup does not support Chargebee backup.

Query: Skyvia Query supports Chargebee.

Establishing Connection

To create a connection with Chargebee, you need to know the API key and Subdomain values.

Getting credentials

Subdomain is a value that comes in the URL before chargebee.com. For example, if your Chargebee link looks like this: https://test-account.chargebee.com, use test-account as your Subdomain.

API Key is a key that is used to authenticate Skyvia and control your access to the Chargebee.

To locate your API Key, perform the following steps:

  1. Log in to your Chargebee account.
  2. Click the gear icon on the left to navigate to Settings -> select Configure Chargebee and scroll down to API Keys and Webhooks.
  3. Click API Keys. Copy the available API Key or create a new one.

    Getting API Key

Creating Connection

Establishing Connection API Key

Paste the obtained Subdomain and API Key to the corresponding boxes of the Connection Editor in Skyvia.

Connector Specifics

Object Specifics

Coupons

To import records to the Coupons object, you must map either the DiscountAmount or DiscountPercentage field value. It depends on whether DiscountType is set to Fixed Amount or Percentage.

Additionally, if the ApplyOn value is set to Each Specified Item, you need to map one of two columns: ItemConstraints or ItemConstraintCriteria. Otherwise, the Import generates an error “Constraint should be passed for at least one item_type, or it has to be all/specific/criteria.”

CreditNotes

To import records to the CreditNotes in addition to the required ReferenceInvoiceId field, you must map either Total or LineItems field. Also, depending on your account settings, you may need to map the CreateReasonCode if it is set as mandatory in Chargebee.

Invoices

To import records to the Invoices object, you must map either the CustomerId or SubscriptionId fields. Additionally, you must map either the Charges or LineItems array field. Find an entry with ItemType = Charge in the ItemPrices table, copy the value from the Id column, and paste it to the LineItems array as item_price_id.

Quotes

To import records to the Quotes table, you must map either the ItemPrices or the Charges additionally to the required CustomerId field. Otherwise, the Import generates the error “At least one nonrecurring addon or charge item should be present.”

UnbilledCharges

To import records to the UnbilledCharges, besides the required SubscriptionId field, you also must map either the ItemPrices or the Charges field.

Charges value example: [{“amount”:77, “description”: “test import”}]

ItemPrices value example: [{“item_price_id”: “item_pr_1”}]

VirtualBankAccounts

Email field is not required for VirtualBankAccounts as its value is taken from the Customers object. However, if Email is not specified in Customers, you will receive an error “virtual_bank_account[email] : cannot be blank.”

Incremental Replication and Synchronization

Replication with Incremental Updates is supported for the following objects: Comments, Coupons, CreditNotes, Customers, Gifts, InvoiceLinkedOrders, Invoices, ItemFamilies, ItemPrices, Items, Orders, PaymentSources, Quotes, Subscriptions, Transactions, UnbilledCharges, VirtualBankAccounts.

Synchronization is supported for the following objects: Customers, Gifts, Invoices, PaymentSources, Quotes, Subscriptions.

The Id value in Coupons, ItemFamilies, Items and ItemPrices objects is not autogenerated and should be set manually. Thus Synchronization of Coupons, ItemFamilies, Items and ItemPrices objects cause an error “Required column ‘Id’ is missing.”

DML Operations

Skyvia supports the following DML operations for Chargebee objects:

Operation Object
INSERT, UPDATE, DELETE Coupons, CouponSets, CustomerContacts, Customers, Invoices, ItemFamilies, ItemPrices, Items, Orders, PaymentSources, Quotes, Subscriptions
INSERT, DELETE Comments, CreditNotes, UnbilledCharges, VirtualBankAccounts
INSERT, UPDATE Gifts

Stored Procedures

A part of Chargebee functionality is supported by Skyvia as stored procedures:

  • call CopyCoupon(:from_site, :id_at_from_site) — copies a coupon from one site to another. Copying of archived coupons is not supported.
  • call UnarchiveCoupon(:coupon_id) — unarchives a specific coupon using the coupon Id.
  • call DeleteUnusedCouponCodes(:coupon_set_id) — deletes all the unutilized coupon codes from a specific coupon set.
  • call ArchiveCouponCode(:coupon_code) — archives a coupon code thereby making it inactive. The archived coupon code cannot be applied to any subscription.
  • call UpdatePaymentMethodForCustomer(:customer_id, :payment_method_type, :payment_method_reference_id) — updates payment method details for a customer.
  • call UpdateBillingInfoForCustomer(:customer_id, :vat_number, :vat_number_prefix, :entity_identifier_scheme, :entity_identifier_standard, :registered_for_gst, :business_customer_without_vat_number, :is_einvoice_enabled, :billing_address_first_name, :billing_address_last_name, :billing_address_email, :billing_address_company, :billing_address_phone, :billing_address_line1, :billing_address_line2, :billing_address_line3, :billing_address_city, :billing_address_state_code, :billing_address_state, :billing_address_zip, :billing_address_country, :billing_address_validation_status) — used for updating the billing_address and vat_number attributes of the customer. Customer_id is the only required parameter. However, due to stored procedure specifics, it is necessary to fill out all the parameters.
  • call AssignPaymentRole(:customer_id, :payment_source_id, :role) — assigns primary or backup payment role or unassigns role for the payment source based on the preference for the payment collection.
  • call RecordExcessPaymentForCustomer(:customer_id, :comment, :transaction.amount, :transaction.currency_code, :transaction.date, :transaction.payment_method, :transaction.reference_number) — records any excess payments made by the customer, such as advance payments. Such payments will be automatically applied to the future invoices.
  • call RefundCreditNote(:credit_note_id, :refund_amount, :customer_notes, :refund_reason_code) — refunds a credit note to the payment source associated with the transaction.
  • call ClaimGift(:gift_id) — claiming a gift with a given id will move the status to claimed. Only gifts in unclaimed state can be claimed.
  • call CancelGift(:gift_id) — cancels gift with given id. Only gifts in scheduled and unclaimed states can be canceled.
  • call StopDunningForInvoice(:invoice_id, :comment) — stops dunning for Payment Due invoices enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to Not Paid.
  • call ApplyPaymentsForInvoice(:invoice_id, :comment, :transactions) — applies excess payments to an invoice.
  • call ApplyCreditsForInvoice(:invoice_id, :comment, :credit_notes) — applies available credits to an invoice.
  • call ClosePendingInvoice(:invoice_id, :comment, :invoice_note, :remove_general_note, :invoice_date, :notes_to_remove) — finalizes a pending invoice.
  • call CollectPaymentForInvoice(:invoice_id, :amount, :authorization_transaction_id, :payment_source_id, :comment) — collects payments for payment_due and not_paid invoices.
  • call RefundInvoice(:invoice, :refund_amount, :comment, :customer_notes, :credit_note_reason_code, :credit_note_create_reason_code) — refunds the invoice.
  • call AssignOrderNumber(:order_id) — assigns order number to the order based on the settings, if not already assigned.
  • call CancelOrder(:order_id, :cancellation_reason, :customer_notes, :comment, :cancelled_at, :credit_note_total) — cancels order and creates a refundable credit note for the order.
  • call CreateAuthorizationPayment(:customer_id, :payment_source_id, :currency_code, :amount) — authorizes a specific amount in a customer’s Credit card, which can be collected within a period.
  • call VoidAuthorizationTransaction(:transaction_id) — voids the specific authorization transaction to release blocked funds from the customer’s card.
  • call RefundPayment(:transaction_id, :amount, :comment) — refunds an online payment. Applicable only for transactions of type = payment. You can only refund a transaction with a success.

Supported Actions

Skyvia supports all the common actions for Chargebee.