BokaMera.API.Host

<back to all web services

CreateArticle

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/articlesAdd new articleAdd article to the company for the currently logged in user
CreateArticle Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?No
NamebodystringYes
ArticleTypeIdbodyintYes
DescriptionbodystringYes
ImageUrlbodyUriYes
ActivebodyboolYes
AmountbodyintYes
DurationbodyintYesIf the article is a service article, the duration in minutes.
SortOrderbodyintNoSortOrder
PricebodydoubleYesThe price of the article.
CurrencyIdbodystringYesThe payment currency id
VATbodydecimal?NoThe price VAT in percent
ServiceIdsqueryint[]YesQuery for specific services.
ValidDaysbodyintNoNumber of days the article is valid from the purchase date. Used to calculate ValidToDate on rebate codes, punch tickets, and gift cards.
SendNotificationbodyboolNoIf true, an email notification is sent to NotificationEmail when this article is purchased.
NotificationEmailbodystringYesEmail address to notify when the article is purchased. Only used when SendNotification is true.
ArticleResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNo
IdformintNo
NameformstringYes
ArticleTypeIdformintNo
DescriptionformstringYes
ImageUrlformstringYes
ActiveformboolNo
AmountformintNo
PriceformdoubleNo
CurrencyIdformstringYes
SortOrderformintNo
UpdatedDateformDateTimeNo
CreatedDateformDateTimeNo
DurationformintNo
ServicesformList<ArticleServiceRelation>Yes
ServiceIdsformList<int>Yes
PriceSignformstringYes
VATformdecimal?No
ValidDaysformintNo
SendNotificationformboolNo
NotificationEmailformstringYes
ArticleServiceRelation Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidYes
IdformintNo
ServiceIdformintYes
ArticleIdformintYes

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /articles HTTP/1.1 
Host: api.bookmore.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Name":"String","ArticleTypeId":0,"Description":"String","Active":false,"Amount":0,"Duration":0,"SortOrder":0,"Price":0,"CurrencyId":"String","VAT":0,"ServiceIds":[0],"ValidDays":0,"SendNotification":false,"NotificationEmail":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"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"}