API

A simple, easy to use URL schema to integrate your business with Payment for Stripe.

Easily redirect from any iOS app or website, directly into the Payment app to get paid.

Populate a new charge

Pass data to Payment to create charges: payment://new?

Add an amount, in cents: payment://new?amount=2000

Choose a supported currency: payment://new?currency=usd

Add a URL encoded description for the charge: payment://new?description=Cat+Sweater

Create an invoice with line items

Alternatively, create a line-item Stripe invoice: payment://cart?

Pass a price id and quantity pair: payment://cart?line_items=price_xxx:3

Or pass along multiple price ids and quantities: payment://cart?line_items=price_abc:3,price_xyz:2

Additionally, you can apply a coupon: payment://cart?coupon=kZjFzekm

Provide customer information (optional)

Add an URL encoded name for the customer: payment://new?name=John+Doe

Provide an email address for a receipt: payment://new?email=john@doe.com

Provide a callback URL

Upon a successful transaction, the Payment app will return to your app. payment://new?callback=https://foo.bar.com/hook

Your callback URL will receive these query parameters on success: https://foo.bar.com/hook?success=true&
  amount=2000&currency=usd&
  chargeId=pi_xxxxxx

In the event of an error: https://foo.bar.com/hook?error[message]=Card+declined

If the user cancels the transaction: https://foo.bar.com/hook?cancelled=true

Use an existing customer

Use an existing Stripe customer by passing their ID: payment://new?customer_id=cus_xxxxxx

This pre-selects the customer for the transaction, so their saved payment methods will be available.

Include custom metadata

Pass custom metadata to include on the Stripe charge: payment://new?metadata[order_id]=12345

Add multiple metadata fields as needed: payment://new?metadata[order_id]=12345&
  metadata[source]=pos

Auto-process payments

Skip the home screen and start the charge immediately: payment://new?amount=2000&auto=true

The payment will begin automatically when the app opens. If a card reader is connected, it will prompt for payment right away.

Complete example

Here's an example that combines everything together:

payment://new?amount=2000&
  currency=usd&
  customer_id=cus_xxxxxx&
  metadata[order_id]=12345&
  callback=myapp://payment&
  auto=true

Want something more from the API?
Let us know