Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management

Set up a subscription with Nigerian cardsPrivate preview

Learn how to create and charge a subscription with Nigerian cards.

Copy page

Set up a subscription using Naira card as a payment method.

Create and confirm a Subscription using two API calls. The first API call sends customer and product information to the Subscriptions API to create a Subscription and PaymentIntent in one call. The response includes a PaymentIntent ID that you must use in a Payment Intents API call to confirm a payment.

Create a product and price
Dashboard

Products represent the item or service you’re selling. Prices define how much and how frequently you charge for a product. This includes how much the product costs, what currency you accept, and whether it’s a one-time or recurring charge. If you only have a few products and prices, create and manage them in the Dashboard.

This guide uses a stock photo service as an example and charges customers a 100,000 NGN monthly subscription. To model this:

  1. Navigate to the Add a product page.
  2. Enter a Name for the product.
  3. Enter 100,000 for the price.
  4. Select NGN as the currency.
  5. Click Save product.

After you create the product and the price, record the price ID so you can use it in subsequent steps. The pricing page displays the ID and it looks similar to this: price_G0FvDp6vZvdwRZ.

Note

You must convert your prices to NGN to use the payment method.

Create a SetupIntent
Server-side

Create a SetupIntent to save a customer’s payment method for future payments. The SetupIntent tracks the steps of this setup process.

Command Line
cURL
curl https://api.stripe.com/v1/setup_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d confirm=true \ --data-urlencode return_url="https://www.stripe.com" \ -d usage=off_session \ -d customer=cus_ODQluYFNl44ODI \ -d "payment_method_data[type]"=ng_card \ -d "payment_method_types[]"=ng_card \ -d "mandate_data[customer_acceptance][type]"=online \ -d "mandate_data[customer_acceptance][online][ip_address]"="127.0.0.0" \ -d "mandate_data[customer_acceptance][online][user_agent]"=device

The SetupIntent object contains a unique client_secret. Pass it to Stripe.js on the client side to redirect your customer to our local processor’s checkout page and authorize the mandate.

Create a subscription
Server-side

Create a subscription that has a price and a customer. Set the value of the default_payment_method parameter to the PaymentMethod ID from the SetupIntent response.

Command Line
cURL
curl https://api.stripe.com/v1/subscriptions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer={{CUSTOMER_ID}} \ -d "items[0][price]"={{PRICE_ID}} \ -d default_payment_method={{PAYMENT_METHOD_ID}} \ -d off_session=true

Creating subscriptions automatically charges customers based on the preset default payment method. After a successful payment, the status in the Stripe Dashboard changes to Active. The price that you previously set determines the amount for future billings. Learn how to create a subscription with a free trial period.

Confirm a payment
Server-side

Confirm a payment with PaymentIntents using the PaymentIntent ID from the Subscriptions response. Add the PaymentIntent ID to the URL path and set the value of the payment_method_types parameter to ng_card:

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents/:id/confirm \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ --data-urlencode return_url="https://www.stripe.com" \ -d "payment_method_data[]"=type \ -d "payment_method_data[]"=ng_card

The PaymentIntent response includes the status requires_action. This status indicates that the customer must complete the payment with the payment method they selected to complete the PaymentIntent. After a successful payment, the subscription becomes active and saves the payment method as the default payment method.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc