> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayar.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Digital Product

> Endpoint used to create a digital product

```bash Request Example theme={null}
curl --request POST 'https://api.mayar.id/hl/v2/products/digital-product/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
        "name": "E-Book Panduan Bisnis Buat Pemula",
        "description": "Panduan lengkap memulai bisnis online",
        "amount": 75000,
        "crossoutPrice": 150000,
        "redirectUrl": "https://example.com/ebook-download",
        "notes": "diskon-50",
        "expiredAt": "2026-06-15T12:00:00.000Z",
        "limit": 200,
        "tax": 7500
    }'
```

```json Response Example 200 theme={null}
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "6894b1b2-f303-423b-a6b6-93e230e1d393",
        "link": "https://testingmayar.myr.id/catalog/E-Book-Panduan-Bisnis-Buat-Pemula"
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/hl/v2/products/digital-product/create
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/hl/v2/products/digital-product/create
```

## Authorization

**Authorization** `string` *required*

Example:

`Authorization | Bearer Paste-Your-API-Key-Here`

## Request Body

**name** `string` *required*

Digital product name.

**description** `string` *required*

Digital product description.

**amount** `integer` *required*

Digital product price amount.

**crossoutPrice** `integer`

Crossed-out price displayed as the original price.

**redirectUrl** `string`

URL where the customer will be redirected after completing payment.

**notes** `string`

Additional notes for the digital product.

**expiredAt** `string | datetime`

Product expiration date in ISO 8601 format.

**limit** `integer`

Maximum purchase limit.

**tax** `integer`

Tax amount applied to the product.

## Response

Successful Response

### Main Structure (Root)

**statusCode** `integer`

Status code from API.

**messages** `string`

Status message that describes the status code.

**data** `object`

The created digital product data.

### data Structure (Object)

**data.id** `string`

Unique identifier of the digital product.

**data.link** `string`

Public URL of the created digital product.

### Errors

**400 Bad Request** `object`

Returned when the request body fails validation:
`{ "statusCode": 400, "messages": "Validation Error" }`.

**409 Conflict** `object`

Returned when a product with the same identifier already exists:
`{ "statusCode": 409, "messages": "already exist" }`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.