Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Visual Basic 6.0 Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Visual Basic 6.0) Amazon MWS Upload Invoice

Demonstrates how to upload an invoice using _UPLOAD_VAT_INVOICE_FeedType to submit an invoice for an order.

For more information, see https://m.media-amazon.com/images/G/03/B2B/invoice-uploader-developer-documentation.pdf

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim success As Long

Dim rest As New ChilkatRest

' Connect to the Amazon MWS REST server.
' 
' Make sure to connect to the correct Amazon MWS Endpoint, otherwise
' you'll get an HTTP 401 response code.
' 
' See Amazon MWS endpoints and MarketplaceId values

Dim bTls As Long
bTls = 1
Dim port As Long
port = 443
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("mws.amazonservices.com",port,bTls,bAutoReconnect)

rest.Host = "mws.amazonservices.com"

' MarketplaceList.Id parameter This should be the marketplace in which the order was placed. Only one marketplace must be used per order.T
' Here are the marketplace ID's
' Spain: A1RKKUPIHCS9HS
' UK: A1F83G8C2ARO7P
' France: A13V1IB3VIYZZH
' Germany: A1PA6795UKMFR9
' Italy: APJ6JRA9NG5V4
' ...
' (See https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html)

' FeedOptions parameter  Seller can input key value pairs to give important metadata along with the PDF invoice.
success = rest.AddQueryParam("FeedOptions","metadata:orderid=206-2341234-3455465;metadata:invoicenumber=INT-3431-XJE3;metadata:documenttype=Invoice")

' Load the PDF invoice file that is to be the body of the HTTP POST request.
Dim pdfData As New ChilkatBinData
success = pdfData.LoadFile("qa_data/pdf/sample.pdf")

' Get the MD5 hash of the PDF data.
Dim crypt As New ChilkatCrypt2
crypt.HashAlgorithm = "md5"
crypt.EncodingMode = "base64"
Dim md5Hash As String
md5Hash = crypt.HashBdENC(pdfData)

success = rest.AddQueryParam("AWSAccessKeyId","0PB842ExampleN4ZTR2")
success = rest.AddQueryParam("Action","SubmitFeed")
success = rest.AddQueryParam("FeedType","_UPLOAD_VAT_INVOICE_")
success = rest.AddQueryParam("MWSAuthToken","EXAMPLE-amzn.mws.4ea38b7b-f563-7709-4bae-87aea-EXAMPLE")

success = rest.AddQueryParam("MarketplaceIdList.Id.1","ATVExampleDER")
success = rest.AddQueryParam("SellerId","A1XExample5E6")
success = rest.AddQueryParam("ContentMD5Value",md5Hash)
success = rest.AddQueryParam("SignatureMethod","HmacSHA256")
success = rest.AddQueryParam("SignatureVersion","2")
success = rest.AddQueryParam("Version","2009-01-01")

' Add the MWS Signature param.  (Also adds the Timestamp parameter using the curent system date/time.)
success = rest.AddMwsSignature("POST","/Feeds/2009-01-01","mws.amazonservices.com","YOUR_MWS_SECRET_ACCESS_KEY_ID")

success = rest.AddHeader("Content-Type","application/octet-stream")
Dim sbResponseBody As New ChilkatStringBuilder
success = rest.FullRequestBd("POST","/Feeds/2009-01-01",pdfData,sbResponseBody)
If (rest.LastMethodSuccess <> 1) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

If (rest.ResponseStatusCode <> 200) Then
    ' Examine the request/response to see what happened.
    Debug.Print "response status code = " & rest.ResponseStatusCode
    Debug.Print "response status text = " & rest.ResponseStatusText
    Debug.Print "response header: " & rest.ResponseHeader
    Debug.Print "response body: " & sbResponseBody.GetAsString()
    Debug.Print "---"
    Debug.Print "LastRequestStartLine: " & rest.LastRequestStartLine
    Debug.Print "LastRequestHeader: " & rest.LastRequestHeader
End If

' Examine the XML returned in the response body.
Debug.Print sbResponseBody.GetAsString()
Debug.Print "----"
Debug.Print "Success."

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.