Welcome to our guide on using tokens for recurring payments with Moyasar! Tokens are a powerful tool that allows you to securely handle recurring payments without needing to store sensitive payment information on your servers.
To get started with recurring payments, you will first need to learn how to get the token.
To generate a tokenized card, you have 2 options:
To initiate a payment using the stored token, send a POST request to https://api.moyasar.com/v1/payments; here is an example using cURL
You can use a token to retrieve saved card information to provide your users with good UX. Here is an example of the information you can obtain from the token:
This will help your users identify which card is being used for the recurring payment.
Sometimes your users may want to remove old or expired cards from their accounts, Tokens will be invalidated when the card reaches its expiration date or by issuing a DELETE request, here is an example:
You will get an empty response with a 204 HTTP status code.