Skip to main content
All CollectionsCloud Commerce ProAPI
CCP - Open API: Paying an Invoice for an Order
CCP - Open API: Paying an Invoice for an Order

Using the API to get the details of an invoice against an order

Chelsea Kelly avatar
Written by Chelsea Kelly
Updated over a week ago

The CreatePayment function can:-

  • assign a payment against a known invoice

The CreatePayment function will return a generic response which includes:-

  • Success indicator if the payment was made or not

  • Content the PaymentID for the payment if successful, useful for internal logging

Tips and Recommendations when using this function

  • Pass in the InvoiceID returned from the getInvoiceSummaryForOrderID function as the intInvoiceID for the function

  • Use the amounts returned from the getInvoiceSupportForOrderID function to calculate the payment value to use for dbPaymentAmount if wanting to pay an invoice in full

  • intSalesChannelID and intCustomerID relating to the invoice can be found in the result of the AddCustomer function, if this function was used when inputting the order.

  • TransactionTypeID should be set to Invoice if you want to pay an invoice

  • The recommended date format for dtPaymentDate is 2021-10-22T12:01:44

  • It is recommended that you embed an order reference into a short description for strPaymentReference

Endpoints

All requests for this function need to go to the following endpoint:

LIVE: https://wcfccpservicesbase.cloudcommercepro.com/CCPApiPaymentService.svc?wsdl

Example Minimal Request to pay an order for so that it falls into the Dispatch Queue:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header />
<soapenv:Body>
<tem:CreatePayment>
<tem:request>
<tem:BrandID>12</tem:BrandID>
<tem:SecurityHash>98,114,159,142,193,251,85,184,254,121,38,92,206,180,142,179,121,224,68,1,122,17,132,158,161,85,26,91,35,133,149,245,249,30,232,38,46,136,226,91,92,75,42,87,66,254,33,14,189,56,127,61,73,130,74,177,221,164,220,185,187,148,1,78,153,81,198,54,170,115,167,130,150,131,242,183,8,208,2,110,61,185,217,246,38,108,235,177,4,231,20,218,60,104,219,37,209,139,29,195,160,80,62,44,7,234,167,220,219,228,30,82,223,173,14,73,105,67,44,211,1,16,255,181,125,179,141,103</tem:SecurityHash>
<tem:Content>
<tem:intInvoiceID>86592563</tem:intInvoiceID>
<tem:intBrandID>12</tem:intBrandID>
<tem:intSalesChannelID>36</tem:intSalesChannelID>
<tem:strPaymentReference>Payment made against external order: TEST23456</tem:strPaymentReference>
<tem:dbPaymentAmount>12.00</tem:dbPaymentAmount>
<tem:intCustomerID>96354316</tem:intCustomerID>
<tem:dtPaymentDate>2021-10-22T12:01:44</tem:dtPaymentDate>
<tem:TransactionTypeID>Invoice</tem:TransactionTypeID>
</tem:Content>
</tem:request>
</tem:CreatePayment>
</soapenv:Body>
</soapenv:Envelope>


Example of Successful Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreatePaymentResponse xmlns="http://tempuri.org/">
<CreatePaymentResult>
<Success>true</Success>
<ErrorLevel>0</ErrorLevel>
<ErrorMessage />
<Content>84975726</Content>
<Errors />
</CreatePaymentResult>
</CreatePaymentResponse>
</s:Body>
</s:Envelope>
Did this answer your question?