Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use a standalone Stripe payment to create an invoice in NetSuite with custom data
# Michael Bianco <>
# Description: Use a standalone payment to create an invoice in NetSuite with customized metadata
# Link:
# Usage:
# export STRIPE_KEY=sk_test
# gem install stripe netsuite
# ruby create_standalone_payment_with_custom_metadata.rb
require 'stripe'
Stripe.api_key = ENV['STRIPE_KEY']
currency: 'usd',
amount: 100_00,
source: 'tok_visa',
description: "Order #123 from Fred",
metadata: {
netsuite_product_name: "identifer_of_netsuite_product"
# additional fields on the NetSuite invoice or NetSuite customer payment
# metadata fields can be mapped to whatever NetSuite field (on the invoice or customer payment) you'd like
# drop-downs needs to be specified using a NS internal ID:
netsuite_department_id: 123
netsuite_class_id: 234,
# free form text can just be passed along
netsuite_custom_field_data: "Some data for a custom NetSuite field"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment