Cloud Jasmin DevelopmentConcepts
DevelopmentConcepts
Concepts
Back | List of Articles

What are the Web API endpoints?

Last changed in 26/08/2022

The Web API provides endpoints to access all system entities and perform the following common operations:

OperationVerbExample
Get a list of all recordsGETGET /sales/orders
Get a page with a list of all recordsGETGET /sales/orders?page={page}&pageSize={size}
Get a record using its idGETGET /sales/orders/{id}
Get a record using its keyGETGET /sales/orders/{key}
Create a new recordPOSTPOST /sales/orders
Update the value of an attribute of a recordPUTPUT /sales/orders/{key}/{field}
Cancel a record using its idDELETEDELETE /sales/orders/{id}
Cancel a record using its keyDELETEDELETE /sales/orders/{key}

Note: There are no endpoints to update a record in a single operation.

These are the standard operations available for all entities. Other operations can be available for private entities, according to the corresponding business logic. The full list of all endpoints, operations, and entry parameters is available on the reference documentation.

Endpoint organization

For organization reasons, the entities and endpoints are grouped in modules. A module defines a category of entities that are related because they belong to the same product functional area. The module identifier is used on the endpoint URL before the entity identifier (sales on the previous examples).

These are a few examples of the existing modules and the corresponding entities:

ModuleDescriptionEntidades
FinancialsFinancial management of transactionsfinancialInstitutions, paymentMethods, pettyCashes
LogisticsLogistic management of transactionsdeliveryTerms, deliveryTypes, shippingMethods
PurchasesTransactions of purchases to suppliersinvoice, orders, supplierParties
SalesTransactions of sales to customersinvoices, orders, customerParties

Entities (Resources)

The entities are identified using a name that generally matched its name in English, in camel case.

For example, purchase and sales orders are both identified by the term order, but there is no conflict because they exist in different modules (purchases and sales).

Others examples of entity names can be the deliveryTerm, pettyCash, or financialInstitution.

The easiest way to determining the exact name for each entity on the Web API is by viewing the API reference documentation.

Entity list

It is possible to get the list of all entity records, such as all existing customers, using the main endpoint with the GET verb.

https://my.jasminsoftware.com/api/{account}/{subscription}/salesCore/customerParties

The result is returned on the message body in JSON:

[
{
    "version": [
        0,
        0,
        0,
        0,
        0,
        1,
        184,
        56
    ],
    "settlementDiscountPercent": 10,
    "locked": false,
    "oneTimeCustomer": false,
    "endCustomer": true,
    "partyKey": "0001",
    "partyKeySegments": null,
    "partyKeySequenceId": null,
    "searchTerm": null,
    "name": "Fornecedor",
    "companyTaxID": "123456789",
    "electronicMail": null,
    "telephone": null,
    "mobile": null,
    "websiteUrl": null,
    "notes": null,
    "picture": null,
    "pictureThumbnail": null,
    "streetName": "Rua",
    "buildingNumber": "100",
    "postalZone": "4700-100",
    "cityName": "Braga",
    "contactName": "Fornecedor",
    "contactTitle": null,
    "username": null,
    "externalId": null,
    "externalVersion": null,
    "isExternallyManaged": false,
    "customerGroup": "01",
    "customerGroupId": "59548ad9-8647-400b-9a6d-4ad9042179d0",
    "customerGroupDescription": "Clientes Finais",
    "priceList": "PVP1",
    "priceListId": "d74c0465-edfb-4855-a988-5e8ee40e555f",
    "priceListDescription": "Preço de venda ao público 1",
    "paymentMethod": "NUM",
    "paymentMethodId": "6fcdea7e-274c-40bd-aeee-848d73ccd4d3",
    "paymentMethodDescription": "Numerário",
    "paymentTerm": "00",
    "paymentTermId": "34a8eeac-9dfe-4ada-b46d-8776566dc5f4",
    "paymentTermDescription": "Pronto Pagamento",
    "salesperson": null,
    "salespersonId": null,
    "salespersonBaseEntityId": null,
    "salespersonDescription": null,
    "partyTaxSchema": "IVA-RN-MN2",
    "partyTaxSchemaId": "7bdc2748-fa41-e711-9401-0003ff41e200",
    "partyTaxSchemaDescription": "IVA - Regime Normal - Mercado Nacional",
    "partyWithholdingTaxSchema": null,
    "partyWithholdingTaxSchemaId": null,
    "partyWithholdingTaxSchemaDescription": null,
    "deliveryTerm": "EM-MAO",
    "deliveryTermId": "d50e4e63-e95f-406a-91f6-b7a0c1b45674",
    "deliveryTermDescription": "Entregue em mão",
    "accountingSchema": 1,
    "accountingParty": null,
    "accountingPartyId": null,
    "accountingPartyDescription": null,
    "currency": "EUR",
    "currencyId": "b28426d4-f1c0-4210-baa3-a080cf06ff4f",
    "currencyDescription": "Euro",
    "country": "PT",
    "countryId": "02c605d0-24ca-11df-85ae-005056c00001",
    "countryDescription": "Portugal",
    "address": "3",
    "addressId": "85c719da-56b9-4004-88b2-9b47b4e376cf",
    "contact": "2",
    "contactId": "85c719da-56b9-4004-88b2-9b47b4e376cf",
    "culture": "PT-PT",
    "cultureId": "fcd41e40-248e-11df-9deb-005056c00001",
    "cultureDescription": "Portuguese-Portugal",
    "baseEntityId": "85c719da-56b9-4004-88b2-9b47b4e376cf",
    "isDraft": false,
    "id": "fb70fb36-2240-4e09-8b74-6cfc8ba771a7",
    "isActive": true,
    "isDeleted": false,
    "isSystem": false,
    "createdBy": "[email protected]",
    "createdOn": "2017-05-18T09:29:53.1202287",
    "modifiedBy": "[email protected]",
    "modifiedOn": "2017-07-19T16:27:45.2775966",
    "subscriptionId": null,
    "draftId": "00000000-0000-0000-0000-000000000000"
},
(…)
]

This result is a list of reources CustomerPartyResource.

Create record

When you wish to create a new entity, for examples, a payment method, you must use the main endpoint for the entity and the POST verb.

https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms

The new entity data must be supplied on the message body.

{
    "paymentTermKey": "PT001",
    "description": "My payment term 001",
    "useInAccountsReceivable": true,
    "useInAccountsPayable": true
}

If the record is correctly creates, the status code 201 (Created) will be returned and the new record identifier will be returned on the message body.

Update record attribute

The existing records on the system can be updated attribute by attribute, using the corresponding endpoint.

Using the previous example, we can update the attribute “useInAccountsPayable” for the payment condition using the following URL:

https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms/{key}/useInAccountsPayable

Please note that this URL includes the record key (PT001) before the part that defined the attribute being updated.

The new attribute value must be passed on the message body in JSON.

See record

You can get a specific record for an entity by: using the record unique identifier (the creation operation result) or the record unique key (one of the record attributes).

The endpoint parameters are different, but they both use the GET verb.

https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms/{id}
https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms/{key}
{
    "version": [
        0,
        0,
        0,
        0,
        0,
        2,
        89,
        31
    ],
    "paymentTermKey": "PT001",
    "description": "My payment term 001",
    "validFrom": "2017-01-01T00:00:00",
    "validTo": "2099-12-31T00:00:00",
    "useInAccountsReceivable": true,
    "useInAccountsPayable": false,
    "daysFromReferenceDate": 1,
    "naturalKey": "PT001",
    "isDraft": false,
    "id": "7b0595fd-bdd6-4f96-8f5c-0dd3ba6c685f",
    "isActive": true,
    "isDeleted": false,
    "isSystem": false,
    "createdBy": "[email protected]",
    "createdOn": "2017-09-12T14:57:05.5452566",
    "modifiedBy": "[email protected]",
    "modifiedOn": "2017-09-12T15:05:09.1178198",
    "subscriptionId": null,
    "draftId": "00000000-0000-0000-0000-000000000000"
}

Cancel record

The records can be deleted (or canceled, depending on the entity) using the DELETE verb on the main endpoint. In this case, you can also use the record identifier or the natural key to identify the record being eliminated.

https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms/{id}
https://my.jasminsoftware.com/api/{account}/{subscription}/financialCore/paymentTerms/{key}

If the record is successfully eliminated, the status code returned is 204 (No Content).

Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Quais são os endpoints da Web API? Características da Web API Primavera Formato dos pedidos e respostas Mensagens de erro Entidades base e extensões