Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 anyone tried the e-invoice API sandbox?

views
     
TSAmpBuster
post Apr 25 2024, 04:00 PM, updated 12 months ago

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


I can't figure out how to log in using the client id and secret.

Header:
QUOTE
POST /connect/token HTTP/2
Host: preprod-api.myinvois.hasil.gov.my
accept: application/json
accept-language: en
content-type: application/json
Raw POST in UBL JSON format:
QUOTE
{"client_id":[{"_":"<<client_id>>"}],"client_secret":[{"_":"<<client_secret>>"}],"grant_type":[{"_":"client_credentials"}]}


Raw POST in normal JSON format:
QUOTE
{"client_id":"<<client_id>>","client_secret":"<<client_secret>>","grant_type":"client_credentials"}


POST form-data:
QUOTE
client_id=<<client_id>>&client_secret=<<client_secret>>&grant_type=client_credentials


The response is always:

QUOTE
{ "statusCode": 400, "message": "Bad Request" }


Anyone managed to retrieve the access token? blink.gif
TSAmpBuster
post Apr 25 2024, 04:23 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(danieln @ Apr 25 2024, 04:13 PM)
did you check it have to be sent as parameter or in header?

By the way, where did you get it? I am still trying to get and try it
*
the sdk didn't specify

send this info to sdkmyinvois@hasil.gov.my
1) Tin Number :
2) Business Registration Number :
3) Company Name :
4) Company Email :
5) Name of the Enterprise Resource Planning (ERP) system used:
TSAmpBuster
post Apr 25 2024, 04:25 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE
POST /connect/token HTTP/2
Host: preprod-api.myinvois.hasil.gov.my
accept: application/json
accept-language: en
content-type: application/json
client_id: <<client_id>>
client_secret: <<client_secret>>
grant_type: client_credentials


body blank, still didn't work
TSAmpBuster
post Apr 26 2024, 01:46 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


OK I've figured it out.

Header:
QUOTE
POST /connect/token HTTP/1.1
Host: preprod-api.myinvois.hasil.gov.my
Accept: */*
Content-Length: <<variable>>
Content-Type: application/x-www-form-urlencoded


Body:
QUOTE
client_id=<<client_id>>&client_secret=<<client_secret>>&grant_type=client_credentials&scope=InvoicingAPI


normal POST to retrieve access token

This post has been edited by AmpBuster: Apr 26 2024, 01:46 PM
TSAmpBuster
post May 3 2024, 09:10 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(j0nn @ May 3 2024, 09:06 PM)
were you able to submit the invoice? No matter how I try, only get the message: "The authenticated TIN and documents TIN is not matching"
*
u have to change the supplier TIN to the one u used to register
TSAmpBuster
post May 15 2024, 05:03 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(blazeechee @ May 15 2024, 11:16 AM)
Good day!
Wanna check with you all. How long do you get a reply from myinvois after sending the email requesting for ID and secret?
I have not got any reply after 1 day, and wanna know if that is normal.
If need to follow up, anyone knows how to check with them?
Thanks a lot!
*
took about 2 weeks for me
TSAmpBuster
post May 28 2024, 10:15 AM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(plurbuddyskuppy @ May 27 2024, 01:37 PM)
i have same issue, but using the same TIN not fixed the issue.  bangwall.gif
*
are you getting this error?

QUOTE
Result: Array
(
    [error] => Array
        (
            [code] => ValidationError
            [message] =>
            [target] =>
            [details] => Array
                (
                    [0] => Array
                        (
                            [code] => submission
                            [target] => submission
                            [message] => The authenticated TIN and documents TIN is not matching
                        )

                )

        )

)
i can confirm that setting the supplier TIN to the one you used to register fixes it

QUOTE
"PartyIdentification": [
    {
        "ID": [
            {
                "_": "<TIN>",
                "schemeID": "TIN"
            }
        ]
    },
    {
        "ID": [
            {
                "_": "<BRN>",
                "schemeID": "BRN"
            }
        ]
    }
]
TSAmpBuster
post May 30 2024, 12:15 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(plurbuddyskuppy @ May 30 2024, 12:12 PM)
Yup, I can confirm our TIN same as what we registered with IRB, but still having same issue.
*
case sensitivity maybe? 🤔
TSAmpBuster
post May 30 2024, 01:13 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(plurbuddyskuppy @ May 30 2024, 12:38 PM)
Even try to validate TaxPayer's TIN also having issue. You may try from your side, that BRN number is legit.

user posted image
*
you have to perform HTTP POST rather than GET
i think you have to get the access token before trying to validate TIN

This post has been edited by AmpBuster: May 30 2024, 01:14 PM
TSAmpBuster
post May 30 2024, 01:17 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(AmpBuster @ May 30 2024, 01:13 PM)
you have to perform HTTP POST rather than GET
i think you have to get the access token before trying to validate TIN
*
oh my mistake, validate TIN is using GET
however, you need to pass your access token in the header
TSAmpBuster
post May 30 2024, 01:34 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(plurbuddyskuppy @ May 30 2024, 01:20 PM)
yup, the token already passed.

user posted image
*
This is the reply when the TIN is incorrect
QUOTE
Result: Array
(
    [type] => https://tools.ietf.org/html/rfc9110#section-15.5.5
    [title] => Not Found
    [status] => 404
    [traceId] => 00-e6055bf6f6414f58c4f2f539a4909606-2c3b6779e2a64ed1-00
)


This is the reply when TIN is correct

QUOTE
Result:

TSAmpBuster
post Sep 2 2024, 06:45 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(bowranger @ Sep 2 2024, 06:22 PM)
Need to request for access for both production and sandbox ?
*
probably... i tried using the sandbox credentials for production but it didn't work
TSAmpBuster
post Sep 2 2024, 08:13 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia



yes, i used the above template and they provided the security token which i used to access the sandbox api

This post has been edited by AmpBuster: Sep 2 2024, 08:14 PM
TSAmpBuster
post Oct 8 2024, 01:12 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(dewill @ Oct 8 2024, 11:59 AM)
how to get list of customers with correct tin and ssm?
*
have to ask the customer
TSAmpBuster
post Jan 5 2025, 04:40 PM

Getting Started
**
Junior Member
145 posts

Joined: Jul 2005
From: Johor Bahru, Johor, Malaysia


QUOTE(danieln @ Jan 5 2025, 02:11 PM)
Hi,

you able to connect and get it working?

I an trying connect/token but it always gives the error 400 even with my newly generated keys
*
yes, refer to this post: https://forum.lowyat.net/index.php?showtopi...ost&p=109622939

 

Change to:
| Lo-Fi Version
0.0175sec    0.38    6 queries    GZIP Disabled
Time is now: 15th December 2025 - 02:48 PM