Managing a Subscription

This article describes some actions that can be used to manage an existing account updater subscription.

Getting Subscription Details

This request allows the retrieval of a previously configured subscription by issuing an HTTP GET request while supplying the appropriate PayConex account and subscriptionId as part of the end-point URL.

End-point: /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}

HTTP Method: GET

A successful response is indicated by an HTTP response code of 200. Below is an example response body containing the information of a previously configured subscription.

{
  "id": "css_d4c2c2cd09924d71abad464ac3004a17",
  "periodId": "PERIOD_1W",
  "periodDate": "2023-04-04",
  "responseFormat": "payconex",
  "enabled": true,
  "createdAt": "2023-04-04T15:40:28.459Z",
  "updatedAt": "2023-04-04T15:40:28.459Z",
  "templateRef": "string",
  "records": [
    {
      "id": "css_5cd5614dd4514735ae2d274597824c5e",
      "token": "string",
      "createdAt": "2023-04-04T15:40:28.459Z",
      "updatedAt": "2023-04-04T15:40:28.459Z",
      "type": "payconex",
      "enabled": true,
      "expiry": "1230"
    }
  ]
}

📘

A subscriptionId is returned as part of the API response after creating a subscription. For more information please see our guid onCreating Subscriptions.

Removing a Subscription

Using this end-point a request can also be sent that will remove a subscription that was previously configured. This is accomplished by issuing an HTTP DELETE request while supplying the appropriate PayConex account and subscriptionId as part of the end-point URL.

End-point: /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}

HTTP Method: DELETE

A successful deletion is indicated with an HTTP response code of 204.

Removing Records from a Subscription

The end-point below allows the removal of a specific record within a subscription.

This is accomplished by issuing an HTTP DELETE request while supplying the appropriate PayConex account, subscriptionId, and the recordId as part of the end-point URL.

End-point: /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}/records/{recordId}

HTTP Method: DELETE

A successful deletion is indicated with an HTTP response code of 204.

📘

A recordId is returned as part of the API response after creating a subscription. Form more information please see our guide onCreating Subscriptions.

Below is a refined and extended version of the documentation, including guidance on how to add additional tokens or cards to an existing subscription schedule.


Getting Subscription Details

Use the following endpoint to retrieve details of an existing subscription. This is accomplished by issuing an HTTP GET request and providing the PayConex account and subscriptionId.

Endpoint:

GET /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}

Success Response Code: 200 OK

Example Response:

{
  "id": "css_d4c2c2cd09924d71abad464ac3004a17",
  "periodId": "PERIOD_1W",
  "periodDate": "2023-04-04",
  "responseFormat": "payconex",
  "enabled": true,
  "createdAt": "2023-04-04T15:40:28.459Z",
  "updatedAt": "2023-04-04T15:40:28.459Z",
  "templateRef": "string",
  "records": [
    {
      "id": "css_5cd5614dd4514735ae2d274597824c5e",
      "token": "string",
      "createdAt": "2023-04-04T15:40:28.459Z",
      "updatedAt": "2023-04-04T15:40:28.459Z",
      "type": "payconex",
      "enabled": true,
      "expiry": "1230"
    }
  ]
}

Note:
A subscriptionId is returned when you create a new subscription. For more information, please see the guide on Creating Subscriptions.


Removing a Subscription

Use the following endpoint to remove an existing subscription. This is accomplished by issuing an HTTP DELETE request, providing the PayConex account and subscriptionId.

Endpoint:

DELETE /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}

Success Response Code: 204 No Content

A 204 response indicates that the subscription was successfully removed.


Removing Records From a Subscription

Use the following endpoint to remove a specific record (token or card) from a subscription. This is accomplished by issuing an HTTP DELETE request, providing the PayConex account, subscriptionId, and the recordId of the record you want to remove.

Endpoint:

DELETE /api/v4/accounts/{account}/account-updater/subscriptions/{subscriptionId}/records/{recordId}

Success Response Code: 204 No Content

Note:
A recordId is provided in the response after creating or retrieving a subscription. For more information, see the guide on Creating Subscriptions.


Adding Additional Records to an Existing Subscription

You can add more tokens or cards to an existing subscription without creating a new one. Depending on the type of data you initially subscribed (PayConex tokens, ShieldConex tokens, or raw PAN data), you can use the corresponding endpoint to add more items.

Common Behavior:

  • Send an HTTP POST request with the additional tokens or card data in the request body.
  • A successful addition will return a 201 Created or 200 OK (depending on the current state of the subscription and the server configuration).
  • The request body should be a JSON array of objects, each containing the necessary token or card information along with an enabled field.

Adding PayConex Tokens to an Existing Subscription

Endpoint:

POST /api/v4/accounts/{accountId}/account-updater/subscriptions/{subscriptionId}/payconex

Request Body Parameters:

ParameterTypeRequiredDescription
tokenStringYesThe PayConex token (transaction_id) to add to the schedule.
enabledBooleanNoIndicates if the token should be active (true by default).

Example Request Body:

[
  {
    "token": "000000254006",
    "enabled": true
  },
	{
    "token": "000000253966",
    "enabled": true
  },
	{
		"token": "000000253886",
		"enabled": true
	}
]

Adding ShieldConex Tokens to an Existing Subscription

Endpoint:

POST /api/v4/accounts/{accountId}/account-updater/subscriptions/{subscriptionId}/shieldconex

Request Body Parameters:

ParameterTypeRequiredDescription
tokenStringYesA ShieldConex token identifier.
bfidStringYesThe ShieldConex BFID for the token.
enabledBooleanNoIndicates if this token should be active.
expiryStringNoThe card's expiry date in MMYY format.

Example Request Body:

[
  {
    "token": "100001234567",
    "bfid": "djE6MTIwMjAxMTEzMTE1NTA1MTAzMTAzMDQyMXxhZDhkNDQzNDhjNWVhNzc5NmMxMjVmNjZkY2Q1MDIxNHw2czdyYXp5djIvMD18U1ZUMjAxOTA0MTgxMkRFVg==",
    "enabled": true,
    "expiry": "1230"
  }
]

Adding Raw PAN Data to an Existing Subscription

Endpoint:

POST /api/v4/accounts/{accountId}/account-updater/subscriptions/{subscriptionId}/pan

Request Body Parameters:

ParameterTypeRequiredDescription
panStringYesThe raw primary account number (card number).
expiryStringYesThe card's expiry date in MMYY format.
enabledBooleanNoIndicates if this card should be active.

Example Request Body:

[
  {
    "pan": "4444333322221111",
    "expiry": "1230",
    "enabled": true
  }
]