Skip to main content
PUT
/
v0
/
merchantIntegrations
Upsert
curl --request PUT \
  --url https://api.paygentic.io/v0/merchantIntegrations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "merchantId": "<string>",
  "provider": "salesforce",
  "externalId": "<string>",
  "config": {},
  "metadata": {}
}
'
import requests

url = "https://api.paygentic.io/v0/merchantIntegrations"

payload = {
"merchantId": "<string>",
"provider": "salesforce",
"externalId": "<string>",
"config": {},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
provider: 'salesforce',
externalId: '<string>',
config: {},
metadata: {}
})
};

fetch('https://api.paygentic.io/v0/merchantIntegrations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/merchantIntegrations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'provider' => 'salesforce',
'externalId' => '<string>',
'config' => [

],
'metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.paygentic.io/v0/merchantIntegrations"

payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"provider\": \"salesforce\",\n \"externalId\": \"<string>\",\n \"config\": {},\n \"metadata\": {}\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.paygentic.io/v0/merchantIntegrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"provider\": \"salesforce\",\n \"externalId\": \"<string>\",\n \"config\": {},\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/merchantIntegrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"provider\": \"salesforce\",\n \"externalId\": \"<string>\",\n \"config\": {},\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "object": "merchantIntegration",
  "merchantId": "<string>",
  "provider": "salesforce",
  "externalId": "<string>",
  "config": {},
  "metadata": {},
  "connectedAt": "2023-11-07T05:31:56Z",
  "disconnectedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
merchantId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
provider
enum<string>
required

External provider a merchant can connect at the tenant level

Available options:
salesforce
externalId
string

Ampersand installation id.

Maximum string length: 255
status
enum<string>

Connection lifecycle state. Live Ampersand health is separate and not stored here.

Available options:
active,
disconnected,
error
config
object
metadata
object

Response

Merchant integration upserted

A merchant's tenant-level connection to an external provider via Ampersand.

id
string
required

Unique identifier for a merchant integration

Pattern: ^mint_[a-zA-Z0-9]+$
object
enum<string>
default:merchantIntegration
required
Available options:
merchantIntegration
merchantId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
provider
enum<string>
required

External provider a merchant can connect at the tenant level

Available options:
salesforce
externalId
string | null
required

Ampersand installation id.

status
enum<string>
required

Connection lifecycle state. Live Ampersand health is separate and not stored here.

Available options:
active,
disconnected,
error
config
object
required
metadata
object
required
connectedAt
string<date-time>
required
disconnectedAt
string<date-time> | null
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required