samcart
Module samcart
API
Definitions
ballerinax/samcart Ballerina library
Overview
The SamCart API v1.0.0 connector(https://developer.samcart.com/) OpenAPI specification. SamCart's Public API is used for accessing the data inside your SamCart marketplace.
Key Features
- Programmatic access to create and manage resources via REST API
- Manage user accounts and profiles
- Secure authentication with API key or OAuth support
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create SamCart account
- Obtain tokens following this guide
Quickstart
To use the SamCart connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
Import the ballerinax/samcart module into the Ballerina project.
import ballerinax/samcart;
Step 2: Create a new connector instance
Create a samcart:ApiKeysConfig with the API Key obtained, and initialize the connector with it.
samcart:ApiKeysConfig config = { scApi: "<API_KEY>" } samcart:Client baseClient = check new Client(config);
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to retrieve all products using the connector.
Retrieve all products
public function main() { samcart:InlineResponse2004|error response = baseClient->getProducts(); if (response is samcart:InlineResponse2004) { log:printInfo(response.toString()); } else { log:printError(response.message()); } } -
Use
bal runcommand to compile and run the Ballerina program.
Clients
samcart: Client
This is a generated connector for SamCart API v1.0.0 OpenAPI specification. SamCart's Public API is used for accessing the data inside your SamCart marketplace.
Constructor
Gets invoked to initialize the connector.
The connector initialization requires setting the API credentials.
Create a SamCart account and obtain tokens following this guide.
init (ApiKeysConfig apiKeyConfig, ConnectionConfig config, string serviceUrl)- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.samcart.com/v1" - URL of the target service
getCharges
function getCharges(string? createdAtMin, string? createdAtMax, boolean? testMode, int? offset, int? 'limit, string? dir) returns InlineResponse200|errorRetrieve all charges
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse200|error - Successful operation. Response will return an array of 0 or more charges
getByChargeId
function getByChargeId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns ChargeService|errorRetrieve a charge
Parameters
- id int - The SamCart ID for the charge
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- ChargeService|error - Successful operation
getMultipleRefundsByChargeId
function getMultipleRefundsByChargeId(int id) returns RefundService[]|errorRetrieve all refunds on a charge
Parameters
- id int - The SamCart ID for the charge
Return Type
- RefundService[]|error - Successful operation. Response will return an array of 0 or more refunds
getRefundByChargeId
function getRefundByChargeId(int id, int refundId) returns RefundService|errorRetrieve a refund on a charge
Return Type
- RefundService|error - Successful operation
getCustomers
function getCustomers(string? createdAtMin, string? createdAtMax, int? offset, int? 'limit, string? dir) returns InlineResponse2001|errorRetrieve all customers
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse2001|error - Successful operation. Response will return an array of 0 or more customers
getByCustomerId
function getByCustomerId(int id, string? createdAtMin, string? createdAtMax) returns CustomerService|errorRetrieve a customer
Parameters
- id int - The SamCart ID for the customer
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
Return Type
- CustomerService|error - Successful operation
getAddressesByCustomerId
function getAddressesByCustomerId(int id) returns AddressService[]|errorRetrieve all addresses for a customer
Parameters
- id int - The SamCart ID for the customer
Return Type
- AddressService[]|error - Successful operation. Response will return an array of 0 or more addresses
getChargesByCustomerId
function getChargesByCustomerId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns ChargeService[]|errorRetrieve all charges for a customer
Parameters
- id int - The SamCart ID for the customer
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- ChargeService[]|error - Successful operation. Response will return an array of 0 or more charges
getOrdersByCustomerId
function getOrdersByCustomerId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns OrderService[]|errorRetrieve all orders for a customer
Parameters
- id int - The SamCart ID for the customer
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- OrderService[]|error - Successful operation. Response will return an array of 0 or more orders
getSubscriptionsByCustomerId
function getSubscriptionsByCustomerId(int id, string? createdAtMin, string? createdAtMax, string? rebillingAtMin, string? rebillingAtMax, string? canceledAtMin, string? canceledAtMax, string? status, string? 'type, boolean? testMode) returns SubscriptionService[]|errorRetrieve all subscriptions for a customer
Parameters
- id int - The SamCart ID for the customer
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- rebillingAtMin string? (default ()) - Filter by UTC rebilling date at or after given date
- rebillingAtMax string? (default ()) - Filter by UTC rebilling date at or before given date
- canceledAtMin string? (default ()) - Filter by UTC canceled date at or after given date
- canceledAtMax string? (default ()) - Filter by UTC canceled date at or before given date
- status string? (default ()) - Filter subscriptions by status
- 'type string? (default ()) - Filter subscriptions by type
- testMode boolean? (default ()) - Filter by test mode
Return Type
- SubscriptionService[]|error - Successful operation. Response will return an array of 0 or more subscriptions
getFailedCharges
function getFailedCharges(string? createdAtMin, string? createdAtMax, boolean? testMode, int? offset, int? 'limit, string? dir) returns InlineResponse2002|errorRetrieve all failed charges
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse2002|error - Successful operation. Response will return an array of 0 or more failed charges
getByFailedChargeId
function getByFailedChargeId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns FailedChargeService|errorRetrieve a failed charge
Parameters
- id int - The SamCart ID for the charge
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- FailedChargeService|error - Successful operation
getOrders
function getOrders(string? createdAtMin, string? createdAtMax, boolean? testMode, int? offset, int? 'limit, string? dir) returns InlineResponse2003|errorRetrieve all orders
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse2003|error - Successful operation. Response will return an array of 0 or more orders
getByOrderId
function getByOrderId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns OrderService|errorRetrieve an order
Parameters
- id int - The SamCart ID for the order
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- OrderService|error - Successful operation
getChargesByOrderId
function getChargesByOrderId(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns ChargeService[]|errorRetrieve all charges on an order
Parameters
- id int - The SamCart ID for the order
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- ChargeService[]|error - Successful operation. Response will return an array of 0 or more charges
getCustomerByOrderId
function getCustomerByOrderId(int id) returns CustomerService|errorRetrieve customer on an order
Parameters
- id int - The SamCart ID for the order
Return Type
- CustomerService|error - Successful operation
getSubscriptionsByOrderId
function getSubscriptionsByOrderId(int id, string? createdAtMin, string? createdAtMax, string? rebillingAtMin, string? rebillingAtMax, string? canceledAtMin, string? canceledAtMax, boolean? testMode, string? status, string? 'type) returns SubscriptionService[]|errorRetrieve all subscriptions on an order
Parameters
- id int - The SamCart ID for the order
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- rebillingAtMin string? (default ()) - Filter by UTC rebilling date at or after given date
- rebillingAtMax string? (default ()) - Filter by UTC rebilling date at or before given date
- canceledAtMin string? (default ()) - Filter by UTC canceled date at or after given date
- canceledAtMax string? (default ()) - Filter by UTC canceled date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- status string? (default ()) - Filter subscriptions by status
- 'type string? (default ()) - Filter subscriptions by type
Return Type
- SubscriptionService[]|error - Successful operation. Response will return an array of 0 or more subscriptions
getProducts
function getProducts(string? createdAtMin, string? createdAtMax, string? status, string? productCategory, string? pricingType, int? offset, int? 'limit, string? dir) returns InlineResponse2004|errorRetrieve all products
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- status string? (default ()) - Filter product by status
- productCategory string? (default ()) - Filter product by category
- pricingType string? (default ()) - Filter product by pricing type
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse2004|error - Successful operation. Response will return an array of 0 or more products
getByProductId
function getByProductId(int id, string? createdAtMin, string? createdAtMax, string? status, string? productCategory, string? pricingType) returns ProductService|errorRetrieve a product
Parameters
- id int - The SamCart ID for the product
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- status string? (default ()) - Filter product by status
- productCategory string? (default ()) - Filter product by category
- pricingType string? (default ()) - Filter product by pricing type
Return Type
- ProductService|error - Successful operation
getSubscriptions
function getSubscriptions(string? createdAtMin, string? createdAtMax, string? rebillingAtMin, string? rebillingAtMax, string? canceledAtMin, string? canceledAtMax, boolean? testMode, string? status, string? 'type, int? offset, int? 'limit, string? dir) returns InlineResponse2005|errorRetrieve all subscriptions
Parameters
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- rebillingAtMin string? (default ()) - Filter by UTC rebilling date at or after given date
- rebillingAtMax string? (default ()) - Filter by UTC rebilling date at or before given date
- canceledAtMin string? (default ()) - Filter by UTC canceled date at or after given date
- canceledAtMax string? (default ()) - Filter by UTC canceled date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- status string? (default ()) - Filter subscriptions by status
- 'type string? (default ()) - Filter subscriptions by type
- offset int? (default ()) - The offset value used to paginate through a list of entries. If the dir query parameter is prev then the offset will be the id of the first record of the data set otherwise the offset will be the id of the last record
- 'limit int? (default ()) - An optional limit for the number of entries on a page with a maximum value of 100. Default value is 100 if not provided.
- dir string? (default ()) - The direction to paginate the next set of data. If dir is prev the page will return a data set before the offset otherwise the data set will be after the offset. Default value is next if not provided.
Return Type
- InlineResponse2005|error - Successful operation. Response will return an array of 0 or more subscriptions
getSubscriptionById
function getSubscriptionById(int id, string? createdAtMin, string? createdAtMax, string? rebillingAtMin, string? rebillingAtMax, string? canceledAtMin, string? canceledAtMax, boolean? testMode, string? status, string? 'type) returns SubscriptionService|errorRetrieve a subscription
Parameters
- id int - The SamCart ID for the subscription
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- rebillingAtMin string? (default ()) - Filter by UTC rebilling date at or after given date
- rebillingAtMax string? (default ()) - Filter by UTC rebilling date at or before given date
- canceledAtMin string? (default ()) - Filter by UTC canceled date at or after given date
- canceledAtMax string? (default ()) - Filter by UTC canceled date at or before given date
- testMode boolean? (default ()) - Filter by test mode
- status string? (default ()) - Filter subscriptions by status
- 'type string? (default ()) - Filter subscriptions by type
Return Type
- SubscriptionService|error - Successful operation
getChargesBySubscriptionID
function getChargesBySubscriptionID(int id, string? createdAtMin, string? createdAtMax, boolean? testMode) returns ChargeService[]|errorRetrieve charges on a subscription
Parameters
- id int - The SamCart ID for the subscription
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
- testMode boolean? (default ()) - Filter by test mode
Return Type
- ChargeService[]|error - Successful operation. Response will return an array of 0 or more charges
getCustomerBySubscriptionID
function getCustomerBySubscriptionID(int id) returns CustomerService|errorRetrieve a customer on a subscription
Parameters
- id int - The SamCart ID for the subscription
Return Type
- CustomerService|error - Successful operation
getHistoriesBySubscriptionID
function getHistoriesBySubscriptionID(int id, string? createdAtMin, string? createdAtMax) returns SubscriptionHistoryService[]|errorRetrieve a subscription's history
Parameters
- id int - The SamCart ID for the subscription
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
Return Type
- SubscriptionHistoryService[]|error - Successful operation. Response will return an array of 0 or more history entries
getPlanBySubscriptionID
function getPlanBySubscriptionID(int id, string? createdAtMin, string? createdAtMax) returns SubscriptionPlanService|errorRetrieve a plan for a subscription
Parameters
- id int - The SamCart ID for the subscription
- createdAtMin string? (default ()) - Filter by UTC created at date at or after given date
- createdAtMax string? (default ()) - Filter by UTC created at date at or before given date
Return Type
- SubscriptionPlanService|error - Successful operation
Records
samcart: AddressService
Address
Fields
- 'type? string - The type of address for the customer
- street? string - The street for the customer
- postal_code? string - The postal code for the customer
- city? string - The city name for the customer
- state? string? - The 2-letter state code for US customers. For non-US addresses this value will be null.
- region? string? - The optional sub-divided area of a country for international customers. For US addresses this value will be null.
- country? string - The country for the customer
samcart: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- scApi string - Represents API Key
sc-api
samcart: ChargeService
Charge
Fields
- id? int - The SamCart ID for the charge
- customer_id? int - The SamCart ID for the customer that created the charge
- affiliate_id? int? - The SamCart ID of the affiliate credited for the order
- order_id? int - The SamCart ID for the order. For subscriptions, this will be the order ID of the original purchase
- subscription_rebill_id? int? - The SamCart ID for the subscription rebill. If the charge is for a non-subscription product, this will be null.
- test_mode? boolean - Indicates whether the transaction was done while the product was in test mode
- processor_name? string - The name of the processor for the order
- processor_transaction_id? string - The processor ID generated for the charge
- currency? string - The 3 letter identifier for the currency for the charge
- card_used? decimal? - The last 4 digits of the card that was used. PayPal charges will have a null value.
- charge_refund_status? string? - Indicates whether a refund and the type of refund. If no refund was created the value will be null.
- order_date? string - The UTC date and time for when the order was created
- created_at? string - The UTC date and time that the charge was created
- total? int - The total (in cents) for the charge including taxes and shipping fees
samcart: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy? ProxyConfig - Proxy server related options
samcart: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings? ClientHttp1Settings - Configurations related to HTTP/1.x protocol
- http2Settings? ClientHttp2Settings - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache? CacheConfig - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- responseLimits? ResponseLimitConfigs - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
samcart: CustomerService
Customer
Fields
- id? int - The SamCart ID of the customer
- first_name? string? - The first name of the customer
- last_name? string? - The last name of the customer
- email? string - The email address of the customer
- phone? string? - The phone number of the customer
- customer_tags? CustomerserviceCustomerTags[] - The tags applied to the customer
- lifetime_value? int - The lifetime value (in cents) of the customer. Value is for live data only
- updated_at? string - The UTC date and time when the customer information was updated
- created_at? string - The UTC date and time when the customer was created
- addresses? AddressService[] - Addresses associated with the customer
samcart: CustomerserviceCustomerTags
Fields
- name? string - The name of the customer tag
samcart: FailedChargeService
Failed Charge
Fields
- id? int - The SamCart ID for the charge
- customer_id? int? - The SamCart ID for the customer that created the charge
- affiliate_id? int? - The SamCart ID of the affiliate credited for the order
- order_id? int? - The SamCart ID for the order. For subscriptions, this will be the order ID of the original purchase
- subscription_rebill_id? int? - The SamCart ID for the subscription rebill. If the charge is for a non-subscription product, this will be null.
- test_mode? boolean - Indicates whether the transaction was done while the product was in test mode
- processor_name? string - The name of the processor for the order
- processor_transaction_id? string - The processor ID generated for the charge
- 'error? string? - The error message provided by the payment processor
- currency? string - The 3 letter identifier for the currency for the charge
- card_used? decimal? - The last 4 digits of the card that was used. PayPal charges will have a null value.
- created_at? string - The UTC date and time that the charge was created
- total? int - The total (in cents) for the charge including taxes and shipping fees
samcart: InlineResponse200
Fields
- data? ChargeService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: InlineResponse2001
Fields
- data? CustomerService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: InlineResponse2002
Fields
- data? FailedChargeService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: InlineResponse2003
Fields
- data? OrderService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: InlineResponse2004
Fields
- data? ProductService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: InlineResponse2005
Fields
- data? SubscriptionService[] -
- pagination? Pagination - Optional information for paginating large data sets.
samcart: OrderService
Order
Fields
- id? int - The SamCart ID of the order
- customer_id? int - The SamCart ID of the customer
- affiliate_id? int? - The SamCart ID of the affiliate credited for the order
- test_mode? boolean - Indicates whether the transaction was done while the product was in test mode
- order_date? string - The UTC date and time for when the order was created
- cart_items? OrderserviceCartItems[] - A list of cart items on the order
- subtotal? int - The total price of the order (in cents) excluding discount, shipping and tax fees
- discount? int - The total discount (in cents) on the order
- taxes? int - The total of tax fees (in cents) of the order
- shipping? int - The total of shipping fees (in cents) of the order
- total? int - The total price of the order (in cents) including discount, shipping and tax fees
- card_used? string? - The last 4 digits of the card that was used. PayPal charges will have a null value.
- processor_name? string - The name of the processor for the order
- custom_fields? record {} - Optional custom fields applied to the order
samcart: OrderserviceCartItems
Fields
- id? int - The ID for the specific cart item
- product_id? int - The SamCart ID for the product
- subscription_id? int? - The subscription ID for the product. If the cart item is for a non-subscription product the value will be null
- sku? string? - The optional product SKU of the cart item purchased
- internal_product_name? string? - An optional product name displayed on the marketplace dashboard
- product_name? string - The product name displayed to customers
- charge_id? int - The SamCart ID for the charge
- pricing_type? string - Indicates how the product is priced
- processor_transaction_id? string - The processor ID generated for the charge
- currency? string - The 3 letter identifier for the currency for the charge on the cart item
- quantity? int - The quantity of the cart item purchased
- status? string - The current status of the charge on the cart item
- initial_price? OrderserviceInitialPrice - The pricing structure for one-time purchases and for the first charge on subscription products
- recurring_price? OrderserviceRecurringPrice - The pricing structure for limited and recurring subscription products. This structure could differ from the initial price.
- coupon? OrderserviceCoupon - An optional coupon that was applied to the cart item
samcart: OrderserviceCoupon
An optional coupon that was applied to the cart item
Fields
- id? int - The ID of the coupon that was used on the cart item
- charge_instance? string - Whether the coupon applies only once or for recurring charges also
- code? string - The code of the coupon used
- 'type? string - The type of discount applied
- discount_amount? int? - The flat_rate discount amount (in cents) on the cart item
- discount_percentage? int? - The percentage discount on the cart item
samcart: OrderserviceInitialPrice
The pricing structure for one-time purchases and for the first charge on subscription products
Fields
- subtotal? int - The price for the cart item (in cents) excluding discount, taxes and shipping fees
- taxes? int - The tax fees (in cents) for the cart item
- shipping? int - The shipping fees (in cents) for the cart item
- total? int - The price for the cart item (in cents) including discount, taxes and shipping fees
samcart: OrderserviceRecurringPrice
The pricing structure for limited and recurring subscription products. This structure could differ from the initial price.
Fields
- subtotal? int - The recurring price for the cart item (in cents) excluding discount, taxes and shipping fees
- taxes? int - The recurring tax fees (in cents) for the cart item
- shipping? int - The recurring shipping fees (in cents) for the cart item
- total? int - The recurring price for the cart item (in cents) including discount, taxes and shipping fees
samcart: Pagination
Optional information for paginating large data sets.
Fields
- next? string? - A URL to the next page of data to be retrieve. If current page is the last page this value will be null.
- prev? string? - A URL to the previous page of data to be retrieve. If current page is the first page this value will be null.
samcart: ProductService
Product
Fields
- id? int - The SamCart ID of the product
- sku? string? - An optional product SKU displayed on the marketplace dashboard
- internal_product_name? string? - An optional product name displayed on the marketplace dashboard
- product_name? string - The product name displayed to customers
- description? string? - The optional description of the product
- currency? string - The 3 letter identifier for the currency currently configured on the product. This can be changed.
- price? float - The price of the product. For subscription products, it is the initial price (in cents)
- product_category? string - Indicates the type of product being sold
- pricing_type? string - Indicates how the product will be priced
- status? string - Indicates the current status of the product
- taxes? boolean - Indicates if the product is currently configured to have taxes. This can be changed.
- upsell_funnel? string? - The name of the upsell funnel attached to the product
- order_bumps? ProductserviceOrderBumps[] - An optional list of additional products added with the product before checkout
- bundled_products? ProductserviceBundledProducts[] - An optional list of products bundled to the product
- slug? string - The URL slug for the product
- custom_domain? string? - An optional custom domain used for the product
- product_tags? ProductserviceProductTags[] - An optional list of product tags
- created_at? string - The UTC date and time the product was created
- updated_at? string - The UTC date and time the product was updated
- archived_date? string? - The UTC date and time the product was archived. If the product has not been archive the value will be null.
samcart: ProductserviceBundledProducts
Fields
- product_id? int - The SamCart ID of the bundled product
- product_name? string - The bundled product name displayed to customers
samcart: ProductserviceOrderBumps
Fields
- product_id? int - The SamCart ID for the additional product
- product_name? string - The name of the additional product
samcart: ProductserviceProductTags
Fields
- name? string - The name of the product tag
samcart: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
samcart: RefundService
Refund
Fields
- id? int - The SamCart ID for the refund
- charge_id? int - The SamCart ID for the charge
- cart_item_id? int - The ID for the refunded cart item
- created_at? string - The UTC date and time the refund was issued
- test_mode? boolean - Indicates whether the transaction was done while the transaction was in test mode.
- charge_refund_status? string? - Indicates whether a refund and the type of refund. If no refund was created the value will be null.
- currency? string - This will match the currency that the original charge was created in and will be the currency of the created refund
- refund_amount? int - The total refund amount (in cents)
samcart: SubscriptionHistoryService
Subscription History
Fields
- id? int - The SamCart ID for the subscription history record
- subscription_id? int - The SamCart ID for the subscription
- new_status? string - The status of the subscription
- 'source? string - The source of the change
- 'type? string - The type of change
- change_date? string - The UTC date and time that the change was made
samcart: SubscriptionPlanService
Subscription Plan
Fields
- id? int - The SamCart ID for the subscription plan
- product_id? int - The SamCart ID for the product
- plan_status? string - The current status of the subscription plan
- plan_archived_date? string? - The UTC date and time for when the subscription plan was archived
- plan_duration? int - For a limited subscription, this indicates the number of rebills
- plan_frequency? string - Indicates how frequently the subscription will rebill
- plan_price? int - The recurring price of subscription exclusing tax and shipping fees
- trial_period? int - The number of days that the subscription has for a trial
- rebill_days? int - The number of days between each subscription rebill, used for 'days' frequency only
- stripe_compatible? boolean - Indicates whether the subscription will be Stripe-managed
- stripe_plan_id? string? - For Stripe-managed subscriptions, this is the plan ID from within Stripe
- on_stripe_sandbox? boolean - Indicates whether the subscription is associated with a Stripe testing environment
- recurring_shipping? boolean - Indicates whether the shipping prices for the subscription will be charged at every subscription rebill
samcart: SubscriptionService
Subscription
Fields
- id? int - The SamCart ID for the subscription
- customer_id? int - The SamCart ID for the customer that created the charge
- affiliate_id? int? - The SamCart ID of the affiliate credited for the order.
- order_id? int - The SamCart ID for the order. For subscriptions, this will be the order ID of the original purchase.
- product_id? int - The SamCart ID for a product in the cart
- sku? string? - The optional product SKU for the subscription
- status? string - The status of the subscription
- 'type? string - Indicates the format of the subscription
- product_name? string - The name of the product for the subscription
- internal_product_name? string? - An optional product name displayed on the marketplace dashboard for the subscription
- initial_price? SubscriptionserviceInitialPrice - The pricing structure for the first charge of the subscription
- recurring_price? SubscriptionserviceRecurringPrice - The pricing structure for all the recurring charges of the subscription
- coupon? SubscriptionserviceCoupon - An optional coupon that is applied to the subscription rebill
- processor_name? string - The name of the processor for the order
- test_mode? boolean - Indicates whether the transaction was done while the product was in test mode.
- card_used? decimal? - The last 4 digits of the card that was used. PayPal charges will have a null value.
- created_at? string - The UTC date and time the subscription was created. This is also when the original order was created.
- start_date? string - The UTC date and time the first rebill occurred. For subscriptions with trials, this will be the first rebill after the trial.
- end_date? string? - The UTC date and time that a limited subscription will end. Recurring subscriptions will not have a value.
- next_rebilling_date? string - The UTC date and time of the next rebill for the subscription
- total_failed_charges? int - The number of unsuccessful charges for this subscription
samcart: SubscriptionserviceCoupon
An optional coupon that is applied to the subscription rebill
Fields
- id? int - The ID of the coupon that was used on the subscription
- charge_instance? string - Whether the coupon applies only once or for recurring charges also
- code? string - The code of the coupon used
- 'type? string - The type of discount applied
- discount_amount? int? - The flat_rate discount amount (in cents) on the subscription
- discount_percentage? int? - The percentage discount on the subscription
samcart: SubscriptionserviceInitialPrice
The pricing structure for the first charge of the subscription
Fields
- subtotal? int - The initial price (in cents) excluding discount, taxes and shipping fees
- taxes? int - The initial tax fees (in cents)
- shipping? int - The initial shipping fees (in cents)
- total? int - The initial price (in cents) including discount, taxes and shipping fees
samcart: SubscriptionserviceRecurringPrice
The pricing structure for all the recurring charges of the subscription
Fields
- subtotal? int - The recurring price (in cents) excluding discount, taxes and shipping fees
- taxes? int - The recurring tax fees (in cents)
- shipping? int - The recurring shipping fees (in cents)
- total? int - The recurring price (in cents) including discount, taxes and shipping fees
Array types
samcart: RefundServiceArr
RefundServiceArr
samcart: AddressServiceArr
AddressServiceArr
samcart: ChargeServiceArr
ChargeServiceArr
samcart: OrderServiceArr
OrderServiceArr
samcart: SubscriptionServiceArr
SubscriptionServiceArr
samcart: SubscriptionHistoryServiceArr
SubscriptionHistoryServiceArr
Import
import ballerinax/samcart;Metadata
Released date: 2 days ago
Version: 1.5.2
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.8.0
GraalVM compatible: Yes
Pull count
Total: 26
Current verison: 0
Weekly downloads
Keywords
Type/Connector
Vendor/SamCart
Area/E-Commerce
Commerce/eCommerce
Cost/Paid
Contributors
Dependencies