# Payments and orders (/score-api/endpoints/payments)



{/* Written by scripts/build-use-cases.mjs from internal/usecases/catalog.json and use-cases/site.json. Change those, not this file. */}

**Approve more good orders. Pay for fewer chargebacks.** Score every order and payment before you fulfil it. Send the order, the customer and the addresses as you have them, and get a risk score in the same call.

| Endpoint                 | Price           | Group    |
| ------------------------ | --------------- | -------- |
| `POST /v1/score/payment` | $0.005 per call | Payments |

## Request [#request]

Send what you know in one `context` object. `order` is required; every other field is optional. A field can hold text, JSON or CSV.

<Tabs items="[&#x22;curl&#x22;, &#x22;Python&#x22;, &#x22;TypeScript&#x22;]">
  <Tab value="curl">
    ```bash
    curl https://api.finic.ai/v1/score/payment \
      --header "Authorization: Bearer $FINIC_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "context": {
          "order": { "id": "ord_88213", "items": [{ "sku": "IPH16P-256", "name": "iPhone 16 Pro", "quantity": 3, "unit_price_usd": 1199 }], "total_usd": 3597, "shipping_method": "express" },
          "customer": { "created": "2026-11-23", "previous_orders": 0, "email_verified": false },
          "payment_method": { "brand": "visa", "funding": "credit", "issuer_country": "CA", "first_used": "2026-11-25" },
          "billing_address": { "line1": "22 Maple St", "city": "Toronto", "region": "ON", "country": "CA" },
          "shipping_address": { "line1": "1396 NW 82nd Ave", "line2": "Unit 4411", "city": "Doral", "region": "FL", "country": "US" },
          "other_context": "Customer asked support to change the shipping address right after checkout"
        }
      }'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    import os
    import requests

    response = requests.post(
        "https://api.finic.ai/v1/score/payment",
        headers={"Authorization": f"Bearer {os.environ['FINIC_API_KEY']}"},
        json={
            "context": {
                "order": { "id": "ord_88213", "items": [{ "sku": "IPH16P-256", "name": "iPhone 16 Pro", "quantity": 3, "unit_price_usd": 1199 }], "total_usd": 3597, "shipping_method": "express" },
                "customer": { "created": "2026-11-23", "previous_orders": 0, "email_verified": False },
                "payment_method": { "brand": "visa", "funding": "credit", "issuer_country": "CA", "first_used": "2026-11-25" },
                "billing_address": { "line1": "22 Maple St", "city": "Toronto", "region": "ON", "country": "CA" },
                "shipping_address": { "line1": "1396 NW 82nd Ave", "line2": "Unit 4411", "city": "Doral", "region": "FL", "country": "US" },
                "other_context": "Customer asked support to change the shipping address right after checkout"
            }
        },
        timeout=30,
    )
    response.raise_for_status()
    print(response.json()["score"])
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const response = await fetch("https://api.finic.ai/v1/score/payment", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.FINIC_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        context: {
          "order": { "id": "ord_88213", "items": [{ "sku": "IPH16P-256", "name": "iPhone 16 Pro", "quantity": 3, "unit_price_usd": 1199 }], "total_usd": 3597, "shipping_method": "express" },
          "customer": { "created": "2026-11-23", "previous_orders": 0, "email_verified": false },
          "payment_method": { "brand": "visa", "funding": "credit", "issuer_country": "CA", "first_used": "2026-11-25" },
          "billing_address": { "line1": "22 Maple St", "city": "Toronto", "region": "ON", "country": "CA" },
          "shipping_address": { "line1": "1396 NW 82nd Ave", "line2": "Unit 4411", "city": "Doral", "region": "FL", "country": "US" },
          "other_context": "Customer asked support to change the shipping address right after checkout"
        },
      }),
    });
    const { score, questions } = await response.json();
    ```
  </Tab>
</Tabs>

## Fields you send [#fields-you-send]

Send the details, not only an ID: an account ID tells the score nothing, but the account's age, profile and history do. Fields that are not in this list are also read.

| Field              |          | Description                                                                                                                                |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `order`            | Required | What was bought: the items, quantities, total and delivery method.                                                                         |
| `customer`         | Optional | A description of the customer, not a customer ID: the account's age, past orders, and the contact details on file.                         |
| `payment_method`   | Optional | A description of the card or payment method: its type, where it was issued, and how long this customer has used it. Never the card number. |
| `billing_address`  | Optional | The billing address, as written.                                                                                                           |
| `shipping_address` | Optional | The shipping address, as written.                                                                                                          |
| `ip`               | Optional | The IP address with what your lookup says about it: country, city and network type. An address by itself says little.                      |
| `device`           | Optional | A description of the device: its type, its operating system, and whether this customer has used it before.                                 |
| `other_context`    | Optional | Any other information, structured or unstructured, that is useful for scoring.                                                             |

## Response [#response]

`score` runs from 0, the lowest risk, to 1000, the highest. `questions` are the yes/no questions behind it, each with the probability that the answer is yes.

```json title="200 OK"
{
  "score": 871,
  "questions": [
    {
      "text": "Does the shipping address look like a reshipper or freight forwarder?",
      "probability": 0.94
    },
    {
      "text": "Is the order unusually large for a new account?",
      "probability": 0.9
    },
    {
      "text": "Do the card and the shipping address point to different countries?",
      "probability": 0.88
    },
    {
      "text": "Are the items easy to resell?",
      "probability": 0.83
    }
  ],
  "request_id": "req_01M4YF1068X8B4C458ENPD4JHT"
}
```

## The questions behind the score [#the-questions-behind-the-score]

1. Does the shipping address look like a reshipper or freight forwarder?
2. Is the order unusually large for a new account?
3. Do the card and the shipping address point to different countries?
4. Are the items easy to resell?

Every organization gets the same questions for this score. To use your own questions, or to calibrate a score to your own outcomes, copy it to a [custom scoring model](/score-model) in the Finic app (Starter plan and above).

## Turn the score into an action [#turn-the-score-into-an-action]

These thresholds are examples. Choose your own, and change them as you learn.

| Score       | Action  | Example                         |
| ----------- | ------- | ------------------------------- |
| Under 300   | Approve | Fulfil the order.               |
| 300 to 599  | Step up | Ask for 3-D Secure.             |
| 600 to 849  | Review  | Hold fulfilment for an analyst. |
| 850 or more | Block   | Cancel and refund.              |

## Errors [#errors]

| Status | `type`                 | When                                                                                                         |
| ------ | ---------------------- | ------------------------------------------------------------------------------------------------------------ |
| 400    | `invalid_request`      | `context` is missing, is not a JSON object, or a required field (`order`) is empty. `param` names the field. |
| 401    | `authentication_error` | The API key is missing or not valid.                                                                         |
| 402    | `insufficient_credit`  | The organization has no credit. Add credit in the Finic app.                                                 |
| 429    | `rate_limited`         | Too many requests. Retry with exponential backoff.                                                           |

See the [API reference](/reference) for every error and limit, and [Pricing](/pricing) for what a call costs.
