JavaScript
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const customerIntegrationResponse = await client.v1.customers.integrations.link('x', {
id: 'id',
syncedEntityId: 'syncedEntityId',
vendorIdentifier: 'STRIPE',
});
console.log(customerIntegrationResponse.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
customer_integration_response = client.v1.customers.integrations.link(
path_id="x",
body_id="id",
synced_entity_id="syncedEntityId",
vendor_identifier="STRIPE",
)
print(customer_integration_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
customerIntegrationResponse, err := client.V1.Customers.Integrations.Link(
context.TODO(),
"x",
stigg.V1CustomerIntegrationLinkParams{
ID: "id",
SyncedEntityID: "syncedEntityId",
VendorIdentifier: stigg.V1CustomerIntegrationLinkParamsVendorIdentifierStripe,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerIntegrationResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.customers.CustomerIntegrationResponse;
import io.stigg.models.v1.customers.integrations.IntegrationLinkParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
IntegrationLinkParams params = IntegrationLinkParams.builder()
.pathId("x")
.bodyId("id")
.syncedEntityId("syncedEntityId")
.vendorIdentifier(IntegrationLinkParams.VendorIdentifier.STRIPE)
.build();
CustomerIntegrationResponse customerIntegrationResponse = client.v1().customers().integrations().link(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
customer_integration_response = stigg.v1.customers.integrations.link(
"x",
body_id: "id",
synced_entity_id: "syncedEntityId",
vendor_identifier: :STRIPE
)
puts(customer_integration_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Customers.Integrations;
StiggClient client = new();
IntegrationLinkParams parameters = new()
{
ID = "x",
IDValue = "id",
SyncedEntityID = "syncedEntityId",
VendorIdentifier = IntegrationLinkParamsVendorIdentifier.Stripe,
};
var customerIntegrationResponse = await client.V1.Customers.Integrations.Link(parameters);
Console.WriteLine(customerIntegrationResponse);stigg v1:customers:integrations link \
--api-key 'My API Key' \
--id x \
--id id \
--synced-entity-id syncedEntityId \
--vendor-identifier STRIPEcurl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/integrations \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"id": "<string>",
"syncedEntityId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/customers/{id}/integrations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'syncedEntityId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "<string>",
"vendorIdentifier": "STRIPE",
"syncedEntityId": "<string>",
"syncData": {
"billingId": "<string>",
"billingLinkUrl": "<string>",
"priceGroupPackageBillingId": "<string>"
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Customer Integrations
Link customer integration
Links a customer to an external integration by specifying the vendor and external entity ID.
POST
/
api
/
v1
/
customers
/
{id}
/
integrations
JavaScript
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const customerIntegrationResponse = await client.v1.customers.integrations.link('x', {
id: 'id',
syncedEntityId: 'syncedEntityId',
vendorIdentifier: 'STRIPE',
});
console.log(customerIntegrationResponse.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
customer_integration_response = client.v1.customers.integrations.link(
path_id="x",
body_id="id",
synced_entity_id="syncedEntityId",
vendor_identifier="STRIPE",
)
print(customer_integration_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
customerIntegrationResponse, err := client.V1.Customers.Integrations.Link(
context.TODO(),
"x",
stigg.V1CustomerIntegrationLinkParams{
ID: "id",
SyncedEntityID: "syncedEntityId",
VendorIdentifier: stigg.V1CustomerIntegrationLinkParamsVendorIdentifierStripe,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerIntegrationResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.customers.CustomerIntegrationResponse;
import io.stigg.models.v1.customers.integrations.IntegrationLinkParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
IntegrationLinkParams params = IntegrationLinkParams.builder()
.pathId("x")
.bodyId("id")
.syncedEntityId("syncedEntityId")
.vendorIdentifier(IntegrationLinkParams.VendorIdentifier.STRIPE)
.build();
CustomerIntegrationResponse customerIntegrationResponse = client.v1().customers().integrations().link(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
customer_integration_response = stigg.v1.customers.integrations.link(
"x",
body_id: "id",
synced_entity_id: "syncedEntityId",
vendor_identifier: :STRIPE
)
puts(customer_integration_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Customers.Integrations;
StiggClient client = new();
IntegrationLinkParams parameters = new()
{
ID = "x",
IDValue = "id",
SyncedEntityID = "syncedEntityId",
VendorIdentifier = IntegrationLinkParamsVendorIdentifier.Stripe,
};
var customerIntegrationResponse = await client.V1.Customers.Integrations.Link(parameters);
Console.WriteLine(customerIntegrationResponse);stigg v1:customers:integrations link \
--api-key 'My API Key' \
--id x \
--id id \
--synced-entity-id syncedEntityId \
--vendor-identifier STRIPEcurl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/integrations \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"id": "<string>",
"syncedEntityId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/customers/{id}/integrations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'syncedEntityId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "<string>",
"vendorIdentifier": "STRIPE",
"syncedEntityId": "<string>",
"syncData": {
"billingId": "<string>",
"billingLinkUrl": "<string>",
"priceGroupPackageBillingId": "<string>"
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Headers
Body
application/json
Links a customer to an integration, specifying which external entity (e.g. Stripe customer ID) the customer maps to. syncedEntityId is required on creation, though the same field can read back as null on other integration links that have not yet synced.
Response
The created customer integration object.