pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
227 lines (226 loc) • 9.14 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* With this resource, you can create a shipping rate - [Stripe API shipping rate documentation](https://stripe.com/docs/api/shipping_rates).
*
* Shipping rates let you display various shipping options—like standard, express, and overnight—with more accurate delivery estimates.
* Charge your customer for shipping using different Stripe products, some of which require coding.
*
* > Removal of the shipping rate isn't supported through the Stripe API.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* // shipping rate with delivery estimate
* const shippingRate = new stripe.ShippingRate("shippingRate", {
* deliveryEstimates: [{
* maximum: {
* unit: "day",
* value: 4,
* },
* minimum: {
* unit: "hour",
* value: 24,
* },
* }],
* displayName: "shipping rate",
* fixedAmount: {
* amount: 1000,
* currency: "aud",
* },
* });
* // shipping rate with currency options
* // !!! Currency options have to be sorted alphabetically
* // !!! by the currency field
* const shipping = new stripe.ShippingRate("shipping", {
* displayName: "shipping rate",
* fixedAmount: {
* amount: 1000,
* currency: "aud",
* currencyOptions: [
* {
* amount: 350,
* currency: "eur",
* },
* {
* amount: 500,
* currency: "usd",
* },
* ],
* },
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import stripe:index/shippingRate:ShippingRate rate <shipping_rate_id>
* ```
*/
export declare class ShippingRate extends pulumi.CustomResource {
/**
* Get an existing ShippingRate resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ShippingRateState, opts?: pulumi.CustomResourceOptions): ShippingRate;
/**
* Returns true if the given object is an instance of ShippingRate. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is ShippingRate;
/**
* Bool. Whether the shipping rate is active (can't be used when creating). Defaults to `true`.
*/
readonly active: pulumi.Output<boolean | undefined>;
/**
* List(Resource). The estimated range for how long shipping will take,
* meant to be displayable to the customer. This will appear on CheckoutSessions.
* For details please see Delivery Estimate.
*/
readonly deliveryEstimates: pulumi.Output<outputs.ShippingRateDeliveryEstimate[] | undefined>;
/**
* String. The name of the shipping rate, meant to be displayable to the customer.
* This will appear on CheckoutSessions.
*/
readonly displayName: pulumi.Output<string>;
/**
* List(Resource). Describes a fixed amount to charge for shipping.
* Must be present if type is `fixedAmount`. For details of individual arguments see Fixed Amount.
*/
readonly fixedAmount: pulumi.Output<outputs.ShippingRateFixedAmount>;
/**
* Bool. Has the value true if the object exists in live mode or the value false if the object exists in test mode.
*/
readonly livemode: pulumi.Output<boolean>;
/**
* Map(String). Set of key-value pairs that you can attach to an object. This can be useful for
* storing additional information about the object in a structured format.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* String. Specifies whether the price is considered inclusive of taxes or exclusive of
* taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified it cannot be changed, default is `unspecified`.
*/
readonly taxBehavior: pulumi.Output<string | undefined>;
/**
* String. A tax code ID. The Shipping tax code is `txcd92010001`.
*/
readonly taxCode: pulumi.Output<string | undefined>;
/**
* String. The type of calculation to use on the shipping rate. Can only be `fixedAmount` for now.
*/
readonly type: pulumi.Output<string | undefined>;
/**
* Create a ShippingRate resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ShippingRateArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ShippingRate resources.
*/
export interface ShippingRateState {
/**
* Bool. Whether the shipping rate is active (can't be used when creating). Defaults to `true`.
*/
active?: pulumi.Input<boolean>;
/**
* List(Resource). The estimated range for how long shipping will take,
* meant to be displayable to the customer. This will appear on CheckoutSessions.
* For details please see Delivery Estimate.
*/
deliveryEstimates?: pulumi.Input<pulumi.Input<inputs.ShippingRateDeliveryEstimate>[]>;
/**
* String. The name of the shipping rate, meant to be displayable to the customer.
* This will appear on CheckoutSessions.
*/
displayName?: pulumi.Input<string>;
/**
* List(Resource). Describes a fixed amount to charge for shipping.
* Must be present if type is `fixedAmount`. For details of individual arguments see Fixed Amount.
*/
fixedAmount?: pulumi.Input<inputs.ShippingRateFixedAmount>;
/**
* Bool. Has the value true if the object exists in live mode or the value false if the object exists in test mode.
*/
livemode?: pulumi.Input<boolean>;
/**
* Map(String). Set of key-value pairs that you can attach to an object. This can be useful for
* storing additional information about the object in a structured format.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* String. Specifies whether the price is considered inclusive of taxes or exclusive of
* taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified it cannot be changed, default is `unspecified`.
*/
taxBehavior?: pulumi.Input<string>;
/**
* String. A tax code ID. The Shipping tax code is `txcd92010001`.
*/
taxCode?: pulumi.Input<string>;
/**
* String. The type of calculation to use on the shipping rate. Can only be `fixedAmount` for now.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ShippingRate resource.
*/
export interface ShippingRateArgs {
/**
* Bool. Whether the shipping rate is active (can't be used when creating). Defaults to `true`.
*/
active?: pulumi.Input<boolean>;
/**
* List(Resource). The estimated range for how long shipping will take,
* meant to be displayable to the customer. This will appear on CheckoutSessions.
* For details please see Delivery Estimate.
*/
deliveryEstimates?: pulumi.Input<pulumi.Input<inputs.ShippingRateDeliveryEstimate>[]>;
/**
* String. The name of the shipping rate, meant to be displayable to the customer.
* This will appear on CheckoutSessions.
*/
displayName: pulumi.Input<string>;
/**
* List(Resource). Describes a fixed amount to charge for shipping.
* Must be present if type is `fixedAmount`. For details of individual arguments see Fixed Amount.
*/
fixedAmount: pulumi.Input<inputs.ShippingRateFixedAmount>;
/**
* Map(String). Set of key-value pairs that you can attach to an object. This can be useful for
* storing additional information about the object in a structured format.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* String. Specifies whether the price is considered inclusive of taxes or exclusive of
* taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified it cannot be changed, default is `unspecified`.
*/
taxBehavior?: pulumi.Input<string>;
/**
* String. A tax code ID. The Shipping tax code is `txcd92010001`.
*/
taxCode?: pulumi.Input<string>;
/**
* String. The type of calculation to use on the shipping rate. Can only be `fixedAmount` for now.
*/
type?: pulumi.Input<string>;
}