If your organization supports universal or network tokens, you can share storedMethodId values across paypoints configured to accept them.

Universal and network tokenization must be enabled by the Payabli team, and you can only share tokens that are created after the feature has been enabled in your organization. To learn more about these tokens, see Tokenization Types.

Using shared storedMethodId

Keep these considerations in mind when using shared tokens:

  • The customer you want to use a shared token for must exist in the paypoint, or you must create one with the transaction. The customers must each have the same Payabli customerNumber.
  • There’s no way to pre-associate a token with a second customer record. The token becomes associated with the new customer record when you make the transaction.
  • The storedMethodId must have been created after the feature was enabled. If the token existed before network or universal tokens were enabled in your account, the request returns a 5009 error that reads “Provided stored method and customer are not related”.

To use a shared token, run a transaction and pass the storedMethodId in the paymentMethod object.

Make transaction with a saved payment method
curl --request POST \
     --url 'https://api-sandbox.payabli.com/api/MoneyIn/getpaid?forceCustomerCreation=false' \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --header 'requestToken: API TOKEN'
{
    "entryPoint": "47ca0dfcs",
    "paymentMethod": {
        "method": "card",
        "storedMethodId": "c9700e93-b2ed-4b75-b1e4-ca4fb04fbe45-224"
     },
    "paymentDetails": {
        "totalAmount":20.00
     		 "serviceFee":  0
        },
		"customerData": {
        "customerNumber": 224,
        "billingEmail": "catherinev@example.com"
     }
}