My Products
Help
lema
CONTRIBUTOR ***

Create customer invoice failed with error message Object reference not set to an instance of an obje

by lema

When I create customer invocie by API, there throw error message "VismaId: 64579d83-7030-4abc-a9bf-a9bd722c1e68. Object reference not set to an instance of an object.", I didn't know which field value incorrect, my request json as below:

{
  "PaymentMethodId": {
    "Value""01"
  },
  "CreditTermsId"null,
  "CurrencyId": {
    "Value""SEK"
  },
  "CustomerRefNumber": {
    "Value""10121"
  },
  "CashDiscountDate": {
    "Value""2023-07-17T00:00:00"
  },
  "DocumentDueDate": {
    "Value""2023-07-17T00:00:00"
  },
  "ExternalReference"null,
  "CustomerProject"null,
  "ExchangeRate": {
    "Value"0.0
  },
  "DomesticServicesDeductibleDocument": {
    "Value"false
  },
  "RotRutDetails": {
    "DistributedAutomaticaly": {
      "Value"true
    },
    "Type": {
      "Value""Rut"
    },
    "Appartment"null,
    "Estate"null,
    "OrganizationNbr"null,
    "Distribution"null
  },
  "PaymentReference"null,
  "Contact"null,
  "Project": {
    "Value""00148"
  },
  "TaxDetailLines": [],
  "InvoiceLines": [
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false
      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork"null,
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate""2021-10-07T00:00:00",
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation""Insert",
      "InventoryNumber": {
        "Value"null
      },
      "LineNumber"0,
      "Description": {
        "Value""200 - Brf lien, storskogsvägen 8 takavvattning"
      },
      "Quantity": {
        "Value"0.0
      },
      "UnitPriceInCurrency": {
        "Value"0.0
      },
      "ManualAmountInCurrency": {
        "Value"0.0
      },
      "AccountNumber": {
        "Value""1010"
      },
      "VatCodeId"null,
      "Uom": {
        
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
        {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""0"
        }
      ],
      
      "DeferralSchedule": {
        "value"0
      },
      "DeferralCode": {
        "Value""One"
      },
  
      "Note"null
    }
    
  ],
  "SendToAutoInvoice": {
    "Value"true
  },
  "CustomerVatZoneId": {
    "Value""01"
  },
  "BillingAddress": {
    "Value": {
      "AddressLine1": {
        "Value""X"
      },
      "AddressLine2": {
        "Value""X"
      },
      "AddressLine3"null,
      "PostalCode": {
        "Value""123456"
      },
      "City": {
        "Value"null
      },
      "CountryId"null,
      "County": {
        "Value""SE"
      },
      "overrideAddress": {
        "Value"true
      }
    }
  },
  "InvoiceContact": {
    "Value": {
      "Name": {
        "Value""Brf Lien 5"
      },
      "Attention"null,
      "Email": {
        "Value""1232@123.com"
      },
      "Web"null,
      "Phone1": {
        "Value"null
      },
      "Phone2"null,
      "Fax"null,
      "OverrideContact": {
        "Value"true
      }
    }
  },
  "StartDate": {
    "Value""2021-10-07T00:00:00"
  },
  "EndDate": {
    "Value""2022-05-11T00:00:00"
  },
  "AccountingCostRef"null,
  "OriginatorDocRef"null,
  "ContractDocRef"null,
  "OverrideNumberSeries": {
    "Value"true
  },
  "ReferenceNumber"null,
  "CustomerNumber": {
    "Value""10121"
  },
  "DocumentDate": {
    "Value""2023-07-17T00:00:00"
  },
  "OrigInvoiceDate":  "2023-07-17T00:00:00",
  "Hold": {
    "Value"false
  },
  "PostPeriod"null,
  "FinancialPeriod"null,
  "InvoiceText"null,
  "LocationId": {
    "Value""MAIN"
  },
  "SalesPersonID"null,
  "Salesperson"null,
  "Note"null,
  "BranchNumber"null,
  "CashAccount"null,
  "DontPrint": {
    "Value"false
  },
  "DontEmail": {
    "Value"false
  }
}
3 REPLIES 3
lema
CONTRIBUTOR ***

by lema

I fond the reason but I get another error, the error info is "VismaId: a1cb92b4-8025-4017-8dfc-eca9ac8abbab. Error creating document. PM error: The revenue account 3034 is not mapped to an account group." Icheck in Visma ERP UI, the account 3034 have account group as below:

lema_0-1692855410732.png

 

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

From what screenID is this screenshot?

When we have this information we can test it on our end.

Thank you. 

lema
CONTRIBUTOR ***

by lema

From screenId  GL202500, and now create customer invoice successfully