> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CancelProject

# Package: marketplace

# Namespace: Projects

# Method link: https://dev.wix.com/docs/api-reference/account-level/studio-workspace/marketplace/project-v1/cancel-project.md

## Permission Scopes:
Manage CRM and Marketplace: SCOPE.ARENA.MANAGE-LEADS

## Introduction

Cancels a project on the provider's side, setting its `status` to `CANCELED_BY_PROVIDER`.

Each time the project is updated, `revision` increments by 1. The current `revision` must be passed when updating the project. This ensures you're working with the latest project and prevents unintended overwrites.

Specify `cancellationInfo` to record why the engagement ended.

A project whose `status` is `COMPLETED`, `EXPIRED`, `CANCELED_BY_CLIENT`, or
`CANCELED_BY_PROVIDER` can't be canceled, because those statuses are final. Cancellation is also
final, so a canceled project can't be restarted.

To mark the engagement as delivered instead, call Complete Project.

---

## REST API

### Schema

```
 Method: cancelProject
 Description: Cancels a project on the provider's side, setting its `status` to `CANCELED_BY_PROVIDER`.  Each time the project is updated, `revision` increments by 1. The current `revision` must be passed when updating the project. This ensures you're working with the latest project and prevents unintended overwrites.  Specify `cancellationInfo` to record why the engagement ended.  A project whose `status` is `COMPLETED`, `EXPIRED`, `CANCELED_BY_CLIENT`, or `CANCELED_BY_PROVIDER` can't be canceled, because those statuses are final. Cancellation is also final, so a canceled project can't be restarted.  To mark the engagement as delivered instead, call Complete Project.
 URL: https://www.wixapis.com/partners/marketplace/v1/projects/{projectId}/cancel
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  revision, cancellationInfo
 Method parameters: 
   param name: cancellationInfo | type: CancellationInfo   | required: true 
        - name: additionalInfo | type: string | description: Additional details about why the project was canceled.  
        - name: reason | type: CancellationReason | description: Reason the project was canceled.  
             - enum:
             -     OTHER: A reason not covered by the other values.
             -     CLIENT_NOT_RESPONDING: The client stopped responding.
             -     BUDGET_IS_TOO_LOW: The client's budget was too low for the work.
             -     DUPLICATE_REQUEST: The request duplicates another project.
             -     REPORT_AS_SPAM: The request was reported as spam.
             -     DOESNT_MATCH_MY_SKILLS: The work doesn't match the provider's skills.
   param name: revision | type: revision | description: Revision number, which increments by 1 each time the project is updated. To prevent conflicting changes, the current revision must be passed. | required: true | validation: format int64
 Return type: CancelProjectResponse
  - name: project | type: Project | description: Updated project.  
     - name: id | type: string | description: Project GUID.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the project is updated. To prevent conflicting changes, the current revision must be passed when updating the project.  | validation: format uint64
     - name: createdDate | type: string | description: Date and time the project was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the project was updated.  | read-only: true | validation: format date-time
     - name: serviceName | type: ServiceName | description: Marketplace service the project is attributed to.  To set this value, specify `serviceName` when calling Complete Project.  | read-only: true 
         - enum:
         -     UNKNOWN_SERVICE_NAME: No service, or an unrecognized service.
         -     DOMAIN: Connect or set up a domain.
         -     ACCESSIBILITY: Improve site accessibility.
         -     RESTAURANT_MENU_SETUP: Set up a restaurant menu.
         -     STORE_OPTIMIZATION: Optimize an online store.
         -     ADVANCED_WEBSITE: Build an advanced website.
         -     CUSTOM_INPUT_FORMS: Build custom input forms.
         -     SITE_GUIDANCE: Guidance on building a site.
         -     ECOMMERCE_SITE: Build an eCommerce site.
         -     ADS: Set up and manage ads.
         -     PROFESSIONAL_TRANSLATION: Professional content translation.
         -     BRAND_DEVELOPMENT: Develop a brand.
         -     EMAIL: Set up business email.
         -     CUSTOM_SITE_FUNCTIONALITIES: Build custom site functionalities.
         -     THIRD_PARTY_SERVICES: Integrate third-party services.
         -     VISUALS: Create visual assets.
         -     CODING_GUIDANCE: Guidance on custom code.
         -     EMAIL_MARKETING: Set up email marketing.
         -     WRITTEN: Written content.
         -     PHOTOS: Photography.
         -     STORE_SETTINGS: Configure store settings.
         -     ANALYTICS: Set up analytics.
         -     CLASSIC_WEBSITE: Build a classic website.
         -     PIXEL: Set up a tracking pixel.
         -     REDESIGN_SITE: Redesign an existing site.
         -     MOBILE_APP: Build a mobile app.
         -     CONTENT_WITH_DATABASE: Build content backed by a database.
         -     UPDATES: Site updates and maintenance.
         -     INSTALL_APPS: Install and set up apps.
         -     MOBILE_SITE: Optimize the mobile site.
         -     LOGO: Design a logo.
         -     CUSTOM_DESIGN: Custom design work.
         -     ADVANCED_STORE: Build an advanced store.
         -     SEO: Search engine optimization.
         -     MOVE_SITE: Move a site to Wix.
         -     EDIT_IMAGE: Edit images.
     - name: contactId | type: string | description: GUID of the contact representing the client in the provider's contact list.  Use this GUID to look up the client's details with the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md).  | validation: format GUID
     - name: status | type: Status | description: Current status of the engagement.  
         - enum:
         -     NEW: The project was created from the client's brief and no one has acted on it yet.
         -     IN_DISCUSSION: The provider and client are discussing the engagement.
         -     IN_PROGRESS: The provider has started work on the engagement.
         -     COMPLETED: The provider has delivered the engagement. Final status.
         -     CANCELED_BY_CLIENT: The client canceled the engagement. Final status.
         -     CANCELED_BY_PROVIDER: The provider canceled the engagement. Final status.
         -     EXPIRED: No one acted on the project before it reached its `expirationDate`. Final status.
         -     CONTACTED: The provider has messaged the client for the first time.
     - name: review | type: Review | description: Client's review of the completed project, together with the provider's reply.  Available only after the client submits a review, which they can do once the project's `status` is `COMPLETED`.  
        - name: overallScore | type: integer | description: Client's rating of the engagement, where 1 is the lowest and 5 is the highest.  | validation: minimum 1, maximum 5, format uint32
        - name: text | type: string | description: Client's written feedback on the engagement.  
        - name: date | type: string | description: Date and time the review was submitted.  | validation: format date-time
        - name: reply | type: Reply | description: Provider's reply to the review.  Add a reply by calling Reply to Project Review. A review supports a single reply, which can't be changed once submitted.  
           - name: text | type: string | description: Provider's response to the client's review.  | validation: minLength 1
           - name: date | type: string | description: Date and time the reply was submitted.  | validation: format date-time
     - name: metasiteId | type: string | description: GUID of the site delivered for the project.  Serves as proof of delivery when calling Complete Project.  | validation: format GUID
     - name: completedProjectSnapshot | type: string | description: URL of a visual snapshot of the delivered work, such as an uploaded thumbnail image or the URL of the delivered site.  Serves as proof of delivery when calling Complete Project.  | validation: format WEB_URL
     - name: statusTimeline | type: array<StatusTimelineItem> | description: NOT marked `readOnly`: the back-office console maintains this list itself and passes `statusTimeline` in the update mask, and a readOnly field in a mask is rejected outright. Remove this exemption once ProjectsBO.UpdateProject appends the timeline server-side and the BO client stops sending it.  
        - name: status | type: Status | description: Status the project held.  
        - name: date | type: string | description: Date and time the project held this status.  | validation: format date-time
     - name: budget | type: number | description: Agreed budget for the engagement.  To set this value, specify `budget` when calling Complete Project.  | validation: format double
     - name: cancellationInfo | type: CancellationInfo | description: Reason the project was canceled, with any additional details.  Returned only when `status` is `CANCELED_BY_PROVIDER` or `CANCELED_BY_CLIENT`.  
        - name: additionalInfo | type: string | description: Additional details about why the project was canceled.  
        - name: reason | type: CancellationReason | description: Reason the project was canceled.  
             - enum:
             -     OTHER: A reason not covered by the other values.
             -     CLIENT_NOT_RESPONDING: The client stopped responding.
             -     BUDGET_IS_TOO_LOW: The client's budget was too low for the work.
             -     DUPLICATE_REQUEST: The request duplicates another project.
             -     REPORT_AS_SPAM: The request was reported as spam.
             -     DOESNT_MATCH_MY_SKILLS: The work doesn't match the provider's skills.
     - name: expirationDate | type: string | description: Date and time the project expires if no one acts on it.  A project that's still in `NEW` status at this time moves to `EXPIRED` automatically. Once the project leaves `NEW` status, it no longer expires.  | read-only: true | validation: format date-time
     - name: source | type: Source | description: How the engagement originated.  
         - enum:
         -     MATCHING: The engagement originated from the marketplace matching flow. Also returned when the source is unknown.
         -     EXPLORE: The client found the provider in the Wix Marketplace and contacted them directly.
         -     AI_ASSISTANT: The engagement originated from an AI assistant conversation.
     - name: briefDescription | type: string | description: Client's request, copied from the brief the project was created from.  Read this field to see what the client asked for without retrieving the brief itself.  | read-only: true | validation: maxLength 5000


```

### Examples

### Cancel Project
Cancels a project on the provider's side, recording why the engagement ended

```curl
curl -X POST \
'https://www.wixapis.com/partners/marketplace/v1/projects/2f7c9a1b-8d3e-4a5f-9c6b-1e0d2f3a4b5c/cancel' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "revision": "3",
  "cancellationInfo": {
    "reason": "CLIENT_NOT_RESPONDING",
    "additionalInfo": "No reply after several follow-ups."
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.marketplaceProjects.marketplaceProjects.cancelProject(projectId, revision, options)
 Description: Cancels a project on the provider's side, setting its `status` to `CANCELED_BY_PROVIDER`.  Each time the project is updated, `revision` increments by 1. The current `revision` must be passed when updating the project. This ensures you're working with the latest project and prevents unintended overwrites.  Specify `cancellationInfo` to record why the engagement ended.  A project whose `status` is `COMPLETED`, `EXPIRED`, `CANCELED_BY_CLIENT`, or `CANCELED_BY_PROVIDER` can't be canceled, because those statuses are final. Cancellation is also final, so a canceled project can't be restarted.  To mark the engagement as delivered instead, call Complete Project.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  projectId, revision, options.cancellationInfo, options
 Method parameters: 
   param name: options | type: CancelProjectOptions  none | required: true 
        - name: cancellationInfo | type: CancellationInfo | description: Reason the project was canceled, with any additional details. | required: true 
           - name: additionalInfo | type: string | description: Additional details about why the project was canceled.  
           - name: reason | type: CancellationReason | description: Reason the project was canceled.  
                 - enum:
                 -     OTHER: A reason not covered by the other values.
                 -     CLIENT_NOT_RESPONDING: The client stopped responding.
                 -     BUDGET_IS_TOO_LOW: The client's budget was too low for the work.
                 -     DUPLICATE_REQUEST: The request duplicates another project.
                 -     REPORT_AS_SPAM: The request was reported as spam.
                 -     DOESNT_MATCH_MY_SKILLS: The work doesn't match the provider's skills.
   param name: projectId | type: string | description: GUID of the project to cancel. | required: true | validation: format GUID
   param name: revision | type: CancelProject   | required: true 
        - name: value | type: string | description:   
 Return type: PROMISE<CancelProjectResponse>
  - name: project | type: Project | description: Updated project.  
     - name: _id | type: string | description: Project GUID.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the project is updated. To prevent conflicting changes, the current revision must be passed when updating the project.  | validation: format uint64
     - name: _createdDate | type: Date | description: Date and time the project was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the project was updated.  | read-only: true 
     - name: serviceName | type: ServiceName | description: Marketplace service the project is attributed to.  To set this value, specify `serviceName` when calling Complete Project.  | read-only: true 
         - enum:
         -     UNKNOWN_SERVICE_NAME: No service, or an unrecognized service.
         -     DOMAIN: Connect or set up a domain.
         -     ACCESSIBILITY: Improve site accessibility.
         -     RESTAURANT_MENU_SETUP: Set up a restaurant menu.
         -     STORE_OPTIMIZATION: Optimize an online store.
         -     ADVANCED_WEBSITE: Build an advanced website.
         -     CUSTOM_INPUT_FORMS: Build custom input forms.
         -     SITE_GUIDANCE: Guidance on building a site.
         -     ECOMMERCE_SITE: Build an eCommerce site.
         -     ADS: Set up and manage ads.
         -     PROFESSIONAL_TRANSLATION: Professional content translation.
         -     BRAND_DEVELOPMENT: Develop a brand.
         -     EMAIL: Set up business email.
         -     CUSTOM_SITE_FUNCTIONALITIES: Build custom site functionalities.
         -     THIRD_PARTY_SERVICES: Integrate third-party services.
         -     VISUALS: Create visual assets.
         -     CODING_GUIDANCE: Guidance on custom code.
         -     EMAIL_MARKETING: Set up email marketing.
         -     WRITTEN: Written content.
         -     PHOTOS: Photography.
         -     STORE_SETTINGS: Configure store settings.
         -     ANALYTICS: Set up analytics.
         -     CLASSIC_WEBSITE: Build a classic website.
         -     PIXEL: Set up a tracking pixel.
         -     REDESIGN_SITE: Redesign an existing site.
         -     MOBILE_APP: Build a mobile app.
         -     CONTENT_WITH_DATABASE: Build content backed by a database.
         -     UPDATES: Site updates and maintenance.
         -     INSTALL_APPS: Install and set up apps.
         -     MOBILE_SITE: Optimize the mobile site.
         -     LOGO: Design a logo.
         -     CUSTOM_DESIGN: Custom design work.
         -     ADVANCED_STORE: Build an advanced store.
         -     SEO: Search engine optimization.
         -     MOVE_SITE: Move a site to Wix.
         -     EDIT_IMAGE: Edit images.
     - name: contactId | type: string | description: GUID of the contact representing the client in the provider's contact list.  Use this GUID to look up the client's details with the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md).  | validation: format GUID
     - name: status | type: Status | description: Current status of the engagement.  
         - enum:
         -     NEW: The project was created from the client's brief and no one has acted on it yet.
         -     IN_DISCUSSION: The provider and client are discussing the engagement.
         -     IN_PROGRESS: The provider has started work on the engagement.
         -     COMPLETED: The provider has delivered the engagement. Final status.
         -     CANCELED_BY_CLIENT: The client canceled the engagement. Final status.
         -     CANCELED_BY_PROVIDER: The provider canceled the engagement. Final status.
         -     EXPIRED: No one acted on the project before it reached its `expirationDate`. Final status.
         -     CONTACTED: The provider has messaged the client for the first time.
     - name: review | type: Review | description: Client's review of the completed project, together with the provider's reply.  Available only after the client submits a review, which they can do once the project's `status` is `COMPLETED`.  
        - name: overallScore | type: integer | description: Client's rating of the engagement, where 1 is the lowest and 5 is the highest.  | validation: minimum 1, maximum 5, format uint32
        - name: text | type: string | description: Client's written feedback on the engagement.  
        - name: date | type: Date | description: Date and time the review was submitted.  
        - name: reply | type: Reply | description: Provider's reply to the review.  Add a reply by calling Reply to Project Review. A review supports a single reply, which can't be changed once submitted.  
           - name: text | type: string | description: Provider's response to the client's review.  | validation: minLength 1
           - name: date | type: Date | description: Date and time the reply was submitted.  
     - name: metasiteId | type: string | description: GUID of the site delivered for the project.  Serves as proof of delivery when calling Complete Project.  | validation: format GUID
     - name: completedProjectSnapshot | type: string | description: URL of a visual snapshot of the delivered work, such as an uploaded thumbnail image or the URL of the delivered site.  Serves as proof of delivery when calling Complete Project.  | validation: format WEB_URL
     - name: statusTimeline | type: array<StatusTimelineItem> | description: NOT marked `readOnly`: the back-office console maintains this list itself and passes `statusTimeline` in the update mask, and a readOnly field in a mask is rejected outright. Remove this exemption once ProjectsBO.UpdateProject appends the timeline server-side and the BO client stops sending it.  
        - name: status | type: Status | description: Status the project held.  
        - name: date | type: Date | description: Date and time the project held this status.  
     - name: budget | type: number | description: Agreed budget for the engagement.  To set this value, specify `budget` when calling Complete Project.  
     - name: cancellationInfo | type: CancellationInfo | description: Reason the project was canceled, with any additional details.  Returned only when `status` is `CANCELED_BY_PROVIDER` or `CANCELED_BY_CLIENT`.  
        - name: additionalInfo | type: string | description: Additional details about why the project was canceled.  
        - name: reason | type: CancellationReason | description: Reason the project was canceled.  
             - enum:
             -     OTHER: A reason not covered by the other values.
             -     CLIENT_NOT_RESPONDING: The client stopped responding.
             -     BUDGET_IS_TOO_LOW: The client's budget was too low for the work.
             -     DUPLICATE_REQUEST: The request duplicates another project.
             -     REPORT_AS_SPAM: The request was reported as spam.
             -     DOESNT_MATCH_MY_SKILLS: The work doesn't match the provider's skills.
     - name: expirationDate | type: Date | description: Date and time the project expires if no one acts on it.  A project that's still in `NEW` status at this time moves to `EXPIRED` automatically. Once the project leaves `NEW` status, it no longer expires.  | read-only: true 
     - name: source | type: Source | description: How the engagement originated.  
         - enum:
         -     MATCHING: The engagement originated from the marketplace matching flow. Also returned when the source is unknown.
         -     EXPLORE: The client found the provider in the Wix Marketplace and contacted them directly.
         -     AI_ASSISTANT: The engagement originated from an AI assistant conversation.
     - name: briefDescription | type: string | description: Client's request, copied from the brief the project was created from.  Read this field to see what the client asked for without retrieving the brief itself.  | read-only: true | validation: maxLength 5000


```

### Examples

### Cancel a project
Cancels a project on the provider's side, recording why the engagement ended

```javascript
import { marketplaceProjects } from "@wix/marketplace-projects";

async function cancelProject() {
  const response = await marketplaceProjects.cancelProject(
    "2f7c9a1b-8d3e-4a5f-9c6b-1e0d2f3a4b5c",
    "3",
    {
      cancellationInfo: {
        reason: "CLIENT_NOT_RESPONDING",
        additionalInfo: "No reply after several follow-ups.",
      },
    },
  );
}

/* Promise resolves to:
 * {
 *   "project": {
 *     "_id": "2f7c9a1b-8d3e-4a5f-9c6b-1e0d2f3a4b5c",
 *     "revision": "4",
 *     "_createdDate": "2024-01-15T10:30:00.000Z",
 *     "_updatedDate": "2024-06-10T11:00:00.000Z",
 *     "serviceName": "ADVANCED_WEBSITE",
 *     "contactId": "5c6d7e8f-9a1b-4c2d-9e3f-4a5b6c7d8e9f",
 *     "status": "CANCELED_BY_PROVIDER",
 *     "cancellationInfo": {
 *       "additionalInfo": "No reply after several follow-ups.",
 *       "reason": "CLIENT_NOT_RESPONDING"
 *     },
 *     "statusTimeline": [
 *       { "status": "NEW", "date": "2024-01-15T10:30:00.000Z" },
 *       { "status": "CONTACTED", "date": "2024-01-16T08:20:00.000Z" }
 *     ],
 *     "budget": 500,
 *     "expirationDate": "2024-01-19T10:30:00.000Z",
 *     "source": "MATCHING",
 *     "briefDescription": "Looking for a modern portfolio site with a blog and contact form."
 *   }
 * }
 */

```

### cancelProject (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { marketplaceProjects } from '@wix/marketplace-projects';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { marketplaceProjects },
  // Include the auth strategy and host as relevant
});


async function cancelProject(projectId,revision,options) {
  const response = await myWixClient.marketplaceProjects.cancelProject(projectId,revision,options);
};
```

---