Stripe Payment Intents

Stripe payment intents integration only supports the purchase payment method.

Pay by token or source

POST https://api.moltin.com/v2/orders/:orderId/payments

Path Parameters

NameTypeDescription

orderId

string

The UUID of the order you want to pay for

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

Request Body

NameTypeDescription

options.idempotency_key

string

Send a Stripe Idempotency Key

options.receipt_email

string

Provide an email for Stripe receipts. live mode feature

payment

string

The Stripe token or source

options.customer

string

The Stripe customer ID (required if sending source)

method

string

purchase

gateway

string

You will use stripe_payment_intents in this case

{
    "data": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "type": "transaction",
        "reference": "pi_1FCOZeCTrBHFHKc3aq7Y6QMe",
        "gateway": "stripe_payment_intents",
        "amount": 5499,
        "currency": "USD",
        "transaction-type": "purchase",
        "transaction_type": "purchase",
        "status": "pending",
        "payment_intent": {
            "client_secret": "pi_1FCOZeCTrBHFHKc3aq7Y6QMe_secret_USOWF0SwovdGuc78rLJqIfa7K",
            "status": "requires_action"
        },
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                }
            }
        },
        "meta": {
            "display_price": {
                "amount": 5499,
                "currency": "USD",
                "formatted": "$54.99"
            },
            "created_at": "2019-08-28T10:40:21.925Z",
            "timestamps": {
                "created_at": "2019-08-28T10:40:21Z",
                "updated_at": "2019-08-28T10:40:23Z"
            }
        }
    }
}

If you are passing a source instead of a token, you must also include the Stripe customer ID in the request

curl -X POST https://api.moltin.com/v2/orders/:orderId/payments \
     -H "Authorization: Bearer XXXX" \
     -d $'{
        "data": {
          "gateway": "stripe_payment_intents",
          "method": "purchase",
          "payment": "pm_card_threeDSecureRequired",
          "options": {
            "receipt_email": "john@example.com"
          }
        }
      }'

It's recommended that you use the token/source with Stripe payments. See Stripe Elements for generating a token on the client-side.

Pay by Stripe Connect

POST https://api.moltin.com/v2/orders/:orderId/payments

Moltin also supports Stripe Connect. Simply pass a destination via the options object.

Path Parameters

NameTypeDescription

orderId

string

The UUID of the order you want to pay for

Headers

NameTypeDescription

Authorization

string

The Bearer token used to grant access to the API

Request Body

NameTypeDescription

options.destination

string

The Stripe Connect Account ID

options.receipt_email

string

Provide an email for Stripe receipts. live mode only

payment

string

The Stripe token or source

method

string

purchase

gateway

string

You will use stripe_payment_intents in this case

{
    "data": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "type": "transaction",
        "reference": "pi_1FCOZeCTrBHFHKc3aq7Y6QMe",
        "gateway": "stripe_payment_intents",
        "amount": 5499,
        "currency": "USD",
        "transaction-type": "purchase",
        "transaction_type": "purchase",
        "status": "pending",
        "payment_intent": {
            "client_secret": "pi_1FCOZeCTrBHFHKc3aq7Y6QMe_secret_USOWF0SwovdGuc78rLJqIfa7K",
            "status": "requires_action"
        },
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                }
            }
        },
        "meta": {
            "display_price": {
                "amount": 5499,
                "currency": "USD",
                "formatted": "$54.99"
            },
            "created_at": "2019-08-28T10:40:21.925Z",
            "timestamps": {
                "created_at": "2019-08-28T10:40:21Z",
                "updated_at": "2019-08-28T10:40:23Z"
            }
        }
    }
}
curl -X POST https://api.moltin.com/v2/orders/:orderId/payments \
     -H "Authorization: Bearer XXXX" \
     -d $'{
        "data": {
          "gateway": "stripe_payment_intents",
          "method": "purchase",
          "payment": "pm_card_threeDSecureRequired",
          "options": {
            "destination": "acct_XXX",
            "receipt_email": "john@example.com"
          }
        }
      }'

Last updated