Skip to main content

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 NameRequiredDescription
AuthorizationYesValid token in Bearer {AccessToken} format
Content-TypeYesapplication/json

Request Body

Field NameTypeRequiredDescription
codestringYesCurrent account code (unique).
currencyCodestringYesCurrency code (e.g., "TRY", "USD").
currentAccountTypestringYesType of current account (e.g., "Customer", "Supplier", "Dealer").
customerOrDealerCodestringYesCode of the customer or dealer associated with the account.
descriptionstringNoCurrent account description.
erpCodestringYesCurrent account code in the ERP system (unique).
isVisibleOnPaymentbooleanNoShould it appear on payment screens? (default: false)
accountNamestringYesName of the current account.
taxNumberstringNoTax number (for corporate accounts).
tcknNumberstringNoNational ID number (for individual accounts).
titlestringNoTitle 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 code and erpCode fields must be unique in the system; otherwise, the request returns 409 Conflict.
  • The currentAccountType field must be one of the predefined values in the system (e.g., "Customer", "Supplier", "Dealer").
  • The customerOrDealerCode must correspond to an existing customer or dealer record in the system.
  • Accounts marked as isVisibleOnPayment = true will be listed on payment screens.
  • For individual accounts, the tcknNumber field must be filled; for corporate accounts, the taxNumber field must be filled.
  • If the token has expired, the request returns 401 Unauthorized; a new token must be obtained and the request resent.