Jump to content

Kelvin Lacy

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Kelvin Lacy

  1. I can't find any examples of how specifically to code the call. My first refund attempt seems to be raising an odd error. The allocated artefact is an on account payment id. Can you point me at a good example or suggest what might be wrong? Thank you 2022-01-04 09:41:13: Array ( [contact_payment] => Array ( [transaction_type_id] => CUSTOMER_REFUND [payment_method_id] => ELECTRONIC [contact_id] => ffaa7373274f05114c419a72bab3dba6 [bank_account_id] => ffaab5139b12f1be428d8effc53a3104 [date] => 2022-01-03 [reference] => ZZZ0281 [total_amount] => 130.00 [allocated_artefacts] => Array ( [0] => Array ( [artefact_id] => 6088be58e9a34db286cbb1429acbcfff [amount] => 130.00 ) ) ) ) 2022-01-04 09:41:14: Refund creation failed: error code 422 2022-01-04 09:41:14: result array Array ( [0] => stdClass Object ( [$severity] => error [$dataCode] => RecordInvalid [$message] => You can only pay unpaid or part-paid invoices. [$source] => base ) )
  2. Mark - am I correct in assuming Sage then creates a new receipt for any residual unallocated amount? And it should then be returned if I list all contact payments?
  3. Thanks Mark, yes in a certain situation (this being it!) I was indeed passing the returned transaction id rather than the payment_on_account_id.
  4. These three sales invoices are unpaid and there is 84.00 yet to allocate. Listing all artefacts verify this as the case. (Artefact id's shown below are obfuscated!) Can you suggest what is going wrong? Sage Call: 'https://api.accounting.sage.com/v3.1/contact_allocations' [contact_allocation] => Array ( [transaction_type_id] => CUSTOMER_ALLOCATION [contact_id] => xxxxb5201cc64b4e9c443e1d6e32b325 [date] => 2021-10-11 [allocated_artefacts] => Array ( [0] => Array ( [artefact_id] => xxxxx03160149f887cfaa495da1150d [amount] => 14.00 ) [1] => Array ( [artefact_id] => xxxxxxee62e604c80ae5fe1759fd8aa21 [amount] => 35.00 ) [2] => Array ( [artefact_id] => xxxxx850a72c4c729e0e1abb5d851ee6 [amount] => 35.00 ) [3] => Array ( [artefact_id] => xxxxx72b64d2985e48668ed24cb88 [amount] => -84 ) ) ) 2021-10-23 13:06:30DST: Sage API Response Code: 422 2021-10-23 13:06:30DST: Severity: error 2021-10-23 13:06:30DST: dataCode: RecordInvalid 2021-10-23 13:06:30DST: message: Couldn't find Sales Payable Artefact. Hope you can help, all other calls in the integration are working fine!
×
×
  • Create New...