This rest API was created by 8coupons. For more information, check out their API Documentation or terms of service here. Meanwhile, you can check out the top APIs that currently available for developers. Browse APIs. Local Deals Galore! What we do:
8coupons API - How To
Laravel Cashier provides an expressive, fluent interface to Stripe s subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs. If you are using Braintree, please consult the Braintree integration documentation.
Instead, use the Stripe SDK directly. When upgrading to a new major version of Cashier, it s important that you carefully review the upgrade guide. Before using Cashier, we ll also need to prepare the database. We need to add several columns to your users table and create a new subscriptions table to hold all of our customer s subscriptions:.
Next, add the Billable trait to your model definition. This trait provides various methods to allow you to perform common billing tasks, such as creating subscriptions, applying coupons, and updating credit card information:. Finally, you should configure your Stripe key in your services. You can change the default currency by calling the Cashier:: The useCurrency method accepts two string parameters: Once you have retrieved the model instance, you may use the newSubscription method to create the model s subscription:.
The first argument passed to the newSubscription method should be the name of the subscription. If your application only offers a single subscription, you might call this main or primary. The second argument is the specific plan the user is subscribing to. This value should correspond to the plan s identifier in Stripe. If you would like to specify additional customer details, you may do so by passing them as the second argument to the create method:.
To learn more about the additional fields supported by Stripe, check out Stripe s documentation on customer creation. If you would like to apply a coupon when creating the subscription, you may use the withCoupon method:. Once a user is subscribed to your application, you may easily check their subscription status using a variety of convenient methods.
First, the subscribed method returns true if the user has an active subscription, even if the subscription is currently within its trial period:. The subscribed method also makes a great candidate for a route middleware , allowing you to filter access to routes and controllers based on the user s subscription status:. If you would like to determine if a user is still within their trial period, you may use the onTrial method.
This method can be useful for displaying a warning to the user that they are still on their trial period:. The subscribedToPlan method may be used to determine if the user is subscribed to a given plan based on a given Stripe plan ID. In this example, we will determine if the user s main subscription is actively subscribed to the monthly plan:. The recurring method may be used to determine if the user is currently subscribed and is no longer within their trail period:.
To determine if the user was once an active subscriber, but has cancelled their subscription, you may use the cancelled method:. You may also determine if a user has cancelled their subscription, but are still on their "grace period" until the subscription fully expires. For example, if a user cancels a subscription on March 5th that was originally scheduled to expire on March 10th, the user is on their "grace period" until March 10th.
Note that the subscribed method still returns true during this time:. To determine if the user has cancelled their subscription is no longer within their "grace period", you may use the ended method:. After a user is subscribed to your application, they may occasionally want to change to a new subscription plan. To swap a user to a new subscription, pass the plan s identifier to the swap method:. If the user is on trial, the trial period will be maintained. Also, if a "quantity" exists for the subscription, that quantity will also be maintained.
If you would like to swap plans and cancel any trial period the user is currently on, you may use the skipTrial method:. Sometimes subscriptions are affected by "quantity". To easily increment or decrement your subscription quantity, use the incrementQuantity and decrementQuantity methods:. The noProrate method may be used to update the subscription s quantity without pro-rating the charges:.
For more information on subscription quantities, consult the Stripe documentation. To specify the tax percentage a user pays on a subscription, implement the taxPercentage method on your billable model, and return a numeric value between 0 and , with no more than 2 decimal places. The taxPercentage method enables you to apply a tax rate on a model-by-model basis, which may be helpful for a user base that spans multiple countries and tax rates. If you use Cashier to make "one off" charges, you will need to manually specify the tax rate at that time.
When changing the hard-coded value returned by the taxPercentage method, the tax settings on any existing subscriptions for the user will remain the same. If you wish to update the tax value for existing subscriptions with the returned taxPercentage value, you should call the syncTaxPercentage method on the user s subscription instance:. By default, the billing cycle anchor is the date the subscription was created, or if a trial period is used, the date that the trial ends.
If you would like to modify the billing anchor date, you may use the anchorBillingCycleOn method:. For more information on managing subscription billing cycles, consult the Stripe billing cycle documentation. This column is used to know when the subscribed method should begin returning false. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the subscribed method will continue to return true until March 5th.
You may determine if a user has cancelled their subscription but are still on their "grace period" using the onGracePeriod method:. If you wish to cancel a subscription immediately, call the cancelNow method on the user s subscription:. If a user has cancelled their subscription and you wish to resume it, use the resume method. The user must still be on their grace period in order to resume a subscription:. If the user cancels a subscription and then resumes that subscription before the subscription has fully expired, they will not be billed immediately.
Instead, their subscription will be re-activated, and they will be billed on the original billing cycle. If you would like to offer trial periods to your customers while still collecting payment method information up front, you should use the trialDays method when creating your subscriptions:. This method will set the trial period ending date on the subscription record within the database, as well as instruct Stripe to not begin billing the customer until after this date.
The trialUntil method allows you to provide a DateTime instance to specify when the trial period should end:. You may determine if the user is within their trial period using either the onTrial method of the user instance, or the onTrial method of the subscription instance. The two examples below are identical:. This is typically done during user registration:.
Cashier refers to this type of trial as a "generic trial", since it is not attached to any existing subscription. You may also use the onGenericTrial method if you wish to know specifically that the user is within their "generic" trial period and has not created an actual subscription yet:. Once you are ready to create an actual subscription for the user, you may use the newSubscription method as usual:.
Occasionally, you may wish to create a Stripe customer without beginning a subscription. You may accomplish this using the createAsStripeCustomer method:. You may check if a customer has a credit card attached to their account using the hasCardOnFile method:. The updateCard method may be used to update a customer s credit card information. This method accepts a Stripe token and will assign the new credit card as the default billing source:.
To sync your card information with the customer s default card information in Stripe, you may use the updateCardFromStripe method:. To delete a card, you should first retrieve the customer s cards with the cards method. Then, you may call the delete method on the card instance you wish to delete:. The deleteCards method will delete all of the card information stored by your application:. Stripe can notify your application of a variety of events via webhooks. To handle webhooks, define a route that points to Cashier s webhook controller.
This controller will handle all incoming webhook requests and dispatch them to the proper controller method:. By default, this controller will automatically handle cancelling subscriptions that have too many failed charges as defined by your Stripe settings , customer updates, customer deletions, subscription updates, and credit card changes; however, as we ll soon discover, you can extend this controller to handle any webhook event you like.
Cashier automatically handles subscription cancellation on failed charges, but if you have additional webhook events you would like to handle, extend the Webhook controller. Your method names should correspond to Cashier s expected convention, specifically, methods should be prefixed with handle and the "camel case" name of the webhook you wish to handle. For example, if you wish to handle the invoice. What if a customer s credit card expires?
No worries - Cashier includes a Webhook controller that can easily cancel the customer s subscription for you. As noted above, all you need to do is point a route to the controller:. That s it! Failed payments will be captured and handled by the controller. The controller will cancel the customer s subscription when Stripe determines the subscription has failed normally after three failed payment attempts. To secure your webhooks, you may use Stripe s webhook signatures.
For convenience, Cashier automatically includes a middleware which validates that the incoming Stripe webhook request is valid. To enable webhook verification, ensure that the stripe. The webhook secret may be retrieved from your Stripe account dashboard. If you would like to make a "one off" charge against a subscribed customer s credit card, you may use the charge method on a billable model instance. The charge method accepts an array as its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation.
Consult the Stripe documentation regarding the options available to you when creating charges:. The charge method will throw an exception if the charge fails. If the charge is successful, the full Stripe response will be returned from the method:.
8coupons API Documentation
Although the structure of the JSON data sent and received using the API is very similar to webhooks , the difference is that with webhooks, FastSpring proactively sends you data about subscribed events in near-real time, as the events happen. You create and arrange hosting for a script that will parse these posts as they come in. Using webhooks does not preclude the use of the API, nor does using the API prevent you from subscribing to and receiving webhook events. Because it is a back-end service and does not have to interact with customers Web browsers, using the API may be more secure compared to client-side methods of communicating with FastSpring, such as the Store Builder Library. However, the Store Builder Library does offer enhanced security measures such as the secure payload , as well.
The most popular, in terms of mashups, is the Groupon API. We list 10 Groupon mashups.
Laravel Cashier provides an expressive, fluent interface to Stripe s subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs. If you are using Braintree, please consult the Braintree integration documentation. Instead, use the Stripe SDK directly. When upgrading to a new major version of Cashier, it s important that you carefully review the upgrade guide.
8coupons And CityPockets Team Up To Let Users Organize, Resell, And Create Their Own Daily Deals
You can use the Stripe API in test mode, which does not affect your live data or interact with the banking networks. The API key you use to authenticate the request determines whether the request is live mode or test mode. The Stripe API differs for every account as we release new versions and tailor functionality. Log in to see docs customized to your version of the API, with your test key and data. Subscribe to Stripe s API announce mailing list for updates. Use apps from our partners to get started with Stripe and to do more with your Stripe account—no code required. Alternatively, you can use restricted API keys for granular permissions.
List of 30+ Deals, Coupons, Promotions and Rewards APIs
Store owners can create coupons for use on their site. Coupons can be either an amount deducted from the order, a percentage off of an order, or free shipping. They can be restricted either by the order amount needing to meet a certain threshold, or they can be restricted to specific products. The owner can also limit the number of coupons available and the date range that they are valid for. For free shipping coupons, the coupon can be for a specific rate or method that the store owner has already configured. You cannot create free shipping coupons using the API. All fields are returned when you retrieve a single item. Returns all coupons for the given site.
At RapidAPI. CashNJoy is an offers, cashback, and rewards website that caters to the India audience. DayWatch is a real-time business reporting and decision support tool for Daily Deal companies. They provide industry reports and insights. Blip A Deal finds and aggregates over , offers every month.
Back in , a startup called 8coupons launched as a mobile coupon service that allowed users to sign up with their phone number, receive coupons and offers from local businesses via SMS. That was before Groupon had hit the streets, before the web daily deal model had really taken hold, and 8coupons was just a little ahead of its time on the mobile front. Over the last six months, 8coupons has been phasing out part of its mobile offers to focus more on providing its customers with the best online deals, as 8coupons Co-founder Landy Ung told us that, while merchants were initially excited by the mobile offering, the SMS option proved not to be scalable. The startup has instead recently launched an iPhone app, which users can use to see aggregated local deals and even take advantage of an augmented reality interface to see which businesses are offering deals as they stroll down the street. With its new focus on becoming an all-in-one platform for deals, 8coupons is now leveraging its relationships with Groupon, LivingSocial and companies like restaurant. Of course, as a web-based daily deal aggregator, 8coupons competes with startups like Yipit and The DealMap, which was recently scooped up by Google. The space, as we all know, is brimming with new daily deal players and aggregators, and as Jason wrote last year, in comparison to sites like Yipit, which offer a clean user interface, 8coupons had some design-related work to do.
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together. Have a question about this project?
Discount coupons allow customers to get discounts on their orders in the checkout process. Learn more about discount coupons in our Help Center. Search or filter discount coupons in an Ecwid store. Filters include: GET https: POST https: PUT https: Maximum number of returned items in one batch. Maximum allowed value: Default value: Comma separated list of discount types. Supported values: Comma separated list of coupon states.
Skip to main content. Add Your Api. Write for us Become member Login. Become member Login. How To. Sample Source Code.
Never Say Never Big Mommas: Los Angeles Mars Needs Moms. I am trying to access the 8coupons api since i want to learn angularjs. A AND B. A if u do something 10mark 7th 2 mark. Save money on hundreds of brands in store or online with Coupons. Find printable coupons for grocery and top brands. Needs to be done in a WORD doc and each of the 10 ways should be at least 2 paragraphs. Get traffic statistics, rank by category and country, engagement metrics and demographics for Friendseat at Alexa. I want to place top five in google for the term: If you do a nice white.