With the Loyalty Settlement platform users can earn points or real money when using thier payment card in a store. By processing payment card transactions or merchant receipts contributions will be calculated as a percentage of the amount on the current transaction.
Calculated contributions is returned by the API as a settlement. Each settlement has a user share and a provider share. The user share is the value that the user has earned and the provider share is the fee to the provider (the consumer of this api). Settlements can be summed up at intervals and the the merchant can be charged.
As a Loyalty Settlement provider partnerships must be made with different merchants with agreement on the percentage for user share and provider share. After agreement the merchant can be created but to start receiveing payment transactions the user must signup thier payment card to Storebox.
This can be done with our Card API if you, as a provider, have the users in your own user/member system. Or if Storebox should do the user administration, then a user should be created through our Loyalty API and afterwards cards can be added to a user.
Merchants are the central part of the Loyalty Settlement API. A merchant is the high level resource with relations to companies, stores, categories and campaigns.
Add a single merchant. To start receiving payment transactions then add a Company resource afterwards.
merchantId | string [ 1 .. 32 ] characters External id of the merchant. Automatically generated upon creation if not provided. |
merchantName required | string [ 1 .. 128 ] characters Name of the merchant |
{- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantName": "Test Merchant"
}
{- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantName": "Test Merchant",
- "merchantStatus": "active",
- "companies": [
- {
- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
], - "campaigns": [
- {
- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
]
}
[- {
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantName": "Test Merchant",
- "merchantStatus": "active",
- "companies": [
- {
- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
], - "campaigns": [
- {
- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
]
}
]
Get a single merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
{- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantName": "Test Merchant",
- "merchantStatus": "active",
- "companies": [
- {
- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
], - "campaigns": [
- {
- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
], - "stores": [
- {
- "storeId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
], - "categories": [
- {
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
], - "derivedShares": [
- {
- "derivedShareId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "merchantId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "share": 2.5,
- "derivedShare": 0.5,
- "derivedShareType": "percentage"
}
]
}
Update one or more fields for a merchant by merchantId. The merchantId cannot be updated.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
merchantName | string [ 1 .. 128 ] characters Name of the merchant |
merchantStatus | string Default: "active" Enum: "active" "disabled" Status of the merchant |
{- "merchantName": "Test Merchant",
- "merchantStatus": "active"
}
Get companies for a merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
]
Get stores for a merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "storeId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
]
Get categories for a merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
]
Get campaigns for a merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
]
Get invoices data for a merchant by merchantId.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "invoiceNumber": 100,
- "type": "user",
- "invoiceDate": "2018-11-10",
- "paymentDate": "2018-11-14",
- "amount": 100,
- "vat": 25,
- "amountWithVat": 125
}
]
Get the state of each settlement source.
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
[- {
- "name": "Nets DK",
- "type": "TRANSACTION",
- "state": "ACTIVE",
- "date": "2020-05-07T17:32:28Z",
- "companyRegistrationNumber": 11223344
}
]
Settle with merchants. Will sum up settlments pr. merchant pr. type (user share and provider share) and create invoice data accordingly. The returned settlementId can be used to fetch invoice data through /api/v1/invoices.
externalMerchantId | string Example: externalMerchantId=mdo9afaoaoy2u7tomdy9y1mzcpftvdpk External id of merchant |
{- "settlementId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3"
}
A settlement represents a payment transaction with calculated contribution values to the user and provider.
Get settlements by a date range for all or specific merchants.
startdate required | string <date-time> Example: startdate=2018-05-18T08:00:00+02:00 Earliest date/time to search for settlements records in ISO-8601 format. This date represents the settlement system processing datetime. Requires URL encoding. |
enddate required | string <date-time> Example: enddate=2018-05-18T20:00:00+02:00 Latest date/time to search for settlements records in ISO-8601 format. This date represents the settlement system processing datetime. Requires URL encoding. |
merchant | string Example: merchant=merchant1,merchant2 Comma-separated list with of external merchant id's that should be included in the response. The value _all_ can be provided to get settlements for all merchants. |
offset | integer Default: 0 Return settlements in the given date interval starting at this index. |
limit | integer <= 1000 Default: 1000 The number of settlements to return. |
curl -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic {base64 encoded username:password}" "https://{host}/api/v1/settlements?startDate=2018-05- 30T08%3A00%3A00%2B02%3A00&endDate=2018-05- 30T20%3A00%3A00%2B02%3A00&merchant=_all_"
{- "offset": 0,
- "limit": 0,
- "totalSize": 0,
- "settlements": [
- {
- "externalMerchantId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "externalCompanyId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "externalStoreId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "campaignCode": "t19q45n57e4mntcapw3hsx8xidsg46g1",
- "merchantName": "Test Merchant",
- "amount": 1234,
- "currency": "DKK",
- "externalReferenceId": 181001216739,
- "cardAcceptorId": 5799449,
- "cardAcceptorInfo": "Test Merchant AS\\Vejen 1\\Byen\\ 1212 DNK",
- "cardId": "km17rvtxp5fsdfgfs81e1mn9fjrawk1l",
- "cardType": 1,
- "userInfo": "t19q45n57e4mntcapw3hsx8xidsg46g1",
- "merchantRegistrationId": 12346790,
- "transactionTime": 181001085022,
- "userShare": 7.5,
- "userShareType": "percentage",
- "userShareValue": 10,
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "providerShareValue": 3,
- "providerShareVatValue": 1,
- "providerShareWithVatValue": 1
}
]
}
Get settlements by batchId. The batchId can be provided by Storebox through a HTTP notification. See Notifications.
batchId required | string Example: mdo9afaoaoy2u7tomdy9y1mzcpftvdpk External id of the settlement batch. |
merchant | string Example: merchant=merchant1,merchant2 Comma-separated list with of external merchant id's that should be included in the response. The value _all_ can be provided to get settlements for all merchants. |
offset | integer Default: 0 Return settlements in the given date interval starting at this index. |
limit | integer <= 1000 Default: 1000 The number of settlements to return. |
{- "offset": 0,
- "limit": 0,
- "totalSize": 0,
- "settlements": [
- {
- "externalMerchantId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "externalCompanyId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "externalStoreId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "campaignCode": "t19q45n57e4mntcapw3hsx8xidsg46g1",
- "merchantName": "Test Merchant",
- "amount": 1234,
- "currency": "DKK",
- "externalReferenceId": 181001216739,
- "cardAcceptorId": 5799449,
- "cardAcceptorInfo": "Test Merchant AS\\Vejen 1\\Byen\\ 1212 DNK",
- "cardId": "km17rvtxp5fsdfgfs81e1mn9fjrawk1l",
- "cardType": 1,
- "userInfo": "t19q45n57e4mntcapw3hsx8xidsg46g1",
- "merchantRegistrationId": 12346790,
- "transactionTime": 181001085022,
- "userShare": 7.5,
- "userShareType": "percentage",
- "userShareValue": 10,
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "providerShareValue": 3,
- "providerShareVatValue": 1,
- "providerShareWithVatValue": 1
}
]
}
Create a batch of settlements with a reference to all settlements which at the time was not already in a batch.
{- "batchId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "settlements": 221,
- "created": "2019-08-24T14:15:22Z"
}
A company is created by a company registration number (in danish CVR-nummer) and will enable data flow of payment transactions for that specific registration number. A merchant will receive payment transactions for all created companies. If a company is configured with zero userShare and providerShare then transactions will only be matched if the transaction has a store number (merchantId/cardAcceptorId) which matches a created Store resource.
Add new company to start receiving payment transactions for the provided company registration number.
companyId | string [ 1 .. 32 ] characters External id of the company. Automatically generated upon creation if not provided. |
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
name required | string [ 1 .. 128 ] characters Name of the company. |
companyRegistrationNumber required | string [ 1 .. 128 ] characters The company registration number (in Denmark CVR number). |
userShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
{- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
{- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
Get a single company by companyId.
companyId required | string External id of the company. |
{- "companyId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
Update one or more fields on a company. The companyId and merchantId cannot be updated.
companyId required | string External id of the company. |
name | string [ 1 .. 128 ] characters Name of the company. |
companyRegistrationNumber | string [ 1 .. 128 ] characters The company registration number (in Denmark CVR number). |
userShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
{- "name": "Test Company",
- "companyRegistrationNumber": 12346790,
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage"
}
A store is created by a store number. The store number should match the merchantId/cardAccceptorId on payment agreement with the transaction provider (eg. NETS). The store can be used to differentiate userShare and providerShare values by store number overriding userShare and providerShare from a Company with matching company registration number.
Add new store providing a storeNumber with seperate userShare and providerShare percentages.
storeId | string [ 1 .. 32 ] characters External id of the store. Automatically generated upon creation if not provided. |
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
storeNumber required | string The number of the store. |
name required | string The name of the store. |
userShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
source | string Default: "transaction" Enum: "transaction" "receipt" The source of data to match against the shop. |
{- "storeId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
{- "storeId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
Get a single store by storeId.
storeId required | string External id of the store. |
{- "storeId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
Update one or more fields on a store. Empty values will be omitted. The storeId and merchantId cannot be updated.
storeId required | string External id of the store. |
storeNumber | string The number of the store. |
name | string The name of the store. |
userShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
source | string Default: "transaction" Enum: "transaction" "receipt" The source of data to match against the shop. |
{- "storeNumber": "39898634",
- "name": "Test store",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "source": "transaction"
}
A product category is used when the merchant is configured to receive receipts. A category will hold a list of products and will be matched if the receipt contains product numbers that match some of the product categories.
Get products for a category.
categoryId required | string External id of the category. |
[- {
- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "categoryId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
]
Will add a list of products to the category.
categoryId required | string External id of the category. |
productId | string [ 1 .. 32 ] characters External id of the product. Automatically generated upon creation. |
categoryId | string [ 1 .. 32 ] characters External id of the category which the product belongs to. |
name | string <= 128 characters The name of the product. |
productNumber required | string <= 128 characters The product number of the product. |
[- {
- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "categoryId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
]
{- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "categoryId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
Add new category with seperate userShare and providerShare percentages for a group of products.
categoryId | string [ 1 .. 32 ] characters External id of the category. Automatically generated upon creation if not provided. |
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
name required | string The name of the category. |
userShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
storeNumber | string The number of the store if the category is store specific. |
{- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
{- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
Get a single category by categoryId.
categoryId required | string External id of the category. |
{- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
Update one or more fields on a category. Empty values will be omitted. The categoryId and merchantId cannot be updated.
categoryId required | string External id of the category. |
name | string The name of the category. |
userShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
storeNumber | string The number of the store if the category is store specific. |
{- "name": "Magazines",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "39898634"
}
List all campaign either currently active or in the future.
[- {
- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
]
Add new campaign for a merchant with seperate userShare and providerShare percentages in a specific period.
campaignId | string [ 1 .. 32 ] characters External id of the campaign. Automatically generated upon creation if not provided. |
merchantId required | string [ 1 .. 32 ] characters External id of the merchant. |
name | string <= 64 characters Name of the campaign. |
campaignStart required | string <date-time> The start date for the campaign ISO-8601 formatted. |
campaignEnd required | string <date-time> The end date for the campaign ISO-8601 formatted. |
userShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare required | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
storeNumber | string The store number for which the campaign should be activated for. |
categoryId | string The external id of the category for which the campaign should be activated for. |
productNumber | string The product number for which the campaign should be activated for. |
{- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
{- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
Get a single campaign by campaignId.
campaignId required | string External id of the campaign. |
{- "campaignId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "merchantId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
Update one or more fields on a campaign. Empty values will be omitted. The campaignId and merchantId cannot be updated.
campaignId required | string External id of the campaign. |
name | string <= 64 characters Name of the campaign. |
campaignStart | string <date-time> The start date for the campaign ISO-8601 formatted. |
campaignEnd | string <date-time> The end date for the campaign ISO-8601 formatted. |
userShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the user share. Maximum of 2 decimals. |
userShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The user share value type. |
providerShare | number <double> [ 0 .. 100 ] The percentage or amount of the transaction amount that will be the provider share. Maximum of 2 decimals. |
providerShareType | string Default: "percentage" Enum: "percentage" "fixed_amount" "derived" The provider share value type. |
storeNumber | string The store number for which the campaign should be activated for. |
categoryId | string The external id of the category for which the campaign should be activated for. |
productNumber | string The product number for which the campaign should be activated for. |
{- "name": "Soda",
- "campaignStart": "2018-11-08T17:32:28Z",
- "campaignEnd": "2018-11-10T17:32:28Z",
- "userShare": 7.5,
- "userShareType": "percentage",
- "providerShare": 2.5,
- "providerShareType": "percentage",
- "storeNumber": "100",
- "categoryId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "productNumber": "1000"
}
A product is created by a product number (eg. EAN). Which product numbers that can be used have to be agreed with and current store sending the receipt to Storebox.
Add new product to a specified category.
productId | string [ 1 .. 32 ] characters External id of the product. Automatically generated upon creation. |
categoryId required | string [ 1 .. 32 ] characters External id of the category which the product belongs to. |
name | string <= 128 characters The name of the product. |
productNumber required | string <= 128 characters The product number of the product. |
{- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "categoryId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
{- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "categoryId": "mdo9afaoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
A blocked product is created by product number (eg. EAN) and will ensure acroos merchants that these products will never be matched for settlment.
Add new blocked product which will never be used to calculate settlements.
productId | string [ 1 .. 32 ] characters External id of the product. Automatically generated upon creation. |
name | string <= 128 characters The name of the product. |
productNumber required | string <= 128 characters The product number of the product. |
{- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
{- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
Add a list of blocked products which will never be used to calculate settlements.
productId | string [ 1 .. 32 ] characters External id of the product. Automatically generated upon creation. |
name | string <= 128 characters The name of the product. |
productNumber required | string <= 128 characters The product number of the product. |
[- {
- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
]
[- {
- "productId": "dsff4aoaoy2u7tomdy9y1mzcpftvdpk",
- "name": "Milk",
- "productNumber": "1000"
}
]
An invoice is a sum of merchant settlements by contribution type - a user share sum and a provider share sum.
Get invoice data by settlementId. The settlementId can be provided by Storebox through a HTTP notification. See Notifications.
settlementId required | string Example: tk91q8wcd8690gymm004gn1frplt8io0 The settlement id |
[- {
- "invoiceNumber": 100,
- "type": "user",
- "invoiceDate": "2018-11-10",
- "paymentDate": "2018-11-14",
- "amount": 100,
- "vat": 25,
- "amountWithVat": 125
}
]
When certain events happen within the platform, a notification can be dispatched.
In order to setup notications, Storebox must receive an URL per notification type with static authentication headers. Storebox will not append information of the event type to the URL.
Storebox monitors the response code returned, but will not handle the response body.
Note: None of the endpoints, in the "Notifications" section, exists in the Loyalty Settlement API, but are endpoints the integrator must implement and expose. The suggested URL's, are only examples, and you, as an integrator, are free to define your own.
Notification that will be send when a new settlement batch has been created. The batchId will accessible as a query parameter and can be used to fetch settlements by endpoint /api/settlements/{batchId}
Note: You do not have to use "/new-settlement-batch-notification" in the path, when implementing the receiving endpoint.
Its possible to get all settlements from a batch delivered by JSON file to a SFTP server.
batchId required | any <string> Example: batchId=tk91q8wcd8690gymm004gn1frplt8io0 |
Notification that will be send when one or more merchants has been settled. The settlementId will accessible as a query parameter and can be used to fetch invoices by endpoint /api/invoices/{settlementId}
Note: You do not have to use "/new-settle-notification" in the path, when implementing the receiving endpoint.
Its possible to get the invoices delivered by CSV file to a SFTP server.
settlementId required | any <string> Example: settlementId=tk91q8wcd8690gymm004gn1frplt8io0 |
Get transactions by batchId.
batchId required | string Example: mdo9afaoaoy2u7tomdy9y1mzcpftvdpk External id of the transaction batch. |
offset | integer Default: 0 Return settlements in the given date interval starting at this index. |
limit | integer <= 1000 Default: 1000 The number of settlements to return. |
{- "offset": 0,
- "limit": 0,
- "totalSize": 0,
- "results": [
- {
- "transactionType": null,
- "processingCode": 0,
- "amount": 10000,
- "currencyCode": "DKK",
- "referenceId": 1234567890,
- "cardAcceptorId": 1234567,
- "cardAcceptorInfo": "Internet butik\\\\vej 14\\\\Bynavn\\\\ 2300 DNK",
- "userInfo": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "externalCardId": "x4w1amapkiejo1wyb91vq5g1vayr6cx3",
- "cardType": 1,
- "merchantCvr": 12346790,
- "transactionTime": 181001085022
}
]
}
Added Transaction API.
Added endpoint Settlement Source States for resource Merchant.
Added new field for resource Settlement: cardType
Added new fields userShareType and providerShareType for resources Company, Store, Category and Campaign. The fields can have values 'percentage', 'fixed_amount' or 'derived'. The default value will be 'percentage'. If 'fixed_amount' then the specificed amount will be equal to the settled amount.
New entity Derived Share added. Can be used to create a mapping table for shares. For example could providerShare be derived by entered userShare by lookup in derived shares. The shareType must be set to 'derived' to activate this behaviour.