Integrations API
API reference for connecting and managing payment provider integrations.
Manage payment provider connections programmatically.
List Integrations
Section titled “List Integrations”GET /v1/integrationscurl -X GET https://api.gopaylocal.com/v1/integrations \ -H "Authorization: Bearer gpl_sk_live_xyz789"const res = await fetch('https://api.gopaylocal.com/v1/integrations', { headers: { 'Authorization': 'Bearer gpl_sk_live_xyz789' },});const { data } = await res.json();Response:
{ "data": [ { "id": "int_abc123", "provider": "stripe", "status": "connected", "environment": "live", "createdAt": "2025-01-15T10:30:00Z", "lastSyncAt": "2025-01-20T14:22:00Z" } ]}Connect Integration
Section titled “Connect Integration”POST /v1/integrationscurl -X POST https://api.gopaylocal.com/v1/integrations \ -H "Authorization: Bearer gpl_sk_live_xyz789" \ -H "Content-Type: application/json" \ -d '{ "provider": "stripe", "apiKey": "sk_live_xxx", "environment": "live" }'const res = await fetch('https://api.gopaylocal.com/v1/integrations', { method: 'POST', headers: { 'Authorization': 'Bearer gpl_sk_live_xyz789', 'Content-Type': 'application/json', }, body: JSON.stringify({ provider: 'stripe', apiKey: 'sk_live_xxx', environment: 'live', }),});Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | Provider name: stripe, paddle, dodo, lemon_squeezy, gumroad, chargebee, whop, polar |
apiKey | string | Yes | Provider API key |
environment | string | No | "live" or "test" (default: "live") |
siteName | string | No | Required for Chargebee (subdomain) |
Disconnect Integration
Section titled “Disconnect Integration”DELETE /v1/integrations/:idcurl -X DELETE https://api.gopaylocal.com/v1/integrations/int_abc123 \ -H "Authorization: Bearer gpl_sk_live_xyz789"await fetch('https://api.gopaylocal.com/v1/integrations/int_abc123', { method: 'DELETE', headers: { 'Authorization': 'Bearer gpl_sk_live_xyz789' },});Response: 204 No Content
Sync Discounts
Section titled “Sync Discounts”Trigger a manual sync of discount codes with the connected provider.
POST /v1/integrations/:id/synccurl -X POST https://api.gopaylocal.com/v1/integrations/int_abc123/sync \ -H "Authorization: Bearer gpl_sk_live_xyz789"This creates or updates discount codes in the payment provider based on your current parity groups and campaign settings.
Test Connection
Section titled “Test Connection”Verify that the integration’s API key is valid.
POST /v1/integrations/:id/testResponse (success):
{ "ok": true, "message": "Connection successful"}Response (failure):
{ "ok": false, "message": "Authentication failed — check your API key"}List Provider Products
Section titled “List Provider Products”Fetch products from the connected payment provider. Currently supported by Dodo Payments.
GET /v1/integrations/:id/productscurl -X GET https://api.gopaylocal.com/v1/integrations/int_abc123/products \ -H "Authorization: Bearer gpl_sk_live_xyz789"const res = await fetch('https://api.gopaylocal.com/v1/integrations/int_abc123/products', { headers: { 'Authorization': 'Bearer gpl_sk_live_xyz789' },});const { data } = await res.json();Response:
{ "data": [ { "providerProductId": "prod_abc123", "name": "Pro Plan", "price": 29.99, "currency": "USD", "url": "https://dodopayments.com/products/prod_abc123" } ]}Import Products
Section titled “Import Products”Import selected products from the payment provider into GoPayLocal.
POST /v1/integrations/:id/products/importRequest Body:
{ "productIds": ["prod_abc123", "prod_def456"]}Response:
{ "data": { "imported": 2 }}Duplicate products (matching by URL) are automatically skipped.