← Back to Overview

Savings

Record successful steering savings when a customer switches payment methods

POST/api/steer/savingsOptional Auth
publicproductoptional-auth

Example Request

cURL

curl -X POST https://margin.so/api/steer/savings \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_live_your_api_key_here" \
  -d '{}'

JavaScript

const response = await fetch('https://margin.so/api/steer/savings', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'sk_live_your_api_key_here'
  },
  body: JSON.stringify({})
});

const data = await response.json();
console.log(data);

Python

import requests

response = requests.post(
    'https://margin.so/api/steer/savings',
    headers={
        'Content-Type': 'application/json',
        'X-API-Key': 'sk_live_your_api_key_here'
    },
    json={}
)

data = response.json()
print(data)

Example Response

{
  "success": true,
  "data": {
    "event_id": "evt_savings_xyz789",
    "savings_cents": 160,
    "basis_points_recovered": 160
  }
}

Request Body

FieldTypeRequiredDescription