404 error - when POST journal sets

Hi, i am trying to post journal sets and I keep getting a 404 error - resource not found. I am not an expert (self taught) so it may be a rookie error. Below is my code. I have checked other posts with similar issues and have included an Accept header. still struggling. I suspect the issue may be to do with the journal set number and journal entry number. I have setup an automation to find the latest numbers for a particular subdomain and added one to each but not sure if this is causing the issue. Grateful for any assistance?

input:

{
“uri”: “https://api.freeagent.com/v2/journal_sets”,
“method”: “POST”,
“headers”: {
“X-Subdomain”: “xxxxxxxx”,
“Authorization”: “sanitized”,
“Content-Type”: “application/json”,
“Accept”: “application/json”
},
“body”: {
“journal_set”: {
“url”: “https://api.freeagent.com/v2/journal_sets/4935541”,
“dated_on”: “2023-12-05”,
“description”: “Dividends Month 8 xxxxxx”,
“updated_at”: “2023-12-05T08:00:00.000Z”,
“tag”: “SAILApp”,
“journal_entries”: [
{
“url”: “https://api.freeagent.com/v2/journal_entries/16404021”,
“category”: “https://api.freeagent.com/v2/categories/908”,
“description”: “Dividend 2023-12-05 - xxxxxxxx”,
“debit_value”: “6372”
},
{
“url”: “https://api.freeagent.com/v2/journal_entries/16404022”,
“category”: “https://api.freeagent.com/v2/categories/907”,
“description”: “Shareholder Loan - xxxxxx”,
“user”: “https://api.freeagent.com/v2/users/958502”,
“debit_value”: “-6372”
},
{
“url”: “https://api.freeagent.com/v2/journal_entries/16404023”,
“category”: “https://api.freeagent.com/v2/categories/907”,
“description”: “Shareholder Loan - xxxxxx”,
“user”: “https://api.freeagent.com/v2/users/958502”,
“debit_value”: “-0”
}
]
}
}
}

Output response:

{
“statusCode”: 404,
“headers”: {
“Date”: “Thu, 07 Dec 2023 07:48:41 GMT”,
“Transfer-Encoding”: “chunked”,
“Connection”: “keep-alive”,
“Server”: “nginx”,
“Cache-Control”: “no-store”,
“Pragma”: “no-cache”,
“Content-Security-Policy”: “default-src ‘self’ https: https://.freeagent.com; font-src ‘self’ https: data:; img-src ‘self’ https: data:; object-src ‘self’; script-src ‘self’ https: data: ‘unsafe-eval’ ‘unsafe-inline’ https://.demdex.net https://.g.doubleclick.net https://.google-analytics.com https://.googleadservices.com https://.googleapis.com https://.googletagmanager.com https://.omtrdc.net https://.rollbar.com https://.wistia.com https://.wistia.net https://.zdassets.com https://analytics.twitter.com https://api.stripe.com https://assets.freeagent.com https://assets.staging.fre.ag https://bat.bing.com https://connect.facebook.net https://fls.doubleclick.net https://freeagent-assets.s3.amazonaws.com https://freeagent-videos.s3.amazonaws.com https://js.stripe.com https://static.ads-twitter.com https://tagmanager.google.com https://widget.trustpilot.com https://www.google.com https://www.gstatic.com https://.bing.com https://.googletagmanager.com https://.stripe.com; style-src ‘self’ https: ‘unsafe-inline’; connect-src ‘self’ data: https://.demdex.net https://.freeagent.com https://.g.doubleclick.net https://.google-analytics.com https://.omtrdc.net https://.rollbar.com https://.wistia.com https://.zdassets.com https://embedwistia-a.akamaihd.net https://freeagent-production-attachments.s3.eu-west-1.amazonaws.com https://freeagent.zendesk.com wss://widget-mediator.zopim.com https://.bing.com https://.googletagmanager.com https://.analytics.google.com; child-src ‘self’; frame-src ‘self’ https://.demdex.net https://.g.doubleclick.net https://.wistia.net https://freeagent.eu.looker.com https://js.stripe.com https://widget.trustpilot.com https://www.google.com https://.doubleclick.net https://.wistia.com; frame-ancestors ‘self’; manifest-src ‘self’; media-src ‘self’ blob: data: https://.wistia.com https://.wistia.net https://.zdassets.com https://embedwistia-a.akamaihd.net; worker-src ‘self’ blob:; report-uri https://csp-report.browser-intake-datadoghq.eu/api/v2/logs?dd-api-key=pubbf1d0e52875367c219e33a714c71eebf&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=env%3Aproduction%2Cservice%3Afreeagent”,
“Content-Security-Policy-Report-Only”: “default-src ‘self’ https://.freeagent.com; font-src ‘self’ https: data:; img-src ‘self’ https: data:; object-src ‘self’; script-src ‘self’ data: ‘unsafe-eval’ ‘unsafe-inline’ https://.demdex.net https://.g.doubleclick.net https://.google-analytics.com https://.googleadservices.com https://.googleapis.com https://.googletagmanager.com https://.omtrdc.net https://.rollbar.com https://.wistia.com https://.wistia.net https://.zdassets.com https://analytics.twitter.com https://api.stripe.com https://assets.freeagent.com https://assets.staging.fre.ag https://bat.bing.com https://connect.facebook.net https://fls.doubleclick.net https://freeagent-assets.s3.amazonaws.com https://freeagent-videos.s3.amazonaws.com https://js.stripe.com https://static.ads-twitter.com https://tagmanager.google.com https://widget.trustpilot.com https://www.google.com https://www.gstatic.com https://.bing.com https://.googletagmanager.com https://.stripe.com https://widget-mediator.zopim.com; style-src ‘self’ https://fonts.googleapis.com https://assets.freeagent.com ‘unsafe-inline’; connect-src ‘self’ data: https://.demdex.net https://.freeagent.com https://.g.doubleclick.net https://.google-analytics.com https://.omtrdc.net https://.rollbar.com https://.wistia.com https://.zdassets.com https://embedwistia-a.akamaihd.net https://freeagent-production-attachments.s3.eu-west-1.amazonaws.com https://freeagent.zendesk.com wss://widget-mediator.zopim.com https://.bing.com https://.googletagmanager.com https://.analytics.google.com https://analytics.google.com; child-src ‘self’; frame-src ‘self’ https://.demdex.net https://.g.doubleclick.net https://.wistia.net https://freeagent.eu.looker.com https://js.stripe.com https://widget.trustpilot.com https://www.google.com https://.doubleclick.net https://.wistia.com; frame-ancestors ‘self’; manifest-src ‘self’; media-src ‘self’ blob: data: https://.wistia.com https://.wistia.net https://.zdassets.com https://embedwistia-a.akamaihd.net; worker-src ‘self’ blob:; report-uri https://csp-report.browser-intake-datadoghq.eu/api/v2/logs?dd-api-key=pubbf1d0e52875367c219e33a714c71eebf&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=env%3Aproduction%2Cservice%3Afreeagent”,
“X-Request-ID”: “1-657178d9-4ea8afdd48ac70bb69b81bdd”,
“X-Rev”: “c545f067ea91e0b26172450798f324dac2e3a775”,
“X-Host”: “ip-10-132-215-218”,
“X-Runtime”: “0.178466”,
“X-Frame-Options”: “SAMEORIGIN”,
“X-XSS-Protection”: “1; mode=block”,
“Referrer-Policy”: “strict-origin-when-cross-origin”,
“Vary”: “Accept,Origin”,
“Strict-Transport-Security”: “max-age=31536000”,
“X-Content-Type-Options”: “nosniff”,
“Content-Type”: “application/json; charset=utf-8”
},
“body”: {
“errors”: {
“error”: {
“message”: “Resource not found”
}
}
}
}

Hi atkjon :wave:

James here from FreeAgent. After speaking with our Tax engineers, we believe the issue is that you also need to supply the user url for the 908 category journal entry.

It was also mentioned that if you’re trying to create a new journal set with new journal entries, you shouldn’t need the url’s for journal_set and journal_entries. In our test the urls are ignored and it worked successfully but just thought it worth mentioning!

I hope that helps but let me know if you have any further questions.

Best,
James

thanks James, let me try that.

It worked perfectly, thanks so much.

No problem, glad that worked for you!