# Cost Account APIs

These APIs provides Cost Account management operations like creating Cost account, modify, get and delete.

Version: 1.0.0

## Servers

```
https://api-dev.sendpro360.pitneycloud.com/costaccountmgmt
```

```
https://api-qa.sendpro360.pitneycloud.com/costaccountmgmt
```

Sandbox Server
```
https://api-sandbox.sendpro360.pitneybowes.com/costaccountmgmt
```

Production Server (uses live data)
```
https://api.sendpro360.pitneybowes.com/costaccountmgmt
```

## Security

### basicAuth

Type: http
Scheme: basic

### bearerAuth

Type: http
Scheme: bearer

## Download OpenAPI description

[Cost Account APIs](https://docs.sendpro360.pitneycloud.com/_bundle/openapi/costaccount.yaml)

## Cost Account Management

APIs provide facility to create and manage cost accounts.

### Add Cost Account

 - [POST /api/v1/costAccounts](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/addcostaccount.md): This operation creates cost account. 

Key Considerations:

  - A cost account is an account used to maintain and segregate records for shipments, postage, and other operational data. There can be multiple Cost accounts, I.e; multiple Wallet - but one ledger. 
  - Cost accounts allow to track which wallet was used for payment, maintain detailed payment history, and set budget notifications or thresholds.
  - Cost accounts are managed in a hierarchical structure: Enterprise > Division > Location.
  - Cost accounts can be assigned to a location, enabling client administrators to filter and analyze records based on the selected cost account.
  - A location can have one or more cost accounts assigned to it. This allows to filter shipments or postage records by selecting the cost account.
  - Cost accounts are assigned a status of either Active or Inactive.
  - Sub-Cost Accounts and Sub-Sub-Cost Accounts can also be created under the main cost account to further refine segregation.

### Get Cost Accounts

 - [GET /api/v1/costAccounts](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/getcostaccounts.md): This operation gets cost account details

### Update Cost Account

 - [PUT /api/v1/costAccounts/{costaccountId}](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/updatecostaccount.md): Update Cost Account

### Get Cost Account Details by Cost Account ID

 - [GET /api/v1/costAccounts/{costaccountId}](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/getcostaccount.md): This operation gets the Cost account by cost account ID

### Delete Cost Account

 - [DELETE /api/v1/costAccounts/{costaccountId}](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/deletecostaccount.md): This operation archive the cost account

### Create Cost Account Import Job

 - [POST /api/v1/costAccounts/importUrl](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/importcostaccount.md): This operation is used for creating a job for Cost Accounts Import. The payload for this endpoint is an empty JSON object {} because it does not require any additional data to be sent in the request body. jobID and url is returned in the response where user can upload csv file containing cost accounts. Download the sample-cost-accounts-import file.

### Process Import Cost Account Job

 - [POST /api/v1/costAccounts/batch/{jobID}/process](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/processimportcostaccount.md): This operation processes (executes) the existing Batch job. The payload for this endpoint is an empty JSON object {} because it does not require any additional data to be sent in the request body. The jobId parameter in the endpoint URL specifies which batch of shipments to process.

### Get Import Cost Account Job Status

 - [GET /api/v1/costAccounts/batch/{jobID}/status](https://docs.sendpro360.pitneycloud.com/openapi/costaccount/cost-account-management/importcostaccountstatus.md): This operation retrieves the status of an existing Batch identified by {jobID}. The response will provide information about its current status and whether the job has been completed, In case of error, error csv file will be generated for details of error

