SellAuth-format API
Point your SellAuth scripts, bots and embeds at PaidGoods and keep them working.
PaidGoods answers SellAuth's API paths and request fields, so existing SellAuth scripts keep working after you move. For new work, use the PaidGoods API, which is the main, documented API.
Switch a script over
- Change the base URL to
https://api.paidgoods.com/formats/sellauth. SellAuth's paths, such as/v1/shops/{shopId}/..., stay the same after that prefix. - Use a PaidGoods API key (
sk_…). For a drop-in replacement, give it Full access; a SellAuth key can do everything, while a PaidGoods key has only the permissions you tick.
Every SellAuth-format route is in the API reference, under SellAuth format, with the filters it supports.
IDs
- Paths, bodies and
{shopId}accept the SellAuth ID of anything you imported, and responses return it. Records made in PaidGoods get a stable number instead. PaidGoods IDs are accepted too, and the native API shows the SellAuth ID asexternal_ids.sellauth. - This covers products, variants, add-ons, groups, categories, customers, coupons, invoices (number or
unique_id), invoice items, tickets, feedback, subscriptions, blacklist and whitelist entries, email contacts and lists, and the rest of the import. - Downloadable files and ticket messages get new IDs, because SellAuth's API can't hand them over. The import report names them.
- Send a variant's
idon product update to keep that variant and its stock.
Tokens
Three kinds, kept apart as on SellAuth:
| Routes | Token |
|---|---|
Merchant (/v1/user, /v1/shops/...) | Store API key, sk_… |
| Customer Dashboard API | Customer token, ct_… |
| Reseller API | Reseller key, rs_… |
The wrong kind of token gets 403 naming the right one; a missing or unknown token gets 401. A key without the needed permission gets 403 naming it. The Customer Dashboard and Reseller APIs don't need X-Shop-Id, since the token names its store; if you send it, it must match.
Responses and lists
- Responses are PaidGoods' own shapes. Lists use SellAuth's envelope:
data,current_page,per_page,last_page,total. - Lists take
page,perPage,orderColumnandorderDirection. - A filter or sort the route can't apply is refused with
422naming it, instead of returning an unfiltered list. - Values PaidGoods can't keep are refused with
422, not silently dropped. - Balance changes, marking an invoice refunded, affiliate transfers and reseller invoices accept an
Idempotency-Keyheader: a retry with the same key is applied once.
Products and stock
- Bulk updates: every
PUT .../products/bulk-update/...route works, withproduct_ids(up to 500) orall: true. Each call sets its whole section, so a field you leave out is cleared. IDs that aren't this store's products come back inskipped_product_ids.bulk-update/deliverables-typewithfilesis refused, because each variant needs its own files. - Currency:
bulk-update/currencyrelabels prices and keeps the number (14.99 USD becomes 14.99 EUR). It is refused for products with subscribers or a subscription option. - Deliverables:
GET .../deliverables/{variantId}returns unsold serials (needsstock:write).overwritereplaces only unsold serials no checkout is holding; an empty list needsconfirm_empty: true. - Add-ons:
type: "addon"on product create or update makes an add-on. Link add-ons to products withbulk-update/addons. - Sort:
sortedIdstakes an array, a JSON array string or a comma-separated list.
Checkout
POST /v1/shops/{shopId}/checkout takes the same body as SellAuth and needs invoices:write.
cartmixes products (productId,variantId,quantity,custom_fields,subscribe) and custom items (name,pricein major units,quantity). A cart of only custom items must cost more than 0, and needscurrency.email+payment_method_idcreate the invoice at once. A redirect method returns the provider's URL; a method paid on the invoice page (crypto, manual, embedded card forms) returns the invoice URL.gateway(deprecated) works only when it names exactly one active method, such asPAYPALorBTC; otherwise422.CUSTOMERBALANCEis refused.- Also accepted:
coupon,affiliate,newsletter,metadata(up to 10 values),attribution,redirectUrl,billing_*,shipping_*, and the buyer'sip,country_codeanduser_agent.
The response is { success, invoice_id, invoice_url, url, type }, where type is checkout, redirect or invoice.
Different from SellAuth: without an email and payment method, url opens the hosted checkout and invoice_id and invoice_url are null, because the invoice is made only once the buyer finishes. The link works for 24 hours and makes one invoice. Track it with webhooks or the invoice list.
Invoices
GET invoices/:id/process delivers an unpaid invoice without counting it as revenue, unless you add mark_as_paid=1. status: refunded reverses neither cashback nor affiliate commission, as on SellAuth; call reverse-cashback or reverse-affiliate-commission separately. status: completed on a refunded invoice undoes a recorded refund.
Reseller API and dynamic delivery
- Reseller API (
/v1/reseller/products,/balance,/invoices,/invoices/{id}) returns SellAuth's fields: prices in major units,stock: -1for unlimited,reseller_source1 (API), 2 (dynamic) or 3 (panel).*_usdfields arenullwhen the supplier's balance isn't in USD. - Create invoice answers
201with the delivered keys initems[].delivered. Send anIdempotency-Keyand reuse it on retries; a retry returns the first invoice and never charges twice. A short balance is402. Limits: 60 reads and 20 invoices a minute per key. - Dynamic delivery URLs: on the supplier's reseller panel, paste the secret your store signs dynamic delivery with into Your store’s dynamic delivery secret (on PaidGoods, the Dynamic delivery secret under Developers → API keys → Signing secrets, not the webhook secret; on SellAuth, the shop's one signing secret) and turn on dynamic delivery. Each variant then shows a URL to paste into your product as its dynamic delivery URL. Add
max_unit_price=4.50to refuse a delivery, before anything is charged, when the price rises above it. Only serial, service and dynamic products can be delivered this way. The answer is plain text, one item per line;503means retry. Each invoice item is charged at most once, and a failed delivery is refunded to your balance. - Connect your store on the supplier's panel opens a wizard in your PaidGoods dashboard. See Connected stores.
Customer Dashboard API
- Issue a token for a signed-in buyer with
POST /v1/shops/{shopId}/customers/{customerId}/token(expires_in60 to 2,592,000 seconds, default 30 days; needscustomers:writeand a live key). It acts as that buyer on the Customer Dashboard API only, and shows in their account as "Issued by the store". Past 20 live tokens for one buyer, the oldest is revoked. - Works:
balance,logout(revokes the calling token),tickets,subscriptions(list, cancel, uncancel, andportalfor a Stripe page to change the card),affiliate(edit code, payout request, cancel, transfer),reseller/*(apply, API key, dynamic delivery, connect token, orders) andinstant-balance(quote, then pay only if the amount matches the quote). - Token calls always act on live data, under the same store settings and limits as the buyer account.
What answers 501
These answer 501 and are left out of the API reference:
- Connecting a payment method (enter credentials in the dashboard) and wallet-domain registration.
- CSV import into a marketing list, and deleting a marketing contact (unsubscribe it instead).
- Creating or deleting a shop.
reseller/orders/quoteandreseller/orders/{unique_id}/pay(usePOST /reseller/invoiceswith anIdempotency-Key), andreseller/disconnect(disconnect in your dashboard).- SellAuth's crypto wallet (
/v1/shops/{shopId}/payouts...). PaidGoods doesn't hold your coins: each paid invoice is sent straight to your own payout address, so there is no wallet balance to read or pay out. See your payments in Payments → Crypto wallets.
Refused with 422 rather than half-applied: provider credentials in a payment method's settings, per-tier affiliate attribution, and shop fields with no equivalent (Discord bot, chat widgets, pixels). Set notification channels in Settings → Notifications.
Webhooks
HTTP notifications use SellAuth's body and event names, signed the same way. See Webhooks.
Embed
Change the script source to your PaidGoods store address (/embed/v1.js or /embed/v3.js) and keep using sellAuth.open, sellAuth.close, sellAuth.on and sellAuth.off. Events are sent as sellauth:* as well as dc:*.
These attributes work: data-sellauth-cart, data-sellauth-variant, data-sellauth-shop, data-sellauth-product, data-sellauth-quantity, data-sellauth-email, data-sellauth-coupon, data-sellauth-affiliate, data-sellauth-theme, data-sellauth-language, data-sellauth-redirect-url, data-sellauth-ticket-panel and data-sellauth-mode.
As on SellAuth, the support-ticket card after purchase is hidden in the popup unless you pass ticketPanel: true (or data-sellauth-ticket-panel="true"). See Checkout API, links and embed.