Create Offer

API Docs by APIMATIC
Advanced Billing APIAPI EndpointsOffers

Create Offer
#

Create an offer within your Advanced Billing site by sending a POST request.

Documentation

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.

Using a Product Price Point

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
Authentication

This endpoint requires BasicAuth

BasicAuth
BasicAuth
Required

Set authorization parameters for BasicAuth

Required
string

The username to use with basic authentication

  • is a required field
Required
string

The password to use with basic authentication

  • is a required field

API Code Playground

Endpoint Arguments
Parameters
Required


Responses

  • 201
  • 422

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"
      }
    ]
  }
}
  • HTTP
  • Java
  • .NET
  • PHP
  • Python
  • Ruby
  • TypeScript
  • Go
  • Request
  • Response
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"
    ]
  }
}'