Ramp: Create a mileage reimbursement
Ramp reimbursement.postMileageReimbursementResource: arguments, response, policy and SDK examples.
← Reimbursement operations · Get started
Operation ramp.post_mileage_reimbursement_resource
Provider route: POST /developer/v1/reimbursements/mileage. 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["reimbursement"]["postMileageReimbursementResource"]>[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.reimbursement.postMileageReimbursementResource(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.reimbursement.post_mileage_reimbursement_resource(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create a mileage reimbursement — request body — body |
Referenced models: Create a mileage reimbursement — request body — body
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 reimbursement — response body |
Referenced models: Fetch a reimbursement — response body
Schemas
Section titled “Schemas”4 more schemas are linked from the tables above, on the schema pages.
Create a mileage reimbursement — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
distance | JSON | Required within parent | |
distance (oneOf 1) | string | Alternative | Format: decimal |
distance (oneOf 2) | number | Alternative | |
distance_units | string | Optional | One of: KILOMETERS, MILES |
end_location | string | Optional | |
memo | string | Optional | |
reimbursee_id | string | Required within parent | Format: uuid |
spend_allocation_id | JSON | Optional | |
spend_allocation_id (anyOf 1) | string | Alternative | Unique identifier of the fund to attribute the mileage reimbursement to Format: uuid |
spend_allocation_id (anyOf 2) | null | Alternative | |
start_location | string | Optional | |
trip_date | string | Required within parent | Format: date |
waypoints | array | Optional | |
waypoints[] | string | Each item |
Fetch a transaction — response body — attendees item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
name | string | Required within parent | Full name of the attendee |
user_id | JSON | Required within parent | |
user_id (anyOf 1) | string | Alternative | User ID of the attendee, if linked to a Ramp user. Missing if the attendee is not a Ramp user Format: uuid |
user_id (anyOf 2) | null | Alternative |
Fetch a reimbursement — response body — trace id
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
descriptor | JSON | Required within parent | |
descriptor (anyOf 1) | string | Alternative | Human-readable description of the bank reference. For example, 'Trace ID', 'IMAD number', or 'Reference number'. Default: null |
descriptor (anyOf 2) | null | Alternative | |
trace_id | JSON | Required within parent | |
trace_id (anyOf 1) | string | Alternative | The bank-facing accountability reference for the reimbursement payment. Default: null |
trace_id (anyOf 2) | null | Alternative |
Fetch a transaction — response body — external approval
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An approval step awaiting a decision from an external approver. |
approval_trigger_instance_uuid | string | Required within parent | Identifier of the external approval step awaiting a decision. Format: uuid |
service_key | string | Required within parent | Service key of the external approver. |
Fetch a payment — response body — amount
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
currency | string | Required within parent | The currency of the amount in ISO 4217 format (e.g. USD). Known values: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNH, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, EURC, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, OPEN_USD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDB, USDC, USDG, USDT, USN, UYI, UYU, UYW, UZS, VED, VES, VND, VUV, WST, XAD, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XCG, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWG, ZWL |
value | JSON | Required within parent | |
value (anyOf 1) | integer | Alternative | The non-negative amount in the smallest denomination of the currency (e.g. cents for USD). Minimum: 0 |
value (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Fetch a reimbursement — response body — accounting field selections item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
category_info | JSON | Required within parent | |
category_info (anyOf 1) | Model | Alternative | Expand Fetch a reimbursement — response body — accounting field selections item category info external id, id, name, type Information about the parent accounting category. |
category_info (anyOf 2) | null | Alternative | |
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 | Required within parent | |
external_code (anyOf 1) | string | Alternative | External code displayed in the ERP for this option. |
external_code (anyOf 2) | null | Alternative | |
external_id | JSON | Required within parent | |
external_id (anyOf 1) | string | Alternative | External ID that uniquely identifies this option in the ERP. |
external_id (anyOf 2) | null | Alternative | |
id | JSON | Required within parent | |
id (anyOf 1) | string | Alternative | Unique identifier for this option within Ramp. |
id (anyOf 2) | null | Alternative | |
name | JSON | Required within parent | |
name (anyOf 1) | string | Alternative | Name of the accounting field option. |
name (anyOf 2) | null | Alternative | |
provider_name | JSON | Required within parent | |
provider_name (anyOf 1) | string | Alternative | Name of accounting field provider Read only: true |
provider_name (anyOf 2) | null | Alternative | |
source | JSON | Required within parent | |
source (anyOf 1) | Model | Alternative | Expand Fetch a transaction — response body — accounting field selections item source Source of this accounting coding selection. |
source (anyOf 2) | null | Alternative | |
type | JSON | Required within parent | |
type (anyOf 1) | string | Alternative | Type of accounting field. 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 |
type (anyOf 2) | null | Alternative |
Referenced models: Fetch a transaction — response body — accounting field selections item source, Fetch a reimbursement — response body — accounting field selections item category info external id, id, name, type
Fetch a reimbursement — response body — entity amount currency, minor unit conversion rate, value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
currency | string | Required within parent | The currency of the amount in ISO 4217 format (e.g. USD). Known values: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNH, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, EURC, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, OPEN_USD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDB, USDC, USDG, USDT, USN, UYI, UYU, UYW, UZS, VED, VES, VND, VUV, WST, XAD, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XCG, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWG, ZWL |
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 `value` 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 | |
value | JSON | Required within parent | |
value (anyOf 1) | integer | Alternative | The non-negative amount in the smallest denomination of the currency (e.g. cents for USD). Minimum: 0 |
value (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Fetch a reimbursement — response body — line items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accounting_field_selections | array | Required within parent | Accounting field selections used to code this line item. |
accounting_field_selections[] | Model | Each item | Expand Fetch a reimbursement — response body — accounting field selections item |
amount | JSON | Required within parent | |
amount (anyOf 1) | Model | Alternative | Expand Hold Bill — response body — amount Amount of the line item. |
amount (anyOf 2) | null | Alternative | |
memo | JSON | Required within parent | |
memo (anyOf 1) | string | Alternative | Memo text for this line item. |
memo (anyOf 2) | null | Alternative |
Referenced models: Fetch a reimbursement — response body — accounting field selections item, Hold Bill — response body — amount
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.post_mileage_reimbursement_resource. Catalog operation: post_mileage_reimbursement_resource. 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: ["reimbursements:write"]