For this example to work properly you must perform the following steps:
Note: you can use an existing app. Either change the Redirect URI to https://demo.open-api.co.il/OpenAPI or get an Authorization Code idependently and "Set" it in step 3.
2. Set the key, secret, etc. here:
Available keys and secrets:
|Env סביבה||Key מפתח||Secret סוד||Redirect URI||Shaaam URL פורטל|
3. Get an Authorization Code:
Authorization Code =
State (received from Tax Authority) =
Or if you have your own App in the Sandbox, then use it to get the Authorization Code and set it manually:
Refresh Token = Expires at =
Once you received the Token the Authorization Code is invalidated. If you want to test again then you need to get a new Authorization Code. Go back to step 3.
5. Get an Invoice Allocation Number (מספר הקצאה):
Invoice Allocation Number Response =
Invoice Allocation Number =
How to check your Invoice JSON?
Note: when you try to get an "Allocation Number" you may receive criptic validation errors such as:
Validate: temporary:///swagger/shaam_tsandbox_invoices_v1.json:396: [JSV0008] Invalid number: 0 must be greater than or equal to 1."
6. Refresh the Access Token
The Access Token is valid only for 10 minutues. Once it expires you can aquire a new Authorization Code and a new Acces Token.
But if your login into the Persnal Area (איזור אישי) expired you will need to login again. This may affect performance and usability.
Alternatively you can aquire a new Access Token via the Refresh Token.
Refresh Token Response =