List a customer's credit history
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/customer-credit/v1-customer-credit-index.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
GET/
Lists the customer's credit entries, newest first: credit added or taken out by hand, credit used to pay sales orders, sales order payments refunded to credit, Customer Portal payments received into credit and later changes to them, overpayments from online payments moved into credit or refunded from it, credit a refund took back, and credit given back when that refund failed (see type, subtype and action). Together they add up to the customer's wallet_fund. credit_source says where credit came from or went.
This list reads per_page (1 to 100; the team's page size when left out) as well as page.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The customer's id (
idfrom List customers or Create a customer). A hash id from an earlier answer; unique keys and document numbers (such asPO0042) don't work here.- Example
EDhVUaC6jbLbed
- Example
Query parameters
Request body
This operation takes no request body.
Response
200Successful response.
Fields of each item (37)
The specific action that created the entry:
Manual entries:
CUSTOMER_DEPOSIT: credit added by hand (created by this API).CUSTOMER_WITHDRAW: credit taken out by hand (created by this API).CUSTOMER_CREDIT_WITHDRAW: credit used to pay a sales order.CUSTOMER_CREDIT_DEPOSIT: a sales order payment refunded to credit.
System entries:
CUSTOMER_CHECKOUT_FUNDING: a Customer Portal payment received into credit.CUSTOMER_CHECKOUT_<KIND>: an adjustment to a portal payment (such asCUSTOMER_CHECKOUT_REFUND).CUSTOMER_CREDIT_RECOVERY: credit a refund took back.CUSTOMER_CREDIT_RESTORED: credit restored after a failed refund.- Overpayment actions for
CUSTOMER_SPILLED_OVER_*entries.
Positive for credit added, negative for credit taken out. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.Where the credit came from or went: on credit issued from a payment, credit applied to a sales order, and credit a refund or a lost dispute took back or gave back. Null on other entries.
Child fields (5)
The Customer Portal payment's key, when the credit came from one. Null otherwise.
issued: credit issued from a sales order payment.returned: Issue credit took back credit a Customer Portal payment had left on the order.order_deleted_credit: issued credit whose sales order was later deleted.applied: credit applied to a sales order.refund: credit the customer had already spent, owed back after a refund.credit_used_for_refundandcredit_taken_back: credit a refund took back without making the balance negative; nothing is owed.refund_failed: that credit given back because the refund failed.chargeback: taken back by a lost dispute.refund_and_chargeback: taken back by a lost dispute after a refund during it.order_deleted: taken back for a deleted sales order.- One of:
"issued","returned","order_deleted_credit","applied","refund","credit_used_for_refund","credit_taken_back","refund_failed","chargeback","refund_and_chargeback","order_deleted"
- One of:
The sales order's id. Null when no single order is involved, or when the order of an
appliedentry was deleted.That sales order's number, such as
SO1001. Not an id.The payment the credit came from, as YoPrint names it, such as "Stripe payment", "Cash payment" or "Customer credit".
When the entry was made.
Whether the entry added credit or took it out.
- One of:
"INCREASE","DECREASE"
- One of:
The category of the credit entry:
TRANSFER: allMANUALentries.CUSTOMER_CHECKOUT_FUNDING: a Customer Portal payment received into customer credit.CUSTOMER_CHECKOUT_FUNDING_ADJUSTMENT: a later change to a portal payment, such as a refund or lost dispute.CUSTOMER_SPILLED_OVER_GATEWAY_PAYMENT: an online payment overpayment moved into credit.CUSTOMER_SPILLED_OVER_GATEWAY_PAYMENT_REFUND: a refund of an overpayment.CUSTOMER_SPILLED_OVER_GATEWAY_REFUND: an online refund overpayment moved into credit.CUSTOMER_CREDIT_RECOVERY: credit a refund took back.CUSTOMER_CREDIT_RESTORED: credit given back because that refund failed.
- One of:
"TRANSFER","CUSTOMER_CHECKOUT_FUNDING","CUSTOMER_CHECKOUT_FUNDING_ADJUSTMENT","CUSTOMER_SPILLED_OVER_GATEWAY_PAYMENT","CUSTOMER_SPILLED_OVER_GATEWAY_PAYMENT_REFUND","CUSTOMER_SPILLED_OVER_GATEWAY_REFUND","CUSTOMER_CREDIT_RECOVERY","CUSTOMER_CREDIT_RESTORED"
Whether the entry was made by a person or by YoPrint:
MANUAL: credit added or taken out by hand, credit used to pay a sales order, and sales order payments refunded to credit.SYSTEM: entries YoPrint creates automatically, including Customer Portal payments received into credit and their adjustments (such as refunds), online overpayments, and credit recovered or restored.
- One of:
"MANUAL","SYSTEM"
credit_source_payment_idstring | nullThose two kinds only: the id of the sales order payment the credit came from.
currency_isostring | nullCustomer Portal payment entries only: the payment's currency, such as
USD.customer_idstring | nullcustomer_payment_application_idstring | nullcustomer_payment_checkout_idstring | nullCustomer Portal payment entries only: the key of the checkout the payment was made in, or null.
customer_payment_funding_idstring | nullCustomer Portal payment entries only (
CUSTOMER_CHECKOUT_*, and credit applied from such a payment): the payment's key.customer_payment_source_kindstring | nullCustomer Portal payment entries only: what the entry is, for example
fundingfor the payment, the kind of change for an adjustment (such asrefund), orapplicationfor credit applied from it.customer_payment_sourcesarray of objectsCustomer Portal payment entries only: the Customer Portal payments the entry draws on, when it lists them; empty otherwise.
Fields of each item (4)
amountstring | nullA decimal string, such as
"25.00"; parse it as a decimal.currency_isostring | nullcustomer_payment_funding_idstring | nullfunding_transaction_idstring | null
funding_payment_gatewaystring | nullCustomer Portal payment entries only: the payment's provider, as in
payment_gateway.funding_transaction_idstring | nullCustomer Portal payment entries only: the id of the payment's
CUSTOMER_CHECKOUT_FUNDINGentry.has_open_holdbooleanCustomer Portal payment entries only: true while the payment is held, for example by an open dispute, or when YoPrint could not read the payment.
is_deletablebooleanis_editablebooleanis_external_cash_movementbooleanCustomer Portal payment entries only: true when money moved through the provider (the payment and its adjustments), false for credit moved inside YoPrint.
order_idnullAlways null on customer credit entries, also for credit used on or refunded from a sales order.
credit_sourcenames the order where there is one.payment_gatewaystring | nullThe payment provider for entries that moved money through one: for a Customer Portal payment,
STRIPE,PAYPAL,SQUARE_V2,AUTHORIZE_NETorCHARGE_IT_PRO. Null otherwise.payment_method_idstring | nullpayment_noticesarray of objectsCustomer Portal payment entries only: why the payment needs attention, such as
dispute_open,dispute_under_revieworpayment_needs_attention.Fields of each item (3)
codestringcustomer_payment_funding_idstring | nullnext_actionstring | null
Only on a Customer Portal payment refund that has one: the provider's refund reference.
recovery_kindstring | nullCUSTOMER_CREDIT_RECOVERYandCUSTOMER_CREDIT_RESTOREDentries only:credit_consumedwhen unspent credit was taken back,negative_creditwhen spent credit was taken back and the balance went below zero.- One of:
"credit_consumed","negative_credit"
- One of:
reference_descriptionstring | nullreference_idstring | nullYour reference; on a Customer Portal payment adjustment, the payment provider's reference.
refundable_amountinteger | number | stringHow much of it can still be refunded; 0 for credit entries. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.restores_transaction_idstring | nullCUSTOMER_CREDIT_RESTOREDonly: theCUSTOMER_CREDIT_RECOVERYentry it gives back.reversal_transaction_idstring | nullCUSTOMER_CREDIT_RESTOREDonly: the entry that recorded the failed refund.tokenstring | nulluser_idstring | nullWho made it.
voidedboolean
paginationobjectChild fields (6)
Links to the neighbouring pages:
previousandnext, each present only when that page exists. An empty list,[], when there is only one page.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- No live customer with this id: deleted customers are not found here.
error.codeis null anderror.messagenames the record type. - Fix
- Check the id.
422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
per_pageis over 100 or below 1, orpageis below 1.error.codeisvalidation_failed.- Fix
- Send
per_page1 to 100 andpage1 or more.
Related
- POSTAdd or take out customer credit
/v1/ api/ store/ {team_slug}/ customer/ {hash_id}/ credit - GETGet a customer credit entry
/v1/ api/ store/ {team_slug}/ customer/ {hash_id}/ credit/ {id}
