Overview
The Save Payment Method API allows you to securely store a customer’s payment credentials and charge them later—on your schedule, for any amount. Unlike fixed recurring billing, this approach gives you full control over when and how much to charge.Key Concept: You’re creating a “billing session” where the customer authorizes you to save their payment method. Once saved, you can charge it anytime via API without the customer needing to re-enter their details.
Supported Payment Methods
| Payment Method | Supported Countries | Supported Currencies | Method Code |
|---|---|---|---|
| Cards (Visa, Mastercard, Amex) | Singapore, Malaysia | All | card |
| ShopeePay | Singapore, Malaysia | SGD, MYR | shopee_pay |
| GrabPay | Singapore, Malaysia | SGD, MYR | grabpay_direct |
When to Use This
This API is ideal when you need flexibility in your billing:Variable Billing Amounts
Charge different amounts each time based on usage, consumption, or services rendered.
On-Demand Charges
Bill customers when needed rather than on a fixed schedule (e.g., marketplace payouts, top-ups).
Subscription with Flexibility
Run subscriptions where the amount may change (upgrades, add-ons, prorated charges).
Delayed First Charge
Save the payment method now but only charge when the customer’s trial ends or service begins.
How It Works
The integration follows 3 steps:1
Create a Billing Session
Call the
/v1/recurring-billing API with save_payment_method=true. You’ll receive a checkout URL to redirect the customer.2
Customer Attaches Payment Method
Redirect the customer to the checkout URL where they select their preferred payment method (card, ShopeePay, GrabPay, etc.) and authorize it.
3
Charge the Saved Method
Once attached, use the charge API to bill the customer any amount, anytime. No customer interaction required.
Step 1 – Create a Billing Session
Create a billing session by calling the/v1/recurring-billing API with save_payment_method=true. This returns a checkout URL where your customer can attach their payment method.
Endpoint
Request Parameters
Required fields:
name, customer_email, amount, and save_payment_method=true| Parameter | Description | Example |
|---|---|---|
| name | Name for this billing session | Spotify Premium |
| customer_email | Customer’s email address | [email protected] |
| amount | Amount to display (minimum 1.00) | 9.90 |
| currency | Currency code | SGD |
| save_payment_method | Must be true to save the payment method | true |
| payment_methods[] | Payment methods to offer. Include multiple for customer choice | card, shopee_pay, grabpay_direct |
| redirect_url | URL to redirect customer after they attach their payment method | https://example.com/success |
| reference | Your internal reference ID to identify this customer/session | cust_123 |
| customer_name | Customer’s name (optional) | Paul |
| description | Description shown to customer (optional) | Spotify Membership |
| send_email | Send email receipt to customer. Default: false | true |
Example Request
Response
Important: Save the
id from the response. You’ll need this to charge the customer later.Step 2 – Redirect Customer to Checkout
Redirect your customer to theurl returned in Step 1. This is a one-time setup where the customer selects and authorizes their preferred payment method.

- They are redirected to your
redirect_url - Their payment method is now saved and ready to be charged
Step 3 – Charge the Saved Payment Method
After the customer has attached their payment method, you can charge them anytime by calling the charge API.Endpoint
{id} with the billing session ID from Step 1.
Request Parameters
Required fields:
amount and currencyInclude header Content-Type: application/x-www-form-urlencoded| Parameter | Description | Example |
|---|---|---|
| amount | Amount to charge | 9.90 |
| currency | Currency code | SGD |
Example Request
Response
Congrats! You’ve successfully integrated the Save Payment Method API.
FAQs
Is it possible to Authorization an amount before charging?
Is it possible to Authorization an amount before charging?
Do I need to specify an amount when saving a payment method?
Do I need to specify an amount when saving a payment method?
Yes, a minimum amount of 1 is required to initiate the save-payment-method session.
Can I modify the amount I will charge my customer later on?
Can I modify the amount I will charge my customer later on?
Yes, once your customer has attached a payment method to the
subscription, you can charge any amount using the charge the saved payment method
API.
Product Checklist
Product Checklist
Ensure the following before moving to production - Change the base URL
for all API calls to https://api.hit-pay.com/v1/ - Update API keys and
Salt values from the production dashboard