Skip to main content

Updating a Customer

  • Endpoint: /vendor/customer/{Code}
  • HTTP Method: PUT
  • Request Content-Type: application/json
  • Authorization: Valid AccessToken is required. (See: 2. Authentication)

Description

This service allows updating an existing customer record in the system. Both individual and corporate customers are supported. Only fields to be updated can be sent; fields not sent remain unchanged.

Note: code and erpCode fields are required. updateCode identifies the existing record, while code represents the new customer code (can be changed).

Header Information

HeaderRequiredDescription
AuthorizationYesToken in Bearer {AccessToken} format
Content-TypeYesapplication/json

Update Reference Field

FieldTypeRequiredDescription
updateCodestringYesThe member code (code) of the customer to be updated

Request Body Fields

FieldTypeRequiredDescription
codestringYesCustomer code (unique).
erpCodestringYesUnique customer code in ERP system.
firstNamestringIndividualFirst name for individual customers.
lastNamestringIndividualLast name for individual customers.
companyNamestringCorporateCompany name for corporate customers.
isCompanybooleanNotrue: Corporate, false: Individual.
isForeignNationalbooleanNoIs the customer foreign?
tcknstringIndividualTurkish ID number (for individuals).
taxNumberstringCorporateTax number (for corporate).
taxOfficestringCorporateTax office (for corporate).
emailstringNoCustomer email address.
phonestringNoLandline number.
mobilestringNoMobile number.
countryCodestringNoCountry code (e.g., "TR").
cityCodestringNoCity code.
districtCodeintegerNoDistrict code.
currencyCodestringNoCurrency code (e.g., "TRY").
addressstringNoAddress information.
paymentSetIdstringNoRelated payment set ID.
customerRepresentativeIdsarray(string)NoList of customer representative IDs.
canUseMobilebooleanNoPermission to use mobile app.
sendMailbooleanNoSend notification email after update?
isActivebooleanNoIs the customer active?
titlestringNoTitle or additional note (optional).

Note on field name differences: Some field names in the creation service (e.g., countryCode vs countryCodeISO, currencyCode vs currencyTypeId) may differ in this service. Use the names provided in this table for update requests.

{  
"code": "501",
"erpCode": "501",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"address": "test",
"taxOffice": "Silifke",
"paymentSetId": "504978bf-bebd-40c5-89aa-b76f3a20341c",
"customerRepresentativeIds": [
"a90b225c-fa6e-418d-8c03-93946a05e355"
],
"isForeignNational": false,
"isCompany": false,
"firstName": "vendor",
"lastName": "test5",
"email": "[email protected]",
"mobile": "5000000000",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"tckn": "00000000000"
}

Usage Notes & Best Practices

  • Partial Update: Only send the fields to be updated; fields not sent remain unchanged.
  • Field Consistency: Field names may differ between creation (POST) and update (PUT) (e.g., countryCodecountryCodeISO).
  • Identification Fields: updateCode refers to the existing code value of the record to be updated. If changing code, both updateCode (old code) and code (new code) can appear in the body.
  • Email Notification: If sendMail=true, a notification email may be triggered according to your system configuration.
  • Currency/Payment Set: Ensure that currencyTypeId and paymentSetId values are defined in your system; otherwise, a 404 may occur.
  • Client-side Checks: If the token has expired, refresh it before retrying the request (See: 2.2 Token Expiration and Renewal).