Skip to main content

Stripe APMs Admin API Guide

Stripe Alternative Methods (APMs) are a fully integrated payment methods supported both in the storefront checkout and the Admin API. Stripe APM transactions process the customer through a redirect flow with the resulting order information provided back to your application.

info

Your store must have a Stripe Gateway enabled with the appropriate Stripe APM to be able to use on the Admin API.

tip

Stripe APMs redirect flow follows the same principles as Apple Pay, 3DS2 and PayPal, implementing payment redirect flow is recommended to easily cover many payment methods.

Supported Stripe Alternative Payment Methods

Payment MethodPayment Method CodeStripe Docs
Klarna PaymentsklarnaStripe Docs
iDEALidealStripe Docs
BancontactbancontactStripe Docs
giropaygiropayStripe Docs
SofortsofortStripe Docs
SEPA Direct Debitsepa_debitStripe Docs

API Payment Redirect Flow

Below is a high-level overview of the user flow when creating orders on the Admin API that utilize the payment method redirect flow.

Create Order on Admin API

When creating a new order using a Stripe APM, you’ll need to specify the payment_method=<payment method code> as well as provide a payment_return_url. The payment_return_url is your endpoint that will receive a POST request containing the final order data.

Payment Details for Order with Stripe APMs
{
"payment_method": "<payment method code>",
"payment_details": {
"payment_return_url": "<external checkout url>",
"payment_gateway": "<gateway id>", // optional
"payment_gateway_group": "<gateway group id>" // optional

}
}
tip

You can optionally provide a payment_gateway or payment_gateway_group when creating the order to use a specific Stripe Gateway configured in the store.

Redirect Customer to Payment Complete URL

The response when creating the order will provide a payment_complete_url. Your application should redirect the customer to this URL for completing the payment on the store's Stripe APM checkout flow.

Response with Payment Complete URL
{
"reference_transaction_id": null,
"payment_complete_url": "https://<domain>/stripe/checkout/<unique payment id>/"
}

Receiving Order Data

After the customer has completed their payment, they will be redirected to your application with a POST request containing data in the response key comprising all of the order information as a string. See examples below.

caution

Order data structure follows Admin Order API and is application/x-www-form-urlencoded in a variable called response. If the order data is an empty dictionary {}, it means payment collection was unsuccessful and the order was not created.

Example Parsing of Order Data
import json

def order_receiver_view(request):
data = json.loads(request.POST.get("response"))
...
return HttpResponse(status=201)