Skip to main content

Introduction

The Sevi Partner API lets you accept Sevi as a payment method in your shop, ERP or checkout: buyers pay with M-Pesa, their Sevi wallet, or Sevi credit (pay later), and you get the money in your Sevi wallet once the goods are delivered.

Typical integrations:

  • ERP / invoicing systems — create a Sevi order for each invoice and print the payment link as a QR code.
  • E-commerce platforms — add Sevi as a checkout option (WooCommerce, Shopify, custom shops).
  • Distributor / route-sales apps — create the order at the shop, confirm delivery when the driver drops the goods.

Start with the Integration flow — it describes the one standard flow end to end.

Environments​

Sandbox (testing)Production
GraphQL endpointhttps://sandbox.sevi.io/graphqlhttps://partner.sevi.io/graphql
Seller dashboard (API token, webhooks)staging admin portal (ask us)admin.sevi.io
Moneytest money onlyreal money

Both environments expose the same schema and behave the same way. See Testing for how to get a sandbox account.

Authentication​

Every request needs your API token in the Authorization header, sent as-is (no Bearer prefix):

POST /graphql HTTP/1.1
Host: partner.sevi.io
Content-Type: application/json
Authorization: <your API token>

The token identifies your seller wallet, so orders you create are automatically linked to your account. See Authentication for how to get one.

What the Partner API offers​

OperationTypeUse it to
orderCreatemutationCreate an order and get the payment link
orderDelivermutationConfirm delivery (full or partial) — releases the money to you
orderCancelmutationClose an unpaid order the buyer abandoned
orderSearchqueryLook up the current state of an order (reconciliation)
orderPaymentProposalsqueryPreview the credit options for a buyer before creating the order
orderUpdateItemsmutationChange the items of an unpaid order
paymentRequestmutationTrigger an M-Pesa STK push for an order directly (instead of the payment link)
setUpWebhooksmutationRegister a webhook URL (you can also do this in the dashboard)
customerCreatemutationRegister a buyer with your own customer reference ahead of the first order

Order and payment updates are pushed to you via webhooks — there is no need to poll.

Working with GraphQL​

  • Open the endpoint URL in a browser to use the GraphQL playground; its documentation explorer lists every field and input with a description.
  • Use query variables rather than inlining values.
  • Generate typed clients from the schema with GraphQL Code Generator.
  • GraphQL always answers HTTP 200; check the errors array in the response body.
  • A Postman collection with sandbox and production examples is available.