My Products
Help
Quan Pham
PARTNER

POST CustomerInvoice. Error: 'RevisionID' cannot be empty.

by Quan Pham

Hi,

 

I'm getting this error when trying to create a CustomerInvoice with the bearer token that is generated via tenantid, clientid and clientsecret.

 

If i try to post the exact same json with the old bearer token and the company-id in the header it works.

 

Please see below for the json body:

{
  "customerNumber": {
    "Value""30122"
  },
  "customerRefNumber": {
    "Value""AO23310.1"
  },
  "hold": {
    "Value"false
  },
  "billingAddress": {
    "Value": {
      "overrideAddress": {
        "Value"true
      },
      "addressLine1": {
        "Value""Gatan 3"
      },
      "addressLine2": {
        "Value"""
      },
      "addressLine3": {
        "Value"""
      },
      "postalCode": {
        "Value""56113"
      },
      "city": {
        "Value""HUSKVARNA"
      },
      "countryId": {
        "Value""SE"
      },
      "county": {
        "Value"""
      }
    }
  },
  "invoiceContact": {
    "Value": {
      "overrideContact": {
        "Value"true
      },
      "attention": {
        "Value""xxxx.xxxxx@zzzzz.se"
      },
      "email": {
        "Value""faktura@zzzzz.se"
      },
      "name": {
        "Value""zzzzz"
      }
    }
  },
  "domesticServicesDeductibleDocument": {
    "Value"false
  },
  "invoiceLines": [
    {
      "description": {
        "Value""REST API"
      },
      "discountPercent": {
        "Value"30.00
      },
      "domesticServicesDeductible": {
        "Value"false
      },
      "lineNumber": {
        "Value"0
      },
      "manualDiscount": {
        "Value"false
      },
      "quantity": {
        "Value"1.0
      },
      "unitPriceInCurrency": {
        "Value"6250.0
      },
      "operation""Insert"
    }
  ]
}

 

 

8 REPLIES 8

by Magnus Johnsen

Hi,

We're not able to reproduce this on our end. Please try to recreate the invoice in the UI.

It should show you what causes the error, most likely there is an issue with the setup of the customer.

Hi, 

 

The only thing we change is the authentication, old vs new. The invoice is no problem to create in the UI

 

/Anders

KonsultVn
CHAMPION ***

Hi,

Anders, are you still experiencing Branch '1'-Error? We get the same error on both customer invoice and supplier invoice, but if we wait a few hours after the first failed request, then it seems to work. 

Hi

Actually it seams to have been solved now. Its working.

 

/Anders

by Magnus Johnsen

Hi,

We'll have a look at it and get back to you.

Thank you. 

Hi,

Here is another example this when adding an invoice.

 

Below Json works just fine when using token generated the old way but fails with error when using token from Visma Connect. This has quite high impact of for us since we cannot change to Visma Connect and we have rather many integrations to change.

 

Error: Inserting 'Sales invoice/note' record raised at least one error. Please review the errors.
Error: Branch '1 ' cannot be found in the system.

 

 

{
  "referenceNumber": {
    "Value": "AFO01195"
  },
  "customerNumber": {
    "Value": "200019"
  },
  "documentDate": {
    "Value": "2023-09-22T00:00:00.000Z"
  },
  "documentDueDate": {
    "Value": "2023-10-22T00:00:00.000Z"
  },
  "invoiceText": {
    "Value": "DHL Mottagarfrakt"
  },
  "cashAccount": {
    "Value": "1940"
  },
  "invoiceLines": [
    {
      "description": {
        "Value": "INVOICE AFO01195 TEST AB "
      },
      "unitPriceInCurrency": {
        "Value": 67710.0
      },
      "accountNumber": {
        "Value": "3011"
      },
      "quantity": {
        "Value": 1.0
      },
      "vatCodeId": {
        "Value": "17"
      },
      "operation": "Insert",
      "lineNumber": {
        "Value": 0
      }
    }
  ]
}

 

  

Hi,

We're not able to reproduce this with the service token, what branch setup does this company have?

Hi, no branches active in this company. Could it be something inte company setup? I noticed that when we create a new customer with the service token it has empty values on the Created By field. Do you want to try in the company let me know.