WinShopAPI docs
ReferenceCompanies

Create a company card

Registers a card for the company and returns the stored row. Requires `Permissions.Companies.Create`.

POST
/api/companies/{companyId}/cards

Authorization

Bearer
headerAuthorizationBearer <token>

OAuth 2.0 client credentials. Obtain a client id/secret from Winshop support ([email protected]), then POST to the token URL.

Path Parameters

companyId*integer
Formatint32

Request Body

application/json
  1. body
barcode?|
Lengthlength <= 255
companyId?|
Formatint32
discount?|
Formatdecimal
discountAmount?|
Formatdecimal
discountGroupId?|
Formatint32
guid?|
Formatguid
id?|
Formatint32
isBillingEnabled?boolean|null
isInvalid?boolean|null
lastModify?|
Formatdate-time
name?|
Lengthlength <= 80
note?string|null
validFrom?|
Formatdate-time
validTo?|
Formatdate-time

Response Body

application/json
  1. response
barcode?|
Lengthlength <= 255
companyId?|
Formatint32
discount?|
Formatdecimal
discountAmount?|
Formatdecimal
discountGroupId?|
Formatint32
guid?|
Formatguid
id?|
Formatint32
isBillingEnabled?boolean|null
isInvalid?boolean|null
lastModify?|
Formatdate-time
name?|
Lengthlength <= 80
note?string|null
validFrom?|
Formatdate-time
validTo?|
Formatdate-time
curl -X POST 'https://<your-instance>/api/companies/0/cards' \  -H 'Authorization: Bearer <access-token>' \  -H 'Content-Type: application/json' \  -d '{  "barcode": "1234567890123",  "companyId": 2,  "discount": 20,  "isInvalid": false,  "name": "New Card",  "note": "Special gift card",  "validFrom": "2022-01-01T00:00:00",  "validTo": "2025-01-01T00:00:00"}'
{  "barcode": "string",  "companyId": 0,  "discount": 0,  "discountAmount": 0,  "discountGroupId": 0,  "guid": "string",  "id": 0,  "isBillingEnabled": true,  "isInvalid": true,  "lastModify": "2019-08-24T14:15:22Z",  "name": "string",  "note": "string",  "validFrom": "2019-08-24T14:15:22Z",  "validTo": "2019-08-24T14:15:22Z"}