Creating a Customer
Description
Through this service, a customer record can be created just like via the Portal screen. Both individual and corporate customers are supported. Additionally, some optional fields used in the system (passportNo, districtCode, isForeignNational, title) can also be sent.
- Endpoint:
/vendor/customer - Method:
POST Request Content-Type:application/jsonAuthorization:Valid AccessToken is required. (See: Section 1 – Obtaining AccessToken)
Request Body
| Field Name | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Customer or sub-customer user code (must be unique). |
| companyName | string | Yes (if isCompany True) | Company name for corporate customers. |
| firstName | string | Yes (if isCompany False) | First name for individual customers. |
| lastName | string | Yes (if isCompany False) | Last name for individual customers. |
| string | Yes | Customer/sub-customer email address. | |
| mobile | string | Yes | Mobile phone number. |
| phone | string | No | Landline phone number. |
| countryCode | string | Yes | Country code (e.g., "TR"). |
| cityCode | string | No | City code. |
| districtCode | integer | No | District code (optional). |
| currencyCode | integer | Yes | Currency ID. |
| erpCode | string | Yes | ERP code (must be unique). |
| isActive | boolean | No | Active/Inactive status (true or false). |
| isCompany | boolean | Yes | True for corporate, false for individual. |
| address | string | No | Address information. |
| tckn | string | Yes (if isCompany False) | National ID number for individual customers. |
| taxNumber | string | Yes (if isCompany True) | Tax number for corporate customers. |
| taxOffice | string | Yes (if isCompany True) | Tax office for corporate customers. |
| sendMail | boolean | No | Should a registration email be sent (true or false). |
| addDefaultCurrentAccount | boolean | No | Should a default current account be created automatically after registration. |
| paymentSetId | string | No | Defined payment set ERP code. |
| canUseMobile | boolean | No | Should mobile access be allowed. |
| customerRepresentativeIds | array | No | IDs of customer representatives. |
| passportNo | string | No | Foreign ID/passport number. |
| isForeignNational | boolean | No | Is the customer a foreign national. |
| title | string | No | Title or additional information (optional). |
Example Request
- Header:
Authorization: Bearer {token}, Content-Type: application/json - Body:
JSON
- Successful Request
- Successful Response
- Example cURL
{
"code": "5",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "",
"address": "test",
"taxNumber": "",
"taxOffice": "Silifke",
"paymentSetId": "504978bf-bebd-40c5-89aa-b76f3a20341c",
"customerRepresentativeIds": [
"a90b225c-fa6e-418d-8c03-93946a05e355"
],
"isForeignNational": false,
"isCompany": false,
"companyName": "",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "5000000000",
"passportNo": "",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"tckn": "00000000000"
}
{
"status": "success",
"message": "Customer created successfully.",
"customerId": "1a5a47a9-688e-463d-b3d8-253dde5738ee"
}
curl --location 'https://pgw.netahsilatdemo.com/vendor/customer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJwd3N2MS5hcGkiLCJlcnB2MS5hcGkiLCJjYXR2MS5hcGkiLCJ2ZW5kb3J2MS5hcGkiXSwiYWN0b3J0Ijoic2VydmljZSIsInJvbGUiOiJzZXJ2aWNlIiwiVW5pcXVlIjoiYTY4OTM1NzYtZTgwYi00OGU0LTllYWItZmExNTIwMTYxYWY5IiwiVGVuYW50SWQiOiI2NzA2ODNjMS0yZmUwLTQ4NDYtODdiMi02Y2JhOWI3OTNhYjIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2V4cGlyYXRpb24iOiI2Mzg5NjEyMTczOTU4NjE1MTUiLCJuYmYiOjE3NjAzNTIxMzksImV4cCI6MTc2MDUyNDkzOSwiaWF0IjoxNzYwMzUyMTM5LCJpc3MiOiJzc28uYXBpIiwiYXVkIjoiZWNvenVtLnNzbyJ9.8w1fAcCqq0JrLSS9CkNpu2FTMv6jB0Flob8aKHwVl68' \
--data-raw '{
"code": "501",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "501",
"address": "test",
"taxNumber": "",
"taxOffice": "Silifke",
"paymentSetId": "504978bf-bebd-40c5-89aa-b76f3a20341c",
"customerRepresentativeIds": [
"a90b225c-fa6e-418d-8c03-93946a05e355"
],
"isForeignNational": false,
"isCompany": false,
"companyName": "",
"firstName": "vendor",
"lastName": "test3",
"email": "[email protected]",
"mobile": "5000000000",
"passportNo": "",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"tckn": "00000000000"
}'