Skip to content

POS refunds and Flow actions are live7-day free trial

Install CreditsYard (opens the Shopify App Store)

Custom API

Read balances and add or deduct store credit from your own systems with the CreditsYard REST API.

2 min read · Updated December 4, 2026

Open in CreditsYard

Use the API to connect CreditsYard to your ERP, an in-store system, a loyalty program or your own scripts.

Get your API key

  1. In CreditsYard, go to Integrations › Custom API.
  2. Copy your API key. Click View documentation for the full reference with examples.
The Custom API page with the shop domain and API key
The Custom API page with the shop domain and API key

Make a request

  • Base URL: https://creditsyard.com/api/common
  • Send your key in the X-Shop-Api-Key header with every request.
  • Send JSON with Content-Type: application/json.
  • Find customers by Shopify customer_id, or by customer_email.

This adds $10 to a customer and emails them:

curl -X POST "https://creditsyard.com/api/common/credits/adjust" \
  -H "X-Shop-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_email": "maya.lopez@example.com", "amount": 10, "reason": "Thanks for your review", "send_email_notification": true}'

Endpoints

Endpoint What it does
GET /validate Checks that your API key works.
POST /credits/adjust Adds or deducts credit. amount is positive to add, negative to deduct. Optional: reason, send_email_notification, customer_name.
POST /customers/balance/update Sets the balance to an exact balance. CreditsYard records the difference as one change.
GET /customers/get One customer's balance, tags and credit activity. Add skip_activity=1 for the balance only.
GET /customers/index Customers with credit activity, page by page. Optional: start_date, end_date, page, limit (page size, default 10, max 250), after_id (return the customers after this id; each response gives pagination.next_after_id for the next call — the fastest way to read every customer).
POST /customers/update Updates a customer's name, tags and personal limits (custom_shipping_value, custom_tax_value, custom_expiration_days).
GET /credits/transactions Every credit change, newest first. Optional: start_date, end_date (Y-m-d), limit (up to 10000), page.
GET /orders/get Credit used and earned on an order. Needs order_id.

Good to know

  • Keep the API key on your server. Anyone with it can change your customers' balances.
  • A customer that isn't in CreditsYard yet is created when you add credit to them.
  • Errors come back with an errors object that names the field, for example a missing amount.
  • API changes count under Flow & API in Reports, and update Shopify and Klaviyo like any other change.
  • Most limits need no code: check Limits, tax and shipping first.
Was this guide helpful?