Contacts
Manage persons and companies that could be future clients, clients and suppliers.
Create a contact
This endpoint allows the creation of a new contact in your application.
HTTP Request
POST/contacts
Parameters
Name | Type | Description |
---|---|---|
name | String / Required | Name or commercial name |
types | Array / Optional | Array of contact types identifiers Types available in data.options.contact_types of the endpoint: /info. |
tax_name | String / Optional | Fiscal name |
tax_number | String / Optional | Fiscal identifier |
phone | String / Optional | Phone |
phone_secondary | String / Optional | Secondary phone |
phone_mobile | String / Optional | Mobile phone |
String / Optional | ||
web | String / Optional | Website |
bank_name | String / Optional | Bank name |
bank_iban | String / Optional | IBAN account number |
address | Object / Optional | Default address |
person | Object / Optional | Default contact person |
You can create a default address and a default contact person, at the time of creating the contact, they are optional, if they are sent, the information of their properties is the following:
Address
Name | Type | Description |
---|---|---|
street | String / Required | Street |
city | String / Optional | City / Population |
postal_code | String / Optional | Postal code |
province | String / Optional | Province / State |
country | String / Required | Country code Codes available in data.options.countries of the endpoint: /info. |
receptor | String / Optional | Receiver of the document for this address |
Person
Name | Type | Description |
---|---|---|
name | String / Required | Name |
position | String / Optional | Position |
phone | String / Optional | Phone |
String / Optional |
Playload
{
"name": "Acme",
"types": [1,3],
"tax_name": "Acme S.L.",
"tax_number": "ESB2700001",
"phone": "999999999",
"phone_mobile": "66666666",
"email": "info@acme.com",
"web": "www.acme.com",
"bank_name": "Bank name",
"bank_iban": "ES005555999922223333",
"person": {
"name":"John Doe",
"email": "john@acme.com"
},
"address": {
"receptor": "John Doe",
"street": "Acme address nº 99",
"city": "My City",
"postal_code": "55555",
"province": "My Province",
"country": "ES",
}
}
201Response
{
"data": {
"id": 102,
"name": "Acme",
"types": [1,3],
"tax_name": "Acme S.L.",
"tax_number": "ESB2700001",
"phone": "999999999",
"phone_secondary": "",
"phone_mobile": "66666666",
"email": "info@acme.com",
"web": "www.acme.com",
"notes": "",
"bank_name": "Bank name",
"bank_iban": "ES005555999922223333",
"address": {
"id": 37,
"receptor": "John Doe",
"street": "Acme address nº 99",
"city": "My City",
"postal_code": "55555",
"province": "My Province",
"country": "ES",
"default": true,
"contact_id": 102,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
"person": {
"id": 52,
"name": "John Doe",
"position": "",
"phone": "",
"email": "john@acme.com",
"default": true,
"contact_id": 102,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
List contacts
This endpoint allows the consultation of contacts from your application. If they exist, it also obtains the data of the address and contact person by default, if there are no data by default, it obtains the first contact and the first address.
HTTP Request
GET/contacts
GET Parameters
Name | Type | Description |
---|---|---|
page | Integer / Optional / Min:1 | Page |
per_page | Integer / Optional / Min:1 Max:100 | Items per page |
types | String / Optional | Filter contact type identifiers separated by comma /contacts?types=2,3 ... Types available in data.options.contact_types of the endpoint: /info. |
search | String / Optional / Min:3 | Search by string of at least 3 characters |
order | String / Optional | Order by a field in ascending or descending, descending by default, in format "{field},desc" or "{field},asc" where {field} can be: id, name |
200 Response
{
"data": [
{
"id": 116,
"name": "Mary Doe",
"types": [
2
],
"tax_name": "Mary Doe",
"tax_number": "33333333P",
"phone": "678678678",
"phone_secondary": "",
"phone_mobile": "",
"email": "mary@mary.com",
"web": "www.mary.com",
"notes": "",
"bank_name": "",
"bank_iban": "",
"address": null,
"person": null,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
{
"id": 115,
"name": "Acme",
"types": [
1,
3
],
"tax_name": "Acme SL",
"tax_number": "B27999999",
"phone": "987987987",
"phone_secondary": "",
"phone_mobile": "",
"email": "info@acme.com",
"web": "www.acme.com",
"notes": "",
"bank_name": "",
"bank_iban": "",
"address": {
"id": 52,
"receptor": "John Doe",
"street": "Acme street n12",
"city": "Lugo",
"postal_code": "27001",
"province": "Lugo",
"country": "ES",
"default": true,
"contact_id": 115,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
"person": {
"id": 61,
"name": "John Doe",
"position": "Boss",
"phone": "654654654",
"email": "JohnDoe@gmail.com",
"default": false,
"contact_id": 115,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
],
"links": {
"first": "http:\/\/api.orzame.com\/v1\/contacts?page=1",
"last": "http:\/\/api.orzame.com\/v1\/contacts?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http:\/\/api.orzame.com\/v1\/contacts",
"per_page": 100,
"to": 2,
"total": 2
}
}
Get a contact
This endpoint allows the consultation of a contact of your application. If they exist, it also obtains the data of the address and contact person by default, if there are no data by default, it obtains the first contact and the first address.
HTTP Request
GET/contacts/{id}
200 Response
{
"data": {
"id": 102,
"name": "Acme",
"types": [1,3],
"tax_name": "Acme S.L.",
"tax_number": "ESB2700001",
"phone": "999999999",
"phone_secondary": "",
"phone_mobile": "66666666",
"email": "info@acme.com",
"web": "www.acme.com",
"notes": "",
"bank_name": "Bank name",
"bank_iban": "ES005555999922223333",
"address": {
"id": 37,
"receptor": "John Doe",
"street": "Acme address nº 99",
"city": "My City",
"postal_code": "55555",
"province": "My Province",
"country": "ES",
"default": true,
"contact_id": 102,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
"person": {
"id": 52,
"name": "John Doe",
"position": "",
"phone": "",
"email": "john@acme.com",
"default": true,
"contact_id": 102,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
Update a contact
This endpoint allows the update of a contact of your application.
HTTP Request
PATCH/contacts/{id}
Parameters
Name | Type | Description |
---|---|---|
name | String / Optional | Name or commercial name |
types | Array / Optional | Array of contact types identifiers Types available in data.options.contact_types of the endpoint: /info. |
tax_name | String / Optional | Fiscal name |
tax_number | String / Optional | Fiscal identifier |
phone | String / Optional | Phone |
phone_secondary | String / Optional | Secondary phone |
phone_mobile | String / Optional | Mobile phone |
String / Optional | ||
web | String / Optional | Website |
bank_name | String / Optional | Bank name |
bank_iban | String / Optional | IBAN account number |
All parameters are optional but at least one parameter with value must be sent.
Playload
{
"name": "Acme Enterprises",
"email": "newemail@acme.com",
}
204 Response
Response without body.
Delete a contact
This endpoint allows the deletion of a contact from your application.
HTTP Request
DELETE/contacts/{id}
204 Response
Response without body.