Pecuario.Backend

<back to all web services

PublishProduct

Requires Authentication
The following routes are available for this service:
POST/api/v1/marketplace/products
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class PublishProduct implements IPost
    {
        public String categoryName = null;
        public String productName = null;
        public String supplier = null;
        public String companyName = null;
        public Integer regionId = null;
        public Integer cityId = null;
        public String description = null;
        public Boolean homeDelivery = null;
        public BigDecimal price = null;
        
        public String getCategoryName() { return categoryName; }
        public PublishProduct setCategoryName(String value) { this.categoryName = value; return this; }
        public String getProductName() { return productName; }
        public PublishProduct setProductName(String value) { this.productName = value; return this; }
        public String getSupplier() { return supplier; }
        public PublishProduct setSupplier(String value) { this.supplier = value; return this; }
        public String getCompanyName() { return companyName; }
        public PublishProduct setCompanyName(String value) { this.companyName = value; return this; }
        public Integer getRegionId() { return regionId; }
        public PublishProduct setRegionId(Integer value) { this.regionId = value; return this; }
        public Integer getCityId() { return cityId; }
        public PublishProduct setCityId(Integer value) { this.cityId = value; return this; }
        public String getDescription() { return description; }
        public PublishProduct setDescription(String value) { this.description = value; return this; }
        public Boolean isHomeDelivery() { return homeDelivery; }
        public PublishProduct setHomeDelivery(Boolean value) { this.homeDelivery = value; return this; }
        public BigDecimal getPrice() { return price; }
        public PublishProduct setPrice(BigDecimal value) { this.price = value; return this; }
    }

    public static class PublishProductResponse extends BaseResponse
    {
        public String id = null;
        
        public String getId() { return id; }
        public PublishProductResponse setId(String value) { this.id = value; return this; }
    }

    public static class BaseResponse
    {
        public Status status = null;
        
        public Status getStatus() { return status; }
        public BaseResponse setStatus(Status value) { this.status = value; return this; }
    }

    public static class Status
    {
        public String message = null;
        public Integer statusCode = null;
        
        public String getMessage() { return message; }
        public Status setMessage(String value) { this.message = value; return this; }
        public Integer getStatusCode() { return statusCode; }
        public Status setStatusCode(Integer value) { this.statusCode = value; return this; }
    }

}

Java PublishProduct DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/v1/marketplace/products HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	categoryName: String,
	productName: String,
	supplier: String,
	companyName: String,
	regionId: 0,
	cityId: 0,
	description: String,
	homeDelivery: False,
	price: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String
}