Ramp: Fetch a vendor credit
Ramp vendor.getVendorCreditDetail: arguments, response, policy and SDK examples.
← Vendor operations · Get started
Operation ramp.get_vendor_credit_detail
Provider route: GET /developer/v1/vendors/credits/{vendor_credit_id}. 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"]["getVendorCreditDetail"]>[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.getVendorCreditDetail(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_vendor_credit_detail(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.vendor_credit_id | string | Required within parent | Format: uuid |
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 Fetch a vendor credit — response body |
Referenced models: Fetch a vendor credit — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
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
Hold Bill — response body — amount
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | JSON | Required within parent | |
amount (anyOf 1) | integer | Alternative | the amount of money represented in the smallest denomination of the currency. For example, when the currency is USD, then the amount is expressed in cents. |
amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
currency_code | string | Required within parent | The type of currency, in ISO 4217 format. e.g. USD for US dollars Default: USD |
minor_unit_conversion_rate | JSON | Required within parent | |
minor_unit_conversion_rate (anyOf 1) | JSON | Alternative | |
minor_unit_conversion_rate (anyOf 1) (anyOf 1) | integer | Alternative | The conversion factor to convert from the integer amount to the actual currency value. Divide amount by this value to get the real currency amount. For USD, this is 100 (e.g., 12034 / 100 = 120.34 USD). See https://docs.ramp.com/developer-api/v1/monetary-values for more information. Read only: true |
minor_unit_conversion_rate (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
minor_unit_conversion_rate (anyOf 2) | null | Alternative |
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
Fetch a vendor credit — response body — expense line items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accounting_field_selections | array | Required within parent | List of accounting field options selected to code the line item. |
accounting_field_selections[] | Model | Each item | Expand Hold Bill — response body — accounting field selections item |
amount | Model | Required within parent | Expand Hold Bill — response body — amount Amount of the line item, in the Vendor Credit's currency. Read only: true |
memo | string | Optional | Memo of the line item |
Referenced models: Hold Bill — response body — accounting field selections item, Hold Bill — response body — amount
Hold Bill — response body — accounting field selections item category info
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
external_id | string | Required within parent | external id of accounting field; It should uniquely identify an accounting field on the client end. |
id | string | Required within parent | ID that uniquely identifies an accounting field within Ramp |
name | string | Required within parent | name of accounting field |
type | string | Required within parent | accounting field type Known values: AMORTIZATION_TEMPLATE, BILLABLE, COST_CENTER, CUSTOMERS_JOBS, DEFERRAL_CODE, EXPENSE_ENTITY, GL_ACCOUNT, INVENTORY_ITEM, JOURNAL, MERCHANT, NON_ERP, OTHER, PAYROLL_PROVIDER, PROJECT, REPORTING_TAG, SALES_TAX_CODE, SUBSIDIARY, TAX_CODE, UNIT_OF_MEASURE |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.get_vendor_credit_detail. Catalog operation: get_vendor_credit_detail. 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"]