Create an offer within your Advanced Billing site by sending a POST request.
Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products.
Once an offer is defined it can be used as an alternative to the product when creating subscriptions.
Full documentation on how to use offers in the Advanced Billing UI can be located here.
You can optionally pass in a product_price_point_id
that corresponds with the product_id
and the offer will use that price point. If a product_price_point_id
is not passed in, the product's default price point will be used.
POST /offers.json
This endpoint requires BasicAuth
Created
application/json
{
"offer": {
"id": 3,
"site_id": 2,
"product_family_id": 4,
"product_family_name": "Chargify",
"product_id": 31,
"product_name": "30-Day Square Trial",
"product_price_in_cents": 2000,
"product_revisable_number": 0,
"name": "Solo",
"handle": "han_shot_first",
"description": "A Star Wars Story",
"created_at": "2018-06-08T14:51:52-04:00",
"updated_at": "2018-06-08T14:51:52-04:00",
"archived_at": null,
"product_price_point_name": "Default",
"offer_items": [
{
"component_id": 24,
"component_name": "Invoices",
"component_unit_price": "3.0",
"price_point_id": 104,
"price_point_name": "Original",
"starting_quantity": "1.0",
"editable": false
}
],
"offer_discounts": [
{
"coupon_id": 3,
"coupon_code": "DEF456",
"coupon_name": "IB Loyalty"
}
]
}
}
curl -X POST \
--url 'https://subdomain.chargify.com/offers.json' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"offer": {
"name": "Solo",
"handle": "han_shot_first",
"description": "A Star Wars Story",
"product_id": 31,
"product_price_point_id": 102,
"components": [
{
"component_id": 24,
"starting_quantity": 1
}
],
"coupons": [
"DEF456"
]
}
}'