💳Fatura API'si Oluştur
The Create Invoice API allows you to generate an invoice for a specific merchant. This API handles parameters like the merchant's information, reference ID, currency, and amount to create an invoice for a given transaction.
Geçerli bir geçiş yaptığınızdan emin olunmerchant_id, reference_id, Vemiktarbir talepte bulunurken. Üye işyeri veya referans bulunamazsa veya tutar geçersizse hata döndürülür.
📝 Giriş Parametreleri
| Parametre | Tip | Gerekli | Tanım |
|---|---|---|---|
| merchant_id | string | ✔️ | Üye işyerinın benzersiz tanımlayıcısı. Bu, fatura oluşturmak için gereklidir. |
| reference_id | string | ✔️ | The `reference_id` is a unique string used to track the user's order in the issuer's database. It can be the order ID from the issuer's database table. |
| currency_id | string | ✔️ | UUID of the enabled currency configured in the gateway. |
| miktar | string | ✔️ | The transaction amount. Must be a valid string representation of the amount (e.g., "10.50"). |
| Tanım | string | ❌ | Fatura için isteğe bağlı açıklama (ör. işlemin amacına yönelik). |
- 🔹 API bir gerektirirAPI Anahtarıkimlik doğrulama için.
- 🔹 merchant_idistek gövdesine iletilmelidir.
- 🔹 miktarbir sayının geçerli bir dize temsili olmalı ve 1'den büyük olmalıdır.
💡 Örnek İstek
POST https://core.dinakel.com/api/gateway/v1/invoices
Headers:
Authorization: Bearer <your_api_key>
Body:
{
"merchant_id": "<merchant_id>",
"reference_id": "<reference_id>",
"currency_id": "<currency_id>",
"amount": "<amount>",
"description": "<description>"
}
🔍 Örnek Yanıt
{
"status": true,
"statusCode": 201,
"invoice_id": "<invoice_id>",
"data": {
"invoice_id": "<invoice_id>"
}
}
⚠️ Hata İşleme
API aşağıdaki hata yanıtlarını sağlar:
{
"status": false,
"statusCode": 400,
"message": "Amount must be a valid decimal number."
}
400 Bad Request:Tutar parametresi geçersiz. Tutarın geçerli bir ondalık sayı olduğundan ve 1'den büyük olduğundan emin olun.
{
"status": false,
"statusCode": 404,
"message": "Merchant or reference not found"
}
404 Not Found:Sağlanan üye işyeri veya referans kimliği sistemde mevcut değil. Üye işyeri kimliğini ve referansını tekrar kontrol edin.
{
"status": false,
"statusCode": 500,
"message": "Internal server error"
}
500 Internal Server Error:Sunucuda beklenmeyen bir hata oluştu. Daha sonra tekrar deneyin veya destek ekibiyle iletişime geçin.