Assist_Design/freebit-api-docs/PA02-04_account-cancellation.md
Temuuleenn 191a377657 fix: enhance Order Activation Flow and improve WHMCS integration
- Refactor executeSfActivatedUpdate to only set Activation_Status__c, deferring Status change.
- Update WHMCS custom fields with new SIM Number, Serial Number, and EID after order acceptance.
- Modify Opportunity WH_Registeration__c field for better WHMCS linking.
- Populate new SIM Inventory assignment fields: Assigned_Account__c, Assigned_Order__c, SIM_Type__c.
- Remove support for PA05-18 Semi-Black SIM registration, switching to PA02-01 call.
- Adjust me-status check to verify Status: Processed instead of Activated.
2026-02-05 16:26:46 +09:00

117 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# PA02-04 - Account Cancellation (アカウント解約)
## Overview
Cancels the specified service account.
- Account cancellation is **asynchronous** - may take up to 10 minutes from specified time
- **Master account cannot be cancelled** via this API
---
## Request
### Method
`POST` (JSON format)
### URL
```
https://[host]/emptool/api/master/cnclAcnt/
```
### Authentication
Obtained via separate authentication API, included in request parameters.
### POST Parameters
| No | Parameter | Name | Required | Description |
| --- | --------- | --------------- | -------- | ----------------- |
| 1 | json | JSON Parameters | ◎ | Main request body |
### JSON Parameters
| No | Parameter | Name | Level | Type | Required | Description |
| --- | --------- | ------------------ | ----- | ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| 1 | authKey | Authentication Key | 1 | Alphanumeric | ◎ | Obtained from OEM authentication |
| 2 | kind | Service Type | 1 | Alphanumeric + symbols | ◎ | Target service. Master account not allowed |
| 3 | account | Account | 1 | Alphanumeric + symbols | ◎ | Target account. For MVNO, specify phone number |
| 4 | runDate | Scheduled Date | 1 | Half-width numeric | - | Cancellation date. Format: `YYYYMMDD` (also accepts `YYYY/MM/DD`, `YYYY-MM-DD`). Immediate if not specified |
**Legend:** ◎ Required
---
## Request Example
### Immediate Cancellation
```json
{
"authKey": "XXXXXXXXXX",
"kind": "MVNO",
"account": "08038433843"
}
```
### Scheduled Cancellation
```json
{
"authKey": "XXXXXXXXXX",
"kind": "MVNO",
"account": "08038433843",
"runDate": "20240331"
}
```
---
## Response
### Format
JSON
### Parameters
| No | Parameter | Name | Level | Type | Required | Description |
| --- | ----------------- | ----------- | ----- | ---------------------- | -------- | ------------------- |
| 1 | resultCode | Result Code | 1 | Numeric | ◎ | Overall result code |
| 2 | status | Status | 1 | Object | ◎ | - |
| 3 | status.message | Message | 2 | Alphanumeric + symbols | ◎ | Result message |
| 4 | status.statusCode | Status Code | 2 | Numeric | ◎ | Result code |
---
## Response Codes
| Status | Status Code | Detail Code | Message | Description |
| ------ | ----------- | ----------- | ----------- | --------------------------------------------- |
| ○ | 200 | 100 | OK | Success |
| ○ | 200 | 101 | OK | Already satisfies request (already cancelled) |
| × | 400 | 200 | Bad Request | Parameter error - kind issue |
| × | 400 | 201 | Bad Request | Parameter error - account issue |
| × | 400 | 204 | Bad Request | Parameter error - other parameter issue |
| × | 400 | 228 | Bad Request | Parameter error - authKey issue |
| × | 403 | 205 | Auth Error | Authentication key problem |
| × | 500 | 210 | NG | Account not found |
| × | 500 | 230 | NG | Account is waiting for async processing |
| × | 500 | 900 | NG | Unexpected error occurred |
---
## Response Example
```json
{
"resultCode": "100",
"status": {
"message": "OK",
"statusCode": "200"
}
}
```