payment-api
Swirepay
- API version: 1.0.0
- Build date: 2020-12-16T16:28:53.447+05:30[Asia/Kolkata]
Swirepay REST APIs' are resource-oriented URLs that accept JSON-encoded request bodies, return JSON-encoded responses, and use standard HTTP response codes, authentication, and verbs. You can use the Swirepay API in test mode, which does not affect your live data or interact with the banking networks. The API key
you use to authenticate the request determines whether the request is live mode or test mode.
Automatically generated by the Swagger Codegen
Requirements
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
Installation
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Maven users
Add this dependency to your project's POM:
<dependency>
<groupId>com.swirepay</groupId>
<artifactId>payment-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Gradle users
Add this dependency to your project's build file:
compile "com.swirepay:payment-api:1.0.0"
Others
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/payment-api-1.0.0.jar
target/lib/*.jar
Getting Started
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.BalanceApi;
import java.io.File;
import java.util.*;
public class BalanceApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
BalanceApi apiInstance = new BalanceApi();
String xApiKey = "xApiKey_example"; // String |
try {
InlineResponse200 result = apiInstance.getBalance(xApiKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BalanceApi#getBalance");
e.printStackTrace();
}
}
}
Documentation for API Endpoints
All URIs are relative to https://api.swirepay.com/v1
Class | Method | HTTP request | Description |
---|---|---|---|
BalanceApi | getBalance | GET /balance | Get balance |
CategoryApi | getCategory | GET /category | Get category |
CountryApi | getCountry | GET /country | Get country |
CurrencyApi | getCurrency | GET /currency | Get currency |
CustomerApi | addCustomer | POST /customer | Add a customer |
CustomerApi | getCustomer | GET /customer | Get customers |
DisputeApi | getDispute | GET /dispute | Get dispute |
EventApi | getEvent | GET /event | Get event |
InvoiceApi | getInvoice | GET /invoice | Get invoice |
MembershipApi | getMembership | GET /membership | Get membership |
PaymentApi | getPayment | GET /payment | Get payment |
PaymentButtonApi | getPaymentButton | GET /payment-button | Get payment button |
PaymentLinkApi | getPaymentLink | GET /payment-link | Get payment link |
PaymentMethodApi | addPaymentMethod | POST /payment-method | Add a payment method |
PaymentMethodApi | getPaymentMethod | GET /payment-method | Get payment methods |
PaymentSessionApi | getPaymentSession | GET /payment-session | Get payment sessions |
PayoutApi | getPayout | GET /payout | Get payout |
PlanApi | getPlan | GET /plan | Get plan |
ProductApi | getProduct | GET /product | Get product |
PublicKeyApi | getPublicKey | GET /public-key | Get public key |
RefundApi | getRefund | GET /refund | Get refund |
ReminderApi | getReminder | GET /reminder | Get reminder |
ReportApi | getReport | GET /report | Get report |
SetupSessionApi | getSetupSession | GET /setup-session | Get setup session |
SetupSubscriptionApi | getSubscription | GET /subscription | Get subscription |
TerminalApi | getTerminal | GET /terminal | Get terminal |
TransactionApi | getTransaction | GET /transaction | Get transaction |
Documentation for Models
- BalanceResponse
- CardRequest
- CustomerRequest
- CustomerResponse
- DefaultResponse
- InlineResponse200
- InlineResponse2001
- InlineResponse2001Entity
- InlineResponse2002
- InlineResponse2002Entity
- InlineResponse2003
- InlineResponse2004
- InlineResponse2004Entity
- InlineResponse2005
- InlineResponse2006
- InlineResponse2006Entity
- InlineResponse200Entity
- PaymentMethodRequest
- PaymentMethodRequestCard
- PaymentMethodResponse
- PaymentSessionResponse
- UserResponse
Documentation for Authorization
Authentication schemes defined for the API:
api_key
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
Recommendation
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.