### HTTPCLIENT GET request example Source: https://docs.pesawise.com/docs/merchant-api/webhook-sample-payment-complete C# HTTPClient example for calling the webhook sample endpoint with Accept header */* and printing the response body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.pesawise.xyz/api/payments/webhook-sample-payment-complete"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HTTPClient Example Source: https://docs.pesawise.com/docs/merchant-api/complete-payment C# example using HttpClient to call the complete-payment endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/complete-payment"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"paymentId\": \"f9eb1b23-4f78-495c-968c-9dfdfc89a16d\",\n \"otp\": \"123131\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### csharp: HTTP request to get all budgets with validity check Source: https://docs.pesawise.com/docs/merchant-api/get-balances C# example using HttpClient to send a GET request to the wallets endpoint. The response is ensured to succeed and printed to the console. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.pesawise.xyz/api/payments/wallets"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get bank info using HttpClient in C# Source: https://docs.pesawise.com/docs/merchant-api/bank-info Implementation example using the C# HttpClient to perform the POST request to the bank info endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/get-bank-info"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Successful Create Order Response Example Source: https://docs.pesawise.com/docs/merchant-api/create-order Example JSON response returned when an order is successfully created. ```json { "requestId": "d4265597-5317-45fd-8d2f-8012870633d5", "detail": "API key not valid or Internal error", "status": "INTERNAL_ERROR", "success": true, "createdPaymentOrder": "Create Payment Order" } ``` -------------------------------- ### C# HttpClient request Source: https://docs.pesawise.com/docs/merchant-api/get-balance C# example using HttpClient to send a GET request to the wallet endpoint. It adds the Accept header, sends the request, ensures success, and prints the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.pesawise.xyz/api/payments/wallet"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# example using HttpClient Source: https://docs.pesawise.com/docs/merchant-api/get-fee C# code example using HttpClient to make the POST request to fetch a payment fee. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/get-fee"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"paymentType\": \"PESALINK\",\n \"amount\": 786.12,\n \"currency\": \"KES\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example response for successful fee fetch Source: https://docs.pesawise.com/docs/merchant-api/get-fee Example of a 200 response body showing the fee details for a payment. ```json { "paymentType": "PESALINK", "fee": 12.2, "currency": "KES" } ``` -------------------------------- ### Request Body Example Source: https://docs.pesawise.com/docs/merchant-api/complete-payment Example JSON body for the complete-payment request. ```json { "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "otp": "123131" } ``` -------------------------------- ### C# HttpClient Example Source: https://docs.pesawise.com/docs/merchant-api/lookup-account-number C# example using HttpClient to send a POST request to the lookup endpoint with the required body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/v1/account/lookup"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"requestId\": \"dcd1c2ab-7a26-4170-939d-9dc2e879b0e5\",\n \"timestamp\": \"1728897681\",\n \"accountNumber\": \"66925336\",\n \"shortcode\": 415010\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Request Body Example Source: https://docs.pesawise.com/docs/merchant-api/generate-qr-code Example JSON body for the request. Includes balanceId, currency, amount, reference, and dynamic fields. ```json { "balanceId": 100121, "currency": "KES", "amount": 100, "reference": "abcd", "dynamic": true } ``` -------------------------------- ### 200 Response Example Source: https://docs.pesawise.com/docs/merchant-api/complete-payment Example of a successful payment completion response. ```json { "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "reference": "test-ref", "success": true } ``` -------------------------------- ### Successful response example Source: https://docs.pesawise.com/docs/merchant-api/generate-token Example response body when the access token is generated successfully. Contains the access_token and expires_in fields. ```json { "access_token": "zoBcDCyxe4Isbvk6ZECr8MYfv79L", "expires_in": "3599" } ``` -------------------------------- ### RESTSHARP GET request Source: https://docs.pesawise.com/docs/merchant-api/webhook-sample-payment-complete This example was listed under the RESTSHARP tab in the documentation, but no code content was displayed on the page. ```csharp ``` -------------------------------- ### 200 Successful Response Example Source: https://docs.pesawise.com/docs/merchant-api/get-balances Example response for a successful request, showing account balances data. ```json { "status": "SUCCESS", "id": 100121, "balanceName": "Jamal's KES balance", "balanceAmount": 12332.11, "bankAccountNumber": "8000010000150", "branchCode": "118", "bankName": "Pesawise Bank", "bankCode": "0001", "active": true } ``` -------------------------------- ### Successful Response Example Source: https://docs.pesawise.com/docs/merchant-api/get-bulk-payment-status An example of a successful JSON response containing the payment status and details. ```json [ { "paymentStatus": "PENDING", "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "reference": " June Payroll", "uniqueReference": "PW-1001-1222", "amount": 100, "amountFee": 10, "amountTax": 10, "timestamp": "2024-07-02T09:26:29.062039Z", "transferType": "BANK", "currency": "KES", "description": "Payment failed", "globalAccountId": "1010911" } ] ``` -------------------------------- ### Request body example Source: https://docs.pesawise.com/docs/merchant-api/mpesa-payment Example JSON body for the M-PESA payment request, showing all required and optional fields. ```json { "amount": 786.12, "phoneNumber": "254712121212", "balanceId": 1001002, "balanceIdCharge": 1001004, "reference": "REF123", "recipient": "Khan Enterprises", "recipientIdNumber": "28277111", "tagId": 1, "recipientId": "EMP12345" } ``` -------------------------------- ### Success response example Source: https://docs.pesawise.com/docs/merchant-api/resend-otp Example of a successful response when the OTP is sent. Contains a message field. ```json { "message": "Otp was sent successfully" } ``` -------------------------------- ### C# HttpClient Implementation Source: https://docs.pesawise.com/docs/merchant-api/generate-qr-code-string Example implementation using C# HttpClient to send the POST request. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/generate-qr-code-string"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"balanceId\": 100121,\n \"currency\": \"KES\",\n \"amount\": 100,\n \"reference\": \"abcd\",\n \"dynamic\": true\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Success Response Example (200) Source: https://docs.pesawise.com/docs/merchant-api/generate-qr-code Example response body when the QR code is generated successfully. Contains requestId, detail, status, success, and qrUrl. ```json { "requestId": "d4265597-5317-45fd-8d2f-8012870633d5", "detail": "API key not valid or Internal error", "status": "INTERNAL_ERROR", "success": true, "qrUrl": "https://pesawise.blob.core.windows.net/assets/sample_qr.png" } ``` -------------------------------- ### Invalid API Keys Response Example Source: https://docs.pesawise.com/docs/merchant-api/get-bulk-payment-status An example of the error response returned when provided API keys are invalid. ```json { "detail": "API key Provided Not Valid " } ``` -------------------------------- ### C# HttpClient Implementation Source: https://docs.pesawise.com/docs/merchant-api/get-bulk-payment-status Example implementation using C# HttpClient to request the bulk payment status. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.pesawise.xyz/api/payments/bulk-payment-status"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### 200 Response Example Source: https://docs.pesawise.com/docs/merchant-api/lookup-account-number Successful response (200) with valid account information returned. ```json { "requestId": "dcd1c2ab-7a26-4170-939d-9dc2e879b0e5", "timestamp": "1728897681", "accountName": "Money Market Account", "accountNumber": "66925336", "shortcode": 415010 } ``` -------------------------------- ### Success response example Source: https://docs.pesawise.com/docs/merchant-api/mpesa-payment Example of a successful response when the M-PESA payment is initiated. Contains paymentId, success, detail, and reference fields. ```json { "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "success": true, "detail": "Payment processed successfully", "reference": "TESTREF1" } ``` -------------------------------- ### Successful Balance Creation Response Source: https://docs.pesawise.com/docs/merchant-api/create-balance Example JSON response returned when a balance is successfully created. ```json { "status": "SUCCESS", "detail": "API key not valid or Internal error", "balance": { "status": "SUCCESS", "id": 100121, "balanceName": "Jamal's KES balance", "balanceAmount": 12332.11, "bankAccountNumber": "8000010000150", "branchCode": "118", "bankName": "Pesawise Bank", "bankCode": "0001", "active": true } } ``` -------------------------------- ### Request Body Example Source: https://docs.pesawise.com/docs/merchant-api/get-qr-payment-status The required JSON body structure for the payment status request. ```json { "balanceId": 100121, "reference": "abcd" } ``` -------------------------------- ### Payment status not found response example (404) Source: https://docs.pesawise.com/docs/merchant-api/get-payment-status Example JSON response for a payment status request that returns a 404 status. Contains a detail field with an error message. ```json { "detail": "API key Provided Not Valid " } ``` -------------------------------- ### Request Body Example Source: https://docs.pesawise.com/docs/merchant-api/lookup-account-number Request body for the lookup endpoint. Requires requestId, timestamp, accountNumber, and shortcode. ```json { "requestId": "dcd1c2ab-7a26-4170-939d-9dc2e879b0e5", "timestamp": "1728897681", "accountNumber": "66925336", "shortcode": 415010 } ``` -------------------------------- ### STK Push Request using HttpClient Source: https://docs.pesawise.com/docs/merchant-api/stk-push Example implementation of the STK Push request using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/stk-push"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"balanceId\": 100121,\n \"amount\": 786,\n \"phoneNumber\": \"254712121212\",\n \"reference\": \"INVOICE 2\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create Order C# HttpClient Implementation Source: https://docs.pesawise.com/docs/merchant-api/create-order Example of how to initiate a POST request to the create-order endpoint using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/e-com/create-order"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"amount\": 123.11,\n \"customerName\": \"string\",\n \"currency\": \"KES\",\n \"externalId\": \"acme_123311222\",\n \"description\": \"Payment for Flight XYZ\",\n \"balanceId\": 1231311,\n \"callbackUrl\": \"https://www.mystore.com/success\",\n \"cancellationUrl\": \"https://www.mystore.com/cancel\",\n \"notificationId\": \"abcdef-order-12\",\n \"timeValidityMinutes\": 0,\n \"customerData\": {\n \"email\": \"acme@pesawise.com\",\n \"phoneNumber\": \"254724106569\",\n \"city\": \"Nairobi\",\n \"state\": \"Nairobi County\",\n \"address\": \"Park Place, 2nd Parklands Avenue\",\n \"countryCode\": \"KE\"\n }\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# Example using HttpClient Source: https://docs.pesawise.com/docs/merchant-api/generate-qr-code C# code using HttpClient to send a POST request to the generate QR code endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/generate-qr-code"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"balanceId\": 100121,\n \"currency\": \"KES\",\n \"amount\": 100,\n \"reference\": \"abcd\",\n \"dynamic\": true\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### 400 Error Response Example Source: https://docs.pesawise.com/docs/merchant-api/complete-payment Example of an error response when the request is invalid. ```json { "requestId": "d4265597-5317-45fd-8d2f-8012870633d5", "detail": "API key not valid or Internal error", "status": "INTERNAL_ERROR" } ``` -------------------------------- ### C# HTTPClient example Source: https://docs.pesawise.com/docs/merchant-api/mpesa-payment C# code using HttpClient to send a POST request to the M-PESA payment endpoint. Includes headers and JSON body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/mpesa-payment"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"amount\": 786.12,\n \"phoneNumber\": \"254712121212\",\n \"balanceId\": 1001002,\n \"balanceIdCharge\": 1001004,\n \"reference\": \"REF123\",\n \"recipient\": \"Khan Enterprises\",\n \"recipientIdNumber\": \"28277111\",\n \"tagId\": 1,\n \"recipientId\": \"EMP12345\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient example Source: https://docs.pesawise.com/docs/merchant-api/generate-token C# code using HttpClient to send a POST request to the generate endpoint. Adds an Accept header and prints the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/oauth2/v1/generate"); request.Headers.Add("Accept", "*/*"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create Balance C# Implementation Source: https://docs.pesawise.com/docs/merchant-api/create-balance Uses HttpClient to send a POST request to the create-balance endpoint with the required account details. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/create-balance"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"currency\": \"KES\",\n \"name\": \"Payroll Account\",\n \"accountType\": \"CLIENT_VIRTUAL_ACCOUNT\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### GET /api/payments/payment-status endpoint URL Source: https://docs.pesawise.com/docs/merchant-api/get-payment-status The endpoint URL for retrieving payment status. The request method is GET and the full URL is https://api.pesawise.xyz/api/payments/payment-status. ```http GET ## https://api.pesawise.xyz/api/payments/payment-status ``` -------------------------------- ### Get Wallet Transaction - Response Schema Source: https://docs.pesawise.com/docs/merchant-api/get-wallet-transaction Describes the response schema for the Get Wallet Transaction API, including the transaction object and pagination metadata. ```APIDOC ## Get Wallet Transaction - Response ### Description This response schema defines the structure returned by the Get Wallet Transaction API. It includes a request ID for traceability, a detail message, a status indicating the outcome, an array of transaction objects, and pagination metadata. ### Response #### Success Response (200) - **requestId** (string) - Request Id for traceability. Example: d4265597-5317-45fd-8d2f-8012870633d5 - **detail** (string) - Detail of the message. Example: API key not valid or Internal error - **status** (string) - Status. Possible values: API_KEYS_INVALID, INTERNAL_ERROR, API_NOT_ACTIVATED, BALANCE_NOT_FOUND, SUCCESS, FAILED. Example: INTERNAL_ERROR - **transactions** (object[]) - Array of transaction objects. Each transaction contains: - **approvedTwoAt** (string) - **approverThree** (string) - **approvedThreeAt** (string) - **batchId** (string) - **date** (string) - **dateString** (string) - **timeString** (string) - **id** (string) - **transactionId** (string) - **amount** (number) - **fees** (number) - **tax** (number) - **currency** (string) - **description** (string) - **reference** (string) - **debit** (boolean) - **settled** (boolean) - **imageUrl** (string) - **transactionAt** (string) - **updatedAt** (string) - **type** (string) - Possible values: BANK_TRANSFER, CARD, B2B, MOBILE_MONEY, FEE, TAX, REVENUE, REFUND, CHARGEBACK, REVERSAL, PAYMENT_LINK, INVOICE, BILL_PAYMENT, WITHDRAWAL, DEPOSIT, COST, INTERNAL, CARD_PAYMENT, BANK_FEE, MOBILE_MONEY_FEE, B2B_FEE, BILL_PAYMENT_FEE, BANK_COST, MOBILE_MONEY_COST, MOBILE_MONEY_REVENUE, BANK_TRANSFER_REVENUE, CARD_REVENUE, BILL_PAYMENT_REVENUE, B2B_REVENUE - **transactionStatus** (string) - Possible values: PENDING, COMPLETE, FAILED, ERROR, SUCCESSFUL, ERROR_PERM, INSUFFICIENT_FUNDS, ALREADY_PROCESSED - **metadata** (object) - property name* (string) - **initials** (string) - **merchantId** (integer) - **merchantName** (string) - **deviceId** (integer) - **transferId** (integer) - **accountId** (integer) - **otherAccountId** (integer) - **otherAccountRunningTotal** (integer) - **downloadableReceipt** (boolean) - **receipt** (string) - **runningTotal** (string) - **tagId** (integer) - **tagName** (string) - **tagCode** (string) - **attachmentUrl** (string) - **bankName** (string) - **bankAccountNumber** (string) - **departmentId** (integer) - **departmentName** (string) - **projectId** (integer) - **projectName** (string) - **projectCode** (string) - **customerName** (string) - **customerId** (integer) - **recipientId** (string) - **externalReference** (string) - **initiator** (string) - **initiatedAt** (string) - **approverOne** (string) - **approvedOneAt** (string) - **approverTwo** (string) - **metadata** (object) - Pagination metadata - **pageSize** (string) - **pageNumber** (string) - **totalElements** (string) - **totalPages** (string) #### Response Example { "requestId": "d4265597-5317-45fd-8d2f-8012870633d5", "detail": "API key not valid or Internal error", "status": "INTERNAL_ERROR", "transactions": [ { "approvedTwoAt": "2024-07-29T15:51:28.071Z", "approverThree": "string", "approvedThreeAt": "2024-07-29T15:51:28.071Z", "batchId": "string", "date": "2024-07-29", "dateString": "string", "timeString": "string", "id": "string", "transactionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "amount": 0, "fees": 0, "tax": 0, "currency": "string", "description": "string", "reference": "string", "debit": true, "settled": true, "imageUrl": "string", "transactionAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "type": "BANK_TRANSFER", "transactionStatus": "PENDING", "metadata": {}, "initials": "string", "merchantId": 0, "merchantName": "string", "deviceId": 0, "transferId": 0, "accountId": 0, "otherAccountId": 0, "otherAccountRunningTotal": 0, "downloadableReceipt": true, "receipt": "string", "runningTotal": "string", "tagId": 0, "tagName": "string", "tagCode": "string", "attachmentUrl": "string", "bankName": "string", "bankAccountNumber": "string", "departmentId": 0, "departmentName": "string", "projectId": 0, "projectName": "string", "projectCode": "string", "customerName": "string", "customerId": 0, "recipientId": "string", "externalReference": "string", "initiator": "string", "initiatedAt": "2024-07-29T15:51:28.071Z", "approverOne": "string", "approvedOneAt": "2024-07-29T15:51:28.071Z", "approverTwo": "string" } ], "metadata": { "pageSize": "string", "pageNumber": "string", "totalElements": "string", "totalPages": "string" } } ``` -------------------------------- ### GET /api/payments/bulk-payment-status Source: https://docs.pesawise.com/docs/merchant-api/get-bulk-payment-status Get the status of a bulk payment with the given batch ID. Requires batch-id as a query parameter and api-key and api-secret as header parameters. Returns an array of payment status objects. ```APIDOC ## GET /api/payments/bulk-payment-status ### Description Get the status of a Bulk payment with Batch ID. ### Method GET ### Endpoint https://api.pesawise.xyz/api/payments/bulk-payment-status ### Parameters #### Query Parameters - **batch-id** (uuid) - Required - The unique batch identifier of the payment #### Header Parameters - **api-key** (string) - Required - API key for authentication - **api-secret** (string) - Required - API secret for authentication - **page-size** (int32) - Optional - Size of the page to be returned. Default value: 10 - **page-number** (int32) - Optional - Page number to be returned. Default value: 1 ### Response #### Success Response (200) Returns an array of payment status objects. **Response Headers:** - **x-request-id** - Request Id for traceability - **x-event-type** - bulk-payment-status **Response Body Fields:** - **paymentStatus** (string) - Required - Status. Possible values: SUCCESS, FAILED, PENDING, NOT_FOUND, INVALID_API_KEYS, API_NOT_ENABLED - **paymentId** (string) - Required - Unique identifier for the payment - **reference** (string) - Required - Reference for the transfer - **uniqueReference** (string) - Required - Unique Reference for the transfer - **amount** (number) - Required - Amount of the transfer - **amountFee** (number) - Optional - Fee of the transfer - **amountTax** (number) - Optional - Tax of the transfer - **timestamp** (string) - Optional - Transfer Time - **transferType** (string) - Optional - Transfer Type. Possible values: BANK, B2B, MOBILE_MONEY, INTERNAL, INTERNAL_FX, BILL_PAYMENT, COUNTERPARTY_TRANSFER - **currency** (string) - Required - Currency of the transfer - **description** (string) - Required - Detail result of the transfer - **globalAccountId** (string) - Required - Wallet ID #### Response Example ``` [ { "paymentStatus": "PENDING", "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "reference": " June Payroll", "uniqueReference": "PW-1001-1222", "amount": 100, "amountFee": 10, "amountTax": 10, "timestamp": "2024-07-02T09:26:29.062039Z", "transferType": "BANK", "currency": "KES", "description": "Payment failed", "globalAccountId": "1010911" } ] ``` #### Error Response (400) Invalid api keys. **Response Body Fields:** - **detail** (string) - Detail of the message. **Response Example:** ``` { "detail": "API key Provided Not Valid " } ``` ``` -------------------------------- ### Payment status response example (200) Source: https://docs.pesawise.com/docs/merchant-api/get-payment-status Example JSON response for a successful payment status request. Shows the response schema with fields such as paymentStatus, paymentId, reference, uniqueReference, amount, amountFee, amountTax, timestamp, transferType, currency, description, and globalAccountId. ```json { "paymentStatus": "PENDING", "paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d", "reference": " June Payroll", "uniqueReference": "PW-1001-1222", "amount": 100, "amountFee": 10, "amountTax": 10, "timestamp": "2024-07-02T09:26:29.062039Z", "transferType": "BANK", "currency": "KES", "description": "Payment failed", "globalAccountId": "1010911" } ``` -------------------------------- ### C# HttpClient B2B Payment Implementation Source: https://docs.pesawise.com/docs/merchant-api/b-2-b-payment Example implementation using C# HttpClient to send a POST request to the B2B payment endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.pesawise.com/api/payments/b2b-payment"); request.Headers.Add("Accept", "*/*"); var content = new StringContent(string.Empty); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Request body example Source: https://docs.pesawise.com/docs/merchant-api/resend-otp The JSON body for the request, containing the paymentId field. ```json { "paymentId": "ca959474-f61d-424c-8204-bd6e8abc6f11" } ``` -------------------------------- ### C# HttpClient example Source: https://docs.pesawise.com/docs/merchant-api/resend-otp C# code using HttpClient to send a POST request to the resend-otp endpoint with the paymentId in the body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.pesawise.xyz/api/payments/resend-otp"); request.Headers.Add("Accept", "*/*"); var content = new StringContent("{\n \"paymentId\": \"ca959474-f61d-424c-8204-bd6e8abc6f11\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ```