Ramp: List all vendor credits for all vendors of a business
Ramp vendor.getAllVendorCreditsList: arguments, response, policy and SDK examples.
← Vendor operations · Get started
Operation ramp.get_all_vendor_credits_list
Provider route: GET /developer/v1/vendors/credits. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/ramp with npm, or alter-sdk-ramp with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { RampIntegration } from "@alter-ai/ramp";
async function execute(input: Parameters<RampIntegration["vendor"]["getAllVendorCreditsList"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new RampIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.vendor.getAllVendorCreditsList(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_ramp import RampIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = RampIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.vendor.get_all_vendor_credits_list(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | Model | Optional | Expand List vendor credits by vendor — request body — query |
Referenced models: List vendor credits by vendor — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List vendor credits by vendor — response body |
Referenced models: List vendor credits by vendor — response body
Schemas
Section titled “Schemas”4 more schemas are linked from the tables above, on the schema pages.
List vendor credits by vendor — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | Resources returned in this page. |
data[] | array | Each item | |
data[][] | Model | Each item | Expand Fetch a vendor credit — response body |
page | Model | Required within parent | Expand List bills — response body — page Pagination details for this response. |
Referenced models: List bills — response body — page, Fetch a vendor credit — response body
List vendor credits by vendor — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
entity_id | JSON | Optional | |
entity_id (anyOf 1) | string | Alternative | Default: null Format: uuid |
entity_id (anyOf 2) | null | Alternative | |
from_created_at | JSON | Optional | |
from_created_at (anyOf 1) | string | Alternative | Default: null Format: date-time |
from_created_at (anyOf 2) | null | Alternative | |
to_created_at | JSON | Optional | |
to_created_at (anyOf 1) | string | Alternative | Default: null Format: date-time |
to_created_at (anyOf 2) | null | Alternative | |
from_accounting_date | JSON | Optional | |
from_accounting_date (anyOf 1) | string | Alternative | Default: null Format: date |
from_accounting_date (anyOf 2) | null | Alternative | |
to_accounting_date | JSON | Optional | |
to_accounting_date (anyOf 1) | string | Alternative | Default: null Format: date |
to_accounting_date (anyOf 2) | null | Alternative | |
include_fully_used | boolean | Optional | Default: false |
is_archived | boolean | Optional | Default: false |
start | string | Optional | |
page_size | integer | Optional | Default: 20 |
List bills — response body — page
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Pagination details for a Developer API response. |
next | JSON | Required within parent | |
next (anyOf 1) | string | Alternative | the query to get to the next page; it is in the format of <BASE_URL>?<new_params> |
next (anyOf 2) | null | Alternative |
Fetch a vendor credit — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accounting_date | string | Required within parent | Accounting date of the vendor credit Format: date |
accounting_field_selections | array | Required within parent | List of accounting field selections associated with this vendor credit Read only: true |
accounting_field_selections[] | Model | Each item | Expand Hold Bill — response body — accounting field selections item |
applied_bills | array | Required within parent | Bills that this Vendor Credit has been applied to. A Vendor Credit can be applied to multiple Bills Read only: true |
applied_bills[] | Model | Each item | Expand Fetch a vendor credit — response body — applied bills item |
applied_draft_bills | array | Required within parent | Draft Bills that this Vendor Credit has been applied to. A Vendor Credit can be applied to multiple Draft Bills Read only: true |
applied_draft_bills[] | Model | Each item | Expand Fetch a vendor credit — response body — applied bills item |
archived_at | JSON | Required within parent | |
archived_at (anyOf 1) | string | Alternative | The datetime the vendor credit was archived. Null for active credits. Archived credits cannot be applied to bills, even when remaining_amount is positive. Format: date-time |
archived_at (anyOf 2) | null | Alternative | |
created_at | JSON | Required within parent | |
created_at (anyOf 1) | string | Alternative | Date and time when the vendor credit was created Format: date-time |
created_at (anyOf 2) | null | Alternative | |
entity_id | JSON | Required within parent | |
entity_id (anyOf 1) | string | Alternative | UUID of the business entity associated with this vendor credit Format: uuid |
entity_id (anyOf 2) | null | Alternative | |
expense_line_items | array | Required within parent | Expense line items of the vendor credit. Expense line items contain an overall amount. |
expense_line_items[] | Model | Each item | Expand Fetch a vendor credit — response body — expense line items item |
id | string | Required within parent | Unique identifier for the vendor credit |
inventory_line_items | array | Required within parent | Inventory line items of the vendor credit. Inventory line items are tied to a particular good or service. |
inventory_line_items[] | Model | Each item | Expand Fetch a vendor credit — response body — inventory line items item |
reference_bill_id | JSON | Required within parent | |
reference_bill_id (anyOf 1) | string | Alternative | UUID of the bill that was the origin of this vendor credit, if any Format: uuid |
reference_bill_id (anyOf 2) | null | Alternative | |
reference_number | JSON | Required within parent | |
reference_number (anyOf 1) | string | Alternative | Reference number from the vendor credit memo |
reference_number (anyOf 2) | null | Alternative | |
remaining_amount | Model | Required within parent | Expand Hold Bill — response body — amount Unapplied amount, equal to total_amount minus total_applied_amount. This amount is retained for archived credits and does not indicate eligibility to apply the credit. Credits with a non-null archived_at cannot be applied. Denominated in the Vendor Credit's currency. Read only: true |
total_amount | Model | Required within parent | Expand Hold Bill — response body — amount Total amount of the vendor credit, sum of all line items, in the Vendor Credit's currency. Read only: true |
total_applied_amount | Model | Required within parent | Expand Hold Bill — response body — amount Total amount that has been applied to bills and/or draft bills, in the Vendor Credit's currency. Read only: true |
vendor_id | string | Required within parent | UUID of the payee associated with this vendor credit Format: uuid |
Referenced models: Hold Bill — response body — accounting field selections item, Hold Bill — response body — amount, Fetch a vendor credit — response body — applied bills item, Fetch a vendor credit — response body — expense line items item, Fetch a vendor credit — response body — inventory line items item
Hold Bill — response body — accounting field selections item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
category_info | Model | Required within parent | Expand Hold Bill — response body — accounting field selections item category info information about the accounting category (or accounting field). |
display_name | JSON | Required within parent | |
display_name (anyOf 1) | string | Alternative | Customer-set display name for the accounting field option in Ramp. When the customer renames an option inside Ramp, this returns the new label while `name` continues to return the ERP-source name. May be null if no Ramp-side override is set. |
display_name (anyOf 2) | null | Alternative | |
external_code | JSON | Optional | |
external_code (anyOf 1) | string | Alternative | external code of accounting field option; Code field displayed on the ERP. |
external_code (anyOf 2) | null | Alternative | |
external_id | string | Required within parent | external id of accounting field option; It should uniquely identify an accounting field option on the client end. |
id | string | Required within parent | ID that uniquely identifies an accounting field option within Ramp |
name | string | Required within parent | name of accounting field option |
provider_name | JSON | Required within parent | |
provider_name (anyOf 1) | string | Alternative | Name of the accounting provider Read only: true |
provider_name (anyOf 2) | null | Alternative |
Referenced models: Hold Bill — response body — accounting field selections item category info
Fetch a vendor credit — response body — applied bills item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | Model | Required within parent | Expand Hold Bill — response body — amount Amount of this Vendor Credit that has been applied to the given bill, in the Vendor Credit's currency. Read only: true |
bill_id | string | Required within parent | UUID of the bill or draft bill that this vendor credit is applied to Format: uuid Read only: true |
Referenced models: Hold Bill — response body — amount
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.get_all_vendor_credits_list. Catalog operation: get_all_vendor_credits_list. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["vendors:read"]