Customer Payment

NetSuite exposes the customer payment record to REST web services. A customer payment transaction records a customer payment and applies it to the appropriate invoice or cash sale, decreasing the amount due, and tracking revenue.

The customer payment record has no subrecords.

There are no prerequisites for using this record through REST web services.

For more information about the customer payment record, see Customer Payments.

The REST API Browser includes information about the field names and field types of the customer payment record. It also includes the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser’s customerPayment reference page.

For information about using the REST API Browser, see The REST API Browser.

Record ID

The record ID for the customer payment REST record is customerpayment.

Code Samples

The following code samples show how to work with the customer payment record.

Creating a Customer Payment Record

                { "account": { "id": "1" }, "apply": { "items": [ { "doc": { "apply": true, "id": "104", "line":0 }, "disc": 5, "amount": 200.0 } ] }, "currency": { "id": "1" }, "customer": { "id": "4" }, "payment": 250, }, "memo": 10, "toBeEmailed": false
} 

              

Getting an Existing Customer Payment by ID

                HTTP method: GET
URL: {{COMPANY_URL}}/services/rest/record/v1/customerpayment/{{customerPaymentId}} 

              

Changing the Applied Invoice Amount by Updating an Existing Customer Payment by ID

                HTTP method: PATCH
URL: {{COMPANY_URL}}/services/rest/record/v1/customerpayment/{{customerPaymentId}}
Request body: { "apply": { "items": [ { "doc": { "id": "4" }, "amount": 200 } ] }, "customer": { "id": "4" }
} 

              

Adding an Invoice to Apply by Updating an Existing Customer Payment by ID

                HTTP method: PATCH
URL: {{COMPANY_URL}}/services/rest/record/v1/customerpayment/{{customerPaymentId}}
Request body: { "apply": { "items": [ { "doc": { "id": "104" }, "amount": 10 } ] }, "customer": { "id": "4" }
} 

              

Unapply an Invoice by Updating an Existing Customer Payment by ID

                { "apply": { "items": [ { "doc": { "id": "104" }, "apply": false } ] }, "customer": { "id": "4" }
} 

              
                { "apply": { "items": [ { "doc": { "id": "104" }, "amount": 0 } ] }, "customer": { "id": "4" }
} 

              

Related Topics

General Notices