Skip to main content

What is a SKU?

A SKU (Stock Keeping Unit) represents a specific variant of a product. For example, for a t-shirt, each size/color combination is a distinct SKU.
Identifier format: sku_ followed by 36 alphanumeric characters.Example: sku_abc123def456ghi789jkl012mno345

Product → SKU Relationship

Product "Premium T-shirt"
├── SKU "T-shirt S White" (TSHIRT-S-WHITE)
├── SKU "T-shirt M White" (TSHIRT-M-WHITE)
├── SKU "T-shirt L White" (TSHIRT-L-WHITE)
├── SKU "T-shirt S Black" (TSHIRT-S-BLACK)
├── SKU "T-shirt M Black" (TSHIRT-M-BLACK)
└── SKU "T-shirt L Black" (TSHIRT-L-BLACK)
A product can have multiple SKUs, and each SKU can have multiple prices (different currencies, monthly/yearly subscriptions, etc.).

SKU Attributes

Main Attributes

AttributeTypeDescription
idstringUnique SKU identifier
productIdstringReference to parent product
skuCodestringUnique SKU code (e.g., “TSHIRT-S-WHITE”)
namestringVariant name
attributesobjectVariant attributes (size, color, etc.)

Inventory Management

AttributeTypeDescription
stockTrackingbooleanStock management enabled
stockQuantitynumber | nullStock quantity (null if not tracked)

Create a SKU

Simple SKU

curl -X POST https://api.yabetoo.com/v1/products/prod_abc123/skus \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "skuCode": "TSHIRT-M-WHITE",
    "name": "T-shirt M White",
    "attributes": {
      "size": "M",
      "color": "white"
    },
    "stockTracking": true,
    "stockQuantity": 100
  }'

SKU without Stock Management

For digital products or services, disable stock tracking:
curl -X POST https://api.yabetoo.com/v1/products/prod_abc123/skus \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "skuCode": "COURSE-PRO",
    "name": "Pro Course",
    "attributes": {
      "access": "lifetime"
    },
    "stockTracking": false
  }'

API Response

{
  "id": "sku_xyz789abc123def456",
  "object": "sku",
  "productId": "prod_abc123def456ghi789",
  "skuCode": "TSHIRT-M-WHITE",
  "name": "T-shirt M White",
  "attributes": {
    "size": "M",
    "color": "white"
  },
  "stockTracking": true,
  "stockQuantity": 100,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Inventory Management

When stockTracking is enabled, the system automatically manages stock:
  • Pre-purchase verification: Availability is checked before validating an order
  • Automatic update: Stock is decremented upon purchase
  • Automatic restoration: On cancellation or payment failure, stock is restored
For digital products or services, disable stockTracking to allow unlimited sales.

Custom Attributes

The attributes field is a flexible JSON object that can contain any combination of attributes:
{
  "size": "L",
  "color": "blue",
  "material": "cotton"
}

SKU Code

The skuCode is a unique, human-readable identifier for internal management:
  • Use alphanumeric characters and hyphens only
  • Keep codes short but descriptive
  • Avoid spaces and special characters
  • Be consistent in your naming convention

Common Operations

List SKUs for a product

curl https://api.yabetoo.com/v1/products/prod_abc123/skus \
  -H "Authorization: Bearer sk_live_..."

Update a SKU

curl -X PATCH https://api.yabetoo.com/v1/skus/sku_xyz789 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "stockQuantity": 150,
    "name": "T-shirt M White - Limited Edition"
  }'

Update stock

curl -X PATCH https://api.yabetoo.com/v1/skus/sku_xyz789/stock \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "stockQuantity": 200
  }'

SKU → Price Relationship

Each SKU can have multiple prices for different pricing strategies:
SKU "Pro Course"
├── Price €99 (one-time payment)
├── Price €19/month (monthly subscription)
├── Price €199/year (yearly subscription)
└── Price 65,000 XOF (one-time payment Africa)
See Price Documentation to configure pricing.

Complete Examples

{
  "product": {
    "name": "Slim Jeans",
    "type": "physical",
    "hasSkus": true
  },
  "skus": [
    {
      "skuCode": "JEANS-SLIM-28-BLUE",
      "name": "Slim Jeans 28 Blue",
      "attributes": { "waist": "28", "color": "blue" },
      "stockTracking": true,
      "stockQuantity": 25
    },
    {
      "skuCode": "JEANS-SLIM-30-BLUE",
      "name": "Slim Jeans 30 Blue",
      "attributes": { "waist": "30", "color": "blue" },
      "stockTracking": true,
      "stockQuantity": 40
    },
    {
      "skuCode": "JEANS-SLIM-32-BLACK",
      "name": "Slim Jeans 32 Black",
      "attributes": { "waist": "32", "color": "black" },
      "stockTracking": true,
      "stockQuantity": 15
    }
  ]
}

Next Steps

Configure prices

Define pricing for each SKU

Create promotions

Apply discounts to your SKUs