1. Home
  2. Subscriptions API calls

Subscriptions API calls

Query Subscription Status

This function allows merchant to query the current status of a subscription.

API Url

Environment Url Method Version
Production https://api.payxpert.com/subscription/{subscriptionID} GET >= 0200

Query Request

No fields are needed in the request. The subscription reference is in the URI.

Query Response

Field Type Max Length Requirement Description Version
errorCode D 3 M See Messages and error codes
errorMessage S 100 M See Messages and error codes
subscription O M Subscription object (see Common Data Structures)
transactionList L M List (array) of associated transactions (see Common Data Structures)

PHP Gateway Client

Transaction name : StatusSubscription

Methods

Method name Requirement
setSubscriptionID M

Example

<?php
$client = new GatewayClient();

$transaction = $client->newTransaction('StatusSubscription', 'testMerchant', 'testPassword');
$transaction->setSubscriptionID($subscriptionID);

$response = $transaction->send();

if ('000' === $response->errorCode) {
    $subscription    = $response->subscription;
    $transactionList = $response->transactionList;
} else {
    echo "Error {$response->errorCode} with message {$response->errorMessage}";
}
?>

Java Gateway Client

Methods

Connector method getSubscriptionStatus
Request class SubscriptionStatusRequest
Response class SubscriptionStatusResponse

Examples

PaymentGatewayConnector connector = new PaymentGatewayConnector(API_URL, ORIGINATOR, PASSWORD);

SubscriptionStatusResponse response = null;
SubscriptionStatusRequest request = new SubscriptionStatusRequest();
request.setSubscriptionId(1234567L);

try {
  response = connector.getSubscriptionStatus(request);
} catch (Exception e) {
  e.printStackTrace();
}

if (response != null) {
  if (TransactionResultCode.TRANSACTION_SUCCESSFULLY.equals(response.getErrorCode()) {
    System.out.println("Success: " + response.getErrorMessage());
  } else {
    System.out.println("Failure: " + response.getErrorMessage());
  }
}
Still any doubt?

Open a support ticket

Was this article helpful?