@@ -37,8 +37,16 @@ export class Cards extends APIResource {
3737 * });
3838 * ```
3939 */
40- create ( body : CardCreateParams , options ?: RequestOptions ) : APIPromise < Card > {
41- return this . _client . post ( '/v1/cards' , { body, ...options } ) ;
40+ create ( params : CardCreateParams , options ?: RequestOptions ) : APIPromise < Card > {
41+ const { 'Idempotency-Key' : idempotencyKey , ...body } = params ;
42+ return this . _client . post ( '/v1/cards' , {
43+ body,
44+ ...options ,
45+ headers : buildHeaders ( [
46+ { ...( idempotencyKey != null ? { 'Idempotency-Key' : idempotencyKey } : undefined ) } ,
47+ options ?. headers ,
48+ ] ) ,
49+ } ) ;
4250 }
4351
4452 /**
@@ -851,7 +859,7 @@ export namespace CardWebProvisionResponse {
851859
852860export interface CardCreateParams {
853861 /**
854- * Card types:
862+ * Body param: Card types:
855863 *
856864 * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
857865 * wallet like Apple Pay or Google Pay (if the card program is digital
@@ -871,95 +879,99 @@ export interface CardCreateParams {
871879 type : 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET' ;
872880
873881 /**
874- * Globally unique identifier for the account that the card will be associated
875- * with. Required for programs enrolling users using the
882+ * Body param: Globally unique identifier for the account that the card will be
883+ * associated with. Required for programs enrolling users using the
876884 * [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc).
877885 * See [Managing Your Program](doc:managing-your-program) for more information.
878886 */
879887 account_token ?: string ;
880888
881889 /**
882- * Globally unique identifier for an existing bulk order to associate this card
883- * with. When specified, the card will be added to the bulk order for batch
884- * shipment. Only applicable to cards of type PHYSICAL
890+ * Body param: Globally unique identifier for an existing bulk order to associate
891+ * this card with. When specified, the card will be added to the bulk order for
892+ * batch shipment. Only applicable to cards of type PHYSICAL
885893 */
886894 bulk_order_token ?: string ;
887895
888896 /**
889- * For card programs with more than one BIN range. This must be configured with
890- * Lithic before use. Identifies the card program/BIN range under which to create
891- * the card. If omitted, will utilize the program's default `card_program_token`.
892- * In Sandbox, use 00000000-0000-0000-1000-000000000000 and
897+ * Body param: For card programs with more than one BIN range. This must be
898+ * configured with Lithic before use. Identifies the card program/BIN range under
899+ * which to create the card. If omitted, will utilize the program's default
900+ * `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and
893901 * 00000000-0000-0000-2000-000000000000 to test creating cards on specific card
894902 * programs.
895903 */
896904 card_program_token ?: string ;
897905
906+ /**
907+ * Body param
908+ */
898909 carrier ?: Shared . Carrier ;
899910
900911 /**
901- * Specifies the digital card art to be displayed in the user’s digital wallet
902- * after tokenization. This artwork must be approved by Mastercard and configured
903- * by Lithic to use. See
912+ * Body param: Specifies the digital card art to be displayed in the user’s digital
913+ * wallet after tokenization. This artwork must be approved by Mastercard and
914+ * configured by Lithic to use. See
904915 * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).
905916 */
906917 digital_card_art_token ?: string ;
907918
908919 /**
909- * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided,
910- * an expiration date will be generated.
920+ * Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year`
921+ * is provided, an expiration date will be generated.
911922 */
912923 exp_month ?: string ;
913924
914925 /**
915- * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is
916- * provided, an expiration date will be generated.
926+ * Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year`
927+ * is provided, an expiration date will be generated.
917928 */
918929 exp_year ?: string ;
919930
920931 /**
921- * Friendly name to identify the card.
932+ * Body param: Friendly name to identify the card.
922933 */
923934 memo ?: string ;
924935
925936 /**
926- * Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and
927- * `VIRTUAL`. See
937+ * Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL`
938+ * and `VIRTUAL`. See
928939 * [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block).
929940 */
930941 pin ?: string ;
931942
932943 /**
933- * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic
934- * before use. Specifies the configuration (i.e., physical card art) that the card
935- * should be manufactured with.
944+ * Body param: Only applicable to cards of type `PHYSICAL`. This must be configured
945+ * with Lithic before use. Specifies the configuration (i.e., physical card art)
946+ * that the card should be manufactured with.
936947 */
937948 product_id ?: string ;
938949
939950 /**
940- * Restricted field limited to select use cases. Lithic will reach out directly if
941- * this field should be used. Globally unique identifier for the replacement card's
942- * account. If this field is specified, `replacement_for` must also be specified.
943- * If `replacement_for` is specified and this field is omitted, the replacement
944- * card's account will be inferred from the card being replaced.
951+ * Body param: Restricted field limited to select use cases. Lithic will reach out
952+ * directly if this field should be used. Globally unique identifier for the
953+ * replacement card's account. If this field is specified, `replacement_for` must
954+ * also be specified. If `replacement_for` is specified and this field is omitted,
955+ * the replacement card's account will be inferred from the card being replaced.
945956 */
946957 replacement_account_token ?: string ;
947958
948959 /**
949- * Additional context or information related to the card that this card will
950- * replace.
960+ * Body param: Additional context or information related to the card that this card
961+ * will replace.
951962 */
952963 replacement_comment ?: string ;
953964
954965 /**
955- * Globally unique identifier for the card that this card will replace. If the card
956- * type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is
957- * `VIRTUAL` it will be replaced by a `VIRTUAL` card.
966+ * Body param: Globally unique identifier for the card that this card will replace.
967+ * If the card type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the
968+ * card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card.
958969 */
959970 replacement_for ?: string ;
960971
961972 /**
962- * Card state substatus values for the card that this card will replace:
973+ * Body param: Card state substatus values for the card that this card will
974+ * replace:
963975 *
964976 * - `LOST` - The physical card is no longer in the cardholder's possession due to
965977 * being lost or never received by the cardholder.
@@ -1000,11 +1012,14 @@ export interface CardCreateParams {
10001012 | 'UNDELIVERABLE'
10011013 | 'OTHER' ;
10021014
1015+ /**
1016+ * Body param
1017+ */
10031018 shipping_address ?: Shared . ShippingAddress ;
10041019
10051020 /**
1006- * Shipping method for the card. Only applies to cards of type PHYSICAL. Use of
1007- * options besides `STANDARD` require additional permissions.
1021+ * Body param: Shipping method for the card. Only applies to cards of type
1022+ * PHYSICAL. Use of options besides `STANDARD` require additional permissions.
10081023 *
10091024 * - `STANDARD` - USPS regular mail or similar international option, with no
10101025 * tracking
@@ -1029,16 +1044,16 @@ export interface CardCreateParams {
10291044 | 'STANDARD_WITH_TRACKING' ;
10301045
10311046 /**
1032- * Amount (in cents) to limit approved authorizations (e.g. 100000 would be a
1033- * $1,000 limit). Transaction requests above the spend limit will be declined. Note
1034- * that a spend limit of 0 is effectively no limit, and should only be used to
1035- * reset or remove a prior limit. Only a limit of 1 or above will result in
1036- * declined transactions due to checks against the card limit.
1047+ * Body param: Amount (in cents) to limit approved authorizations (e.g. 100000
1048+ * would be a $1,000 limit). Transaction requests above the spend limit will be
1049+ * declined. Note that a spend limit of 0 is effectively no limit, and should only
1050+ * be used to reset or remove a prior limit. Only a limit of 1 or above will result
1051+ * in declined transactions due to checks against the card limit.
10371052 */
10381053 spend_limit ?: number ;
10391054
10401055 /**
1041- * Spend limit duration values:
1056+ * Body param: Spend limit duration values:
10421057 *
10431058 * - `ANNUALLY` - Card will authorize transactions up to spend limit for the
10441059 * trailing year.
@@ -1054,14 +1069,19 @@ export interface CardCreateParams {
10541069 spend_limit_duration ?: SpendLimitDuration ;
10551070
10561071 /**
1057- * Card state values:
1072+ * Body param: Card state values:
10581073 *
10591074 * - `OPEN` - Card will approve authorizations (if they match card and account
10601075 * parameters).
10611076 * - `PAUSED` - Card will decline authorizations, but can be resumed at a later
10621077 * time.
10631078 */
10641079 state ?: 'OPEN' | 'PAUSED' ;
1080+
1081+ /**
1082+ * Header param: Idempotency key for the request
1083+ */
1084+ 'Idempotency-Key' ?: string ;
10651085}
10661086
10671087export interface CardUpdateParams {
0 commit comments