Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trymaven.com/llms.txt

Use this file to discover all available pages before exploring further.

Connecting Shift4

Maven connects to Shift4 using your Public Key and Secret Key. These credentials allow Maven to create charges and vault cards on your behalf.

Prerequisites

  • A Shift4 account
  • Public Key and Secret Key
  • A Maven app

Getting Your Credentials

1

Log in to Shift4

Go to Shift4 Dashboard and log in.
2

Navigate to API Keys

Click API Keys in the left sidebar.
3

Copy Credentials

You’ll see your:
  • Public Key (starts with pk_)
  • Secret Key (starts with sk_)
Use the Test keys for sandbox testing and Live keys for production.

Connecting in Maven

1

Go to Payments

In the Maven Dashboard, navigate to your app and click the Payments tab.
2

Click Connect Shift4

Click the Shift4 card and enter your credentials.
3

Enter Credentials

  • Public Key: Your Shift4 Public Key
  • Secret Key: Your Shift4 Secret Key
4

Save

Click Connect. Maven will validate the credentials and save them.

Sandbox Testing

For testing, use your Test API keys from the Shift4 dashboard. Test keys start with pk_test_ and sk_test_. Use test credentials with mvn_test_ API keys to test without real charges.

Processor Response Fields

Charge Mode

FieldDescription
charge_idShift4 charge ID
customer_idShift4 customer ID
card_idShift4 card ID
card_brandCard brand
card_last4Last 4 digits

Tokenize Mode (Vault)

FieldDescription
customer_idShift4 customer ID
card_idShift4 card ID
card_brandCard brand
card_last4Last 4 digits

Using Tokenized Cards

After tokenizing, use the customer and card IDs to create charges via the Shift4 API:
import httpx

resp = httpx.post(
    "https://api.shift4.com/charges",
    auth=("sk_live_your_secret_key", ""),
    data={
        "amount": 4999,
        "currency": "USD",
        "customerId": "cust_xxx",  # from customer_id
        "card": "card_xxx",        # from card_id
    },
)