tripletex / tripletex-api2 Goto Github PK
View Code? Open in Web Editor NEWTripletex API 2 resources and examples
License: MIT License
Tripletex API 2 resources and examples
License: MIT License
There seems to be some hidden validation going on when updating customers via the API.
Steps to reproduce:
Expected behaviour:
When making a post-request to the /project-endpoint the docs says that only first- and lastname of the project manager is required. When executing the request you get a missing parameter error saying that the endpoint requires projectmanager.id.
Docs should be updated...
I'm trying to generate a Java client with the Swagger spec, but there is an issue when the the code generator tries to write the WorkingHoursScheme. If the computer trying to generate isn't powerful enough, the generator will throw an exception like this:
96740 [ERROR] Java heap space -> [Help 1]
1125java.lang.OutOfMemoryError: Java heap space
I've tried with various versions of the OpenApi generator and the Swagger generator, and I will be able to generate everything only with certain versions, like OpenApi generator Maven plugin 4.2.0, but 4.3.x doesn't work. Sometimes it can help to increase memory but I think the problem should be better solved my adjusting WorkingHoursScheme.
Example today:
POST /product
field: number
constaints:
string
maxLength: 100
... It should also contain what chars are valid and not ...
I have clients that have experienced issues when transferring products that have productnumber that is a string with max 100 chars, but have invalid characters. There was no understandable error message. We therefore needed to add a strict filter at our end to avoid products not being transferred. Since we dont know what the constraints really are.
Documenting invalid characters in the API doc will help partners a lot avoiding bad transfers.
Is there any good practice to sync tripletex projects to on-prem database?
We have a customer that needs a local db with tripletex projects and we want to keep the sync job to minimum data transfer.
The customer service has a "changedSince" property that works perfect. Is there anything similar to projects?
When I run GET inventory/inventories?inventoryId=123
I get the exact same response as when I run GET inventory/inventories
without that parameter.
I would expect to only get results for warehouse/inventory with id 123.
While APIs like Fiken allow for attachments and Stripe allow for general metadata arrays Trippeltex does not allow for anything like this attached to invoices which makes it a big hassle to work with. Instead of letting your accounting system be a source of truth it will require extra handling of data outside of the system.
Hi
When fetching invoices, should there not be a seperate invoice_line endpoint instead of reusing order_line?
Atleast when the order_lines for the invoice is not the same as on the order - it would make more sense for this to be called invoice_line..?
We want to create autocomplete functionality for orders on our side, but filtering orders is not possible atm.
It would be good at least to have like
option for filtering by order number.
Create Order:
{
"customer": {
"id": 1000000
},
"orderDate": "2020-10-27",
"receiverEmail": "[email protected]",
"deliveryDate": "2022-01-01",
"invoicesDueIn": 10000,
"deliveryAddress": {
"addressLine1": "Street 1",
"addressLine2": "Dublin",
"city": "Dublin",
"postalCode": "34234",
"country": {
"id": 99
}
}
}
Order Lines:
[
{
"product": {
"id": 11647,
"name": "Bambu Coffee Substitute",
"number": "AVG10013"
},
"currency": {
"id": 5
},
"amountExcludingVatCurrency": "7.4500",
"amountIncludingVatCurrency": "7.4500",
"order": {
"id": "RETURNED ORDER ID"
}
},
{
"product": {
"id": 11649,
"name": "Fresh Royal Jelly",
"number": "Q3680"
},
"currency": {
"id": 5
},
"amountExcludingVatCurrency": "30.3800",
"amountIncludingVatCurrency": "30.3800",
"order": {
"id": "RETURNED ORDER ID"
}
}
]
And it gives me an error. How one supposed to add orderlines? I cannot use orderlist endpoint.
When querying inventory/inventories
you get a response with the name of the inventory(warehouse), and no ID.
Example response today (part of it):
"stock": [
{
"inventory": "Hovedlager",
"openingStock": 0,
"changesInPeriod": 0,
"closingStock": 0
},
{
"inventory": "Kasserte-varer",
"openingStock": 0,
"changesInPeriod": 0,
"closingStock": 0
},
]
Should be something like:
"stock": [
{
"inventory": [{
"inventoryId": 123,
"name": "Hovedlager",
}],
"openingStock": 0,
"changesInPeriod": 0,
"closingStock": 0
},
{
"inventory": [{
"inventoryId": 234,
"name": "Kasserte varer",
}],
"openingStock": 0,
"changesInPeriod": 0,
"closingStock": 0
},
]
When we create a new sub project with the API the "hourlyrates/projectspecificrates" is not automatically set based on the main project.
This is automatically set based on the main project if you create a sub project inside Tripletex. Can you implement this logic for the API as well?
Hi.
I created an invoice through an API with negative quantity on each order items to make the invoice becomes credit note.
However, there will be a balance with negative amount. To make it zero balance, I have to send a negative payment.
But If I add negative amount to paidAmount with paymentTypeId 3218504 or 3218505, I got this error validation
"Både paidAmount og paymentTypeId må oppgis ved registrering av en forhåndsbetalt faktura."
Is there a way to make the Post /invoice can accept negative paidAmount?
PUT /invoice/{id}/:payment can accept negative paidAmount, can we make Post /invoice accept negative paidAmount also?
When inserting currency it's necessary to search Tripletex id. That generates too much complexity and is too slow
currency: { id: 12 }
Should be:
currency: "EUR"
The example code for automatically generating a session token should be updated (tripletex-api2/examples/java-gradle/token/src/main/java/no/tripletex/api/v2/TripletexApiClient.java)
ZonedDateTime error:
tokenValidUntil is stored as ZonedDateTime on line 39
session token is generated with date only at line 100
but the later validity checks still use the ZonedDateTime to check if the token is valid, which includes the time component of ZonedDateTime.
This will result in Unauthorized exceptions between midnight and the time of day in the tokenValidUntil field.
StackOverflowException:
buildCall ends up calling sessionApi.delete, which in turn calls buildCall, etc.
Hey friends,
I tried to create a new REST client using VS2019 (right click project -> add -> REST API Client), and unfortunately it fails with the following error message:
Exception: Property 'feeInvoiceText' in Model 'ProjectInvoiceDetails' is marked readOnly and is also required. This is not allowed.
I'm sure I'll manage to work my way around this, but thought you should know.
Cheers!
Hi,
Context:
Question:
Relevant code-stubs.
def create_invoice(self, payload):
"""!
@remarks
- API: https://tripletex.no/v2-docs/?#/invoice/InvoiceSend_send
- ?? related issue: https://github.com/Tripletex/tripletex-api2/issues/25
"""
# FIXME: possilbe to use teh followign tempalte: https://tripletex.no/execute/docViewer?articleId=721&language=0 ??
r = requests.post(f'{self.base_url}/invoice', data=json.dumps(payload), auth=self.auth, headers=self.headers)
#print("(Tripletex::)\t r=", r);
print("(Tripletex::create_invoice)\t r=", r);
return self.map(r)
def create_invoice(invoice_date, invoice_due_date, order_id):
payload = {
'invoiceDate': invoice_date,
'invoiceDueDate': invoice_due_date,
'orders': [{'id': order_id}]
}
return client.create_invoice(payload=payload)
if (__name__ == '__main__'):
create_emps()
print(">> creating product")
product = create_product('RPi13-v7').value
print(">> creating customer")
customer = create_customer('TPG13-v3').value
print(">> fetching product")
print(client.get_product_by_id(product.id, 'id,name,weight').value)
print(">> fetching customer")
print(client.get_customer_by_id(customer.id, 'id,name,isSupplier').value)
print(">> creating order")
order = create_order(customer.id, customer.name, product.id, '2021-11-17', '2021-11-18').value
print(">> creating invoice", order.id)
#order_id = 14;
order_id = order.id;
#! @FIXME: why does the "create_invoice(..)" throw a 422 error? <-- are the input-paramters wrong? do I miss access-rights? other?
invoice = create_invoice('2022-01-18', '2022-01-18', order_id).value
Looking forward hearing from you,
Cheers,
Disclaimer: I might have asked this question in the wrong fora, ie, hope you may forgive me
Problem: When using the tripltex Python API, the following error (on session-creation) is received:
ERROR: 422 {
"status" : 422,
"code" : 18000,
"message" : "Validering feilet.",
"link" : "https://www.tripletex.no/tripletex-api-2-0/",
"developerMessage" : null,
"validationMessages" : [ {
"field" : "arg:consumerToken",
"message" : "The consumer token is invalid or does not exist.",
"path" : "arg:consumerToken",
"rootId" : null
} ],
"requestId" : "e7563c66-b243-440a-a4a0-278fda002eba"
}
The Consumer Token:
Question:
Cheers,
The response code for POST /ledger/voucher
is stated to be 200, but actually returns 201 (in test environment, at least).
This leads to generated clients implementations throws on successful requests. (using BccCode.Tripletex.Client / NSwag.Net)
When inserting country with address it's necessary to search Tripletex id. That generates too much complexity and is too slow
country: { id: 12 }
Should be:
country: "EE"
It would be useful to know if a certain activity was marked as an "absence"
Hi,
When we make a post / order on an order that already exists in Tripletex, it will not be possible to create a new order with the same number. We were told by you to create a new invoice on existing orders, and that we could do it via PUT / order / {id} /: invoice.
We have now tested "PUT / order / {id} /: invoice" that you advised us, but the difference is that the new method doesn’t support us setting Invoice No. or Due Date. Do you have a solution to set them?
Best regards Gro
Håndverksdata
"validationMessages": [
{
"field": "postings",
"message": "Et bilag kan ikke registreres uten posteringer.",
"path": null,
"rootId": null
},
{
"field": "postings.row",
"message": "Posteringene på rad 0 (guiRow 0) er systemgenererte og kan ikke opprettes eller endres på utsiden av Tripletex.",
"path": null,
"rootId": null
}
]
The error I am getting while creating the posting, the data i am sending is as per example have in documentation. Please share if we have some small sample example for creating ledger voucher
Hi,
We are having an issue where the definition says the max length of the displayName
on the Address
is 100, but the API returns a response with a displayName
of 120 characters, which means the client built on the definition cannot decode the response and throws an exception
It is the postalAddress
and physicalAddress
on Supplier
object
Hello, I am experiencing an error when I send in an order that should be closed attached to an invoice.
I have attached an image from postman, if you need the whole json let me know where I should send it.
If the order is set to "isClosed" : false it works. but we need the order to be closed and not possible to invoice.
Hi!
Not sure if this is the correct forum for feature requests in the API or just the documentation, but here goes anyway!
It would be great if all request could take an optional idempotency key header, to ensure that resources are not created as duplicates when performing retries on network requests.
We often sync a lot of invoices and payments from our system in to Tripletex, and some times a network request will fail, but we don't know if only the response delivery back to us failed, or if the resource was not created at all. Trying to sync the same resource again could result in it being created twice in Tripletex, which is not good.
Stripe has this feature in their API, for reference: https://stripe.com/docs/api/idempotent_requests
The API endpoint to create multiple orderlines in one go1 is great!
Have you planned creating the same for creating multiple order groups?
POST /customer
{
"name": "SWEDEN customer",
"postalAddress": {
"country": {
"id":191
}
},
"physicalAddress": {
"country": {
"id":191
}
},
"organizationNumber": "212121-1212"
}
Response error:
{
"status": 422,
"code": 18000,
"message": "Validation failed.",
"link": "https://www.tripletex.no/tripletex-api-2-0/",
"developerMessage": null,
"validationMessages": [
{
"field": "organizationNumber",
"message": "The organization number must consist of 9 numbers and cannot have any spaces.",
"path": null,
"rootId": null
}
],
"requestId": "1111-1111-111-11111"
}
Creating the customer via the UI works as expected (when selecting Sweden as country)
I am trying to update an order using the OrderApi method. but I am not sure how to do this.
I only want to set the order to closed,
here is the description
///
this is what i tried (see image) but how do I send in only the partial part, (isClosed)
It seems you guys have a complicated relationship with HTTP and HTTPS protocols - for example, to create a webhook subscription, one needs to POST to http://tripletex.no/v2/event/subscription. If one wants to delete the subscription, one has to send a DELETE to https://tripletex.no/v2/event/subscription/. Neither of these requests work using the other protocol than the one used; the HTTP DELETE request, for example, just returns the subscription details without taking any further action. The swagger.json document uses HTTP for what seems like every single endpoint.
Wouldn't it be better just to ensure encryption for all requests? Considering the security implications with sending a basic auth header with an easily base64 decoded token?
Hi.
Great API, congrats.
I've found the Python examples, just wondering if you guys happen to have a Python SDK that you can open source, or if you know if an open source one exists?
PUT /customer
body:
{
"organizationNumber": "444444-4444"
}
response:
{
"status": 422,
"code": 18000,
"message": "Validation failed.",
"link": "https://www.tripletex.no/tripletex-api-2-0/",
"developerMessage": "VALIDATION_ERROR",
"validationMessages": [
{
"field": "organizationNumber",
"message": "The organization number must consist of 9 numbers and cannot have any spaces.",
"path": null,
"rootId": null
}
],
"requestId": "07c35378-a8e9-43f7-8852-c33c5e0aeabe"
}
Tripletex docs clearly says that limit for this field is 100 chars
Also, POST /customer allows strings shorter/longer then 9, at least it allows them now
Hi,
We have integrated our internal invoicing system to Tripletex and things have been running smoothly. We are currently investigating the possibility to automate paybacks to customers for the sales (provision) they generate on our platform. That is, we'd like to wire money (via the API), or alternatively via the UI, from our Tripletex integrated bank account (DNB) to our customers. Another accounting system we have an integration with (Procountor) supports this in their API (via POST /payments/directbanktransfers
, https://dev.procountor.com/api-reference/). The closest thing I was able to find as per the Tripletex API documentation was the concept of supplierInvoice
but that doesn't seem to fit our use case (since the paybacks will need to be initiated by us).
Does this happen to be something you have in the pipeline and/or is there currently some other way to create outgoing payments to customers added to Tripletex? Thank you! :)
Hi. I am trying to match vouchers in one system with vouchers in Tripletex (created with GBat10 files). To do this, I need to know the base number of the numberseries used to create the vouchernumber in Tripletex. In case the Tripletex installation use a different number series than the default 1000000 + (type * 10000).
Is there a way to get this numberseries value via the API?
Hi,
I'm using PUT /v2/invoice/123456789/:send?sendType=EHF
to send a reminder on a previously sent (created) invoice. The request seems to fail with the following error payload:
{
status: 500,
code: 1002,
message: 'ApplicationException',
link: 'https://www.tripletex.no/tripletex-api-2-0/',
developerMessage: null,
validationMessages: null,
requestId: '6a15197e-7af5-4cf0-a101-cef71a1b9c64'
}
Changing sendType
to e.g. EMAIL
fixes this but isn't of course ideal.
Is there any way of fetching all invoices (Faktura and kreditnota) by an order id without doing the following steps?
Questions:
Regarding webhooks
In test env there are only one event of event type invoice.charged
. Will this event type emit on credit notes?
Importing your json into https://editor.swagger.io/ gives a bunch of errors:
This means that the code generators do not work as well.
When assigning a default warehouse for a product, it should be visible in GET product
, example:
defaultWarehouseId = 123
This tests for the presence of a dash in the returned sessiontoken, but since sessiontokens don't have dashes, all valid requests for sessiontokens are reported as "failed"
When inserting orderLines with an order. Order is being inserted but the orderLines are not.
{
customer: { id: 11118000 },
orderDate: '2020-10-22',
receiverEmail: '[email protected]',
deliveryDate: '2022-01-01',
invoicesDueIn: 10000,
currency: { id: 12 },
deliveryAddress:
{
addressLine1: 'Street 1',
addressLine2: 'Village2',
city: 'Dublin',
postalCode: '34234',
country: { id: 99 }
},
orderLines:
[{
product:
{ name: 'Aloe Vera Skin Gel', number: 'APUE1083A' },
currency: { id: 12 },
amountExcludingVatCurrency: '6.7500',
amountIncludingVatCurrency: '6.7500'
}]
}
No errors are being shown and the response comes back without order lines also
When I create an invoice with POST /invoice
, I can embed an order-object that has an array of orderLine-objects embedded. The result is that an Invoice, an order and the orderlines are created with one API-call.
The same should be possible with POST /order
Our integration has a config "What warehouse should orderslines use". In most cases our clients only have one warehouse, so this works fine. But sometimes they forget to assign aome of their products to their "default" warehouse, causing issues when we try to create order(lines). Invalid warehouse ID for product.
A feature request is therefore:
Trying to register a new Tripletex account for testing the API (our previous one expired) via https://api.tripletex.io. When submitting the form, an error is returned: Ugyldig telefonnummer. Tried also with a valid Norwegian mobile telephone number but no cigar. Doubt that the phone number is the issue, could the error message be wrong? Would appreciate a quick resolution to the issue. Thanks! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.