Getting startedOverview
HelpStatusOpen portal

Getting started

Payva helps you sell to more customers by letting them pay over time. Whether you sell through your own Payva checkout links or a partner platform, Payva approves your customers, takes care of their payments and pays you, either upfront or as payments come in.

The Merchant API gives your systems the same data you see in the Payva portal, so you can report on sales, reconcile payouts and automate how you sell.

Overview

The Payva Merchant API lets your systems read and manage your Payva orders, payments, payouts, products and payment links from code. Get a key, send one request, and you’re in.

API URLhttps://merchant.api.payva.com/graphql
MethodPOST, with a JSON body
Auth headerx-api-key: <your API key>

Every request goes to that one URL. There are no other endpoints to learn. There is no sandbox or test environment today, so every key works against your live account.

New to GraphQL? A good starting point is the official Introduction to GraphQL (opens in a new tab).

Step 1: Create an API key

  1. Sign in to the Payva merchant portal.
  2. Open Settings, then API keys (under Developers).
  3. Select Create key, name it after the system that will use it, such as “Order reporting” or “CRM sync”, and select Create key again.
  4. Copy the API key value with the copy icon next to it. This is what goes in the x-api-key header. You can come back and copy it again later.

The page also shows a Secret key, which can only be viewed once. The Merchant API does not use it.

You need to be an owner, or have permission to manage API keys, to see this page. If API keys is missing, your account may not be enabled for the API yet. Contact your Payva account manager.
Keep your key on your server. Never put it in a website, a mobile app or a public code repository.

Rotate or revoke a key

Both live on the same API keys page, next to each key.

  • Rotate issues a new key. The old key stops working right away, so update your integration as soon as you rotate. To switch with no downtime, create a second key, move your integration to it, then revoke the old one.
  • Revoke stops the key immediately. This cannot be undone.
  • If a key may have leaked, revoke it and create a new one.

What your key can access

Today, an API key belongs to your business, not to the person who created it.

  • It can see everything on your merchant account: every order, payment, payout, product and team member.
  • It keeps working if the person who created it leaves your team. Revoke it if you no longer trust where it is stored.
  • Anyone who has the key has that same access, so treat it like a password to your whole account.
Keys tied to a single team member are coming in a future release. Those keys will only see what that person can see in the portal, and will stop working when the person leaves your team.

Step 2: Make your first call

This request returns your most recent order. Swap in your key and run it.

Example

query MostRecentOrder {
  orders(input: { first: 1 }) {
    edges { node { orderId status orderTotal orderDate } }
  }
}
Response
{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "orderId": "100235",
            "status": "ACTIVE",
            "orderTotal": 10000,
            "orderDate": "2026-07-14T15:32:08.000Z"
          }
        }
      ]
    }
  }
}

If you get back data, your key works. If you get an errors array with UNAUTHORIZED, check the key. If it says FORBIDDEN, your account isn’t enabled for the API yet.

Next steps

Authentication

Send your API key in the x-api-key header on every request to https://merchant.api.payva.com/graphql. Your key tells us which business you are, so you never send an account ID.

Keep it on your server

Never put your key in a website, a mobile app or a public code repository. Anyone who has it can see and change your whole account.

It works on live data

There are no test keys. Every call reads and changes your real account.

It belongs to your business

A key isn’t tied to the person who created it. Some changes, such as making someone an owner, can only be made in the merchant portal for now. Keys tied to a team member are coming in a future release.

When a key doesn’t work

UNAUTHORIZED means the key is missing, wrong, expired, rotated or revoked. FORBIDDEN means your account isn’t enabled for the API yet; contact your account manager.

Headers

NameTypeDescription
x-api-keyheaderrequiredYour API key, from Settings > API keys in the merchant portal. It starts with pv_sk_live_.
Content-Typeheaderrequiredapplication/json

Example

Request
# A first request: confirm your key works
POST https://merchant.api.payva.com/graphql
Content-Type: application/json
x-api-key: pv_sk_live_example_0000000000000000

{ "query": "{ orders(input: { first: 1 }) { totalCount } }" }
Response
{
  "data": {
    "orders": {
      "totalCount": 148
    }
  }
}

Errors

When something goes wrong, the response has an errors array. Each error has a code in extensions. Branch on the code, not the message, because message text can change.

Check the body, not the status

Most errors still return HTTP 200. Look for an errors array in the response. Only a query that can’t run at all (bad syntax, wrong variable types) returns HTTP 400. A missing or bad API key returns HTTP 401, and an account without API access gets HTTP 403.

One problem at a time

A bad argument returns the first problem found. Fix it and send again to see the next one.

Missing records

Looking up one record that isn’t on your account returns null. Changing one returns NOT_FOUND.

Retrying safely

Reads are always safe to retry. Creates are not: if one times out, check whether it went through before sending it again, or you may end up with two.

Error codes

CodeWhat it meansWhat to do
INVALID_REQUESTSomething in the request is missing, malformed or the wrong formatRead the message, fix the request, resend
UNAUTHORIZEDThe API key is missing, wrong, expired, rotated or revokedCheck the x-api-key header
FORBIDDENYour key works, but your account isn’t enabled for this, or the change can only be made in the portalContact your account manager
NOT_FOUNDYou tried to change a record that isn’t on your accountCheck the ID
INTERNAL_SERVER_ERRORSomething went wrong on our sideRetry reads. Check before retrying a create

Response

FieldTypeDescription
dataObjectThe fields you asked for. A field that failed is null, and its error is in errors. data itself is null or absent when the request could not run.
errors[Error!]Present only when something failed. Each error carries a message and an extensions.code you can branch on.

Example

Example
{
  "errors": [
    {
      "message": "Payment link not found",
      "extensions": {
        "code": "NOT_FOUND"
      }
    }
  ],
  "data": null
}
Response
{
  "errors": [
    {
      "message": "Missing API key",
      "extensions": {
        "code": "UNAUTHORIZED"
      }
    }
  ],
  "data": null
}

Pagination

Every list returns results in pages. You get up to 25 results by default, and up to 100 if you ask.

  1. Ask for a page with input: { first: 100 }.
  2. If pageInfo.hasNextPage is true, send the same request again with after set to pageInfo.endCursor.
  3. Repeat until hasNextPage is false.

totalCount on every page tells you how many results match your filter in total.

Pages don’t shift

New orders arriving while you page through won’t move or repeat results. The 400th page is as fast as the first.

Keep the sort the same

Changing sortBy or sortDesc partway through starts over from the first page. Pass cursors back exactly as you got them.

Arguments

NameTypeDescription
input.firstIntPage size, 1–100. Defaults to 25 on every list.
input.afterStringThe endCursor of the page you already have. A value that is not a cursor is refused with INVALID_REQUEST.

Response

FieldTypeDescription
totalCountInt!Everything that matches your filter, not just this page.
pageInfo.hasNextPageBoolean!True while there is more to fetch.
pageInfo.endCursorStringPass it as after. Null on an empty page.
edges[].cursorString!The position of that one row, if you want to resume from the middle of a page.

Example

query Walk($input: OrdersInput) {
  orders(input: $input) {
    totalCount
    pageInfo { hasNextPage endCursor }
    edges { node { orderId status } }
  }
}
Variables
{
  "input": {
    "first": 100,
    "after": "eyJzb3J0ZWRGaWVsZCI6Ik9SREVSX0RBVEUiLCJkaXJlY3Rpb24iOiJERVNDIiwidmFsdWUiOiIyMDI2LTA4LTAxIDAwOjAwOjAwIiwiaWQiOjkwMDAwMjB9"
  }
}
Response
{
  "data": {
    "orders": {
      "totalCount": 148,
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "eyJzb3J0ZWRGaWVsZCI6Ik9SREVSX0RBVEUiLCJkaXJlY3Rpb24iOiJERVNDIiwidmFsdWUiOiIyMDI2LTAzLTAyIDAwOjAwOjAwIiwiaWQiOjkwMDAwMDF9"
      },
      "edges": [
        {
          "node": {
            "orderId": "100219",
            "status": "ACTIVE"
          }
        }
      ]
    }
  }
}

How you get paid

Every order pays you out one of two ways: UPFRONT or PAC. The route decides when you get paid, and whether money can be taken back later.

UPFRONT

You’re paid at the start of the order, before your customer has paid it off. payoutAmount and payoutPercent on the order show what you were paid.

PAC (pay as collected)

You’re paid as each customer payment comes in. Your payouts follow your customer’s payments.

How an order gets its route

Try it: flip the switch to compare AutoRoute (on) with Upfront only (off).
AutoRoute On
RiskchecklowUpfrontPACYour payoutAutoRoute off
Order

You get paid on every order. Low-risk pays upfront. Higher-risk orders route through PAC, paying out as your customer pays.

Each product has a route setting:

Product routeWhat happens at checkout
AUTOROUTEThe credit check decides. Good credit pays UPFRONT. Weaker credit goes to PAC instead of being declined.
UPFRONT_ONLYGood credit pays UPFRONT. Weaker credit is declined.
PAC_ONLYEvery approved order pays as collected.

Clawbacks

If your customer stops paying after you’ve been paid upfront, Payva takes some of that payout back. A clawback shows in payouts and transactions as a negative PAYOUT with the CLAWBACK sub-type.

When an order is safe

Once your customer has paid off enough of an UPFRONT order, it can no longer be clawed back. recourseThresholdMet turns true and clawbackAtRisk becomes null.

Sales through another platform

If the order came through a partner platform, the payout goes to that platform, and they pay you.

Example

query Payouts($input: OrdersInput) {
  orders(input: $input) {
    edges { node {
      orderId orderTotal
      payoutSummary { payoutAmount payoutPercent payoutToDate }
    } }
  }
}
Variables
{
  "input": {
    "first": 2
  }
}
Response
{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "orderId": "100235",
            "orderTotal": 10000,
            "payoutSummary": {
              "payoutAmount": 8000,
              "payoutPercent": 80,
              "payoutToDate": 8000
            }
          }
        },
        {
          "node": {
            "orderId": "100219",
            "orderTotal": 6000,
            "payoutSummary": {
              "payoutAmount": null,
              "payoutPercent": null,
              "payoutToDate": 3040
            }
          }
        }
      ]
    }
  }
}

Types

RouteEnum

How you are paid out on an order. See How an order gets its route for how a product’s route setting decides it.

ValueMeaning
UPFRONTPaid out upfront, at the start of the order.
PACPaid out as each customer payment comes in.
PENDINGThe route is not decided yet, as on a pending plan.
INVALIDThe stored route is not valid.