Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Create Invoice: endpoint expecting invoice data in body #166

Closed
palunel opened this issue Dec 2, 2024 · 3 comments
Closed

Cannot Create Invoice: endpoint expecting invoice data in body #166

palunel opened this issue Dec 2, 2024 · 3 comments

Comments

@palunel
Copy link

palunel commented Dec 2, 2024

Using Python SDK v6.3.0

I make a call to the create_invoices method of the AccountingAPi:

response = self._accounting_api.create_invoices(self._tenant_id, [invoice], summarise_errors, unit_dp, idempotency_key)

where invoice is a valid Invoice object as per the SDK constructed using this method:

def invoice_request_model_dto(invoice: InvoiceIssueRequest) -> Invoice:

    line_items = [(LineItem(**item.model_dump())) for item in invoice.line_items]
    contact = Contact(
        name=invoice.company_name,
        addresses=[Address(**address_dto([invoice.company_address]))]
    )
    return Invoice(
        date=invoice.invoice_date,
        due_date=invoice.invoice_due_date,
        line_items=line_items,
        contact=contact
    )

I receive the following error:

"No data has been processed for this endpoint. This endpoint is expecting Invoice data to be specifed in the request body."
Copy link

github-actions bot commented Dec 2, 2024

PETOSS-679

Copy link

github-actions bot commented Dec 2, 2024

Thanks for raising an issue, a ticket has been created to track your request

@palunel
Copy link
Author

palunel commented Dec 9, 2024

I am closing this ticket; I managed to get it working. The documentation around this SDK is not great though. Took me two days to figure out that some of the values in the Invoices object were incorrect.

@palunel palunel closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant