Developer documentation
Fatoorah API with .NET
Use a named HttpClient, keep the bearer credential in managed configuration, send a stable idempotency key, and store the returned request identity for logs, webhooks, and support.
Implementation guide
What the integration should preserve.
- 01
Use IHttpClientFactory rather than creating a client for every request.
- 02
Keep credentials in server-side configuration protected by the deployment platform.
- 03
Apply retries only to explicitly safe transport failures.
- 04
Read the structured error response before deciding an operation can be repeated.
- 05
Verify webhook signatures before deserializing into domain events.
Relevant paths
POST /v1/fatoorah/invoicesPOST /v1/webhook-endpointsExample
using var request = new HttpRequestMessage(HttpMethod.Post, "/v1/fatoorah/invoices");
request.Headers.Authorization = new("Bearer", options.ApiKey);
request.Headers.Add("Idempotency-Key", invoice.OperationId);
request.Content = JsonContent.Create(new {
invoice_type = "simplified", currency = "SAR", total = 115
});
using var response = await client.SendAsync(request, cancellationToken);
response.EnsureSuccessStatusCode();Continue reading
