API documentation

v1.0

Products

In products you can store articles and services that you use frequently in your documents.

Products or services always use the latest version of taxes. When modifying a tax, all products in which it applies will be recalculated.

Create a product

This endpoint allows the creation of a new product or service in your application.

HTTP Request

POST/products

Parameters

NameTypeDescription
nameString / RequiredProduct or service name
quantityInteger / RequiredQuantity
priceNumber up to 2 decimals / RequiredPrice / Can contain a negative sign as "-100.05"
descriptionString / Optional / Maximum 500 charactersProduct or service description
skuString / OptionalUnique internal product code
discountNumber up to 2 decimals / Optional / Min:0 Max:100Discount percentage applied to the product or service
business_line_idInteger / OptionalBusiness line identifier associated to the product or service
taxesArray / OptionalArray of tax identifiers that will be applied to the product or service

Playload

{
    "name": "My product",
    "quantity": 2,
    "price": 10,
    "description": "My product description",
    "sku": "my-product-sku",
    "discount": 10,
    "business_line_id": 1
    "taxes": [1,2],
}

201Response

{
    "data": {
        "id": 120,
        "name": "My product",
        "description": "My product description",
        "sku": "my-product-sku",
        "business_line": {
            "id": 1,
            "name": "Hardware"
        },
        "quantity": 2,
        "price": 10,
        "discount": 10,
        "subtotal": 20,
        "total_discount": 2,
        "total_before_taxes": 18,
        "taxes": [
            {
                "id": 1,
                "name": "IVA",
                "percentage": 21,
                "total": 3.78
            },
            {
                "id": 2,
                "name": "IRPF",
                "percentage": -15,
                "total": -2.7
            }
        ],
        "total_taxes": 1.08,
        "total_with_taxes": 19.08,
        "created_at": "2022-09-30T15:30:15+00:00",
        "updated_at": "2022-09-30T15:30:15+00:00"
    }
}

List products

This endpoint allows the consultation of products and services of your application.

HTTP Request

GET/products

GET Parameters

NameTypeDescription
pageInteger / Optional / Min:1Page
per_pageInteger / Optional / Min:1 Max:100Items per page
business_line_idInteger / OptionalFilter by business line identifier
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, price, quantity, discount, total

200 Response

{
    "data": [
        {
            "id": 120,
            "name": "My product",
            "description": "My product description",
            "sku": "my-product-sku",
            "business_line": {
                "id": 1,
                "name": "Hardware"
            },
            "quantity": 2,
            "price": 10,
            "discount": 10,
            "subtotal": 20,
            "total_discount": 2,
            "total_before_taxes": 18,
            "taxes": [
                {
                    "id": 1,
                    "name": "IVA",
                    "percentage": 21,
                    "total": 3.78
                },
                {
                    "id": 2,
                    "name": "IRPF",
                    "percentage": -15,
                    "total": -2.7
                }
            ],
            "total_taxes": 1.08,
            "total_with_taxes": 19.08,
            "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\/products?page=1",
        "last": "http:\/\/api.orzame.com\/v1\/products?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/api.orzame.com\/v1\/products",
        "per_page": 100,
        "to": 1,
        "total": 1
    }
}

Get a product

This endpoint allows the consultation of a product of your application.

HTTP Request

GET/products/{id}

200 Response

{
    "data": {
        "id": 120,
        "name": "My product",
        "description": "My product description",
        "sku": "my-product-sku",
        "business_line": {
            "id": 1,
            "name": "Hardware"
        },
        "quantity": 2,
        "price": 10,
        "discount": 10,
        "subtotal": 20,
        "total_discount": 2,
        "total_before_taxes": 18,
        "taxes": [
            {
                "id": 1,
                "name": "IVA",
                "percentage": 21,
                "total": 3.78
            },
            {
                "id": 2,
                "name": "IRPF",
                "percentage": -15,
                "total": -2.7
            }
        ],
        "total_taxes": 1.08,
        "total_with_taxes": 19.08,
        "created_at": "2022-09-30T15:30:15+00:00",
        "updated_at": "2022-09-30T15:30:15+00:00"
    }
}

Update a product

This endpoint allows the update of a product or service of your application.

HTTP Request

PATCH/products/{id}

Parameters

NameTypeDescription
nameString / OptionalProduct or service name
quantityInteger / OptionalQuantity
priceNumber up to 2 decimals / OptionalPrice / Can contain a negative sign as "-100.05"
descriptionString / Optional / Maximum 500 charactersProduct or service description
skuString / OptionalUnique internal product code
discountNumber up to 2 decimals / Optional / Min:0 Max:100Discount percentage applied to the product or service
business_line_idInteger / OptionalBusiness line identifier associated to the product or service. You can send the value `null` to unassign the business line from the product
taxesArray / OptionalArray of tax identifiers that will be applied to the product or service. You can send an empty array `[]` to unassign all taxes from the product

All parameters are optional but at least one parameter with value must be sent.

Playload

{
    "name": "My new product",
    "description": "My new product description",
    "sku": "my-new-product-sku",
    "quantity": 1,
    "price": 5,
    "discount": 0,
    "taxes": [],
    "business_line_id": null
}

200 Response

{
    "data": {
        "id": 120,
        "name": "My new product",
        "description": "My new product description",
        "sku": "my-new-product-sku",
        "business_line": null,
        "quantity": 1,
        "price": 5,
        "discount": 0,
        "subtotal": 5,
        "total_discount": 0,
        "total_before_taxes": 5,
        "taxes": [],
        "total_taxes": 0,
        "total_with_taxes": 5,
        "created_at": "2022-09-30T15:30:15+00:00",
        "updated_at": "2022-09-30T16:40:25+00:00"
    }
}

Delete a product

This endpoint allows the deletion of a product or service of your application.

HTTP Request

DELETE/products/{id}

204 Response

Response without body.