BokaMera.API.Host

<back to all web services

CreateCustomerArticle

Requires Authentication
The following routes are available for this service:
POST/customerarticleCreate a new CustomerArticle.Create a new CustomerArticle directly with price, status, and customer.
// @ts-nocheck

export class BaseModel
{

    public constructor(init?: Partial<BaseModel>) { (Object as any).assign(this, init); }
}

export class ArticleServiceRelation extends BaseModel
{
    // @Required()
    public CompanyId: string;

    public Id: number;
    // @Required()
    public ServiceId: number;

    // @Required()
    public ArticleId: number;

    public constructor(init?: Partial<ArticleServiceRelation>) { super(init); (Object as any).assign(this, init); }
}

export class ArticleResponse
{
    public CompanyId: string;
    public Id: number;
    public Name: string;
    public ArticleTypeId: number;
    public Description: string;
    public ImageUrl: string;
    public Active: boolean;
    public Amount: number;
    public Price: number;
    public CurrencyId: string;
    public SortOrder: number;
    public UpdatedDate: string;
    public CreatedDate: string;
    public Duration: number;
    public Services: ArticleServiceRelation[] = [];
    public ServiceIds: number[] = [];
    public PriceSign: string;
    public VAT?: number;
    public ValidDays: number;
    public SendNotification: boolean;
    public NotificationEmail: string;

    public constructor(init?: Partial<ArticleResponse>) { (Object as any).assign(this, init); }
}

export class CustomerArticleCustomerResponse
{
    public Id: string;
    public Firstname: string;
    public Lastname: string;
    public Email: string;
    public Phone: string;

    public constructor(init?: Partial<CustomerArticleCustomerResponse>) { (Object as any).assign(this, init); }
}

export class CustomerArticleCompanyResponse
{
    public Id: string;
    public Name: string;
    public LogoType: string;
    public Email: string;
    public Phone: string;
    public City: string;
    public Street1: string;
    public ZipCode: string;
    public CountryId: string;

    public constructor(init?: Partial<CustomerArticleCompanyResponse>) { (Object as any).assign(this, init); }
}

export class PaymentLogResponse
{
    public Id: number;
    public Amount?: number;
    public AmountCredited?: number;
    public CurrencyId: string;
    public Comments: string;
    public Created: string;
    public Updated: string;

    public constructor(init?: Partial<PaymentLogResponse>) { (Object as any).assign(this, init); }
}

export class CustomerArticleResponse
{
    public Id: number;
    public CompanyId: string;
    public ArticleId?: number;
    public Price?: number;
    public VAT?: number;
    public CurrencyId: string;
    public StatusId: number;
    public StatusName: string;
    public CustomerId?: string;
    public CreatedDate: string;
    public UpdatedDate: string;
    public Article: ArticleResponse;
    public Customer: CustomerArticleCustomerResponse;
    public Company: CustomerArticleCompanyResponse;
    public PaymentLog: PaymentLogResponse[] = [];
    public ResponseStatus: ResponseStatus;

    public constructor(init?: Partial<CustomerArticleResponse>) { (Object as any).assign(this, init); }
}

export enum CustomerArticleStatusEnum
{
    AwaitingPayment = 1,
    AwaitingPaymentFromProvider = 2,
    AwaitingPaymentNoTimeLimit = 3,
    Active = 4,
    Off = 5,
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
export class CreateCustomerArticle implements ICompany
{
    /** @description The company id, if empty will use the company id for the user you are logged in with. */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    public CompanyId?: string;

    /** @description The article id to base this customer article on */
    // @ApiMember(Description="The article id to base this customer article on", IsRequired=true)
    public ArticleId: number;

    /** @description The customer id to assign the article to */
    // @ApiMember(Description="The customer id to assign the article to", IsRequired=true)
    public CustomerId: string;

    /** @description The status of the customer article */
    // @ApiMember(Description="The status of the customer article")
    public StatusId?: CustomerArticleStatusEnum;

    /** @description Optional price override. If not provided, uses the article price. */
    // @ApiMember(Description="Optional price override. If not provided, uses the article price.")
    public Price?: number;

    /** @description Optional VAT override. If not provided, uses the article VAT. */
    // @ApiMember(Description="Optional VAT override. If not provided, uses the article VAT.")
    public VAT?: number;

    /** @description Optional currency override. If not provided, uses the article currency. */
    // @ApiMember(Description="Optional currency override. If not provided, uses the article currency.")
    public CurrencyId: string;

    public constructor(init?: Partial<CreateCustomerArticle>) { (Object as any).assign(this, init); }
}

TypeScript CreateCustomerArticle DTOs

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

HTTP + CSV

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

POST /customerarticle HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","ArticleId":0,"StatusId":"0","Price":0,"VAT":0,"CurrencyId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Id":0,"ArticleId":0,"Price":0,"VAT":0,"CurrencyId":"String","StatusId":0,"StatusName":"String","CustomerId":"00000000-0000-0000-0000-000000000000","Article":{"Id":0,"Name":"String","ArticleTypeId":0,"Description":"String","ImageUrl":"String","Active":false,"Amount":0,"Price":0,"CurrencyId":"String","SortOrder":0,"Duration":0,"Services":[{"Id":0,"ServiceId":0,"ArticleId":0}],"ServiceIds":[0],"PriceSign":"String","VAT":0,"ValidDays":0,"SendNotification":false,"NotificationEmail":"String"},"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String"},"Company":{"Name":"String","LogoType":"String","Email":"String","Phone":"String","City":"String","Street1":"String","ZipCode":"String","CountryId":"String"},"PaymentLog":[{"Id":0,"Amount":0,"AmountCredited":0,"CurrencyId":"String","Comments":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}