- Notifications
You must be signed in to change notification settings - Fork1
A wrapper for the Ramp API
NotificationsYou must be signed in to change notification settings
r0aringthunder/ramp-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Accounting
Ex: $ramp->accounting->...
- Accounting Connections
Ex: $ramp->accountingconnections->...
- Bills
Ex: $ramp->bills->...
- Business
Ex: $ramp->business->...
- Card Programs - This is not implemented and instead you should useSpend Programs
- Cards
Ex: $ramp->cards->...
- Cash Backs
Ex: $ramp->cashbacks->...
- Departments
Ex: $ramp->departments->...
- Entities
Ex: $ramp->entities->...
- Leads
Ex: $ramp->leads->...
- Ledger Accounts
Ex: $ramp->ledgeraccounts->...
- Limits
Ex: $ramp->limits->...
- Locations
Ex: $ramp->locations->...
- Memos
Ex: $ramp->memos->...
- Merchants
Ex: $ramp->merchants->...
- Receipt Integrations
Ex: $ramp->receiptintegrations->...
- Receipts
Ex: $ramp->receipts->...
- Reimbursements
Ex: $ramp->reimbursements->...
- Spend Programs
Ex: $ramp->spendprograms->...
- Statements
Ex: $ramp->statements->...
- Transactions
Ex: $ramp->transactions->...
- Transfers
Ex: $ramp->transfers->...
- Users
Ex: $ramp->users->...
- Vendors
Ex: $ramp->vendors->...
php artisan vendor:publish --tag=rampapi-config
<?phpreturn ['client_id' =>env('RAMP_CLIENT_ID','your_client_id'),'client_secret' =>env('RAMP_CLIENT_SECRET','your_client_secret'),'prod_ready' =>env('PROD_READY',false),'scopes' =>env('RAMP_SCOPES','accounting:read accounting:write bills:read business:read cards:read cards:write cashbacks:read departments:read departments:write entities:read leads:read leads:write limits:read limits:write locations:read locations:write memos:read merchants:read receipt_integrations:read receipt_integrations:write receipts:read reimbursements:read spend_programs:read spend_programs:write statements:read transactions:read transfers:read users:read users:write'),];
useR0aringthunder\RampApi\Ramp;publicfunctionrampUsers(){$ramp =newRamp();$users =$ramp->users->listUsers();returnresponse()->json($users);}
useR0aringthunder\RampApi\Ramp;publicfunctionfetchCards(){$ramp =newRamp();$cards =$ramp->cards->listCards();returnresponse()->json($cards['data']);}
useR0aringthunder\RampApi\Ramp;publicfunctionfetchCard(){$ramp =newRamp();$card =$ramp->cards->fetchCard('[CARD ID]');returnresponse()->json($card);}
Important
At the time of implementation the API and Ramp dashbaord take approximately 5 minutes to sync but the API reacts immediately to changes
Important
The only file types accepted by Ramp arepng, webp, heif, pdf, heic, jpg, jpeg
useR0aringthunder\RampApi\Ramp;useIlluminate\Http\Request;publicfunctionuploadReceipt(Request$request){$ramp =newRamp();$file =$request->file('receipts');$path =$file->getRealPath();return$ramp->receipts->upload( ['user_id' =>$request->input('ramp_user_id'),'transaction_id' =>$request->input('ramp_transaction_id'), ],$path );}
Tip
On$path
you can use an uploaded file or a link to a file (Ex. an S3 link)
More exmaples coming...
About
A wrapper for the Ramp API