---
# System prepended metadata

title: Contracts

---

# Contracts Requests/Responses


**URL:** POST /contracts/

`initiateContractRequest`

```json=
{
    "clientId" : clientId,
    "freelancerId" : freelancerId,
    "proposalId" : proposalId
}
```

`initiateContractResponse`
```json=
{
    "contractId" : contractId
}
```

**URL:** POST /checkpoints/{checkpointId}

`submitWorkRequest`

```json=
{
   "freelancerId": freelancerId,
   "checkpointId": checkpointId,
   "checkpointStatus": checkpointStatus     
}
```

`submitWorkResponse`

```json=
{
}
```
**URL:** POST /milestones/{milestoneId}/actions/

`proposeMilestoneChangeRequest`

```json=
{
   "freelancerId": freelancerId,
   "milestoneId": milestoneId,
    "updateChanges" : [
        {
           "checkpointId":checkpointId,
            "newText" : newText 
        }
    ],
    "addChanges" : [
        {
            "newText" : newText 
        }
    ],
    "removeChanges" : [
        {
           "checkpointId":checkpointId,
        }
    ]
}
    
}
```

`proposeMilestoneChangeResponse`

```json=
{
    "milestoneId": milestoneId,
   "newCheckpoints": [
       {
           "checkpointId": checkpointId,
           "checkpointText": checkpointText
       }
   ]
   
    
}
```
**URL:** POST /milestones/{milestoneId}/accept/


`acceptMilestoneRequest`

```json=
{
    "milestoneId": milestoneId
}
```

`acceptMilestoneResponse`

```json=
{
    
}
```
**URL:** POST /checkpoints/{checkpointId}/reset/


// reset the status of the checkpoint
`requestCheckpointChangeRequest`

```json=
{
    "checkpointId": checkpointId,
    "newCheckpointObjective": newCheckpointObjective
}
```

`requestCheckpointChangeResponse`

```json=
{
    
   
}
```

**URL:** GET /contracts/{contractId}/


`viewContractMilestonesResponse`

```json=
{
    "contractMilestones": [
        {
            "milestoneId": milestoneId,
            "checkpointStatuses": 
                {
                    "pending": 3,
                    "inProgress" : 2,
                    "finished" : 12,
                    "accepted" : 10
                
                }
        }
    ]
   
}
```

**URL:** GET /contracts/{contractId}/print/


`printContractResponse`

```json=
{
    "contractFileLink": contractFileLink
}
```
**URL:** POST /contract-termination/


`requestContractTerminationRequest`

```json=
{
    "userId": userId,
    "contractId": contractId,
    "terminationReason": reasonForTermination 
}
```

`requestContractTerminationResponse`

```json=
{
    "requestStatus": requestStatus 
}
```

**URL:** POST /mark-payment/


`markPaymentCompletedRequest`

```json=
{   
    "milestoneId": milestoneId
}
```

`markPaymentCompletedResponse`

```json=
{
    
}
```

# Contracts Schemas

### Contract Schema

```json=
{
    "contractId": string,
    "status": string,
    "proposalId": string
}
```

### Proposal Schema

```json=
{
    "proposalId": string,
    "jobId": string,
    "status": string,
    "clientId": string,
    "freelancerId": string,
    "milestones": string[]
}
```

### Milestone Schema

```json=
{
    "milestoneId": string,
    "paymentAmount": Decimal,
    "status": string,
    "deadline": date,
    "contractId": string
}
```