Skip to content

OpenAPI

How to generate API

You can use OpenAPI Generator to generate a client library

For example

Terminal window
openapi-generator-cli generate -i https://HELP_NAME/api/openapi -g java -o out

Then you can use the generated library.

Here is the example for fetching an order status.

// openapi-generator-cli generate -i https://HELP_NAME/api/openapi -g java -o out
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.StatusRequest;
import org.openapitools.client.model.StatusResponse;
public class GetStatusExample {
public static void main(String[] args) throws ApiException {
Integer requestorId = 10;
String basePath = "https://{SERVER_BASE_PATH}";
String bearerToken = "bt_q1***13";
long orderSystemId = 54321;
ApiClient apiClient = new ApiClient();
apiClient.setBasePath(basePath);
apiClient.setBearerToken(bearerToken);
PaymentsApi api = new PaymentsApi(apiClient);
StatusRequest statusRequest = new StatusRequest();
statusRequest.setOrderSystemId(orderSystemId);
StatusResponse statusResponse = api.paymentsStatusRequestorIdPost(requestorId, statusRequest);
System.out.println("statusResponse = " + statusResponse);
}
}