[GH-ISSUE #4] createDraftInvoice ile fatura oluşturamıyorum #3

Closed
opened 2026-03-02 04:04:21 +03:00 by kerem · 2 comments
Owner

Originally created by @mzuvin on GitHub (Mar 25, 2020).
Original GitHub issue: https://github.com/f/fatura/issues/4

express js ile kendime api oluşturdum. fatura oluşturmada hata alıyorum. Nerede hata yapıyorum?

app.post('/faturalar/create', asyncHandler(async (req, res, next) => {
	if ('token' in req.headers){
		const invoices = await createDraftInvoice(req.headers.token,req.body);
		res.json({'message':invoices});
	}
	else{
		res.json({message: "token required headers"})
	}
}));

image

{
   "date":"25/03/2020",
   "time":"09:07:48",
   "taxIDOrTRID":"11111111111",
   "taxOffice":"Beylikduzu",
   "title":"FATIH AKIN",
   "name":"Fatih",
   "surname":"Akın",
   "contry":"Türkiye",
   "district":"Hürriyet",
   "city":"İstanbul",
   "fullAddress":"X Sok. Y Cad. No: 3 Z Istanbul",
   "items":[
      {
         "name":"Stickker",
         "quantity":1,
         "unitPrice":100,
         "price":100,
         "VATRate":18,
         "VATAmount":18
      }
   ],
   "totalVAT":18,
   "grandTotal":100.0,
   "grandTotalInclVAT":118.0,
   "paymentTotal":118.0
}

{"message":{"date":"25/03/2020","uuid":"e6b4f8e0-6e8f-11ea-a70b-0d71135da38f","data":"Teknik bir hata oluştu.","metadata":{"optime":"20200325145812+0300"}}}

Originally created by @mzuvin on GitHub (Mar 25, 2020). Original GitHub issue: https://github.com/f/fatura/issues/4 express js ile kendime api oluşturdum. fatura oluşturmada hata alıyorum. Nerede hata yapıyorum? ```js app.post('/faturalar/create', asyncHandler(async (req, res, next) => { if ('token' in req.headers){ const invoices = await createDraftInvoice(req.headers.token,req.body); res.json({'message':invoices}); } else{ res.json({message: "token required headers"}) } })); ``` ![image](https://user-images.githubusercontent.com/19695833/77535155-2d7f4580-6eab-11ea-8c37-315b970d1dc4.png) ```json { "date":"25/03/2020", "time":"09:07:48", "taxIDOrTRID":"11111111111", "taxOffice":"Beylikduzu", "title":"FATIH AKIN", "name":"Fatih", "surname":"Akın", "contry":"Türkiye", "district":"Hürriyet", "city":"İstanbul", "fullAddress":"X Sok. Y Cad. No: 3 Z Istanbul", "items":[ { "name":"Stickker", "quantity":1, "unitPrice":100, "price":100, "VATRate":18, "VATAmount":18 } ], "totalVAT":18, "grandTotal":100.0, "grandTotalInclVAT":118.0, "paymentTotal":118.0 } ``` {"message":{"date":"25/03/2020","uuid":"e6b4f8e0-6e8f-11ea-a70b-0d71135da38f","data":"Teknik bir hata oluştu.","metadata":{"optime":"20200325145812+0300"}}}
kerem closed this issue 2026-03-02 04:04:21 +03:00
Author
Owner

@berkslv commented on GitHub (Feb 22, 2021):

@mzuvin Sorun çözüldümü? bende aynı hatayı alıyorum

<!-- gh-comment-id:783697641 --> @berkslv commented on GitHub (Feb 22, 2021): @mzuvin Sorun çözüldümü? bende aynı hatayı alıyorum
Author
Owner

@mzuvin commented on GitHub (Feb 22, 2021):

@berkslv sitedeki formlar değişiyor, dev console dan bakıp düzeltmiştim ben. yine değişmiştir form elemanlari.

<!-- gh-comment-id:783699607 --> @mzuvin commented on GitHub (Feb 22, 2021): @berkslv sitedeki formlar değişiyor, dev console dan bakıp düzeltmiştim ben. yine değişmiştir form elemanlari.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fatura-f#3
No description provided.