creditExposure
Requires at least one of the permissions customers:customer:read, purchase:purchase_order:read, sales:sales_order:read or suppliers:supplier:read.
Read-only credit exposure for one partner. Use side SALES for a customer's receivables or PURCHASE for a supplier's payables; any other value reads as SALES. SALES needs the customer read or sales order read permission and the customer must be in your scope; PURCHASE needs the supplier read or purchase order read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query CreditExposure($partnerId: ID!) {
creditExposure(partnerId: $partnerId) {
baseCurrency
currentExposure
enabled
headroom
invoiceExposure
limit
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CreditExposure($partnerId: ID!) {\n creditExposure(partnerId: $partnerId) {\n baseCurrency\n currentExposure\n enabled\n headroom\n invoiceExposure\n limit\n }\n}",
"variables": {
"partnerId": "id"
}
}
EOF
Variables:
{
"partnerId": "id"
}
Response:
{
"data": {
"creditExposure": {
"baseCurrency": "string",
"currentExposure": 0,
"enabled": true,
"headroom": 0,
"invoiceExposure": 0,
"limit": 0
}
}
}
creditExposure(
partnerId: ID!
side: String
): CreditExposureResult!
Arguments
creditExposure.partnerId ● ID! non-null scalar
The ID of the partner.
creditExposure.side ● String scalar
SALES (customer receivables) or PURCHASE (supplier payables). Defaults to SALES.
Type
CreditExposureResult object
A customer's credit exposure: what they owe, what is committed, and the headroom left under their credit limit.