## Actuarial Certificate — Provider-to-Class Updates

Once the Class user has finalised on your website, your system calls back to Class to record the outcome. There are three endpoints, used in order.

[API Reference](/products/class/apis/actuarial-provider/actuarial-certificate); this page explains how to use them together.

All three endpoints require an OAuth bearer token — see [Authentication](/products/class/apis/actuarial-provider/authentication).

### Base URL

```
{host}/api/{version}/c/service-provider/{providerId}/actuary/certificate-request/{requestId}
```

- `{host}` — `apigateway.class-pie.com.au` (PIE) or `apigateway.class.com.au` (Production)
- `{version}` — the API version (e.g. `1.0`)
- `{providerId}` — your Provider ID (from registration)
- `{requestId}` — from `SourceRef` in the initial request payload


### Endpoint A — Create a status

```
POST {base}/status
Content-Type: application/json
Authorization: Bearer <token>
```

This creates a new status and returns a `StatusId` you'll use for endpoints B and C.

```json
{
    "BusinessCode": "<Client.SourceRef>",
    "FundCode": "<Fund.SourceRef>",
    "RequestId": "<SourceRef>",
    "Status": "Interim",
    "ExemptPercentage": "63.18",
    "UseDeemedSegregation": true
}
```

**Field requirements**

| Field    | Required | Notes |
|  --- | --- | --- |
| `BusinessCode` | **Yes** | Identifies the business; used to route the request. |
| `FundCode` | **Yes** | Identifies the fund; used to route the request. |
| `RequestId` | **Yes** | Must match the `RequestId` from the initial request. |
| `ExemptPercentage` | **Yes** | String; a `%` sign and spaces are trimmed, then parsed to a decimal. Percentages are decimal values, not whole numbers (e.g. `"63.18"`). An empty or unparseable value returns **`400 Bad Request`**. |
| `Status` | No | `Interim` or `Final`. Defaults to `Interim` if omitted. |
| `UseDeemedSegregation` | No | Boolean flag; stored and echoed back as supplied. |


**Response** — the `Data` object contains the `StatusId`:

```json
{
    "Data": {
        "StatusId": "a9e9cfce-e3b5-4077-b824-77d23a109ae3",
        "ActuarialPercentage": 63.18,
        "StatusDateTime": "2026-07-29T09:51:48",
        "Description": "Response received; Actuarial Percentage: 63.18% (Interim)",
        "StatusMessage": null,
        "UseDeemedSegregation": true
    },
    "Errors": []
}
```

### Endpoint B — Update an existing status

```
POST {base}/status/{statusId}
Content-Type: application/json
Authorization: Bearer <token>
```

Use this to revise a status you already created — for example, to replace a draft percentage with the final value. The body is the same as endpoint A.

Updating overwrites the existing status's percentage, `UseDeemedSegregation` flag, stored body, and timestamp. As with create, a valid `ExemptPercentage` is required (an empty or unparseable value returns **`400 Bad Request`**).

Endpoint B is optional. If you don't need to revise a status, go straight from create (A) to document upload (C).

### Endpoint C — Upload the certificate document

```
POST {base}/status/{statusId}/doc?businessCode={businessCode}&fundCode={fundCode}
Content-Type: application/pdf
Authorization: Bearer <token>

<binary PDF content>
```

Attach the certificate to a status created by endpoint A. The document is sent as the **raw request body** with `Content-Type: application/pdf` — this is a single-document upload, **not** `multipart/form-data`.

| Parameter | In | Notes |
|  --- | --- | --- |
| `statusId` | path | The status to attach the document to (from endpoint A). |
| `businessCode` | query | Identifies the business. |
| `fundCode` | query | Identifies the fund. |


Only **PDF** documents are accepted. Send the certificate as the raw request body with `Content-Type: application/pdf` (not `multipart/form-data`).

**Example (curl)** — note `--data-binary`, which sends the file as the raw body:

```bash
curl -X POST \
  "https://apigateway.class-pie.com.au/api/1.0/c/service-provider/{providerId}/actuary/certificate-request/{requestId}/status/{statusId}/doc?businessCode={businessCode}&fundCode={fundCode}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/pdf" \
  --data-binary @"/path/to/certificate.pdf"
```

Do **not** use `-F` / `--form` (that sends `multipart/form-data`). The endpoint reads the entire request body as the PDF, so use `--data-binary`.

**Response** — `200 OK` on success, `500 Internal Server Error` if the upload fails.

### Putting it together

```
1. POST .../status                     → returns StatusId
2. (optional) POST .../status/{id}      → revise percentage/flag
3. POST .../status/{id}/doc?...         → upload certificate PDF
```

See [Workflow](/products/class/apis/actuarial-provider/workflow) for the ordering rules and typical sequences.