Skip to main content
PUT
/
v1
/
aggregators
/
{raast-aggregator-id}
/
merchants
/
{aggregator-merchant-id}
Update Merchant
curl --request PUT \
  --url https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id} \
  --header 'Content-Type: application/json' \
  --header 'X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>' \
  --data '
{
  "name": "NSH merchant",
  "enabled": true,
  "iban": "PK85HABB0002157901170103",
  "rate_card": {
    "ratecard_kind": "RateCardKind_fixed",
    "variable_rate": 0.0215,
    "fixed_rate": 2900,
    "tax_rate": 0.1,
    "tax_region": "Punjab",
    "sales_tax_withholding": 0.1,
    "income_tax_withholding": 0.02
  }
}
'
import requests

url = "https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}"

payload = {
"name": "NSH merchant",
"enabled": True,
"iban": "PK85HABB0002157901170103",
"rate_card": {
"ratecard_kind": "RateCardKind_fixed",
"variable_rate": 0.0215,
"fixed_rate": 2900,
"tax_rate": 0.1,
"tax_region": "Punjab",
"sales_tax_withholding": 0.1,
"income_tax_withholding": 0.02
}
}
headers = {
"X-SFPY-AGGREGATOR-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {
'X-SFPY-AGGREGATOR-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'NSH merchant',
enabled: true,
iban: 'PK85HABB0002157901170103',
rate_card: {
ratecard_kind: 'RateCardKind_fixed',
variable_rate: 0.0215,
fixed_rate: 2900,
tax_rate: 0.1,
tax_region: 'Punjab',
sales_tax_withholding: 0.1,
income_tax_withholding: 0.02
}
})
};

fetch('https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}', 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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}",
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([
'name' => 'NSH merchant',
'enabled' => true,
'iban' => 'PK85HABB0002157901170103',
'rate_card' => [
'ratecard_kind' => 'RateCardKind_fixed',
'variable_rate' => 0.0215,
'fixed_rate' => 2900,
'tax_rate' => 0.1,
'tax_region' => 'Punjab',
'sales_tax_withholding' => 0.1,
'income_tax_withholding' => 0.02
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>"
],
]);

$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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}"

payload := strings.NewReader("{\n \"name\": \"NSH merchant\",\n \"enabled\": true,\n \"iban\": \"PK85HABB0002157901170103\",\n \"rate_card\": {\n \"ratecard_kind\": \"RateCardKind_fixed\",\n \"variable_rate\": 0.0215,\n \"fixed_rate\": 2900,\n \"tax_rate\": 0.1,\n \"tax_region\": \"Punjab\",\n \"sales_tax_withholding\": 0.1,\n \"income_tax_withholding\": 0.02\n }\n}")

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

req.Header.Add("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}")
.header("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"NSH merchant\",\n \"enabled\": true,\n \"iban\": \"PK85HABB0002157901170103\",\n \"rate_card\": {\n \"ratecard_kind\": \"RateCardKind_fixed\",\n \"variable_rate\": 0.0215,\n \"fixed_rate\": 2900,\n \"tax_rate\": 0.1,\n \"tax_region\": \"Punjab\",\n \"sales_tax_withholding\": 0.1,\n \"income_tax_withholding\": 0.02\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/merchants/{aggregator-merchant-id}")

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

request = Net::HTTP::Put.new(url)
request["X-SFPY-AGGREGATOR-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"NSH merchant\",\n \"enabled\": true,\n \"iban\": \"PK85HABB0002157901170103\",\n \"rate_card\": {\n \"ratecard_kind\": \"RateCardKind_fixed\",\n \"variable_rate\": 0.0215,\n \"fixed_rate\": 2900,\n \"tax_rate\": 0.1,\n \"tax_region\": \"Punjab\",\n \"sales_tax_withholding\": 0.1,\n \"income_tax_withholding\": 0.02\n }\n}"

response = http.request(request)
puts response.read_body
{
  "api_version": "v1",
  "data": {
    "id": "4",
    "token": "am_749fe6ce-91f9-4f6a-9df2-ec6ae9f75a30",
    "name": "Lazer Sports",
    "aggregator_id": "agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e",
    "merchant_id": "mer_dd0aa205-5b38-4691-bf1e-d30524c5be97",
    "merchant_external_id": "sec_0e84768c-048e-4946-9066-ea199fec7722",
    "bank_account_id": "acc_c03a57cb-a616-42a7-b1dc-de473217a558",
    "enabled": true,
    "created_at": "2025-03-13T09:13:25Z",
    "updated_at": "2025-06-03T11:44:56Z",
    "raast_merchant": {
      "id": "4",
      "token": "mer_dd0aa205-5b38-4691-bf1e-d30524c5be97",
      "partner_id": "partner_ed4f0480-36c8-4a5a-8cd4-381bc4d83f2c",
      "raast_record_id": "478619",
      "status": "Inactive",
      "uid_type": "NTN",
      "uid_value": "4220111082020",
      "name": "Lazer Sports",
      "document_type": "NTN",
      "document_number": "4220111082026",
      "address_details": {
        "country": "PK",
        "city": "Karachi",
        "state_province_region": "Sindh",
        "address_line": "Federal.B. Area"
      },
      "contact_details": {
        "mobile_number": "+923001234926",
        "email": "testingbyHas@gesafepay.com"
      },
      "additional_details": {
        "dba": "The best business 001",
        "mcc": "5633",
        "lat": "",
        "long": ""
      },
      "additional_details_private": {},
      "created_at": "2025-03-13T09:13:23Z",
      "updated_at": "2025-06-03T11:44:56Z"
    },
    "rate_card": {
      "id": "23",
      "token": "mrc_50f44cfa-7fc4-4111-82db-84233aeb7d04",
      "aggregator_merchant_id": "am_749fe6ce-91f9-4f6a-9df2-ec6ae9f75a30",
      "connector_id": "conn_c05caf8c-1f8d-4e58-bcfd-833531500693",
      "rate_card_id": "rc_4a61062c-c3a7-4dee-8199-f122eb9d90d3",
      "ratecard_kind": "RateCardKind_fixed",
      "created_at": "2025-03-13T09:13:23Z",
      "updated_at": "2025-06-03T11:44:57Z",
      "fixed_rate": "40000",
      "tax_rate": 0,
      "tax_region": ""
    }
  }
}
{
"code": "error.bad_request",
"message": "Invalid request parameters"
}
{
"code": "error.not_found",
"message": "Requested resource not found"
}
{
"code": "error.conflict",
"message": "Resource already exists"
}
{
"api_version": "v1",
"error": {
"code": "error.internal_server_error",
"message": "rpc error code Internal desc = something went wrong"
}
}

Authorizations

X-SFPY-AGGREGATOR-SECRET-KEY
string
header
required

Path Parameters

raast-aggregator-id
string
required

The unique identifier for the aggregator

Example:

"agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e"

aggregator-merchant-id
string
required

The unique identifier for the merchant

Example:

"am_be454a50-7612-4dc6-a97e-284ebbe7ae93"

Body

application/json

Request to update an existing aggregator merchant

Fields that can be modified for an existing aggregator merchant

name
string

Merchant display name

enabled
boolean

Indicates whether the merchant should be active for Raast payments

iban
string

Settlement IBAN used for Raast payouts

rate_card
object

Rate configuration Safepay applies to the merchant's Raast transactions

Response

This response contains details of a merchant

Standard response structure for successful operations

api_version
string

The current version of the API spec

Example:

"v1"

data
object

Merchant resource created under an aggregator for Raast transactions