For currencies without any decimal places (e.g. ISK), specifying a tax_percentage = 24 in ‘Create Subscription’ caused the subscription to fail later on.
Notice that the total field in the response has a decimal number in it.
{“id”:“wh_d062c6a8a34856eaf70f81b79e52ce25”,“type”:“INVOICE_PAYMENT_FAILED”,“data”:{“id”:“invoice_4b4c9ee2bb5e2456972252622b2436f6”,“tax”:4797.6,“type”:“payment”,“lines”:[{“id”:“il_271f2bcce18faf03e10d664aa564ad77”,“plan”:{“id”:“plan_7e018e6a03622f5e441a3a7a9459469f”,“tiers”:,“amount”:19990,“currency”:“ISK”,“interval”:“month”,“metadata”:{},“nickname”:"",“created_at”:1623531132,“tiers_mode”:"",“usage_type”:“licensed”,“billing_scheme”:“per_unit”,“interval_count”:1,“aggregate_usage”:“sum”,“transform_usage”:{“round”:“up”,“divide_by”:1},“trial_period_days”:0},“type”:“subscription”,“amount”:19990,“period”:{“end”:1626740259,“start”:1624148259},“currency”:“ISK”,“metadata”:{},“quantity”:1,“proration”:false,“description”:“Áskrift að …”,“discountable”:true,“invoice_item”:"",“subscription”:“sub_55afcb592f05e027ae1b6163e55bd8b6”,“subscription_item”:“subi_3c7a85716e4709495bb33af551e904a8”}],“total”:24787.6,“number”:0,“payout”:null,“status”:“open”,“billing”:“pay_automatically”,“payment”:null,“currency”:“ISK”,“customer”:“cus_2bca62723eb95e65998b94d9a34ca00d”,“discount”:null,“due_date”:1626740259,“metadata”:{},“subtotal”:19990,“period_end”:1626740259,“description”:"",“tax_percent":24,“period_start”:1624148259,“subscription”:“sub_55afcb592f05e027ae1b6163e55bd8b6”,“attempt_count”:1,“payout_fields”:null,“billing_reason”:“subscription_create”,“days_until_due”:30,“payment_fields”:null,“statement_descriptor”:”"},“trigger_operation_id”:“d6d7f1b2-d515-4900-8cb9-5dbd6231c4c4”,“status”:“NEW”,“created_at”:1624148459}
What I’d expect should happen is that the number should be rounded to the nearest integer.
create subscription request that fails:
{
“customer”: “cus_2bca62723eb95e65998b94d9a34ca00d”,
“billing”: “pay_automatically”,
“days_until_due”: 0,
“cancel_at_period_end”: false,
“subscription_items”: [
{
“plan”: “plan_7e018e6a03622f5e441a3a7a9459469f”,
“quantity”: 1
}
],
“tax_percent”: 24
}