Create a new product on Digistore24.
POST https://www.digistore24.com/api/call/createProduct
name_intern(string, max 63 chars) - Internal product name
name_de(string, max 63 chars) - German product namename_en(string, max 63 chars) - English product namename_es(string, max 63 chars) - Spanish product namedescription_de(string) - German product description (filtered HTML)description_en(string) - English product description (filtered HTML)description_es(string) - Spanish product description (filtered HTML)salespage_url(string, max 255 chars) - Sales page URLupsell_salespage_url(string, max 255 chars) - Upsell sales page URLthankyou_url(string, max 255 chars) - Thank you page URLimage_url(string, max 255 chars) - Product image URLproduct_type_id(integer) - Product type ID (seegetGlobalSettingsfor valid IDs)approval_status(string) - Product approval status:neworpendingaffiliate_commission(float) - Affiliate commission amountbuyer_type(string) -consumer(prices include VAT) orbusiness(prices exclude VAT)is_address_input_mandatory(string) -Y= buyer must always enter address,N= only when required for deliveryadd_order_data_to_thankyou_page_url(string) -Y= add order data to thankyou URL,N= no order data added
{
"product_id": 12345
}product_id(integer) - ID of the newly created product
use Digistore24\Request\Product\CreateProductRequest;
$request = new CreateProductRequest(
nameIntern: 'my-awesome-product',
nameEn: 'My Awesome Product',
nameDe: 'Mein tolles Produkt',
descriptionEn: '<p>A comprehensive guide to...</p>',
salespageUrl: 'https://example.com/sales',
thankyouUrl: 'https://example.com/thank-you',
productTypeId: 1,
buyerType: 'consumer',
isAddressInputMandatory: 'N'
);
try {
$response = $digistore24->products()->create($request);
echo "Product created with ID: " . $response->productId;
} catch (\Digistore24\Exception\ApiException $e) {
echo "Error: " . $e->getMessage();
}$request = new CreateProductRequest(
nameIntern: 'ebook-marketing-101',
nameEn: 'E-Book: Marketing 101',
nameDe: 'E-Book: Marketing Grundlagen',
descriptionEn: '<p>Learn the fundamentals of digital marketing</p>',
descriptionDe: '<p>Lernen Sie die Grundlagen des digitalen Marketings</p>',
salespageUrl: 'https://example.com/ebook-marketing',
thankyouUrl: 'https://example.com/download',
imageUrl: 'https://example.com/images/ebook-cover.jpg',
productTypeId: 1, // Digital product
buyerType: 'consumer',
isAddressInputMandatory: 'N', // No shipping address needed
affiliateCommission: 50.00
);
$response = $digistore24->products()->create($request);
echo "Digital product created: " . $response->productId;$request = new CreateProductRequest(
nameIntern: 'printed-course-materials',
nameEn: 'Printed Course Materials',
salespageUrl: 'https://example.com/printed-course',
thankyouUrl: 'https://example.com/thank-you',
productTypeId: 2, // Physical product
buyerType: 'consumer',
isAddressInputMandatory: 'Y', // Shipping address required
approvalStatus: 'new'
);
$response = $digistore24->products()->create($request);
echo "Physical product created: " . $response->productId;use Digistore24\Exception\ValidationException;
use Digistore24\Exception\ForbiddenException;
use Digistore24\Exception\ApiException;
try {
$response = $digistore24->products()->create($request);
echo "Success! Product ID: " . $response->productId;
} catch (ValidationException $e) {
// Invalid parameters (e.g., name too long, invalid enum value)
echo "Validation error: " . $e->getMessage();
} catch (ForbiddenException $e) {
// Full access API key required
echo "Access denied: " . $e->getMessage();
} catch (ApiException $e) {
// General API error
echo "API error: " . $e->getMessage();
}- Full Access Required: This endpoint requires a full access API key
- Internal Name: The
name_internis required and used for internal identification - Product Types: Use
getGlobalSettingsto retrieve valid product type IDs - HTML Descriptions: Description fields accept filtered HTML for formatting
- Approval Status: New products can be created as
neworpendingapproval - VAT Handling: Use
buyer_typeto control whether prices include or exclude VAT - Address Collection: Set
is_address_input_mandatorybased on whether the product requires shipping
- getProduct - Get product details
- listProducts - List all products
- updateProduct - Update product information
- copyProduct - Copy an existing product
- deleteProduct - Delete a product