Introducing the Chargebee CLI

How do I add a billing or shipping address for one-time charges using the API?

Problem Statement

You want to add a billing or shipping address when creating a one-time charge with the API.

Solution

In Product Catalog 2.0, you can include shipping address attributes when creating a one-time charge through the API. See Create invoice for items and one-time charges.

For Legacy Product Catalog to add a shipping address you need to use a different API call. You can billing address using Customer attributes or add shipping address using Subscription attributes then you can use to call Create invoice for items and one-time charges which will use the shipping address on file. Note, in absence of a shipping address, the billing address takes presence for Shipping items.