BokaMera.API.Host

<back to all web services

CreateCustomerArticleFromArticle

The following routes are available for this service:
POST/customerarticle/fromarticleCreate CustomerArticle.Create CustomerArticle.
// @ts-nocheck

export class CustomerBase implements ICustomerBase
{
    public CustomerId?: string;
    public Firstname: string;
    public Lastname: string;
    public Email: string;
    public Phone: string;
    public SubscribedToNewsletter: boolean;
    public PersonalIdentityNumber: string;

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

export class CustomerToHandle extends CustomerBase
{

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

export class InvoiceAddressToHandle implements IInvoiceAddress
{
    public CorporateIdentityNumber: string;
    public InvoiceAddress1: string;
    public InvoiceAddress2: string;
    public InvoiceCity: string;
    public InvoicePostalCode: string;
    public InvoiceCountryCode: string;

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

export class FromArticleBase
{
    /** @description  */
    // @ApiMember(Description="")
    public CompanyId?: string;

    /** @description Article ID for the rebate code */
    // @ApiMember(Description="Article ID for the rebate code", IsRequired=true)
    public ArticleId: number;

    /** @description Customer information */
    // @ApiMember(Description="Customer information")
    public Customer: CustomerToHandle;

    /** @description If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinairy profile.  */
    // @ApiMember(Description="If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinairy profile. ")
    public InvoiceAddress: InvoiceAddressToHandle;

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

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 Services: ArticleServiceRelation[] = [];
    public ServiceIds: number[] = [];
    public PriceSign: string;
    public VAT?: number;

    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); }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
export class CreateCustomerArticleFromArticle extends FromArticleBase implements ICompany
{

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

TypeScript CreateCustomerArticleFromArticle DTOs

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

HTTP + OTHER

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

POST /customerarticle/fromarticle HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","ArticleId":0,"Customer":{"CustomerId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Email":"String","Phone":"String","SubscribedToNewsletter":false,"PersonalIdentityNumber":"String"},"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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,"Services":[{"Id":0,"ServiceId":0,"ArticleId":0}],"ServiceIds":[0],"PriceSign":"String","VAT":0},"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"}}}