API reference · Introduction
API reference
The Inkress API is JSON over HTTPS. Send a secret key or a merchant's OAuth token, get a JSON envelope back.
Base URL
| Environment | Base URL |
|---|---|
| Test | https://api-dev.inkress.com/api/v1 |
| Live | https://api.inkress.com/api/v1 |
Test and live use the same paths. A test key only works on the test API and a live key only on the live one.
Authentication
Send Authorization: Bearer <key> on every request.
| Credential | Use it for |
|---|---|
sk_test_… | Your own server, on the test API. |
sk_live_… | Your own server, live. |
inka_… | An app acting for a merchant who installed it, within the scopes they approved. |
Authentication has the details.
Responses
Every response has a state of ok or error. Successful calls put the object or list in result; creating or updating answers 201.
Statuses come back as numbers, for example an order's 1 pending and 3 paid. Each endpoint lists its values; the Node SDK turns them into words.
Errors
| Status | Meaning |
|---|---|
401 | The key or token is missing, wrong or revoked, or doesn't have the scope. |
422 | A field is missing or wrong. result.reason says which. |
200 with result: false | No such object for this merchant. |
Every response carries an x-request-id header. Paste it into the portal's search to open that request in Request logs. Errors has the rest.
Idempotent requests
Apps can send an Idempotency-Key header on POST, PUT and DELETE. If the same key and body come again within 24 hours, you get the first response back instead of a second order. Idempotent requests.
Endpoints
| Orders | ||
| POST | Create an order | /orders |
| GET | Get an order | /orders/:id |
| GET | List orders | /orders |
| PUT | Update an order | /orders/:id |
| GET | Order status | /orders/status/:id |
| Payment links | ||
| POST | Create a link | /payment_links |
| GET | Get a link | /payment_links/:id |
| GET | List links | /payment_links |
| PUT | Update a link | /payment_links/:id |
| Checkout sessions | ||
| POST | Create a session | /checkout/sessions |
| GET | Get a session | /checkout/sessions/:id |
| DELETE | Cancel a session | /checkout/sessions/:id |
| Billing plans | ||
| POST | Create a plan | /billing_plans |
| GET | Get a plan | /billing_plans/:id |
| GET | List plans | /billing_plans |
| PUT | Update a plan | /billing_plans/:id |
| Subscriptions | ||
| POST | Subscribe a customer | /billing_subscriptions/link |
| GET | List subscriptions | /billing_subscriptions |
| GET | Get a subscription | /billing_subscriptions/:id |
| POST | Charge now | /billing_subscriptions/:uid/charge |
| GET | Charge status | /billing_subscriptions/:uid/charges/:reference |
| POST | Card update link | /billing_subscriptions/:uid/card-update-link |
| GET | Billing periods | /billing_subscriptions/:uid/periods |
| Products | ||
| POST | Create a product | /products |
| GET | Get a product | /products/:id |
| GET | List products | /products |
| PUT | Update a product | /products/:id |
| Merchants | ||
| POST | Set up a business | /merchants/partner-activation |
| POST | Vouch for a merchant | /merchants/:merchant_id/vouch |
| POST | Create a merchant | /merchants |
| GET | Get a merchant | /merchants/:id |
| GET | List merchants | /merchants |
| PUT | Update a merchant | /merchants/:id |
| Payouts | ||
| GET | List payouts | /financial_requests |
| GET | Get a payout | /financial_requests/:id |
| POST | Request a payout | /financial_requests |
| Webhook endpoints | ||
| POST | Add an endpoint | /webhook_urls |
| GET | List endpoints | /webhook_urls |
| GET | Get an endpoint | /webhook_urls/:id |
| PUT | Update an endpoint | /webhook_urls/:id |
| DELETE | Remove an endpoint | /webhook_urls/:id |