Prefill data
Send what you already know about the order and the customer in the data object when you create a session, so the customer does not have to type it again.
When you create a session, you can fill the data object with what you already know. The checkout then shows it, and the customer does not have to enter it.
What you can send
order: the cart and amounts. See Order line types.company.cin: the company identification number, andcompany.name. Only forcustomerType: "business".consumer:identificationNumber,dateOfBirth(YYYY-MM-DD) andname. Only forcustomerType: "consumer".billingandshipping:firstName,lastName,email,phoneNumber,streetAddress,streetAddress2,zip,city,region,countryandcompanyName.
The customer's details are optional. order is required for a one-time payment and must have currency (three letters), amountIncVat and cart. The API reference marks amountExVat as required too, so send it as well.
Example
{
"product": { "type": "payment", "intent": "payment_one_time" },
"customerType": "consumer",
"country": "SE",
"locale": "sv-se",
"urls": {
"terms": "https://example.com/terms",
"redirect": "https://example.com/confirmation"
},
"data": {
"order": {
"currency": "SEK",
"amountIncVat": 105000,
"amountExVat": 84000,
"cart": [
{
"productType": "physical",
"reference": "SKU-001",
"name": "Desk lamp",
"quantity": 1,
"quantityUnit": "pc",
"unitPrice": 84000,
"taxRate": 2500,
"discountPercentage": 0
}
]
},
"consumer": {
"dateOfBirth": "1985-04-12",
"name": "Anna Andersson"
},
"billing": {
"firstName": "Anna",
"lastName": "Andersson",
"email": "anna@example.com",
"phoneNumber": "+46701234567",
"streetAddress": "Storgatan 1",
"zip": "11122",
"city": "Stockholm",
"country": "SE"
},
"shipping": {
"firstName": "Anna",
"lastName": "Andersson",
"streetAddress": "Storgatan 1",
"zip": "11122",
"city": "Stockholm",
"country": "SE"
}
}
}In the checkout
In Briqpay's own billing and shipping steps, the customer can still edit prefilled details. To stop that, set modules.config.billing.lockFields or modules.config.shipping.lockFields to an object that gives each field name a lock: hard_lock allows no edits, and soft_lock locks a field only if it has a value. In the Payment Module setup those steps aren't shown, so there is nothing to lock. See Create session.