API Documentation
API Endpoints/Products

Create products

POST
/products
AuthorizationBasic <token>

Basic authentication is a simple authentication scheme built into the HTTP protocol. To use it, send your HTTP requests with an Authorization header that contains the word Basic followed by a space and a base64-encoded string username:password.Example: Authorization: Basic ZGVtbzpwQDU1dzByZA==

In: header

Header Parameters

Idempotency-Key?string

Set this optional header to the same value for idempotent requests. If the request is repeated with the same idempotency key, the server will return the same response as for the first request. Our servers retain the idempotency key and their result for 24 hours after the initial request, if not defined otherwise in your Abillify contract.

reference?string

Your unique id for the element, ie. the id of the element in your database

meta?object

Merchant data related to the entity

Empty Object

active?boolean
Defaulttrue
billing_interval_align?string

Defines how the billing interval is aligned, only if kind is plan, i.e. plan_interval = month, billling_interval = quarter, billing_interval_align = start -> billed on Jan, Apr, Jul, Oct

Value in"start" | "end"
billing_interval_partial?string

Only relevant for kind = plan, when to send first last invoice, i.e. if product is bought on 15th of month, invoice at end of month = partial or invoice with end of first full month = full

Value in"full" | "partial"
billing_start_alignment?string

LEGACY

billling_interval?string

Billing interval of plan, only if kind is plan, i.e. plan_interval = month, billling_interval = quarter -> billed every 3 months

Value in"month" | "quarter" | "year" | "term"
description_long_localized?object

Long descritpion of product, localized, allows html/markdown, shown on checkout

Default"{}"

Empty Object

description_short_localized?object

Description of product, localized, plain text, shown on checkout and invoice

Default"{}"

Empty Object

filter?object

Filter for availability, i.e. {language: [de]} or {shippingCountry: [de]}

Default"{}"

Empty Object

kind?string

Kind of product, defines behaviour in shop and billing, i.e. item is a one time product, plan is a recurring product, variant is a variation of a parent product, addon is an additional product that can only be booked together with another product

Default"item"
Value in"item" | "variant" | "plan" | "addon"
labelstring

Label of product, internal use

parent?string

Parent product of the product, mostly used when kind is variant or addon, but can also be used to group different models of the same product.

Match^-?[0-9]+$
plan_interval?string

Interval of plan, only if kind is plan

Value in"day" | "week" | "month" | "quarter" | "year"
plan_interval_amount?integer

Only relevant for kind = plan, number of product_interval the contract is made for, i.e. 12 + product_interval = month -> 12 month

Formatint32
plan_interval_minimum?integer

Only relevant for kind = plan, number of min intervals, i.e. plan_interval = month, plan_interval_amount = 1, plan_interval_minimum = 3 -> minimum contract duration 3 months

Formatint32
subsequent_product?string

Product that is newer version of this product, if disabled or validto ended

Match^-?[0-9]+$
title_localized?object

Title of product, localized, plain text, show on checkout and invoice, if not defined label is used

Default"{}"

Empty Object

unit?string

Unit of item, i.e. Pieces or Liters, shown on checkout and invoice

validfrom?string

Avaiable after

Match^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$
Formatstring
validto?string

Avaiable until

Match^d{4}-d{2}-d{2} d{2}:d{2}:d{2}$
Formatstring

Response Body

curl -X POST "https://staging1.abillify.dev/api/products" \
  -H "Idempotency-Key: string" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "abcdefg"
  }'
const body = JSON.stringify({
  "label": "abcdefg"
})

fetch("https://staging1.abillify.dev/api/products", {
  headers: {
    "Idempotency-Key": "string"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://staging1.abillify.dev/api/products"
  body := strings.NewReader(`{
    "label": "abcdefg"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Idempotency-Key", "string")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://staging1.abillify.dev/api/products"
body = {
  "label": "abcdefg"
}
response = requests.request("POST", url, json = body, headers = {
  "Idempotency-Key": "string",
  "Content-Type": "application/json"
})

print(response.text)
{
  "client": "123456789",
  "committed": "2022-07-29 17:23:47",
  "created": "2022-07-29 17:23:47",
  "id": "123456789",
  "modified": "2022-07-29 17:23:47",
  "reference": "abcdefg",
  "meta": {},
  "active": false,
  "billing_interval_align": "start",
  "billing_interval_partial": "full",
  "billing_start_alignment": "abcdefg",
  "billling_interval": "month",
  "description_long_localized": {
    "de": "Beschreibung auf Deutsch",
    "en": "Description in English"
  },
  "description_short_localized": {
    "de": "Beschreibung auf Deutsch",
    "en": "Description in English"
  },
  "filter": "{}",
  "kind": "item",
  "label": "abcdefg",
  "parent": "123456789",
  "plan_interval": "day",
  "plan_interval_amount": 12,
  "plan_interval_minimum": 3,
  "subsequent_product": "123456789",
  "title_localized": {
    "de": "Produktname",
    "en": "Product name"
  },
  "unit": "abcdefg",
  "validfrom": "2022-07-29 17:23:47",
  "validto": "2022-07-29 17:23:47"
}
{
  "code": 400,
  "details": [
    {
      "error": "Value for field 'debtor' is of wrong type, expected bigint.",
      "fields": [
        "debtor"
      ],
      "hint": "Value must be a number or a string containing only a number."
    }
  ],
  "message": "InvalidValue, see error details",
  "name": "ClientError",
  "type": "ERR_INVALID_VALUE"
}
{
  "code": 400,
  "details": [
    {
      "error": "Value for field 'debtor' is of wrong type, expected bigint.",
      "fields": [
        "debtor"
      ],
      "hint": "Value must be a number or a string containing only a number."
    }
  ],
  "message": "InvalidValue, see error details",
  "name": "ClientError",
  "type": "ERR_INVALID_VALUE"
}