This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Accounts
Matheus B. Nakaya edited this page Aug 21, 2018
·
20 revisions
TO DO
TO DO
Index
authorization | able |
---|---|
Basic Auth | ❌ |
OAuth | ✅ |
Map<String, Object> hasAccount = Moip.API.accounts().checkExistence("ARGUMENT", setup);
The search argument can be a tax document number (with punctuation) or an e-mail.
response | account |
---|---|
200 | exist |
400 | invalid |
404 | does not exist |
authorization | able |
---|---|
Basic Auth | ❌ |
OAuth | ✅ |
Map<String, Object> email = new HashMap<>();
email.put("address", "[email protected]");
Map<String, Object> taxDocument = new HashMap<>();
taxDocument.put("type", "CPF");
taxDocument.put("number", "123.456.789-00");
Map<String, Object> identityDocument = new HashMap<>();
identityDocument.put("type", "RG");
identityDocument.put("number", "434322344");
identityDocument.put("issuer", "SSP");
identityDocument.put("issueDate", "2010-01-01");
Map<String, Object> phone = new HashMap<>();
phone.put("countryCode", "55");
phone.put("areaCode", "11");
phone.put("number", "4321-5678");
Map<String, Object> address = new HashMap<>();
address.put("street", "Av. Brigadeiro Faria Lima");
address.put("streetNumber", "2927");
address.put("district", "Itaim Bibi");
address.put("city", "São Paulo");
address.put("state", "SP"); // UF
address.put("country", "BRA");
address.put("zipCode", "01234-000");
Map<String, Object> person = new HashMap<>();
person.put("name", "Name");
person.put("lastName", "Last Name");
person.put("taxDocument", taxDocument);
person.put("identityDocument", identityDocument);
person.put("birthDate", "2000-01-01");
person.put("phone", phone);
person.put("address", address);
Map<String, Object> body = new HashMap<>();
body.put("email", email);
body.put("person", person);
body.put("type", "MERCHANT");
Map<String, Object> hasAccount = Moip.API.accounts().create(body, setup);