---
id: activateinvoice
title: Activate Invoice
hide_title: true
description: "Activating invoices"
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Flag from '../../../../src/components/flag/flag';
import Ingress from '../../../../src/components/ingress/ingress.react';

<Ingress title="Activate Invoice">
Activation of an invoice should be done when the goods are ready to be sent. This request fully activates the invoice. 
Normally an invoice needs to be activated within 90 days from placing an order.
</Ingress>

## Parameters

| Field         | min Occurs | nillable | Max | Type          | Description                                                                                                                        |
| ------------- | ---------- | -------- | --- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Username      | 1          | false    | 50  | string        | The username used to authorize the request.                                                                                       |
| Password      | 1          | false    | 50  | string        | The password used to authorize the request.                                                                                        |
| CorrelationId | 1          | false    | 50  | string        | CorrelationID is sent back in the response.                                                                                        |
| CountryCode   | 1          | false    | 2   | string        | The country code (ISO 3166-1 alpha-2) for the country.                                                                             |
| InvoiceNumber | 1          | false    | 50  | string        | The invoice number previously returned in AddInvoice.                                                                              |
| PaymentInfo   | 1          | false    | -   | [PaymentInfo] | Bank or invoice Information for payout. Used in this request to replace the PaymentInfo sent in the AddInvoice request, if needed. |
| StoreId       | 1          | false    | -   | int           | The StoreId used for identification of store.                                                                                      |

#### PaymentInfo

| Parameter         | Required | Type   | Max | Description                                                                                       |
| :---------------- | :------- | :----- | :-- | :------------------------------------------------------------------------------------------------ |
| ReceiverName      |          | string | 64  | Name of the company                                                                               |
| ReceiverRegNumber |          | string | 64  | The organization number of receiving company                                                      |
| PaymentReference  |          | string | 350 | Reference added to the payment. OCR number must be no longer than 20 characters                   |
| BankAccount       |          | string | 50  | Bank account number. For bank account types with multiple parts "&#124;" (pipe) is used as a delimiter. |
| BankAccountType   |          | int    |     |                                                                                                   |

#### BankAccountType

- 0 - Bic Iban (DEUTDEFF DE99203205004989123456)
- 1 - Iban (DE99203205004989123456)
- 2 - Plusgiro, with OCR
- 3 - Plusgiro, with message
- 4 - Bankgiro, with OCR
- 5 - Bankgiro, with message

## Response

| Field             | min Occurs | nillable | Max | Type     | Description                                                |
| ----------------- | ---------- | -------- | --- | -------- | ---------------------------------------------------------- |
| CorrelationId     | 1          | true     | 50  | string   | CorrelationID from the request if any.                     |
| DueDate           | 1          | false    | 12  | datetime | The due date of the invoice.                               |
| InvoiceUrl        | 1          | false    | 200 | string   | The url to invoice in pdf format.                          |
| LowestAmountToPay | 1          | false    | 6,2 | decimal  | The lowest amount to pay on the invoice.                   |
| PaymentReference  | 1          | true     | 50  | string   | The Reference that should be as a reference on an invoice. |
| TotalAmount       | 1          | false    | 6,2 | decimal  | The total amount to pay for the invoice.                   |

### Example Requests

| &nbsp;       | Value                                                                                         |
| ------------ | :-------------------------------------------------------------------------------------------- |
| Environment: | UAT                                                                                           |
| Service:     | PaymentService                                                                                |
| URL:         | https://ecommercetest.collector.se/v3.0/PaymentServiceV10.svc?wsdl                            |
| Function:    | ActivateInvoice                                                                               |
| Description: | The operation returns invoice information of a customer based on a civic registration number. |
| Notes:       | N/A                                                                                           |

<Tabs defaultValue="reqB2C" values={[
{ label: 'B2C Request', value: 'reqB2C', },
{ label: 'B2C Response', value: 'resB2C', }]}>
<TabItem value="reqB2C">

```xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pay="http://schemas.ecommerce.collector.se/v30/PaymentService">
   <soapenv:Header>
      <pay:Username>USERNAME</pay:Username>
      <pay:Password>PASSWORD</pay:Password>
   </soapenv:Header>
   <soapenv:Body>
      <pay:ActivateInvoiceRequest>
         <pay:CorrelationId>ActivateInvoiceV10</pay:CorrelationId>
         <pay:CountryCode>SE</pay:CountryCode>
         <pay:InvoiceNo>62366761</pay:InvoiceNo>
         <pay:StoreId>1234</pay:StoreId>
      </pay:ActivateInvoiceRequest>
   </soapenv:Body>
</soapenv:Envelope>
```

</TabItem>
<TabItem value="resB2C">

```xml
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <ActivateInvoiceResponse xmlns="http://schemas.ecommerce.collector.se/v30/PaymentService">
         <CorrelationId>ActivateInvoiceV10</CorrelationId>
         <DueDate>2020-05-31T23:59:59</DueDate>
         <InvoiceUrl>https://minasidor-internaltest.collector.se/invoice?id=1_PYWD6cpApt4ADXWDVU19_lNsvkChyldlQByPOdGXy7avQ-n0_ndZB0PkBtkJHu3HhJCMET_Xw4QnsRDMoGLjo8EHotk28csYqUVyvBiHNIV5MDmZnAEKyfqvPHHPs7&amp;language=sv-SE</InvoiceUrl>
         <LowestAmountToPay>710.00</LowestAmountToPay>
         <PaymentReference>100002387703056</PaymentReference>
         <TotalAmount>710.00</TotalAmount>
      </ActivateInvoiceResponse>
   </s:Body>
</s:Envelope>
```

</TabItem>
</Tabs>

### Error Codes

Please see separate page [Error Codes](/docs/paymentsApi/integration/creating-purchases/addinvoice)

| Fault Code        | Description                              |
| :---------------- | :--------------------------------------- |
| INVOICE_NOT_FOUND | The invoice number does not exist.       |
|                   |                                          |
