Pay Upon Invoice

This guide shows you how to integrate Pay Upon Invoice, a local buy now, pay later invoice payment method for buyers in Germany, into your Braintree Web SDK v4 checkout.

OverviewAnchorIcon

Pay Upon Invoice is an invoice payment method in Germany. It's a local buy now, pay later payment method that lets the buyer place an order, receive the goods, verify they're in good order, and then pay the invoice within 30 days. The buyer doesn't need a PayPal account to use Pay Upon Invoice. Braintree/PayPal has partnered with Ratepay to provide this service. This payment method is also called Rechnungskauf mit Ratepay in German.

Check eligibility requirementsAnchorIcon

Payment typeBuyer countriesSeller countriesCurrency codesCustomer transaction limits
pay_upon_invoiceGermanyGermanyEURMin: 5.00 EUR, Max: 2500.00 EUR
  • This integration is available only in Germany to eligible merchants. The only supported currency is euros.
  • You must sell goods in the B2C model only.
  • You must ship orders within seven days after the transaction.
  • You must be approved to accept transactions using this payment method. PayPal asks you to enter a valid VAT ID Number as per EU regulations. Without a valid VAT ID for your business, Braintree/PayPal must collect additional VAT as applicable on Braintree/PayPal fees.
  • Request approval to use Pay Upon Invoice by contacting the Braintree support team.

See how Pay Upon Invoice worksAnchorIcon

Braintree/PayPal facilitates the interaction between you and Ratepay:

  1. Braintree/PayPal sends the buyer information to Ratepay for risk assessment. Depending on the result, Ratepay sends the buyer payment instructions or a rejection notice.
  2. You're funded immediately when the buyer successfully completes the checkout process with the Pay Upon Invoice method. The buyer pays Ratepay instead of you. Ratepay is responsible for following up with the buyer to confirm payment.
  3. You must inform the buyer that they have 30 days to pay Ratepay by bank transfer.
  4. Braintree/PayPal might contact you if a buyer opens a dispute with Ratepay. You must respond to these inquiries.
  5. The buyer receives an invoice with cart details and Ratepay's payment instructions, including the payment reference number returned in the API response. Always use the payment instructions provided on a per-transaction basis to ensure accuracy. In the invoice, instruct the buyer to pay only through Ratepay.
  6. The buyer pays Ratepay by logging in to their bank account and making a bank transfer. If you have a simplified integration, you must ship the order within 7 calendar days.
  7. If the buyer doesn't pay by the due date, Ratepay charges the buyer dunning fees. You don't need to take any action during the follow-up and dunning process.

Handle disputesAnchorIcon

Buyers can open a dispute with Ratepay. You must respond within 10 business days with evidence, either through the PayPal Resolution Center or with the Disputes API. If you don't respond within the timeframe, you're subject to an automatic reversal of the disputed funds. When responding to disputes, you must, depending on the dispute type:

  • Provide the carrier name and shipping tracking number. You need these to respond to an "Item Not Received" dispute.
  • Provide the invoice you sent to the buyer as part of the evidence.
  • Provide additional written explanation in certain cases. For example, if a buyer returned the item and claims they didn't receive a refund.
  • Retain the proof of shipment and delivery for at least 180 days from the time of order placement. Ratepay might ask you for this evidence after 90 days of order placement to legally defend a buyer-defaulted transaction. If you don't provide this evidence, you're subject to an automatic reversal of the disputed funds.

Carrier companies delete tracking information after 90 days, so keep an image or PDF copy so you can respond to the dispute and avoid the reversal of funds.

Provide shipment informationAnchorIcon

As soon as you make a shipment, send tracking information to PayPal. Include the tracking ID and carrier name through either the:

  • PayPal Add Tracking API. Send shipment tracking numbers for all Rechnungskauf mit Ratepay transactions. Set notify_buyer to false for all Pay Upon Invoice transactions.
  • Transaction details page in your PayPal account.

Providing this information to PayPal can help you respond to dispute cases later, especially in older cases where you can't get tracking information from your carrier.

Access VAT statementsAnchorIcon

You can access monthly VAT statements through your PayPal account. These statements reflect a summary of VAT collected by PayPal for any fees PayPal charges. You can use these statements to claim your tax credits or self-assessment of VAT charges.

PrerequisitesAnchorIcon

Before you integrate Pay Upon Invoice, make sure you have:

  • A verified PayPal business account, linked in the Braintree Control Panel, with Pay Upon Invoice approved for your merchant account.
  • Accepted the Rechnungskauf mit Ratepay terms, which are part of the PayPal User Agreement.
  • A valid VAT ID Number on file, if your business is subject to EU VAT regulations.
  • A Braintree Web SDK v4 client instance and a data collector component, because startPayment requires the riskCorrelationId that the data collector component returns.
  • A button or other element in your checkout page, such as pui-button in the following examples, that starts the payment flow.

Configure your accountAnchorIcon

To process Local Payment Methods, you need a valid PayPal business account, created, verified, and linked in the Braintree Control Panel. This account is required for onboarding and provisioning, funds movement, reporting, and viewing and responding to disputes.

For direct merchants, you also need to onboard the linked PayPal account using the following links:

Integrate FraudNetAnchorIcon

FraudNet is a PayPal-developed JavaScript library embedded into your web page to collect browser-based data that helps reduce fraud. During checkout, PayPal Risk Services uses this data for fraud and risk assessment. FraudNet supports desktop browsers only. PayPal uses the data FraudNet collects for risk analysis and authentication, and doesn't share it with third parties for their own independent benefit.

The Client SDK automatically adds the FraudNet library to your web page after the braintree.dataCollector entity is created. You still need to complete the data collector component's integration steps to use it on your page. See the data collector component of the Client SDK for more information.

Invoke Pay Upon InvoiceAnchorIcon

  • You must invoke the startPayment method for preprocessing and result handling.
  • The startPayment method requires the riskCorrelationId parameter. The following example shows how to retrieve the riskCorrelationId from the data collector component.
  1. Async/Await
// Create a client.
async function setupPayUponInvoice() {
    try {
        const clientInstance = await braintree.client.create({
            authorization: 'CLIENT_AUTHORIZATION'
        });

        const [dataCollectorInstance, localPaymentInstance] = await Promise.all([
            // Create a data collector component.
            braintree.dataCollector.create({
                client: clientInstance
            }),
            // Create a local payment component.
            braintree.localPayment.create({
                client: clientInstance,
            }),
        ]);

        const riskCorrelationId = dataCollectorInstance.rawDeviceData.correlation_id;
        const puiButton = document.getElementById('pui-button');

        puiButton.addEventListener('click', async function () {
            // Invoke Pay Upon Invoice...
            try {
                await localPaymentInstance.startPayment({
                    paymentType: 'pay_upon_invoice',
                    amount: '100.00',
                    currencyCode: 'EUR',
                    givenName: 'Max',
                    surname: 'Mustermann',
                    address: { // This is used as the shipping address.
                        streetAddress: 'Taunusanlage 12',
                        locality: 'Frankfurt',
                        postalCode: '60325',
                        countryCode: 'DE',
                    },
                    // PUI specific parameters
                    billingAddress: {
                        streetAddress: 'Schönhauser Allee 84',
                        locality: 'Berlin',
                        postalCode: '10439',
                        countryCode: 'DE'
                    },
                    birthDate: '1990-01-01',
                    email: '[email protected]',
                    locale: 'en-DE',
                    customerServiceInstructions: 'Customer service phone is +49 6912345678.',
                    lineItems: [{
                        category: 'PHYSICAL_GOODS',
                        name: 'Basketball Shoes',
                        quantity: '1',
                        unitAmount: '81.00',
                        unitTaxAmount: '19.00',
                    }],
                    phone: '6912345678',
                    phoneCountryCode: '49',
                    riskCorrelationId: riskCorrelationId,
                    onPaymentStart: function (data) {
                        // NOTE: It is critical here to store data.paymentId on your server
                        // so it can be mapped to a webhook sent by Braintree once the
                        // buyer completes their payment.
                        console.log('Payment ID:', data.paymentId);
                    },
                });
            } catch (err) {
                // Handle any error calling startPayment.
                console.error(err);
            }
        });
    } catch (err) {
        // Handle any error creating the client, data collector component,
        // or local payment component.
        console.error(err);
    }
}

When calling startPayment, the following parameters are required for the pay_upon_invoice payment type:

  • address
  • amount
  • billingAddress
  • birthDate
  • currencyCode
  • customerServiceInstructions
  • email
  • givenName
  • lineItems
  • locale
  • onPaymentStart
  • paymentType
  • phone
  • phoneCountryCode
  • riskCorrelationId
  • surname

Capture Pay Upon Invoice transactionsAnchorIcon

There's no capture call for Pay Upon Invoice transactions. Braintree associates a transaction on behalf of the merchant after it receives confirmation that the invoice is confirmed.

Configure webhooksAnchorIcon

A webhook integration is required for Pay Upon Invoice. Webhooks confirm a successful invoice-based transaction and notify you of a rejected invoice approval. See the webhooks guide for a general overview of how to configure webhooks. The following example shows a Local Payment funded webhook for when Ratepay approves the payment and creates a transaction:

  1. JSON
{
  "local_payment_funded": {
    "payment_id": "the_payment_id",
    "payment_context_id": "the_payment_context_id",
    "transaction": {
      "id": "the_transaction_id",
      "amount": 1.00,
      "currency_iso_code": "EUR",
      "created_at": "2022-03-07",
      "order_id": "the_order_id",
      "status": "settled"
    }
  }
}

The following example shows a Local Payment expired webhook for when the payment is rejected:

  1. JSON
{
  "local_payment_expired": {
    "payment_id": "the_payment_id",
    "payment_context_id": "the_payment_context_id"
  }
}

See the Local Payment Method webhooks reference for details on the exact content of the Local Payment Method completed notification.