Introducing Starknet Network:   OffRamp and OnRamp USDC are now supported for Starknet network.  View changelog for details →.
Sphere Paysphere
Transfer fee

Create Transfer Fee

POST
/v1/transfer/fee
AuthorizationBearer <token>

In: header

bpsFeestring

Basis point percentage fee.

fixedFee?string

Fixed point fee.

targetCustomerIdstring

The customer's id that the fee will be applied to.

Response Body

curl -X POST "https://api.sandbox.spherepay.co/v1/transfer/fee" \
  -H "Content-Type: application/json" \
  -d '{
    "bpsFee": "20",
    "targetCustomerId": "{{customer_id}}"
  }'
const body = JSON.stringify({
  "bpsFee": "20",
  "targetCustomerId": "{{customer_id}}"
})

fetch("https://api.sandbox.spherepay.co/v1/transfer/fee", {
  body
})
package main

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

func main() {
  url := "https://api.sandbox.spherepay.co/v1/transfer/fee"
  body := strings.NewReader(`{
    "bpsFee": "20",
    "targetCustomerId": "{{customer_id}}"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.sandbox.spherepay.co/v1/transfer/fee"
body = {
  "bpsFee": "20",
  "targetCustomerId": "{{customer_id}}"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
{
  "ok": true,
  "object": "object",
  "statusCode": 200,
  "error": null,
  "message": "success",
  "data": {
    "newTransferFee": {
      "id": "payoutFee_56dd365b206449f89fb626b1b2ea9ae0",
      "setter": "merchant",
      "application": {
        "id": "application_82a87bdbece9407fb861357754e85ac0"
      },
      "targetCustomer": {
        "id": "customer_68f1c089703945e7bbff6f04bf1c5041"
      },
      "payoutType": null,
      "cryptoCurrency": null,
      "fiatCurrency": null,
      "active": true,
      "activeSince": "2025-04-12T17:57:22.609Z",
      "deactivated": null,
      "bpsFee": "20",
      "fixedFee": "0",
      "inheritFixedFees": false,
      "customerType": null,
      "updated": "2025-04-12T17:57:22.656Z",
      "created": "2025-04-12T17:57:22.656Z"
    },
    "deactivatedTransferFee": {
      "id": "payoutFee_cbb956037ef74aefb287cb75438b289d",
      "setter": "merchant",
      "application": {},
      "targetCustomer": {},
      "payoutType": null,
      "cryptoCurrency": null,
      "fiatCurrency": null,
      "active": false,
      "activeSince": "2025-04-09T17:32:00.849Z",
      "deactivated": "2025-04-12T17:57:22.608Z",
      "bpsFee": "20",
      "fixedFee": "0",
      "inheritFixedFees": false,
      "customerType": null,
      "updated": "2025-04-12T17:57:22.640Z",
      "created": "2025-04-09T17:32:00.862Z"
    }
  },
  "ts": "2025-04-12T17:57:22.671Z",
  "request": "request_db4b26c3b5a0414b9032d2f19d8c6796"
}
{
  "ok": false,
  "object": "error",
  "statusCode": 500,
  "error": "transfer/invalid-fee",
  "message": "Fee must be a positive integer. Provided: 20x",
  "data": null,
  "ts": "2025-04-12T17:58:01.809Z",
  "request": "request_1e4f0ee8c2b94244a80e9bf2863255be"
}
{
  "ok": false,
  "object": "error",
  "statusCode": 404,
  "error": "customer/not-found",
  "message": "Customer not found",
  "data": null,
  "ts": "2025-04-12T17:57:38.750Z",
  "request": "request_5d7eea753d7242648a73933f7dcb144f"
}