Skip to main content
POST
/
admin
/
products
Create a product
curl --request POST \
  --url https://api-dev.narrative.io/admin/products \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sku": "general-storage",
  "sku_type": {
    "category": "storage"
  },
  "payable_company_id": 1,
  "name": "name",
  "cloud_platform": {
    "platform": "aws",
    "region": "us-east-1"
  },
  "unit": "bytes",
  "default_rate": {
    "type": "per_unit",
    "unit_price": {
      "type": "test-price",
      "currency": "USD",
      "price_in_micro_cents": 1
    }
  },
  "status": "active"
}
'
{
  "id": "cd98bbb6-1086-4aea-9b5f-8ba39671a659",
  "sku": "general-storage",
  "sku_type": {
    "category": "storage"
  },
  "payable_company_id": 1,
  "name": "name",
  "cloud_platform": {
    "region": "us-east-1",
    "platform": "aws"
  },
  "unit": "bytes",
  "default_rate": {
    "type": "per_unit",
    "unit_price": {
      "value": 1,
      "expressed_in": "cents",
      "currency": "USD"
    }
  },
  "status": "active",
  "created_at": "2023-02-13T12:55:24.104Z",
  "created_by_user_id": 1,
  "updated_at": "2023-02-13T12:55:24.104Z",
  "updated_by_user_id": 1
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
sku
string
required

SKU for product

sku_type
object
required

Sku Type (json object, category filed is mandatory)

payable_company_id
number
required

Payable company id

name
string
required

Product name

unit
string
required
default_rate
object
required

Product rate

status
enum<string>
required
Available options:
active,
archived
description
string

Optional description of a product

cloud_platform
object

Cloud Platform (json object)

Response

OK

id
string<uuid>
required

UUID

sku
string
required

SKU for product

sku_type
object
required

Sku Type (json object, category filed is mandatory)

payable_company_id
number
required

Payable company id

name
string
required
unit
string
required
default_rate
object
required

Product rate

status
enum<string>
required
Available options:
active,
archived
created_at
string<date-time>
required
updated_at
string<date-time>
required
description
string
cloud_platform
object

Cloud Platform (json object)

created_by_user_id
number
Example:

123

updated_by_user_id
number
Example:

123