Get default invoice configuration (type and template)

GET/default-invoice-config

Returns invoice type and default template for the given domain, data source, document class, and optional co-owner and language.

Audit event:

  • invoice.default.config.get

Use this endpoint to obtain the typeId and (when applicable) templateId and lang to send when creating or updating invoices.

Example requests

  • Supplier invoices: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=SUPPLIER-INVOICE&docClassCodeName=SUPPLIER_INVOICE&coOwnerId=0
  • Customer prepaid, English template: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=POSTPAID&docClassCodeName=CUSTOMER_INVOICE&templateLang=en&coOwnerId=0
  • Customer postpaid, Serbian template: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=POSTPAID&docClassCodeName=CUSTOMER_INVOICE&templateLang=sr&coOwnerId=0
  • Customer postpaid part-payment, Serbian template: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=POSTPAID&docClassCodeName=CUSTOMER_INVOICE&dtsSelectorCodeName=PART-PAYMENT&templateLang=sr&coOwnerId=0
  • Netting invoice: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=FINANCE&docClassCodeName=NETTING_INVOICE&templateLang=sr&coOwnerId=0
  • Credit/debit note collection member type discovery: GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=FINANCE&docClassCodeName=CREDIT_DEBIT_NOTE&collectionCode=credit-note&templateLang=sr&coOwnerId=0 GET /default-invoice-config?domainCodeName=BULK&dataSourceCodeName=FINANCE&docClassCodeName=CREDIT_DEBIT_NOTE&collectionCode=debit-note&templateLang=sr&coOwnerId=0

Errors:

  • INVOICE_TYPE_NOTFOUND - Invoice type not found
  • NOT_AUTHORIZED - Not authorized
  • NOT_AUTHENTICATED - Not authenticated
  • INT_APP_ERROR - Internal server error
Base URL
https://api-cpaas.sms.es/finance/sit/v1
Authentication

OAuth2 — send Authorization: Bearer <access_token>. Token URL: https://accounts-cpaas.sms.es/oauth2/access-token

Request

Query parameters

domainCodeNamestringrequired

Invoice domain code name

Example: BULK
dataSourceCodeNamestringrequired

PREPAID and POSTPAID are for customer invoices, SUPPLIER-INVOICE is for supplier invoices, FINANCE for netting statements and credit and debit notes

Example: PREPAID
docClassCodeNamestringrequired

Document class code name (eg. CUSTOMER_INVOICE, CONTROL_INVOICE, SUPPLIER_INVOICE, NETTING_INVOICE, CREDIT_DEBIT_NOTE)

Example: CUSTOMER_INVOICE
templateLangstring

Requested template language code (e.g. en, de, sr,...)

Default: "en" · Example: en
collectionCodestring

Collection code parameter must be used to discover document types for invoices which will be used as collection members. if collectionCode value is none, returned invoice type can not be used for documents which can be added as invoice collection members.

Possible values: none, credit-note, debit-no, reminder · Default: "none" · Example: none
dtsSelectorCodeNamestring

Subprocess code name for selected data source. Currently only PART-PAYMENT for POSTPAID customer invoices is supported

Example: PART-PAYMENT
coOwnerIdinteger

When co-owners are enabled on platform level, replace coOwnerId parameter with owner id from biz partner. If co-owners are disabled, coOwnerId should be 0 or not sent at all.

Example: 1

Request example

cURL · cURL
curl -L -X GET "https://api-cpaas.sms.es/finance/sit/v1/default-invoice-config?domainCodeName=DOMAINCODENAME&dataSourceCodeName=DATASOURCECODENAME&docClassCodeName=DOCCLASSCODENAME" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

Invoice configuration (type and template)

application/json
commentstring
dataSourceCodeNamestring
dataSourceDefaultstring
dataSourceIdinteger
docClassCodeNamestring
docClassIdinteger
docFactoryParamsstring
domainCodeNamestring
domainIdinteger
dtsSelectorCodeNamestring
dtsSelectorIdinteger
instanceIdinteger
selfBillingstring
selfBillingOfTypeinteger
statusstring
statusDtstring (date-time)
templateFileNamestring
templateIdinteger

Template ID (use as templateId when creating/updating invoices; not applicable for SUPPLIER_INVOICE)

templateLangstring

Template language (use as lang when creating/updating invoices; may differ from request if requested language not found)

templateNamestring
typeIdinteger

Invoice type ID (use when creating/updating invoices)

typeNamestring

Invoice type name

Example response
{
  "comment": "",
  "dataSourceCodeName": "POSTPAID",
  "dataSourceDefault": "",
  "dataSourceId": 2,
  "docClassCodeName": "CUSTOMER_INVOICE",
  "docClassId": 1,
  "docFactoryParams": "",
  "domainCodeName": "BULK",
  "domainId": 1,
  "dtsSelectorCodeName": "",
  "dtsSelectorId": 0,
  "instanceId": 3000003,
  "selfBilling": "no",
  "selfBillingOfType": 0,
  "status": "active",
  "statusDt": "2024-01-01T00:00:00Z",
  "templateFileName": "template_en.pdf",
  "templateId": 10,
  "templateLang": "en",
  "templateName": "Customer Invoice EN",
  "typeId": 1,
  "typeName": "Bulk Invoice - Postpaid"
}