# /updateProject

Update a project!

Things you can do:

* Change smart contract address
* Turn project on/off
* Change project name/image/details

## Update a project on Winter.&#x20;

<mark style="color:green;">`POST`</mark> `/updateProject`

Authenticate with basic auth where the username is your API key, e.g.&#x20;

`curl -X POST https://winter-api.usewinter.com/updateProject -u sk_live_abcd=:`

`await axios.post(url,{ BODY }, { auth: { username: 'sk_live_abcd=' }})`

#### Request Body

| Name                                        | Type    | Description                                                                                                                                                                                                                                                                     |
| ------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>     | String  | The email associated with the API key -- this is the email that can log into the [dashboard](https://business.usewinter.com) later to edit the project.                                                                                                                         |
| contractAddress                             | String  | The address of the contract on which Winter should call mint. For Solana projects, this is the candyMachine ID.                                                                                                                                                                 |
| contractABI                                 | String  | The ABI of the contract -- this is nullable for Solana but required for Eth and Polygon projects.                                                                                                                                                                               |
| projectName                                 | String  | This will show up on your checkout.                                                                                                                                                                                                                                             |
| brandImageURL                               | String  | Address to an image or gif that will be presented on your checkout before the user mints an NFT.                                                                                                                                                                                |
| mintFunction                                | String  | Name of the mint function Winter should call on the smart contract.                                                                                                                                                                                                             |
| tokenSymbol                                 | String  | One of: ETH, MATIC, SOL                                                                                                                                                                                                                                                         |
| mintFunctionParams                          | String  | <p>One of: </p><p><code>address,amount</code></p><p><code>amount,address</code></p><p><code>address</code></p><p><code>amount</code></p>                                                                                                                                        |
| sandbox                                     | Boolean | <p>True if you want to create a project in sandbox to test with fake payments. False if you want to create a live project! </p><p></p><p>Defaults to false. </p>                                                                                                                |
| costPerMint                                 | Number  | Cost per mint in the token (ETH, MATIC, SOL) -- optional if given a contract price function to pull price from.                                                                                                                                                                 |
| maxNumberOfMints                            | Number  | The max NFTs that can be purchased in one sale. If this is > 1, you \*must\* also set allowMultiplePurchases to true.                                                                                                                                                           |
| projectId<mark style="color:red;">\*</mark> | String  | The project id that is being updated                                                                                                                                                                                                                                            |
| \*                                          | String  | You need at least 1 param from /updateProject to update in this request.                                                                                                                                                                                                        |
| contractPriceFunction                       | String  | This is the function on the smart contract that we can call to get the price of the NFT                                                                                                                                                                                         |
| ercType                                     | String  | Either `1155` or `721`                                                                                                                                                                                                                                                          |
| isActive                                    | Boolean | <p>true for project active (can accept payments), false for project disabled (can not accept payments). When it is turned off/false the widget can still appear, but it will say "Can't mint right now".</p><p></p><p>Note: isActive is default false! You must turn it on!</p> |
| requireAddress                              | Boolean | If true, requires a customer to enter in their own non-custodial wallet address (like metamask) and removes Winter's custodial wallet option. If False, Winter's custodial wallet will be an option for user's to store their NFTs                                              |
| contractPriceFunctionParams                 | String  | <p>These are the param identifiers used to match the priceFunctionParams passed into the component/url. Make sure they are separated by a comma.   </p><p><code>ex: tier, tokenId, bundle</code></p>                                                                            |

{% tabs %}
{% tab title="200: OK If successful, you'll get a projectId in the response. " %}

```javascript
{
  "success": true,
  "project_id": 6736
}
```

{% endtab %}

{% tab title="400: Bad Request Return success = false and the error message" %}

```javascript
{
  "success": false,
  // Error message
  "error": "Did not send the owner email in the 'email' field"
}
```

{% endtab %}
{% endtabs %}
