Manuais
PHC GO Create/Update Customers
 

Method


The method to be called is:


Create/Update Customer vs Create Customer

Using this method, the customer´s existence is verified according to the following criteria:

  • Customer number
  • NIF
  • Email

If the customer exists, the data is updated, otherwise a new one is created with the respective data.

 

Parameters


In the request headers the Authorization header must have the Access Token:

  • Authorization: {{accessToken}}

 

JSON body


In the body of the POST a JSON structure like this one has to be passed:

{
"customer": {
"number": 86298,
"name": "JUERGEN SCHOBER",
"address": "",
"postalCode": "",
"city": "",
"country": "DE",
"email": "",
"taxNumber": "233936688",
"phone": "884112332",
"mobilePhone": "332445221",
"iban": "1122333444455",
"bic": "3331444112",
"observations": "This is an example"
}
}

 

Return Information


Any call made to this method will return a JSON information with this structure:

  1. In case of success:


    {
    "code": 1,
    "message": "Information saved with success"
    }


  2. In case of error:


    {
    "code": 100,
    "message": "Error message"
    }



JSON Specification for Create/Update Customers



Customer


 
NameTypePHC GO EntityPHC GO FieldObservations
numberIntegerClno
name1StringClnome
createEstablishmentBooleanCl- If createEstablishment parameter is activated (true), the number parameter becomes mandatory.
estabIntegerClestabIndicate which establishment you want to update. By default it goes 0.
addressStringClmorada
address2StringClmorada2
postalCodeStringClcodpost
cityStringCllocal
country1StringClpaisCan be set with the full name or the alpha-2 letter ISO3166 format.
Ex. “PT”, “ES”,”US” (See here)
emailStringClemail
taxNumberStringClncontRequired when PHC Go Application parameter “Tax number required” is True.
phoneStringCltelefone
mobilePhoneStringCltlmvl
ibanStringCliban
bicStringClswift
observationsStringClobs
abbreviatedNameStringClnome2
refintStringClrefIntInternal reference.
province (required field for Spain and Angola)StringClprovinciaCustomer Province.
county (required field for Angola)StringClmunicipioCustomer county.

 


Footnotes


1 - Required