Creating a Current Account
- Endpoint:
/vendor/currentAccount - HTTP Method:
POST - Request Content-Type:
application/json - Response Content-Type:
application/json - Authorization: Valid AccessToken is required. (See: 2. Authentication – Obtaining AccessToken)
Description
This service is used to create a new current account record following the same logic as operations on the Portal screen.
Current accounts are financial records belonging to entities such as dealers, customers, or suppliers, and are used in payment/collection processes.
Each current account must have a unique code and erpCode in the system.
Header Information
| Header Name | Required | Description |
|---|---|---|
| Authorization | Yes | Valid token in Bearer {AccessToken} format |
| Content-Type | Yes | application/json |
Request Body
| Field Name | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Current account code (unique). |
| currencyCode | string | Yes | Currency code (e.g., "TRY", "USD"). |
| currentAccountType | string | Yes | Type of current account (e.g., "Customer", "Supplier", "Dealer"). |
| customerOrDealerCode | string | Yes | Code of the customer or dealer associated with the account. |
| description | string | No | Current account description. |
| erpCode | string | Yes | Current account code in the ERP system (unique). |
| isVisibleOnPayment | boolean | No | Should it appear on payment screens? (default: false) |
| accountName | string | Yes | Name of the current account. |
| taxNumber | string | No | Tax number (for corporate accounts). |
| tcknNumber | string | No | National ID number (for individual accounts). |
| title | string | No | Title of the current account. |
Example Request
{
"code": "CA-001",
"currencyCode": "USD",
"currentAccountType": "Dealer",
"customerOrDealerCode": "DEALER-123",
"description": "International Dealer Current Account",
"erpCode": "ERP-ACC-001",
"isVisibleOnPayment": true,
"accountName": "ABC Foreign Trade Account",
"taxNumber": "00000000000",
"tcknNumber": "00000000000",
"title": "Authorized Dealer"
}
The customerOrDealerCode field must be an existing customer or dealer code.
A second record cannot be created with the same code or erpCode.
Successful Response (200 OK)
{
"isSuccess": true,
"message": "Current account created successfully."
}
Notes & Best Practices
- The
codeanderpCodefields must be unique in the system; otherwise, the request returns409 Conflict. - The
currentAccountTypefield must be one of the predefined values in the system (e.g.,"Customer","Supplier","Dealer"). - The
customerOrDealerCodemust correspond to an existing customer or dealer record in the system. - Accounts marked as
isVisibleOnPayment = truewill be listed on payment screens. - For individual accounts, the
tcknNumberfield must be filled; for corporate accounts, thetaxNumberfield must be filled. - If the token has expired, the request returns
401 Unauthorized; a new token must be obtained and the request resent.