API Documentation
Overview
This document details API use cases and endpoints for Sway. Note that these API endpoints are the same endpoints used by the Sway mobile apps, and are subject to the same authentication, rate limit, and throttling constraints.
API endpoints are subject to change, and developer access for Sway is currently limited. If you are building upon these endpoints, please get in touch – we'd love to discuss your specific use case.
Authentication
To make authenticated API requests to Sway, you will need to generate a JWT, which you will include in the Authorization header of your API requests:
API Root URL
All endpoints mentioned are relative paths. The API root URL is:
https://api.sway.money
Endpoints
GET /v1/pv/orders
GET /v1/pv/orders/:orderId
POST /v1/pv/orders/draft
- lineItems: Array
- price: Number
- productVariantId: String (optional)
- quantity: Number
POST /v1/pv/orders/:orderId/publish
POST /v1/pv/orders/:orderId/update
- internalNote: String (optional)
Creating a new order
A common workflow is to create a new order, to request a payment from an end-customer. To accomplish that, follow these steps:
1. Create a draft order (POST /v1/pv/orders/draft
)
2. Publish draft order (POST /v1/pv/orders/:orderId/publish
)
You can also optionally add an internal note to orders via the POST /v1/pv/orders/:orderId/update
endpoint.