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

# Update Project

> Update a project's settings, theme, and configuration

Updates a project's details. Only the fields you include in the request body will be changed — all other fields remain untouched.

## Endpoint

```
PUT /api/v1/projects/{slug}
```

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key. Requires `read_write` permission.
</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>
  The project's URL-friendly slug identifier.
</ParamField>

## Body Parameters

All fields are optional. Only provided fields are updated.

### General Settings

<ParamField body="name" type="string">
  Project name. Maximum 100 characters.
</ParamField>

<ParamField body="description" type="string">
  Short project description.
</ParamField>

<ParamField body="pricingPageDescription" type="string">
  Longer description shown on the pricing page header.
</ParamField>

<ParamField body="currency" type="string">
  Currency code (e.g. `"USD"`, `"EUR"`, `"GBP"`).
</ParamField>

<ParamField body="annualDiscount" type="number">
  Discount for annual billing as a decimal (e.g. `0.2` for 20% off).
</ParamField>

<ParamField body="annualDiscountEnabled" type="boolean">
  Enable or disable the annual billing toggle.
</ParamField>

<ParamField body="isActive" type="boolean">
  Activate or deactivate the project.
</ParamField>

### Checkout URLs

<ParamField body="checkoutSuccessUrl" type="string">
  URL to redirect customers after a successful Stripe checkout in live mode.
</ParamField>

<ParamField body="checkoutCancelUrl" type="string">
  URL to redirect customers when they cancel Stripe checkout in live mode.
</ParamField>

<ParamField body="checkoutTestSuccessUrl" type="string">
  URL to redirect after successful checkout in test mode.
</ParamField>

<ParamField body="checkoutTestCancelUrl" type="string">
  URL to redirect on cancel in test mode.
</ParamField>

### Theme Settings

<ParamField body="theme" type="object">
  Visual customization settings for the pricing widget.

  <Expandable title="Theme properties">
    <ParamField body="theme.fontFamily" type="string">
      Font family for the pricing widget (e.g. `"Inter"`, `"Roboto"`).
    </ParamField>

    <ParamField body="theme.primaryColor" type="string">
      Primary accent color as a hex code (e.g. `"#298558"`).
    </ParamField>

    <ParamField body="theme.hoverColor" type="string">
      Button hover color as a hex code.
    </ParamField>

    <ParamField body="theme.buttonTextColor" type="string">
      Text color inside buttons as a hex code.
    </ParamField>

    <ParamField body="theme.borderRadius" type="string">
      Border radius for cards and buttons (e.g. `"8px"`, `"12px"`).
    </ParamField>

    <ParamField body="theme.pricingBackgroundColor" type="string">
      Background color of the pricing cards.
    </ParamField>

    <ParamField body="theme.pricingBorderColor" type="string">
      Border color of the pricing cards.
    </ParamField>

    <ParamField body="theme.customCSS" type="string">
      Custom CSS to inject into the pricing widget. Overrides default styles.
    </ParamField>

    <ParamField body="theme.showProjectName" type="boolean">
      Show or hide the project name in the pricing header.
    </ParamField>

    <ParamField body="theme.showPricingHeader" type="boolean">
      Show or hide the pricing page header section.
    </ParamField>

    <ParamField body="theme.headerAlign" type="string">
      Alignment of the header text (`"left"`, `"center"`, `"right"`).
    </ParamField>

    <ParamField body="theme.descriptionAlign" type="string">
      Alignment of the description text (`"left"`, `"center"`, `"right"`).
    </ParamField>

    <ParamField body="theme.toggleAlign" type="string">
      Alignment of the monthly/annual toggle (`"left"`, `"center"`, `"right"`).
    </ParamField>

    <ParamField body="theme.popularBadgePosition" type="string">
      Position of the "Popular" badge on plan cards (`"top"`, `"inline"`).
    </ParamField>
  </Expandable>
</ParamField>

## Response

Returns the full updated project object.

## Example — Update Basic Settings

```bash theme={null}
curl -X PUT https://cuprice.io/api/v1/projects/my-saas-app \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My SaaS App Pro",
    "annualDiscount": 0.25,
    "annualDiscountEnabled": true,
    "checkoutSuccessUrl": "https://myapp.com/welcome",
    "checkoutCancelUrl": "https://myapp.com/pricing"
  }'
```

## Example — Update Theme with Custom CSS

```bash theme={null}
curl -X PUT https://cuprice.io/api/v1/projects/my-saas-app \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "theme": {
      "fontFamily": "Roboto",
      "primaryColor": "#4F46E5",
      "hoverColor": "#4338CA",
      "buttonTextColor": "#FFFFFF",
      "borderRadius": "12px",
      "pricingBackgroundColor": "#F9FAFB",
      "pricingBorderColor": "#E5E7EB",
      "showProjectName": true,
      "showPricingHeader": true,
      "headerAlign": "center",
      "descriptionAlign": "center",
      "toggleAlign": "center",
      "popularBadgePosition": "top",
      "customCSS": ".cuprice-card { box-shadow: 0 4px 12px rgba(0,0,0,0.08); } .cuprice-card:hover { transform: translateY(-2px); transition: transform 0.2s ease; }"
    }
  }'
```

```json theme={null}
{
  "id": 42,
  "name": "My SaaS App Pro",
  "slug": "my-saas-app",
  "description": "AI-powered project management tool",
  "pricingPageDescription": "Simple, transparent pricing for teams of all sizes.",
  "shareId": "nTZ7axXQHU",
  "currency": "USD",
  "annualDiscount": 0.25,
  "annualDiscountEnabled": true,
  "isActive": true,
  "checkoutSuccessUrl": "https://myapp.com/welcome",
  "checkoutCancelUrl": "https://myapp.com/pricing",
  "checkoutTestSuccessUrl": null,
  "checkoutTestCancelUrl": null,
  "themeSettings": {
    "fontFamily": "Roboto",
    "primaryColor": "#4F46E5",
    "hoverColor": "#4338CA",
    "buttonTextColor": "#FFFFFF",
    "borderRadius": "12px",
    "pricingBackgroundColor": "#F9FAFB",
    "pricingBorderColor": "#E5E7EB",
    "customCSS": ".cuprice-card { box-shadow: 0 4px 12px rgba(0,0,0,0.08); } .cuprice-card:hover { transform: translateY(-2px); transition: transform 0.2s ease; }",
    "showProjectName": true,
    "showPricingHeader": true,
    "headerAlign": "center",
    "descriptionAlign": "center",
    "toggleAlign": "center",
    "popularBadgePosition": "top"
  },
  "createdAt": "2025-09-15T10:30:00.000Z",
  "updatedAt": "2025-12-05T16:00:00.000Z"
}
```

## Errors

| Status | Description                                            |
| ------ | ------------------------------------------------------ |
| `400`  | Invalid field value (e.g. name exceeds 100 characters) |
| `401`  | Invalid or missing API key                             |
| `403`  | API key does not have `read_write` permission          |
| `404`  | Project with the given slug not found                  |
