[−][src]Crate stripe
This crate provides Rust bindings to the Stripe HTTP API.
Getting Started
To get started, we need to create a client:
let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET");
Then we can begin making requests as we'd like. Most Stripe requests accept
many optional parameters, so we usually get the ::new(...)
with any required
params and then set the ones we want from there.
Most requests for creating or updating a Stripe object use the same Rust struct, so you may frequently need to refer to the official API docs to determine which fields are required for either request.
/* Creating a Stripe Charge */ let token = "tok_ID_FROM_CHECKOUT".parse().unwrap(); let mut params = stripe::CreateCharge::new(); // NOTE: Stripe represents currency in the lowest denominations (e.g. cents) params.amount = Some(1095); // e.g. $10.95 params.source = Some(stripe::ChargeSourceParams::Token(token)); // Example: Override currency to be in Canadian Dollars params.currency = Some(stripe::Currency::CAD); let charge = stripe::Charge::create(&client, params).unwrap(); println!("{:?}", charge); // => Charge { id: "ch_12345", amount: 1095, .. }
/* Listing Stripe Charges */ let params = stripe::ListCharges::new(); let charges = stripe::Charge::list(&client, params).unwrap(); println!("{:?}", charges); // => List { data: [Charge { id: "ch_12345", .. }] }
Structs
AcceptTos | |
Account | The resource representing a Stripe "Account". |
AccountCapabilities | |
AccountId | An id for the corresponding object type. |
AccountRequirements | |
AccountSettings | |
AccountSettingsParams | |
Address | |
AlipayAccount | The resource representing a Stripe "AlipayAccount". |
AlipayAccountId | An id for the corresponding object type. |
Application | The resource representing a Stripe "Application". |
ApplicationFee | The resource representing a Stripe "PlatformFee". |
ApplicationFeeId | An id for the corresponding object type. |
ApplicationFeeRefund | The resource representing a Stripe "FeeRefund". |
ApplicationFeeRefundId | An id for the corresponding object type. |
Balance | The resource representing a Stripe "Balance". |
BalanceAmount | |
BalanceAmountBySourceType | |
BalanceTransaction | The resource representing a Stripe "BalanceTransaction". |
BalanceTransactionId | An id for the corresponding object type. |
BankAccount | The resource representing a Stripe "BankAccount". |
BankAccountId | An id for the corresponding object type. |
BankAccountParams | |
BankTokenId | An id for the corresponding object type. |
BillingDetails | |
BrandingSettings | |
BrandingSettingsParams | |
BusinessProfile | |
CancelSubscription | |
CaptureCharge | The set of parameters that can be used when capturing a charge object. |
Card | The resource representing a Stripe "Card". |
CardDetails | |
CardId | An id for the corresponding object type. |
CardParams | |
CardPaymentsSettings | |
CardPaymentsSettingsParams | |
CardPresent | |
CardTokenId | An id for the corresponding object type. |
Charge | The resource representing a Stripe "Charge". |
ChargeId | An id for the corresponding object type. |
ChargeOutcome | |
CheckoutSession | The resource representing a Stripe "Session". |
CheckoutSessionCustomDisplayItemDescription | |
CheckoutSessionDisplayItem | |
CheckoutSessionId | An id for the corresponding object type. |
Client | |
Company | |
CompanyParams | |
ConnectCollectionTransfer | The resource representing a Stripe "ConnectCollectionTransfer". |
Coupon | The resource representing a Stripe "Coupon". |
CouponId | |
CreateAccount | The parameters for |
CreateCharge | The parameters for |
CreateCoupon | The parameters for |
CreateCustomer | The parameters for |
CreateFileLink | The parameters for |
CreateInvoice | The parameters for |
CreateInvoiceItem | The parameters for |
CreateInvoiceLineItem | |
CreateOrder | The parameters for |
CreatePaymentMethod | The parameters for |
CreatePayout | The parameters for |
CreatePlan | The parameters for |
CreatePlanTiers | |
CreatePlanTransformUsage | |
CreateProduct | The parameters for |
CreateRecipient | The parameters for |
CreateRefund | The parameters for |
CreateSku | The parameters for |
CreateSource | The parameters for |
CreateSourceReceiver | |
CreateSourceRedirect | |
CreateSubscription | The parameters for |
CreateSubscriptionItems | |
CreateTaxRate | The parameters for |
CreateToken | The parameters for |
CreateTokenAccount | |
CreateTokenPii | |
CreateTransfer | The parameters for |
CreateWebhookEndpoint | The parameters for |
CustomField | |
Customer | The resource representing a Stripe "Customer". |
CustomerId | An id for the corresponding object type. |
CustomerInvoiceSettings | |
DashboardSettings | |
DeclineChargeOn | |
DeclineChargeOnParams | |
DeliveryEstimate | |
Discount | The resource representing a Stripe "Discount". |
Dispute | The resource representing a Stripe "Dispute". |
DisputeEvidence | |
DisputeEvidenceDetails | |
DisputeId | An id for the corresponding object type. |
Dob | |
Event | |
EventData | |
EventId | An id for the corresponding object type. |
Fee | |
File | The resource representing a Stripe "File". |
FileId | An id for the corresponding object type. |
FileLink | The resource representing a Stripe "FileLink". |
FileLinkId | An id for the corresponding object type. |
FraudDetails | |
FraudDetailsParams | |
Headers | |
Inventory | |
Invoice | The resource representing a Stripe "Invoice". |
InvoiceId | An id for the corresponding object type. |
InvoiceItem | The resource representing a Stripe "InvoiceItem". |
InvoiceItemId | An id for the corresponding object type. |
InvoiceItemThresholdReason | |
InvoiceLineItem | The resource representing a Stripe "InvoiceLineItem". |
InvoiceSettingCustomField | |
InvoiceSettingCustomerSetting | |
InvoiceThresholdReason | |
InvoicesResourceInvoiceTaxId | |
InvoicesStatusTransitions | |
IssuingAuthorization | The resource representing a Stripe "IssuingAuthorization". |
IssuingAuthorizationId | An id for the corresponding object type. |
IssuingAuthorizationRequest | |
IssuingAuthorizationVerificationData | |
IssuingCard | The resource representing a Stripe "IssuingCard". |
IssuingCardAuthorizationControls | |
IssuingCardId | An id for the corresponding object type. |
IssuingCardShipping | |
IssuingCardholder | The resource representing a Stripe "IssuingCardholder". |
IssuingCardholderAddress | |
IssuingCardholderAuthorizationControls | |
IssuingCardholderId | An id for the corresponding object type. |
IssuingDispute | The resource representing a Stripe "IssuingDispute". |
IssuingDisputeEvidence | |
IssuingDisputeFraudulentEvidence | |
IssuingDisputeId | An id for the corresponding object type. |
IssuingDisputeOtherEvidence | |
IssuingTransaction | The resource representing a Stripe "IssuingTransaction". |
IssuingTransactionId | An id for the corresponding object type. |
List | A single page of a cursor-paginated list of an object. |
ListAccounts | The parameters for |
ListApplicationFees | The parameters for |
ListCharges | The parameters for |
ListCoupons | The parameters for |
ListCustomers | The parameters for |
ListDisputes | The parameters for |
ListFileLinks | The parameters for |
ListFiles | The parameters for |
ListInvoiceItems | The parameters for |
ListInvoices | The parameters for |
ListOrderReturns | The parameters for |
ListOrders | The parameters for |
ListOrdersStatusTransitions | |
ListPaymentMethods | The parameters for |
ListPayouts | The parameters for |
ListPlans | The parameters for |
ListProducts | The parameters for |
ListRecipients | The parameters for |
ListRefunds | The parameters for |
ListReviews | The parameters for |
ListSkus | The parameters for |
ListSubscriptionItems | The parameters for |
ListSubscriptions | The parameters for |
ListTaxRates | The parameters for |
ListTopups | The parameters for |
ListTransfers | The parameters for |
ListWebhookEndpoints | The parameters for |
MerchantData | The resource representing a Stripe "IssuingAuthorizationMerchantData". |
Order | The resource representing a Stripe "Order". |
OrderId | An id for the corresponding object type. |
OrderItem | The resource representing a Stripe "OrderItem". |
OrderItemParams | |
OrderReturn | The resource representing a Stripe "OrderReturn". |
OrderReturnId | An id for the corresponding object type. |
PackageDimensions | |
ParseCurrencyError | |
ParseIdError | |
PaymentError | The resource representing a Stripe PaymentError object. |
PaymentIntent | The resource representing a Stripe "PaymentIntent". |
PaymentIntentCancelParams | The set of parameters that can be used when canceling a payment_intent object. |
PaymentIntentCaptureParams | The set of parameters that can be used when capturing a payment_intent object. |
PaymentIntentConfirmParams | The set of parameters that can be used when confirming a payment_intent object. |
PaymentIntentCreateParams | The set of parameters that can be used when creating a payment_intent object. |
PaymentIntentId | An id for the corresponding object type. |
PaymentIntentListParams | The parameters for |
PaymentIntentNextAction | |
PaymentIntentNextActionRedirectToUrl | |
PaymentIntentUpdateParams | The set of parameters that can be used when updating a payment_intent object. |
PaymentMethod | The resource representing a Stripe "PaymentMethod". |
PaymentMethodCardChecks | |
PaymentMethodCardGeneratedCard | |
PaymentMethodDetails | This type is a stub that still needs to be implemented. |
PaymentMethodId | An id for the corresponding object type. |
PaymentsSettings | |
PaymentsSettingsParams | |
Payout | The resource representing a Stripe "Payout". |
PayoutId | An id for the corresponding object type. |
PayoutSettings | |
PayoutSettingsParams | |
Period | Period is a structure representing a start and end dates. |
Person | The resource representing a Stripe "Person". |
PersonId | An id for the corresponding object type. |
PersonParams | |
PersonRelationship | |
PersonRequirements | |
PersonVerification | |
PersonVerificationDocument | |
PersonVerificationDocumentParams | |
PersonVerificationParams | |
Plan | The resource representing a Stripe "Plan". |
PlanId | |
PlanTier | |
Product | The resource representing a Stripe "Product". |
ProductId | An id for the corresponding object type. |
RadarReviewResourceLocation | |
RadarReviewResourceSession | |
RangeBounds | |
Recipient | The resource representing a Stripe "TransferRecipient". |
RecipientId | |
Refund | The resource representing a Stripe "Refund". |
RefundId | An id for the corresponding object type. |
RequestError | An error reported by stripe in a request's response. |
ReserveTransaction | The resource representing a Stripe "ReserveTransaction". |
RetrieveUpcomingInvoice | |
Review | The resource representing a Stripe "RadarReview". |
ReviewId | An id for the corresponding object type. |
Rule | |
ScheduledQueryRun | The resource representing a Stripe "ScheduledQueryRun". |
ScheduledQueryRunId | An id for the corresponding object type. |
Shipping | |
ShippingMethod | |
ShippingParams | |
SigmaScheduledQueryRunError | |
Sku | The resource representing a Stripe "SKU". |
SkuId | An id for the corresponding object type. |
Source | The resource representing a Stripe "Source". |
SourceAcceptanceOfflineParams | |
SourceAcceptanceOnlineParams | |
SourceAcceptanceParams | |
SourceCodeVerificationFlow | |
SourceId | An id for the corresponding object type. |
SourceMandateParams | |
SourceOwner | |
SourceReceiverFlow | |
SourceRedirectFlow | |
SourceTypeAchCreditTransfer | |
SourceTypeAchDebit | |
SourceTypeAlipay | |
SourceTypeBancontact | |
SourceTypeCard | |
SourceTypeCardPresent | |
SourceTypeEps | |
SourceTypeGiropay | |
SourceTypeIdeal | |
SourceTypeMultibanco | |
SourceTypeP24 | |
SourceTypeSepaDebit | |
SourceTypeSofort | |
SourceTypeThreeDSecure | |
SourceTypeWechat | |
SpendingLimit | |
StatusTransitions | |
Subscription | The resource representing a Stripe "Subscription". |
SubscriptionBillingThresholds | |
SubscriptionId | An id for the corresponding object type. |
SubscriptionItem | The resource representing a Stripe "SubscriptionItem". |
SubscriptionItemBillingThresholds | |
SubscriptionItemFilter | |
SubscriptionItemId | An id for the corresponding object type. |
SubscriptionLineId | An id for the corresponding object type. |
TaxAmount | |
TaxId | The resource representing a Stripe "tax_id". |
TaxIdData | |
TaxIdId | An id for the corresponding object type. |
TaxIdVerification | |
TaxInfo | |
TaxInfoParams | |
TaxInfoVerification | |
TaxRate | The resource representing a Stripe "TaxRate". |
TaxRateId | An id for the corresponding object type. |
ThreeDSecureUsage | |
Token | The resource representing a Stripe "Token". |
Topup | The resource representing a Stripe "Topup". |
TopupId | An id for the corresponding object type. |
TosAcceptance | |
Transfer | The resource representing a Stripe "Transfer". |
TransferData | |
TransferDataParams | |
TransferId | An id for the corresponding object type. |
TransferReversal | The resource representing a Stripe "TransferReversal". |
TransferReversalId | An id for the corresponding object type. |
TransferSchedule | |
TransferScheduleParams | |
TransformUsage | |
UpdateAccount | The parameters for |
UpdateCharge | The parameters for |
UpdateCoupon | The parameters for |
UpdateCustomer | The parameters for |
UpdateFileLink | The parameters for |
UpdateInvoiceItem | The parameters for |
UpdateOrder | The parameters for |
UpdatePaymentMethod | The parameters for |
UpdatePayout | The parameters for |
UpdatePlan | The parameters for |
UpdateProduct | The parameters for |
UpdateRecipient | The parameters for |
UpdateRefund | The parameters for |
UpdateSku | The parameters for |
UpdateSource | The parameters for |
UpdateSubscription | The parameters for |
UpdateSubscriptionItem | The parameters for |
UpdateSubscriptionItems | |
UpdateTaxRate | The parameters for |
UpdateTopup | The parameters for |
UpdateTransfer | The parameters for |
UpdateWebhookEndpoint | The parameters for |
VerifyBankAccount | The set of parameters that can be used when verifying a Bank Account. |
WalletAmexExpressCheckout | |
WalletApplePay | |
WalletDetails | |
WalletGooglePay | |
WalletMasterpass | |
WalletSamsungPay | |
WalletVisaCheckout | |
Webhook | |
WebhookEndpoint | The resource representing a Stripe "NotificationWebhookEndpoint". |
WebhookEndpointId | An id for the corresponding object type. |
Enums
AccountHolderType | An enum representing the possible values of a |
AccountType | An enum representing the possible values of an |
ApiVersion | An enum representing the possible values of an |
BalanceTransactionSource | |
BalanceTransactionSourceId | |
BalanceTransactionStatus | An enum representing the possible values of an |
BalanceTransactionType | An enum representing the possible values of an |
BankAccountStatus | An enum representing the possible values of an |
BusinessType | An enum representing the possible values of an |
CapabilityStatus | An enum representing the possible values of an |
CaptureMethod | The resource representing a Stripe CaptureMethod object. |
CardBrand | |
CardType | |
ChargeSourceParams | The set of PaymentSource parameters that can be used to create a charge. |
CheckResult | |
CheckoutSessionLocale | An enum representing the possible values of an |
ConfirmationMethod | The resource representing a Stripe ConfirmationMethod object. |
CouponDuration | An enum representing the possible values of an |
CreatePlanTransformUsageRound | An enum representing the possible values of an |
Currency | Currency is the list of supported currencies. |
CustomerTaxExempt | An enum representing the possible values of an |
CustomerTaxExemptFilter | An enum representing the possible values of an |
DelayDays | |
DelayDaysOther | |
DetachedSource | |
DisputeStatus | An enum representing the possible values of an |
Error | An error encountered when communicating with the Stripe API. |
ErrorCode | The list of possible values for a RequestError's code. |
ErrorType | The list of possible values for a RequestError's type. |
EventFilter | An enum representing the possible values of an |
EventObject | |
EventType | |
Expandable | An id or object. |
ExternalAccount | |
FeeType | An enum representing the possible values of an |
FilePurpose | An enum representing the possible values of an |
FraudDetailsReport | An enum representing the possible values of a |
InvoiceBilling | An enum representing the possible values of an |
InvoiceBillingReason | An enum representing the possible values of an |
InvoiceCustomerTaxExempt | An enum representing the possible values of an |
InvoiceLineItemId | |
InvoiceLineItemType | An enum representing the possible values of an |
InvoiceStatus | An enum representing the possible values of an |
InvoicesResourceInvoiceTaxIdType | An enum representing the possible values of an |
IssuingAuthorizationCheck | An enum representing the possible values of the |
IssuingAuthorizationMethod | An enum representing the possible values of the |
IssuingAuthorizationReason | An enum representing the possible values of the |
IssuingAuthorizationWalletProvider | An enum representing the possible values of an |
IssuingCardReplacementReason | An enum representing the possible values of an |
IssuingCardShippingStatus | An enum representing the possible values of an |
IssuingCardShippingType | An enum representing the possible values of an |
IssuingCardStatus | An enum representing the possible values of an |
IssuingCardType | An enum representing the possible values of an |
IssuingCardholderStatus | An enum representing the possible values of an |
IssuingCardholderType | An enum representing the possible values of an |
IssuingDisputeReason | An enum representing the possible values of an |
IssuingDisputeStatus | An enum representing the possible values of an |
IssuingTransactionType | An enum representing the possible values of an |
MerchantCategory | An enum representing the industry of a merchant. |
OrderItemParamsType | An enum representing the possible values of an |
OrderStatus | An enum representing the possible values of an |
OrderStatusFilter | An enum representing the possible values of an |
PaymentErrorType | The resource representing a Stripe PaymentErrorType object. |
PaymentIntentCancellationReason | An enum representing the possible values of an |
PaymentIntentCaptureMethod | An enum representing the possible values of an |
PaymentIntentConfirmationMethod | An enum representing the possible values of an |
PaymentIntentMethodType | |
PaymentIntentNextActionType | |
PaymentIntentStatus | An enum representing the possible values of an |
PaymentMethodType | An enum representing the possible values of an |
PaymentSource | A PaymentSource represents a payment method associated with a customer or charge. This value is usually returned as a subresource on another request. |
PaymentSourceId | |
PaymentSourceParams | A PaymentSourceParams represents all of the supported ways that can
be used to creating a new customer with a payment method or creating
a payment method directly for a customer via |
PayoutDestination | |
PayoutDestinationId | |
PayoutMethod | An enum representing the possible values of an |
PayoutSourceType | An enum representing the possible values of an |
PayoutType | An enum representing the possible values of an |
PlanAggregateUsage | An enum representing the possible values of an |
PlanBillingScheme | An enum representing the possible values of an |
PlanInterval | An enum representing the possible values of an |
PlanTiersMode | An enum representing the possible values of an |
PlanUsageType | An enum representing the possible values of an |
ProductType | An enum representing the possible values of an |
RangeQuery | A set of generic request parameters that can be used on list endpoints to filter their results by some timestamp. |
RecipientType | An enum representing the possible values of an |
RefundReason | An enum representing the possible values of an |
RequestedCapability | An enum representing the possible values of an |
ReviewClosedReason | An enum representing the possible values of an |
ReviewOpenedReason | An enum representing the possible values of an |
ReviewReason | An enum representing the possible values of an |
Scheduled | |
ScheduledOther | |
SourceAcceptanceParamsStatus | An enum representing the possible values of an |
SourceAcceptanceParamsType | An enum representing the possible values of an |
SourceFlow | An enum representing the possible values of an |
SourceMandateInterval | An enum representing the possible values of an |
SourceMandateNotificationMethod | An enum representing the possible values of an |
SourceRedirectFlowFailureReason | An enum representing the possible values of an |
SourceRedirectFlowStatus | An enum representing the possible values of an |
SourceRefundNotificationMethod | An enum representing the possible values of an |
SourceStatus | An enum representing the possible values of an |
SourceType | An enum representing the possible values of an |
SourceUsage | An enum representing the possible values of an |
SpendingLimitInterval | An enum representing the possible values of an |
SubscriptionBilling | An enum representing the possible values of an |
SubscriptionBillingCycleAnchor | An enum representing the possible values of an |
SubscriptionStatus | An enum representing the possible values of an |
SubscriptionStatusFilter | An enum representing the possible values of an |
TaxIdDataType | An enum representing the possible values of an |
TaxIdType | An enum representing the possible values of an |
TaxIdVerificationStatus | An enum representing the possible values of an |
TaxInfoType | An enum representing the possible values of an |
TokenId | |
TokenType | An enum representing the possible values of an |
TokenizationMethod | |
TopupStatus | An enum representing the possible values of an |
TopupStatusFilter | An enum representing the possible values of an |
TransferScheduleInterval | An enum representing the possible values of an |
TransferSourceType | An enum representing the possible values of an |
TransformUsageRound | An enum representing the possible values of an |
UpTo | |
UpToOther | |
WalletDetailsType | An enum representing the possible values of an |
WebhookEndpointStatus | An enum representing the possible values of an |
WebhookError | An error encountered when communicating with the Stripe API webhooks. |
Weekday | A day of the week. |
Traits
Object | Implemented by types which represent stripe objects. |
Type Definitions
Metadata | |
Response | An alias for |
Timestamp |