Get Subscription Token

Use getSubscriptionToken to retrieve a customer’s Super Wallet tokens (both the subscription token and the customer token).

This is useful when you need to re-establish a customer session or verify tokens for returning users.

Common use: recover a customer’s saved payment tokens using their Email or Phone number.


Endpoint

POST https://secure.3gdirectpay.com/API/v6/

Headers

Content-Type: application/xml; charset=utf-8
Accept: application/xml

Request

Required Fields

FieldTypeReqDescription
RequeststringYesMust be getSubscriptionToken
CompanyTokenstringYesToken provided by DPO to authorize API operations
SearchCriteriaintegerYesDetermines how to identify the customer:1 = by Email 2 = by Phone number
SearchCriteriaValuestringYesEmail address or phone number (depending on chosen SearchCriteria)

Example Request (XML)

<?xml version="1.0" encoding="utf-8"?>
<API3G>
  <CompanyToken>68B90B5E-25F6-4146-8AB1-C7A3A0CAABB3</CompanyToken>
  <Request>getSubscriptionToken</Request>
  <SearchCriteria>1</SearchCriteria>
  <SearchCriteriaValue>[email protected]</SearchCriteriaValue>
</API3G>

Tip:
Use SearchCriteria=1 (email) for most integrations. Use 2 (phone number) only if the customer was registered primarily by mobile.


Response

Example Success Response (XML)

<?xml version="1.0" encoding="utf-8"?>
<API3G>
  <Result>000</Result>
  <ResultExplanation>Success</ResultExplanation>
  <SubscriptionToken>37CB51E6-EF18-4E27-A80E-8448B7B0342A</SubscriptionToken>
  <CustomerToken>C1E0F067-DFB9-4CA0-8CC2-FCC6018243B3</CustomerToken>
</API3G>

Field Reference

FieldTypeDescription
ResultintegerResponse code
ResultExplanationstringDescription of the response
SubscriptionTokenstringThe customer’s subscription token (payment token)
CustomerTokenstringThe customer’s unique Super Wallet token

Result Codes

CodeResultExplanationMeaning / Action
000SuccessTokens retrieved successfully
803Invalid or missing Request nameEnsure getSubscriptionToken
888System errorRetry or contact support
902Data mismatchVerify SearchCriteria and SearchCriteriaValue
950Missing mandatory fieldsCheck XML tags
991Encrypted string emptyInvalid or corrupted request
999Customer not foundEnsure customer exists or was created correctly

Typical Usage Flow

sequenceDiagram
  participant M as Merchant
  participant D as DPO API

  M->>D: getSubscriptionToken (CompanyToken, SearchCriteria, SearchCriteriaValue)
  D-->>M: Result 000 + SubscriptionToken + CustomerToken
  M->>M: Store or refresh local tokens for recurring charges
  Note over M,D: Use these tokens for future customerChargeToken or addCard calls

Notes & Best Practices

  • Use cases: Retrieve existing customer tokens to enable auto-payments or re-link wallets.
  • Search behavior:
    • When using SearchCriteria=1, provide the customer’s email address.
    • When using SearchCriteria=2, provide the customer’s phone number (including country code).
  • Security: Tokens uniquely identify wallet accounts; handle them with care.
  • Verification: Always validate Result=000 before using returned tokens.
  • Fallback: If 999 (Customer not found), consider prompting the user to register via createAccount.