---
title: "Add payment records to invoices"
method: POST
path: "/invoices/Payments"
tags: ["Invoices"]
---

# Add payment records to invoices

`POST /invoices/Payments`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/invoices/Payments`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/invoices/Payments/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates payment records for the invoices in the *Approved* status in bulk.
             <br />**Note**: This method is available to users with the *Invoice Admin* role and with the *InvoiceChangeToPaid* feature flag enabled.
             <br />**Example Request**
             
                 POST /invoices/Payments
                 {
                   "Payments": [
                     {
                       "InvoiceId": 96814318,
                       "PaymentDate": "2021-12-13T06:12:22.820Z",
                       "PaymentNumber": "456858",
                       "PaymentAmount": 756
                     },
                     {
                       "InvoiceId": 4988659,
                       "PaymentDate": "2021-12-13T06:12:22.820Z",
                       "PaymentNumber": "97027818",
                       "PaymentAmount": 1250.55
                     }  
                   ]
                 }

## Request body

- ServiceChannelServicesMessagingInvoicesInvoicePaymentBulkRequest: Request model to add payment records in bulk.
  - `Payments` ServiceChannelServicesMessagingInvoicesAddInvoicePaymentRequest[]
    - `InvoiceId` integer: Unique numeric invoice identifier.
    - `PaymentDate` string, date-time: Date and time when the specified invoice is paid. Cannot be prior to the invoice creation date.
    - `PaymentNumber` string: Number provided by a user when adding a payment record.
    - `PaymentAmount` number, double: Amount of the payment. Cannot exceed the total amount of the invoice. If it’s a credited invoice, a single payment is required with a minus before the payment amount.

## Response `201`

The payments are successfully added.
            <br/>Error codes:
            503 - Request is invalid
            1178 - Invoice cannot be paid before the invoice creation date
            1178 - Invoice has already been paid
            1178 - No invoice ID
            1178 - Only approved invoices may be paid
            1178 - Payment amount exceeds the actual invoice amount
            1178 - Payment amount should be more than zero
            1178 - Payment is not allowed for this subscriber
            1178 - Payment number cannot exceed 100 characters

- ServiceChannelServicesMessagingInvoicesInvoicePaymentBulkResponse: Invoice payments response object.
  - `Payments` ServiceChannelServicesMessagingInvoicesAddInvoicePaymentResponse[]
    - `PaymentDate` string, date-time: Date and time when the specified invoice is paid.
    - `PaymentId` integer: Unique numeric invoice payment ID.
    - `Error` ServiceChannelServicesMessagingInvoicesResponseError: Object details of the response error.
      - `Code` integer: Code of an error that shows why the request has failed.
      - `Message` string: Reason for the request failure.
    - `InvoiceId` integer: Unique numeric invoice identifier.
    - `PaymentNumber` string: Number provided by a user when adding a payment record.
    - `PaymentAmount` number, double: Amount of the payment. Cannot exceed the total amount of the invoice. If it’s a credited invoice, a single payment is required with a minus before the payment amount.

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 503 - Request is empty or null
- `401`: The request is not authorized. <br/>Error codes: 504 - API call rejected by security permissions
- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 100 - User has no permissions to perform this action
- `500`: The server was unable to complete the request due to an internal error. <br/>Error codes: 501 - Error updating invoices payments in bulk mode

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
