Giter Site home page Giter Site logo

tripletex-api2's People

Contributors

ahmedal-faris avatar andreasrosdal avatar andreasva avatar andreeasondavisma avatar andreiavramvisma avatar bogdan-lemnaru-blaj avatar calin-precup avatar costinicolescu avatar daudmohamed avatar dunicm-zz avatar gregtaube avatar harnys avatar huygn123 avatar itvedte avatar jrtm avatar knuthr avatar kristiang-tripletex avatar kristofferkvello avatar magnusgund avatar neburx avatar petru-flueras avatar robertf-visma avatar simondein avatar supertosse avatar tanettrip avatar tlxhakon avatar tlxtellef avatar tlxvidar avatar tripmeis avatar txkong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tripletex-api2's Issues

isCustomer set to false after PUT /customer/{id}

There seems to be some hidden validation going on when updating customers via the API.

Steps to reproduce:

  1. In Tripletex web client, change existing customer to type "Kunde/leverandør" and click SAVE.
  2. PUT to /customer/{id} endpoint with or without any changes to customer attributes.
  3. Reload customer in web client and see that customer type has changed to "Leverandør".

Expected behaviour:

  1. Customer type should remain the same after calling PUT /customer/{id}, not change to "Leverandør".

[Docs] Missing indication on required field in project-endpoint

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...

OutOfMemoryError when generatoring WorkingHoursScheme

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.

Document constraints for api model fields to avoid errors when posting to the API

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.

Best way to sync projects?

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?

Missing support for attachments or metadata

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.

Order_lines / Invoice_lines

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..?

Search option field for `GET /order` api needed

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.

Insert orders with orderlines and customer id is not working

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.

GET inventory/inventories returns inventory with name and no ID

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
            },
        ]

Post /invoice api won't accept negative payment for credit note

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?

Currency needs id to be used

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"

Example code for TripletexApiClient causes exceptions

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.

Generating REST client in VS2019 fails

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!

Creating Invoice: the example does not work: suggestions for why?

Hi,

Context:

  • platform: Linux
  • language: Python3
  • issue: the "create_invoice(..)" function throws an 422 error

Question:

  • suggestions for why the code-stub (found in this repo) fails?
  • could it be due to changes (eg, in the required filelds, changes not reflected in the code)?
  • could there be issues related to access rights?
  • other explanations?

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,

@klatremus

Birds Eye: Creating a new session:

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:

  • was received by email from the TripleTex help-desk

Question:

  • how to resolve this issue?

Cheers,

@klatremus

Wrong HTTP response code in swagger.json

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)

Country needs id to be used

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"

PUT/order/{id}/:invoice

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

Issue while creating ledger voucher

"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

Unexpected error when posting invoice

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.

image

Idempotency key

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

Validation error for organizationNumber on POST customer (non Norwegian country)

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)

How to update an order

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
///


/// Update order.
///

/// Thrown when fails to make API call
/// Element ID
/// Partial object describing what should be updated (optional)
/// ResponseWrapperOrder

this is what i tried (see image) but how do I send in only the partial part, (isClosed)

image

HTTP vs HTTPS

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?

[Request] Python SDK?

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?

Swagger codegen runs out of memory

Attempting to generate C# code from Swagger spec runs out of memory.

Running with jdk1.8.0_291, max heap size 4gb.

A bit strange as the log suggests this is occurring on an markdown file.

image

Validation error on uploading customer`s organizationNumber with string longer/shorter than 9

PUT /customer

image

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

image

Also, POST /customer allows strings shorter/longer then 9, at least it allows them now

Feature request: support for direct bank transfers to customers

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! :)

Get number series for vouchertypes

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?

Unable to (re)send EHF invoice

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.

Fetching all invoices by order id

Is there any way of fetching all invoices (Faktura and kreditnota) by an order id without doing the following steps?

  1. Fetch all invoices by a date range (extend search if the credit note is in a different month)
  2. Filter invoices by looking at the order id

Questions:

  • Is it possible to extend OrderDto with a list of references to invoices?
  • Is it possible to enable invoice filtering by order ids?

Regarding webhooks
In test env there are only one event of event type invoice.charged. Will this event type emit on credit notes?

orderLines are not being inserted.

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

Make warehouseId optional when creating orderLines - choose default warehouse for that product when not set

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:

  1. Assign automatically the "main warehouse" to all new products.
  2. Make it possible to have "default" warehouse for each product.
  3. Make it possible to NOT set warehouseId when creating orders via API, and let Tripletex choose the default warehouse for that product/orderline

Test API registration form broken?

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! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.