Amazon SP-API

Job ID: 35888303

Budget: $99 – $100 USD

I need a PHP Curl code that's completely independent (does not need any composers or 3rd party tools) to generate an SP-API call to Amazon. In this case "buyerinfo":
https://developer-docs.amazon.com/sp-api/docs/orders-api-v0-reference#get-ordersv0ordersorderidbuyerinfo

I need to enter variables like SecretKey, Accesskey, the token and the order ID which in this case is: 111-0000000-0000000. This order is is in the codes below. Also the Acesskey is: AKIA00000000000.

It should be straight forward just 1 file that creates the signature etc and makes the call with "curl_exec".
FIRM price: $100

I can get it to work on Postman but I need it on PHP Curl.
The code from Postman gives for PHP Curl below.
It does not work as the error is with signature issue. It might be that the symbol / exist the token.
Regardless, the code is just to assist. It's only for a specific call. I need the php curl that generates the signature and everything etc.

A)
On postman, In the params there's a key called "orderId". And that's where I put the order number: 111-0000000-0000000
B)
In Headers, there's a key called "x-amz-access-token", and that's where I put the token which is: Atza|IwEBIIPKigVe0qZcud/I2MXSTFbbbbSjkalwfasfkjladskl/bT15U
C)
In authorization (Type: AWS Signature), Postman already put the "accesskey" and "secretkey" which I populate.

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sellingpartnerapi-na.amazon.com/orders/v0/orders/111-0000000-0000000/buyerInfo',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'x-amz-access-token: Atza|IwEBIIPKigVe0qZcud/I2MXSTFbbbbSjkalwfasfkjladskl/bT15U',
'X-Amz-Date: 20230201T184917Z',
'Authorization: AWS4-HMAC-SHA256 Credential=AKIA00000000000/20230201/us-east-1/execute-api/aws4_request, SignedHeaders=accept;host;x-amz-access-token;x-amz-date, Signature=cc1028f10d361ca5a00000000005cbe4f760f2935fe2fc61cbcbb8120c888f'
),
));

$response = curl_exec($curl);
$info = curl_getinfo($curl);
curl_close($curl);
echo $response;
------------------------

Here is the Debug from postman:
=======================

GET /orders/v0/orders/111-0000000-0000000/buyerInfo HTTP/1.1
Accept: application/json
Atza|IwEBIIPKigVe0qZcud/I2MXSTFbbbbSjkalwfasfkjladskl/bT15U
Host: sellingpartnerapi-na.amazon.com
X-Amz-Date: 20230201T181904Z
Authorization: AWS4-HMAC-SHA256 Credential=AKIA00000000000/20230201/us-east-1/execute-api/aws4_request, SignedHeaders=accept;host;x-amz-access-token;x-amz-date, Signature=cc1028f10d361ca5a00000000005cbe4f760f2935fe2fc61cbcbb8120c888f

I need this asap. Thank you very much.
Related categories: PHP Amazon Web Services cURL