#shaharyar-ilyas_api

1 messages ¡ Page 1 of 1 (latest)

wind hazelBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1234422237893890138

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

fallow hazelBOT
mystic wave
#

hi there!

#

can you share an Invoice ID (in_xxx) where you want to do this?

flat iron
#

ok

#

@mystic wave

mystic wave
#

this specific invoice is already finalized, so it can no longer be changed. but for future invoices you can make sure that the customer has no shipping information set.

flat iron
#

i have not set any shipping info but still get this

mystic wave
flat iron
#

i'm using this payload to create a customer:

    name: customer?.name || null,
    email: customer?.email || null,
    phone: customer?.phone || null,
    address: {
      line1: customer?.address?.line1 || null,
      city: customer?.address?.city || null,
      postal_code: customer?.address?.postal_code || null,
      country: customer?.address?.country || null,
    },```
#

is there any problem in this payload

mystic wave
#

yes exactly

#

no there's no problem, but since you added a shipping address to the customer, it automatically gets added to the invoice

flat iron
#

but, i'm not adding shipping info as you can see but get detail in the invoice

#

not sure how?

#
    customer: customer_id,
    days_until_due: body?.days_until_due || null,
    collection_method: "send_invoice",
    currency: CURRENCY,
    default_tax_rates:
      !!body?.add_vat && !!vat_tax_rate_id ? [vat_tax_rate_id] : [],
    custom_fields: [
      ...(vat_id ? [{ name: "VAT", value: vat_id }] : []),
    metadata: {
      user_id,
      account_id,
      vat_included: !!body?.add_vat,
      payment_option: INVOICE_PAYMENT_OPTIONS[body?.payment_option],
      send_invoice_copy: !!body?.send_invoice_copy,
    },
    on_behalf_of: account_id,
    transfer_data: { destination: account_id },
  });```
#

my inovice payload

mystic wave
#

there you can see the shipping address is set

flat iron
#

okay; let me see in the code

#

one more question, i want to add my bussiness address in the invoice; how i acheive this

#

@mystic wave

mystic wave
#

please stop pinging me and be patient.

flat iron
#

Thanks for your support

#

it will be helpful