Skip to content

Print-one/print-one-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1a875ab · Aug 28, 2024
Jul 1, 2024
Aug 7, 2024
Aug 27, 2024
Aug 27, 2024
Nov 1, 2023
May 15, 2024
May 22, 2024
Nov 1, 2023
Nov 1, 2023
Nov 1, 2023
Nov 1, 2023
Aug 28, 2024
May 15, 2024
Nov 1, 2023
Jul 3, 2024
Feb 19, 2024
Aug 28, 2024
Aug 28, 2024
Jul 1, 2024
Feb 13, 2024
Feb 19, 2024
Nov 30, 2023
May 22, 2024

Repository files navigation

Print-one.js

npm package Build Status Issues Semantic Release

The official javascript client for Print.one

Installation

npm install @print-one/print-one-js

Example

import { PrintOne } from '@print-one/print-one-js'

const client = new PrintOne("<YOUR API TOKEN>");

const templates = await client.getTemplates();
const template = templates[0];

const order = await client.createOrder({
    recipient: {
        name: "John Doe",
        address: "Example Street 2",
        city: "Anytown",
        postalCode: "1234AB",
        country: "NL",
    },
    template: template,
    // All other options are optional
    sender: {
        name: "Jane Doe",
        address: "Example Street 1",
        addressLine2: "Apt 1",
        city: "Anytown",
        postalCode: "1234AB",
        country: "NL",
    },
    finish: Finish.GLOSSY,
    mergeVariables: {
        couponCode: "ABC123"
    },
    billingId: "8073",
    sendDate: "2021-01-01",
});

const download = await order.download();

fs.writeFileSync("order.pdf", download);

Help

  • For documentation and more examples, see the documentation.
  • With problems, questions or suggestions, please file an issue.
  • For other questions, feel free to contact us at our support page.