### Start Development Server Source: https://github.com/parcelcraft/docs/blob/main/README.md Starts the development server and makes it accessible at localhost:3000. ```bash pnpm dev ``` -------------------------------- ### Enable Invoices for Stripe Checkout Sessions Source: https://github.com/parcelcraft/docs/blob/main/pages/enable-1-click-shipping/setup-stripe-invoicing.mdx Example of creating a Stripe Checkout Session with invoice creation enabled. ```javascript const session = await stripe.checkout.sessions.create({ payment_method_types: ['card'], line_items: [ { price_data: { currency: 'usd', product_data: { name: 'T-shirt', }, unit_amount: 2000, }, quantity: 1, }, ], mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', invoice_creation: { enabled: true, }, }); ``` -------------------------------- ### Install Dependencies Source: https://github.com/parcelcraft/docs/blob/main/README.md Installs the project dependencies using pnpm. ```bash pnpm i ``` -------------------------------- ### SendGrid dynamic email templates - Subject Line Source: https://github.com/parcelcraft/docs/blob/main/pages/additional-automation/custom-email-notifications.mdx Example subject line for a SendGrid dynamic email template using handlebars variables. ```hbs Shipping confirmation from {{#if from_address.company}}{{from_address.company}}{{else}}{{from_address.name}}{{/if}} ``` -------------------------------- ### SendGrid dynamic email templates - Body Source: https://github.com/parcelcraft/docs/blob/main/pages/additional-automation/custom-email-notifications.mdx Example body for a SendGrid dynamic email template using handlebars variables for customer tracking notifications. ```hbs Hi {{to_address.name}}, Good news! Your shipment from {{#if from_address.company}}{{from_address.company}}{{else}}{{from_address.name}}{{/if}} is on its way. Your tracking number is {{tracking_code}} (shipped via {{service_name}}). {{tracking_URL}} {{#if message}}A note was added by the shipper for you:{{/if}} {{#if message}}{{message}}{{/if}} Tracking information may not appear until the shipment is in the carrier's possession. This message was autogenerated on behalf of {{#if from_address.company}}{{from_address.company}}{{else}}{{from_address.name}}{{/if}}. If you have questions about this shipment please contact them directly. Thank you! Your friendly shipping robot ``` -------------------------------- ### robots.txt Configuration Source: https://github.com/parcelcraft/docs/blob/main/public/robots.txt Standard robots.txt directives for controlling crawler access. ```robots.txt # * User-agent: * Allow: / # Host Host: https://docs.parcelcraft.com # Sitemaps Sitemap: https://docs.parcelcraft.com/sitemap.xml ``` -------------------------------- ### Test Data for Shipment Notification Source: https://github.com/parcelcraft/docs/blob/main/pages/additional-automation/custom-email-notifications.mdx This JSON object represents sample data for a shipment notification, including details about the shipment, addresses, postage, and fees. ```JSON { "created_at": "2023-08-29T11:00:10Z", "is_return": false, "carbon_offset": false, "service_name":"UPS Next Day Air", "tracking_URL":"http://wwwapps.ups.com/WebTracking/processRequest?HTMLVersion=5.0&Requester=NES&AgreeToTermsAndConditions=yes&tracknum=", "mode": "production", "options": { "print_custom_1": "printCustom1", "print_custom_2": "printCustom2", "print_custom_3": "printCustom3", "invoice_number": "INVOICE12345", "label_size": "4X6", "label_format": "PNG", "currency": "USD", "payment": { "type": "SENDER" }, "date_advance": 0 }, "reference": null, "status": "delivered", "tracking_code": "1ZXXXXXXXXXXXXXXXX", "updated_at": "2023-08-29T11:04:22Z", "batch_id": null, "batch_status": null, "batch_message": null, "customs_info": null, "from_address": { "id": "adr_391f1136465b11eeba1b3cecef1b359e", "object": "Address", "created_at": "2023-08-29T11:00:10+00:00", "updated_at": "2023-08-29T11:00:10+00:00", "name": "Clark Kent", "company": "Parcelcraft", "street1": "123 Kent Lane", "street2": null, "city": "Smallville", "state": "KS", "zip": "67524", "country": "US", "phone": "4153334445", "email": "support@parcelcraft.com", "mode": "test", "carrier_facility": null, "residential": null, "federal_tax_id": null, "state_tax_id": null, "verifications": {} }, "insurance": null, "order_id": null, "parcel": { "id": "prcl_05dcf71b0e1d4c3d8bb7515da2201180", "object": "Parcel", "created_at": "2023-08-29T11:00:10Z", "updated_at": "2023-08-29T11:00:10Z", "length": 20.2, "width": 10.9, "height": 5, "predefined_package": null, "weight": 3.9, "mode": "test" }, "postage_label": { "object": "PostageLabel", "id": "pl_d9c28bb80d334cdab9c61e83c6a81fac", "created_at": "2023-08-29T11:00:12Z", "updated_at": "2023-08-29T11:00:13Z", "date_advance": 0, "integrated_form": "none", "label_date": "2023-08-29T11:00:12Z", "label_resolution": 200, "label_size": "4x7", "label_type": "default", "label_file_type": "image/png", "label_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20230829/e8f4c805339eaf4e4598f10da10fa0a064.png", "label_pdf_url": null, "label_zpl_url": null, "label_epl2_url": null, "label_file": null }, "message": "Thank you for your order!", "refund_status": null, "scan_form": null, "selected_rate": { "id": "rate_f170b1e31d9b4831b5bb250bd235155b", "object": "Rate", "created_at": "2023-08-29T11:00:12Z", "updated_at": "2023-08-29T11:00:12Z", "mode": "test", "service": "NextDayAir", "carrier": "UPSDAP", "rate": "50.85", "currency": "USD", "retail_rate": "130.61", "retail_currency": "USD", "list_rate": "138.71", "list_currency": "USD", "billing_type": "easypost", "delivery_days": 1, "delivery_date": null, "delivery_date_guaranteed": true, "est_delivery_days": 1, "shipment_id": "shp_d0c2d25409af42d982adc7f2a87e3209", "carrier_account_id": "ca_35354e128d45462ea1ead3246d558458" }, "to_address": { "id": "adr_391c36bd465b11eea97fac1f6bc539ae", "object": "Address", "created_at": "2023-08-29T11:00:10+00:00", "updated_at": "2023-08-29T11:00:10+00:00", "name": "Lois Lane", "company": null, "street1": "456 Daily Planet Avenue", "street2": null, "city": "Metropolis", "state": "IL", "zip": "62960", "country": "US", "phone": "8573875756", "email": "dr_steve_brule@gmail.com", "mode": "test", "carrier_facility": null, "residential": null, "federal_tax_id": null, "state_tax_id": null, "verifications": {} }, "forms": [], "fees": [ { "object": "Fee", "type": "LabelFee", "amount": "0.01000", "charged": true, "refunded": false }, { "object": "Fee", "type": "PostageFee", "amount": "50.85000", "charged": true, "refunded": false } ], "id": "shp_d0c2d25409af42d982adc7f2a87e3209", "object": "Shipment" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.