API documentation

v1.0

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

NameTypeDescription
nameString / RequiredName or commercial name
typesArray / OptionalArray of contact types identifiers
Types available in data.options.contact_types of the endpoint: /info.
tax_nameString / OptionalFiscal name
tax_numberString / OptionalFiscal identifier
phoneString / OptionalPhone
phone_secondaryString / OptionalSecondary phone
phone_mobileString / OptionalMobile phone
emailString / OptionalEmail
webString / OptionalWebsite
bank_nameString / OptionalBank name
bank_ibanString / OptionalIBAN account number
addressObject / OptionalDefault address
personObject / OptionalDefault 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

NameTypeDescription
streetString / RequiredStreet
cityString / OptionalCity / Population
postal_codeString / OptionalPostal code
provinceString / OptionalProvince / State
countryString / RequiredCountry code
Codes available in data.options.countries of the endpoint: /info.
receptorString / OptionalReceiver of the document for this address

Person

NameTypeDescription
nameString / RequiredName
positionString / OptionalPosition
phoneString / OptionalPhone
emailString / OptionalEmail

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

NameTypeDescription
pageInteger / Optional / Min:1Page
per_pageInteger / Optional / Min:1 Max:100Items per page
typesString / OptionalFilter contact type identifiers separated by comma
/contacts?types=2,3 ...
Types available in data.options.contact_types of the endpoint: /info.
searchString / Optional / Min:3Search by string of at least 3 characters
orderString / OptionalOrder 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

NameTypeDescription
nameString / OptionalName or commercial name
typesArray / OptionalArray of contact types identifiers
Types available in data.options.contact_types of the endpoint: /info.
tax_nameString / OptionalFiscal name
tax_numberString / OptionalFiscal identifier
phoneString / OptionalPhone
phone_secondaryString / OptionalSecondary phone
phone_mobileString / OptionalMobile phone
emailString / OptionalEmail
webString / OptionalWebsite
bank_nameString / OptionalBank name
bank_ibanString / OptionalIBAN 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.