Skip to content
ABUNA
DocsProducts

API reference

Products

Create, list, and rename the things you sell.

A product is something you sell. You charge for it through one or more prices.

The product object

Attributes

  • idstring

    Unique identifier for the product.
  • app_idstring

    The app the product belongs to.
  • namestring

    The product's name.
  • slugstring

    A URL-safe form of the name. It is unique within the app.
  • created_attimestamp

    When the product was created, in Unix seconds.
The product object
{
  "id": "01J9ZQ5A2B3C4D5E6F7G8H9JKM",
  "app_id": "01J9ZQ4Y7R3T6V8W2X5B1C0DEF",
  "name": "Pro plan",
  "slug": "pro-plan",
  "created_at": 1727600000
}

Create a product

POST/v1/apps/{appID}/products

Creates a product.

Parameters

  • namestringrequired

    The product's name.
  • slugstring

    The slug to use. Defaults to one made from name.

Returns the product with status 201. If another product in the app has the same slug, returns 409 with code name_taken.

POST /v1/apps/{appID}/products
curl https://api.abuna.app/v1/apps/01J9ZQ4Y7R3T6V8W2X5B1C0DEF/products \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Pro plan"}'
Response
{
  "id": "01J9ZQ5A2B3C4D5E6F7G8H9JKM",
  "app_id": "01J9ZQ4Y7R3T6V8W2X5B1C0DEF",
  "name": "Pro plan",
  "slug": "pro-plan",
  "created_at": 1727600000
}

List products

GET/v1/apps/{appID}/products

Lists every product in the app, newest first.

Returns an array of product objects. It isn't paginated.

GET /v1/apps/{appID}/products
curl https://api.abuna.app/v1/apps/01J9ZQ4Y7R3T6V8W2X5B1C0DEF/products \
  -H "Authorization: Bearer sk_test_..."
Response
[
  {
    "id": "01J9ZQ5A2B3C4D5E6F7G8H9JKM",
    "app_id": "01J9ZQ4Y7R3T6V8W2X5B1C0DEF",
    "name": "Pro plan",
    "slug": "pro-plan",
    "created_at": 1727600000
  }
]

Rename a product

PATCH/v1/apps/{appID}/products/{id}

Renames the product. Its slug changes to match the new name.

Parameters

  • namestringrequired

    The new name.

Returns the product. If the app has no product with that ID, returns 404 with code not_found. If another product already has the new slug, returns 409 with code name_taken.

PATCH /v1/apps/{appID}/products/{id}
curl https://api.abuna.app/v1/apps/01J9ZQ4Y7R3T6V8W2X5B1C0DEF/products/01J9ZQ5A2B3C4D5E6F7G8H9JKM \
  -X PATCH \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Team plan"}'
Response
{
  "id": "01J9ZQ5A2B3C4D5E6F7G8H9JKM",
  "app_id": "01J9ZQ4Y7R3T6V8W2X5B1C0DEF",
  "name": "Team plan",
  "slug": "team-plan",
  "created_at": 1727600000
}

Next steps