The Commerce API automatically retrieves data from the settlement companies, and uses this to book card transactions, fees and returns in the customer's financial system. For online shop payments, we use reference numbers obtained from the settlement company to close and open entries in the ledger.
The solution can be described as "set it and forget it". When the integration is set up and ready, everything will take place in the background, and you will not have to spend unnecessary time and resources on manual reconciliation routines.
The Commerce REST API is organized around retrieving settlement transactions from a large number of settlement providers, and booking them to any of our integrated accounting systems.
Our API uses resource-oriented endpoint paths, accepts Json-Encoded request bodies, returns Json-Encoded responses, and uses standard HTTP response codes and verbs.
A connection link consists of one ErpClientConnection
, and one SettlementConnection
, and directs the flow of transactions between the two connections.
You may create a connection link if you wish to automatically transfer transactions from a SettlementConnection
to a designated ErpClientConnection
.
Retrieves a connection link with a settlement connection id and an accounting connection id.
A connection link directs the flow of transactions between linked connections.
Returns a connection link response.
Bad request.
Unauthorized.
{- "id": 0,
- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "bookingType": "Payout",
- "batchSetting": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
Updates an existing connection link.
The settlement connection id and an accounting connection id.
Returns a connection link response.
Bad request.
Unauthorized.
{- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "bookingType": "Payout",
- "batchSettings": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
{- "id": 0,
- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "bookingType": "Payout",
- "batchSetting": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
Deletes an existing connection link.
Bad request.
Unauthorized.
Retrieves list of connection links.
Returns a paged result of connection links.
Bad request.
Unauthorized.
{- "values": [
- [
- {
- "id": 0,
- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "bookingType": "Payout",
- "batchSetting": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Creates a connection link between a settlement connection and an accounting connection.
A connection link directs the flow of transactions between linked connections.
The Id of the connectionlink, a settlement connection id and an erp connection id
Returns a connection link response
Bad request
Unauthorized
{- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "bookingType": "Payout",
- "batchSettings": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
{- "id": 0,
- "settlementConnectionId": 0,
- "erpClientConnectionId": 0,
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "bookingType": "Payout",
- "batchSetting": {
- "batchInterval": "Daily",
- "delayDays": 0,
- "weeklyAnchor": "Monday",
- "monthlyAnchor": 0
}, - "autoTransfer": true
}
An ERP client connection represents the connection between the Settlement API and one of your ERP clients. To set up a connection, the ERP client must be accessible with the ERP credentials you provided when creating the Agreement.
Retrieves list of ERP client connections.
Returns a paged result of ERP client connections responses.
Bad request.
Unauthorized.
{- "values": [
- [
- {
- "id": 0,
- "name": "string",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string",
- "hoursBeforeTransactionIsScheduled": 0,
- "accountingRules": [
- {
- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": null,
- "accountingRuleId": null,
- "field": null,
- "value": null
}
]
}
]
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Creates a ERP client connection and one or more accounting rules. ERP client connection and accounting rules are used when posting data to a ERP-system.
An object used when creating a ERP client connection and accounting rules.
Returns a ERP client connection.
Bad request.
Unauthorized.
{- "name": "string",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string",
- "hoursBeforeTransactionIsScheduled": 0,
- "accountingRules": [
- {
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "field": "string",
- "value": "string"
}
]
}
]
}
{- "id": 0,
- "name": "string",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string",
- "hoursBeforeTransactionIsScheduled": 0,
- "accountingRules": [
- {
- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
]
}
Returns a ERP client connection response.
Bad request.
Unauthorized.
{- "id": 0,
- "name": "string",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string",
- "hoursBeforeTransactionIsScheduled": 0,
- "accountingRules": [
- {
- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
]
}
Updates an existing ERP client connection.
Object used to update an ERP connection.
Returns the updated erp client connection response.
No Content
Bad request.
Unauthorized.
{- "name": "string",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string"
}
{- "id": 0,
- "name": "string",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "erpHubClientId": "f6d486cf-81ac-4389-b980-dacd4c5d5992",
- "integrationType": "POS",
- "postToLedger": true,
- "descriptionTemplate": "string",
- "department": "string",
- "project": "string",
- "subAccount": "string",
- "hoursBeforeTransactionIsScheduled": 0,
- "accountingRules": [
- {
- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
]
}
Deletes an existing ERP client connection and its accounting rules.
Bad request.
Unauthorized.
A settlement connection represents the connection between the Settlement API and an external settlement provider (e.g. Stripe
, Vipps
).
SettlementConnections
are the source of all incoming transactions.
Retrieves a settlement connection.
A settlement connection represents a connection to an external settlement provider.
Returns a settlement connection response.
Unauthorized.
Not found.
{- "id": 0,
- "type": "PayPal",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "lastSyncDate": "2019-08-24T14:15:22Z",
- "lastSyncDatePayout": "2019-08-24T14:15:22Z",
- "startDate": "2019-08-24T14:15:22Z",
- "extendedProperties": {
- "property1": "string",
- "property2": "string"
}
}
Updates a settlement settlement connection.
The connection type must match the type of the existing settlement connection.
A request with a connection type and connection details for the settlement provider.
No Content.
Bad Request.
Not Found.
{- "connectionType": "Adyen",
- "startDate": "2024-04-14T08:48:46.0697266+00:00",
- "connectionDetails": {
- "username": "Username",
- "apiKey": "ApiKey",
- "merchantType": "ECommerce",
- "hmacKey": "HmacKey"
}
}
Deletes a settlement settlement connection, and all related connection links.
No Content.
Bad Request.
Not Found.
Retrieves list of settlement connections.
Returns a paged result of settlement connection responses.
Bad request.
Unauthorized.
{- "values": [
- {
- "id": 0,
- "type": "PayPal",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "lastSyncDate": "2019-08-24T14:15:22Z",
- "lastSyncDatePayout": "2019-08-24T14:15:22Z",
- "startDate": "2019-08-24T14:15:22Z",
- "extendedProperties": {
- "property1": "string",
- "property2": "string"
}
}
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Creates a settlement settlement connection.
A settlement connection represents a connection to an external settlement provider.
The request with a connection type and connection details for the settlement provider.
Returns a settlement settlement connection.
Bad Request.
Unauthorized.
{- "connectionType": "Adyen",
- "startDate": "2024-04-14T08:48:46.1649992+00:00",
- "connectionDetails": {
- "username": "Username",
- "apiKey": "ApiKey",
- "merchantType": "ECommerce",
- "hmacKey": "HmacKey"
}
}
{- "id": 0,
- "type": "PayPal",
- "agreementId": "79458f91-82b5-4c38-a886-56df6a6b7980",
- "lastSyncDate": "2019-08-24T14:15:22Z",
- "lastSyncDatePayout": "2019-08-24T14:15:22Z",
- "startDate": "2019-08-24T14:15:22Z",
- "extendedProperties": {
- "property1": "string",
- "property2": "string"
}
}
A settlement transaction represents a transaction received from a settlement provider (SettlementConnection
).
Retrieves a list of transactions for all settlement connections belonging to a agreement.
Returns a paged result of transactions.
Bad request.
Unauthorized.
{- "values": [
- [
- {
- "id": 0,
- "amount": 0,
- "transactionType": "Payment",
- "currency": "string",
- "purchaseDate": "2019-08-24T14:15:22Z",
- "settlementDate": "2019-08-24T14:15:22Z",
- "externalTransactionId": "string",
- "description": "string",
- "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",
- "transactionsReference1": "string",
- "transactionsReference2": "string",
- "transactionGroupId": "string",
- "settlementConnectionId": 0,
- "transactionDate": "2019-08-24T14:15:22Z",
- "createdDate": "2019-08-24T14:15:22Z",
- "transactionStatus": "New",
- "brand": "string",
- "merchantNumber": "string"
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Retrieves a list of transactions for a settlement connection.
Returns a paged result of transactions.
Bad request.
Unauthorized.
{- "values": [
- [
- {
- "id": 0,
- "amount": 0,
- "transactionType": "Payment",
- "currency": "string",
- "purchaseDate": "2019-08-24T14:15:22Z",
- "settlementDate": "2019-08-24T14:15:22Z",
- "externalTransactionId": "string",
- "description": "string",
- "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",
- "transactionsReference1": "string",
- "transactionsReference2": "string",
- "transactionGroupId": "string",
- "settlementConnectionId": 0,
- "transactionDate": "2019-08-24T14:15:22Z",
- "createdDate": "2019-08-24T14:15:22Z",
- "transactionStatus": "New",
- "brand": "string",
- "merchantNumber": "string"
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Retrieves a transaction.
Returns a transaction.
Bad request.
Unauthorized.
{- "id": 0,
- "amount": 0,
- "transactionType": "Payment",
- "currency": "string",
- "purchaseDate": "2019-08-24T14:15:22Z",
- "settlementDate": "2019-08-24T14:15:22Z",
- "externalTransactionId": "string",
- "description": "string",
- "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",
- "transactionsReference1": "string",
- "transactionsReference2": "string",
- "transactionGroupId": "string",
- "settlementConnectionId": 0,
- "transactionDate": "2019-08-24T14:15:22Z",
- "createdDate": "2019-08-24T14:15:22Z",
- "transactionStatus": "New",
- "brand": "string",
- "merchantNumber": "string"
}
Transactions are normally exported to the ERP connection linked with the transactions settlement connection.
You can re-queue any transactions for ERP export with this endpoint.
The ids of the transactions to be sent to the ERP.
Ok.
Bad request.
Unauthorized.
{- "transactionIds": [
- 0
], - "includeConnected": true
}
The request containing payout export information.
Success
{- "payoutIds": [
- "string"
], - "erpClientConnectionId": 0
}
Accounting rules expand on the ErpClientConnection
.
Each ErpClientConnection has a default accounting rule which specifies the standard booking parameters (e.g.cash account, interim account...) for all incoming transactions.
You may also create additional AccountingRules
to adjust booking parameters based on the transaction ISO currency code.
Example
Incoming transactions should be posted to currency-specific accounts in the main ledger. "USD" transactions should go to account 1510, while "NOK" transactions should go to account 1511. This can be achieved by creating an accounting rule for each currency.
Returns an accounting rule response
Bad request
Unauthorized
{- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
Updates an existing accounting rule.
Object used to update an accounting rule.
Returns a accounting rule response.
Bad request.
Unauthorized.
{- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "field": "string",
- "value": "string"
}
]
}
{- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
Bad request
Unauthorized
Retrieves list of accounting rules under a erp connection.
Returns a paged result of accounting rules.
Bad request.
Unauthorized.
{- "values": [
- [
- {
- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Accounting rules are used to specify which accounts to use accounts, when posting transaction to a ERP system.
An object used to create a new accounting rule.
Returns a accounting rule response.
Bad request.
Unauthorized.
{- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "field": "string",
- "value": "string"
}
]
}
{- "id": 0,
- "erpClientConnectionId": 0,
- "currency": "string",
- "cashAccount": "string",
- "interimAccount": "string",
- "feeCreditAccount": "string",
- "feeDebitAccount": "string",
- "filters": [
- {
- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
]
}
Updates an existing filter.
A Settlement.Api.Requests.AccountingRule.FilterRequest filter.
Returns a Settlement.Api.Responses.AccountingRule.FilterResponse.
Bad request.
Unauthorized.
{- "field": "string",
- "value": "string"
}
{- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
Deletes an existing filter.
Bad request
Unauthorized
Creates new filters.
A System.Collections.Generic.IEnumerable`1 of Settlement.Api.Requests.AccountingRule.FilterRequest filters.
Returns a Settlement.Api.Responses.AccountingRule.FilterResponse.
Bad request.
Unauthorized.
[- {
- "field": "string",
- "value": "string"
}
]
{- "id": 0,
- "accountingRuleId": 0,
- "field": "string",
- "value": "string"
}
An agreement represents a many-to-one relationship between your company/companies, and your ERP system credentials(e.g.access tokens).
If your company manages multiple clients, you should create an agreement that connects them to ERP credentials that have access to the respective clients in your ERP system.
Example
An accountant has three clients in Visma.net that want to use Aritma Commerce. They have created an integration account in Visma.net(e.g.integration @accountant.com), and given it access to the three clients. To onboard the clients in the Settlement API, they should create an agreement for integration @accountant.com.Under that agreement, they may create one parent company representing themselves, or one company per client if they wish to keep transactions, settlement connections, and accounting rules seperate.
Retrieves all agreements for a resource group.
Returns a list of available Agreements.
Bad request
Unauthorized
{- "values": [
- [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string"
}
]
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Retrieves an agreement.
Returns a AgreementResponse
Bad request
Unauthorized
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string"
}
Updates an existing Agreement.
Returns an Agreement
No Content
Bad request
Unauthorized
{- "name": "string"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string"
}
Creates an ERP connection which defines the connection to an ERP system and user access to this connection.
The request with a ERP type and connection details for the ERP system
Returns an ERP connection response
Bad Request
Unauthorized
{- "erpSystem": "Agendec",
- "resourceGroupId": "b5fd1a67-2295-4868-a9c7-a0aaefde3254",
- "subscriptionId": "3d37113e-5c2e-49c9-b37a-755accbec8cc",
- "name": "connection name",
- "email": "email",
- "redirectUrl": "redirectUrl",
- "connectionDetails": {
- "password": "Password",
- "uri": "Uri",
- "username": "Username"
}
}
{- "erpConnection": {
- "id": "string",
- "name": "string",
- "erpSystem": "string",
- "email": "string"
}
}
Retrieves list of ERP connections
Returns a paged result of ERP connection responses
Bad request
Unauthorized
{- "values": [
- {
- "id": "string",
- "name": "string",
- "erpSystem": "string",
- "email": "string"
}
], - "metadata": {
- "property1": null,
- "property2": null
},
}
Retrieves list of erp clients. An ERP client is equivalent to a company in your ERP system.
You can list all ERP clients you have access to with the GET /erp-connections
endpoint.
Returns a paged result of client responses
Bad request
Unauthorized
{- "values": [
- {
- "id": "string",
- "name": "string",
- "status": "string",
- "type": "string",
- "editedDate": "string",
- "createdDate": "string",
- "organizationNumber": "string"
}
], - "metadata": {
- "property1": null,
- "property2": null
},
}