Skip to content

Commit 4cac36f

Browse files
committed
Amazon Pay API SDK (Node.js) 2.3.4
1 parent 3cb7ac1 commit 4cac36f

8 files changed

Lines changed: 1033 additions & 271 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Version 2.3.4 - July 2025
2+
* Introducing new Account Management APIs that allow partners to programmatically onboard merchants onto the Amazon Pay.
3+
* The `createMerchantAccount` - Provide merchant info through this API to create loginable account for your merchant partners. Client should expect either a success message or a detailed error message based on data validation and fulfillment.
4+
* The `updateMerchantAccount` - Updates a merchant account and store for the given Amazon merchantAccountId. Partners are only able to update fields which do not change the legal business entity itself.
5+
* The `merchantAccountClaim` - Initiates the merchant account claim process. Clients should expect a redirection response or a detailed error message based on data validation and fulfillment.
6+
17
### Version 2.3.3 - May 2025
28
* Introducing GetDispute API which is used to retrieve details of a chargeback dispute associated with a specific order
39
* Introducing retry logic for HTTP Code 425

README.md

Lines changed: 205 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Please contact your Amazon Pay Account Manager before using the In-Store API cal
134134
### Amazon Checkout v2 SPC
135135
* **finalizeCheckoutSession**(checkoutSessionId, payload, headers = null) → POST to `${version}/checkoutSessions/${checkoutSessionId}/finalize`
136136

137-
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs
137+
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs for Authorised Merchants
138138
* **registerAmazonPayAccount**(payload, headers = null) → POST to `${version}/merchantAccounts`
139139
* **updateAmazonPayAccount**(merchantAccountId, payload, headers = null) → PATCH to `${version}/merchantAccounts/${merchantAccountId}`
140140
* **deleteAmazonPayAccount**(merchantAccountId, headers = null) → DELETE to `${version}/merchantAccounts/${merchantAccountId}`
@@ -149,6 +149,11 @@ Please contact your Amazon Pay Account Manager before using the In-Store API cal
149149
### Amazon Checkout v2 File APIs
150150
* **uploadFile**($payload,headers) → POST to `${version}/files`
151151

152+
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs for Authorised Solution Providers
153+
* **createMerchantAccount**(payload, headers = null) &#8594 POST to `${version}/merchantAccounts`
154+
* **updateMerchantAccount**(merchantAccountId, payload, headers) &#8594 PATCH to `${version}/merchantAccounts/${merchantAccountId}`
155+
* **merchantAccountClaim**(merchantAccountId, payload, headers) &#8594 POST to `${version}/merchantAccounts/${merchantAccountId}/claim`
156+
152157
# Using Convenience Functions
153158

154159
Four quick steps are needed to make an API call:
@@ -1276,4 +1281,203 @@ const fs = require('fs');
12761281
}).catch(err => {
12771282
console.log(err);
12781283
});
1284+
```
1285+
1286+
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs for Authorised Solution Providers - Create Merchant Account API
1287+
1288+
```js
1289+
const fs = require('fs');
1290+
const uuidv4 = require('uuid/v4');
1291+
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');
1292+
1293+
const config = {
1294+
publicKeyId: 'YOUR_PUBLIC_KEY_ID',
1295+
privateKey: fs.readFileSync('tst/private.pem'),
1296+
region: 'YOUR_REGION_CODE',
1297+
sandbox: true,
1298+
algorithm: 'AMZN-PAY-RSASSA-PSS-V2' // Amazon Signing Algorithm, Optional: uses AMZN-PAY-RSASSA-PSS if not specified
1299+
};
1300+
1301+
const payload = {
1302+
uniqueReferenceId: "Unique_Reference_Id",
1303+
ledgerCurrency: "JPY",
1304+
businessInfo: {
1305+
email: "abhi@abc.com",
1306+
businessType: "CORPORATE",
1307+
businessLegalName: "密林コーヒー",
1308+
businessCategory: "Beauty",
1309+
businessDisplayName: "Abhi's Cafe",
1310+
annualSalesVolume: {
1311+
amount: "100000",
1312+
currencyCode: "JPY"
1313+
},
1314+
countryOfEstablishment: "JP",
1315+
businessAddress: {
1316+
addressLine1: "扇町4丁目5-1",
1317+
addressLine2: "フルフィルメントセンタービル",
1318+
city: "小田原市",
1319+
stateOrRegion: "神奈川県",
1320+
postalCode: "250-0001",
1321+
countryCode: "JP",
1322+
phoneNumber: {
1323+
countryCode: "81",
1324+
number: "2062062061"
1325+
}
1326+
},
1327+
customerSupportInformation: {
1328+
customerSupportEmail: "test.merchant_abhi@abc.com",
1329+
customerSupportPhoneNumber: {
1330+
countryCode: "1",
1331+
number: "1234567",
1332+
extension: "123"
1333+
}
1334+
}
1335+
},
1336+
beneficiaryOwners: [
1337+
{
1338+
personFullName: "Abhishek Kumar",
1339+
residentialAddress: {
1340+
addressLine1: "扇町4丁目5-1",
1341+
addressLine2: "フルフィルメントセンタービル",
1342+
city: "小田原市",
1343+
stateOrRegion: "神奈川県",
1344+
postalCode: "250-0001",
1345+
countryCode: "JP",
1346+
phoneNumber: {
1347+
countryCode: "81",
1348+
number: "2062062061"
1349+
}
1350+
}
1351+
}
1352+
],
1353+
primaryContactPerson: {
1354+
personFullName: "Abhishek Kumar"
1355+
},
1356+
integrationInfo: {
1357+
ipnEndpointUrls: [
1358+
"https://yourdomainname.com/ipnendpoint1",
1359+
"https://yourdomainname.com/ipnendpoint2"
1360+
]
1361+
},
1362+
stores: [
1363+
{
1364+
domainUrls: [
1365+
"https://yourdomainname.com"
1366+
],
1367+
storeName: "Rufus's Cafe",
1368+
privacyPolicyUrl: "https://yourdomainname.com/privacy",
1369+
storeStatus: {
1370+
state: "ACTIVE",
1371+
reasonCode: null
1372+
}
1373+
}
1374+
],
1375+
merchantStatus: {
1376+
statusProvider: "Ayden",
1377+
state: "ACTIVE",
1378+
reasonCode: null
1379+
}
1380+
};
1381+
1382+
const testPayClient = new Client.WebStoreClient(config);
1383+
const response = testPayClient.createMerchantAccount(payload);
1384+
1385+
response.then(function (result) {
1386+
console.log(result.data);
1387+
}).catch(err => {
1388+
console.log(err);
1389+
});
1390+
```
1391+
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs for Authorised Solution Providers - Update Merchant Account API
1392+
1393+
```js
1394+
const fs = require('fs');
1395+
const uuidv4 = require('uuid/v4');
1396+
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');
1397+
1398+
const config = {
1399+
publicKeyId: 'YOUR_PUBLIC_KEY_ID',
1400+
privateKey: fs.readFileSync('tst/private.pem'),
1401+
region: 'YOUR_REGION_CODE',
1402+
sandbox: true,
1403+
algorithm: 'AMZN-PAY-RSASSA-PSS-V2' // Amazon Signing Algorithm, Optional: uses AMZN-PAY-RSASSA-PSS if not specified
1404+
};
1405+
1406+
const payload = {
1407+
businessInfo: {
1408+
email: "abhi_updated@abc.com",
1409+
businessType: "CORPORATE",
1410+
businessLegalName: "密林コーヒー",
1411+
businessCategory: "Beauty",
1412+
businessDisplayName: "Abhi's Golden Cafe",
1413+
annualSalesVolume: {
1414+
amount: "500000",
1415+
currencyCode: "JPY"
1416+
},
1417+
countryOfEstablishment: "JP",
1418+
businessAddress: {
1419+
addressLine1: "扇町4丁目5-1",
1420+
addressLine2: "フルフィルメントセンタービル",
1421+
city: "小田原市",
1422+
stateOrRegion: "神奈川県",
1423+
postalCode: "250-0025",
1424+
countryCode: "JP",
1425+
phoneNumber: {
1426+
countryCode: "81",
1427+
number: "2062062065"
1428+
}
1429+
},
1430+
customerSupportInformation: {
1431+
customerSupportEmail: "test.merchant_abhi@abc.com",
1432+
customerSupportPhoneNumber: {
1433+
countryCode: "1",
1434+
number: "9999999",
1435+
extension: "123"
1436+
}
1437+
}
1438+
}
1439+
};
1440+
1441+
const headers = {
1442+
'x-amz-pay-authtoken': 'AUTH-TOKEN'
1443+
};
1444+
1445+
const testPayClient = new Client.WebStoreClient(config);
1446+
const response = testPayClient.updateMerchantAccount("AXXXXXXX",payload,headers);
1447+
1448+
response.then(function (result) {
1449+
console.log(result.data);
1450+
}).catch(err => {
1451+
console.log(err);
1452+
});
1453+
```
1454+
1455+
### Amazon Checkout v2 Merchant Onboarding & Account Management APIs for Authorised Solution Providers - Merchant Account Claim API
1456+
1457+
```js
1458+
const fs = require('fs');
1459+
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');
1460+
1461+
const config = {
1462+
publicKeyId: 'YOUR_PUBLIC_KEY_ID',
1463+
privateKey: fs.readFileSync('tst/private.pem'),
1464+
region: 'YOUR_REGION_CODE',
1465+
sandbox: true,
1466+
algorithm: 'AMZN-PAY-RSASSA-PSS-V2' // Amazon Signing Algorithm, Optional: uses AMZN-PAY-RSASSA-PSS if not specified
1467+
};
1468+
1469+
const payload = {
1470+
uniqueReferenceId: 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxx'
1471+
};
1472+
1473+
1474+
const testPayClient = new Client.WebStoreClient(config);
1475+
const response = testPayClient.merchantAccountClaim("AXXXXXXX",payload);
1476+
1477+
response.then(function (result) {
1478+
console.log(result.data);
1479+
console.log('Location:', result.headers["location"]);
1480+
}).catch(err => {
1481+
console.log(err);
1482+
});
12791483
```

0 commit comments

Comments
 (0)