Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.paymentMethods.setBalance({
enabled: true,
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->paymentMethods->setBalance([
'enabled' => true,
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.paymentMethods.setBalance(enabled=True)
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance"
payload := strings.NewReader("{\n \"enabled\": true\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.shoply.gg/v1/stores/{storeId}/payment-methods/balance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance")
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 \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": [
{
"provider": "nowpayments",
"name": "NOWPayments",
"kind": "crypto",
"blurb": "Accept crypto through your NOWPayments account. Payouts go to your wallet. NOWPayments charges its own fee of 0.5% to 1%.",
"tagline": "Accept crypto at checkout, paid out to your own wallet.",
"accent": "#64acff",
"site": "https://account.nowpayments.io/",
"callbackUrl": "http://localhost:8000/api/payments/nowpayments/callback/743d82fb-6aad-44bb-ab00-d54c4b0eecb7",
"returnOrigin": "",
"originHint": "",
"callbackHint": "",
"copies": [],
"authorizeUrl": "",
"connected": false,
"enabled": false,
"usable": false,
"ready": false,
"testMode": false,
"modes": [],
"mode": "",
"label": "",
"buyerLabel": "Cryptocurrency (NOWPayments)",
"defaultLabel": "Cryptocurrency (NOWPayments)",
"fields": [
{
"name": "api_key",
"label": "API Key",
"placeholder": "XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX",
"required": true,
"max": 255,
"secret": true,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
},
{
"name": "ipn_secret",
"label": "IPN Secret Key",
"placeholder": "",
"required": true,
"max": 255,
"secret": true,
"showCallback": true,
"mode": "",
"isSet": false,
"value": ""
}
],
"toggles": [
{
"name": "require_billing",
"label": "Require Billing Information",
"hint": "Ask crypto buyers for their name and address at checkout.",
"group": "",
"needs": "",
"on": false
}
],
"unpaidHours": null,
"updatedAt": null
},
{
"provider": "stripe",
"name": "Stripe",
"kind": "fiat",
"blurb": "Accept cards through your Stripe account. iDEAL and Bancontact also appear on orders priced in euros.",
"tagline": "Accept cards on your checkout, paid into your Stripe account.",
"accent": "#635bff",
"site": "https://dashboard.stripe.com/apikeys",
"callbackUrl": "http://localhost:8000/api/payments/stripe/callback/743d82fb-6aad-44bb-ab00-d54c4b0eecb7",
"returnOrigin": "",
"originHint": "",
"callbackHint": "",
"copies": [],
"authorizeUrl": "",
"connected": false,
"enabled": false,
"usable": false,
"ready": false,
"testMode": false,
"modes": [],
"mode": "",
"label": "",
"buyerLabel": "Credit/Debit Card (Stripe)",
"defaultLabel": "Credit/Debit Card (Stripe)",
"fields": [
{
"name": "secret_key",
"label": "Secret Key",
"placeholder": "sk_live_... or rk_live_...",
"required": true,
"max": 255,
"secret": true,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
},
{
"name": "publishable_key",
"label": "Publishable Key",
"placeholder": "pk_live_...",
"required": true,
"max": 255,
"secret": false,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
}
],
"toggles": [
{
"name": "require_billing",
"label": "Require Billing Information",
"hint": "Ask card buyers for their name and billing address at checkout.",
"group": "",
"needs": "",
"on": false
}
],
"unpaidHours": null,
"updatedAt": null
}
],
"meta": {
"order": [],
"balance": {
"enabled": true,
"holders": 0
},
"unpaid": {
"hours": 24,
"presets": [
1,
2
],
"least": 1,
"most": 336
},
"routing": {
"providers": []
}
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Payment methods
Switch paying with balance on or off
Whether the checkout offers buyers their balance at the store. Answers the list again.
Needs the payments.write permission (Change Payment Methods).
PUT
/
stores
/
{storeId}
/
payment-methods
/
balance
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.paymentMethods.setBalance({
enabled: true,
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->paymentMethods->setBalance([
'enabled' => true,
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.paymentMethods.setBalance(enabled=True)
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance"
payload := strings.NewReader("{\n \"enabled\": true\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.shoply.gg/v1/stores/{storeId}/payment-methods/balance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/payment-methods/balance")
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 \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": [
{
"provider": "nowpayments",
"name": "NOWPayments",
"kind": "crypto",
"blurb": "Accept crypto through your NOWPayments account. Payouts go to your wallet. NOWPayments charges its own fee of 0.5% to 1%.",
"tagline": "Accept crypto at checkout, paid out to your own wallet.",
"accent": "#64acff",
"site": "https://account.nowpayments.io/",
"callbackUrl": "http://localhost:8000/api/payments/nowpayments/callback/743d82fb-6aad-44bb-ab00-d54c4b0eecb7",
"returnOrigin": "",
"originHint": "",
"callbackHint": "",
"copies": [],
"authorizeUrl": "",
"connected": false,
"enabled": false,
"usable": false,
"ready": false,
"testMode": false,
"modes": [],
"mode": "",
"label": "",
"buyerLabel": "Cryptocurrency (NOWPayments)",
"defaultLabel": "Cryptocurrency (NOWPayments)",
"fields": [
{
"name": "api_key",
"label": "API Key",
"placeholder": "XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX",
"required": true,
"max": 255,
"secret": true,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
},
{
"name": "ipn_secret",
"label": "IPN Secret Key",
"placeholder": "",
"required": true,
"max": 255,
"secret": true,
"showCallback": true,
"mode": "",
"isSet": false,
"value": ""
}
],
"toggles": [
{
"name": "require_billing",
"label": "Require Billing Information",
"hint": "Ask crypto buyers for their name and address at checkout.",
"group": "",
"needs": "",
"on": false
}
],
"unpaidHours": null,
"updatedAt": null
},
{
"provider": "stripe",
"name": "Stripe",
"kind": "fiat",
"blurb": "Accept cards through your Stripe account. iDEAL and Bancontact also appear on orders priced in euros.",
"tagline": "Accept cards on your checkout, paid into your Stripe account.",
"accent": "#635bff",
"site": "https://dashboard.stripe.com/apikeys",
"callbackUrl": "http://localhost:8000/api/payments/stripe/callback/743d82fb-6aad-44bb-ab00-d54c4b0eecb7",
"returnOrigin": "",
"originHint": "",
"callbackHint": "",
"copies": [],
"authorizeUrl": "",
"connected": false,
"enabled": false,
"usable": false,
"ready": false,
"testMode": false,
"modes": [],
"mode": "",
"label": "",
"buyerLabel": "Credit/Debit Card (Stripe)",
"defaultLabel": "Credit/Debit Card (Stripe)",
"fields": [
{
"name": "secret_key",
"label": "Secret Key",
"placeholder": "sk_live_... or rk_live_...",
"required": true,
"max": 255,
"secret": true,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
},
{
"name": "publishable_key",
"label": "Publishable Key",
"placeholder": "pk_live_...",
"required": true,
"max": 255,
"secret": false,
"showCallback": false,
"mode": "",
"isSet": false,
"value": ""
}
],
"toggles": [
{
"name": "require_billing",
"label": "Require Billing Information",
"hint": "Ask card buyers for their name and billing address at checkout.",
"group": "",
"needs": "",
"on": false
}
],
"unpaidHours": null,
"updatedAt": null
}
],
"meta": {
"order": [],
"balance": {
"enabled": true,
"holders": 0
},
"unpaid": {
"hours": 24,
"presets": [
1,
2
],
"least": 1,
"most": 336
},
"routing": {
"providers": []
}
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
Body
application/json
Whether buyers may pay with their balance.

