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
danieln
post Apr 25 2024, 04:13 PM

Regular
******
Senior Member
1,307 posts

Joined: Feb 2008
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
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
j0nn
post May 3 2024, 09:06 PM

Getting Started
**
Junior Member
83 posts

Joined: Jan 2018
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"
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
blazeechee
post May 15 2024, 11:16 AM

New Member
*
Junior Member
9 posts

Joined: Apr 2009
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!

This post has been edited by blazeechee: May 15 2024, 11:16 AM
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
plurbuddyskuppy
post May 27 2024, 01:37 PM

Casual
***
Junior Member
301 posts

Joined: Dec 2009
QUOTE(AmpBuster @ May 3 2024, 09:10 PM)
u have to change the supplier TIN to the one u used to register
*
i have same issue, but using the same TIN not fixed the issue. bangwall.gif
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"
            }
        ]
    }
]
plurbuddyskuppy
post May 30 2024, 12:12 PM

Casual
***
Junior Member
301 posts

Joined: Dec 2009
QUOTE(AmpBuster @ May 28 2024, 10:15 AM)
are you getting this error?
i can confirm that setting the supplier TIN to the one you used to register fixes it
*
Yup, I can confirm our TIN same as what we registered with IRB, but still having same issue.


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? 🤔
plurbuddyskuppy
post May 30 2024, 12:38 PM

Casual
***
Junior Member
301 posts

Joined: Dec 2009
QUOTE(AmpBuster @ May 30 2024, 12:15 PM)
case sensitivity maybe? 🤔
*
Even try to validate TaxPayer's TIN also having issue. You may try from your side, that BRN number is legit.

user posted image
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
plurbuddyskuppy
post May 30 2024, 01:20 PM

Casual
***
Junior Member
301 posts

Joined: Dec 2009
QUOTE(AmpBuster @ May 30 2024, 01:17 PM)
oh my mistake, validate TIN is using GET
however, you need to pass your access token in the header
*
yup, the token already passed.

user posted image

This post has been edited by plurbuddyskuppy: May 30 2024, 01:21 PM
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:

plurbuddyskuppy
post May 30 2024, 01:51 PM

Casual
***
Junior Member
301 posts

Joined: Dec 2009
QUOTE(AmpBuster @ May 30 2024, 01:34 PM)
This is the reply when the TIN is incorrect
This is the reply when TIN is correct
*
might have an issue with my registered TIN with IRB. Already email them last week to check either the registered number is correct or not, but no reply yet. doh.gif
bpc
post Jun 25 2024, 01:02 PM

Getting Started
**
Junior Member
58 posts

Joined: Mar 2013


I have exactly same issue.
Validate endpoint is validating my TIN and BRN number and get 200 response. Btw `Validate` has to be GET not POST. you can check API documentation. And i tried sending wrong numbers, it sends 404, when correct combo you get 200.
When i submit a dummy document i get this error ;

"message": "The authenticated TIN and documents TIN is not matching "



i decided to develope a e-invoice tool and cannot do a full flow now

This post has been edited by bpc: Jun 25 2024, 01:23 PM

2 Pages  1 2 >Top
 

Change to:
| Lo-Fi Version
0.0161sec    1.50    5 queries    GZIP Disabled
Time is now: 17th December 2025 - 01:43 PM