Introduction
The Account Number Subscription API is designed for the webhook subscribers to manage their account number based webhook projects and perform project related operations such as edit or view details using API endpoints.
Note:
- You must have admin access for your API project where this API is enabled.
- For more information on webhook and its features, visit the Shipment Visibility Webhook documentation page.
Benefits of Account Number Subscription API
The benefits of Account Number Subscription API are:
- You can easily update and manage your webhook project using the API endpoints.
- This API enables you to associate multiple accounts to your project in a single API transaction, instead of selecting each account one by one.
How Account Number Subscription API works
Use the below endpoints to manage your webhook project:
Retrieve Summary
Use this endpoint to retrieve all webhook project details under your organization in a paginated format.
The required input information for this request is:
- pageNumber: Specify the number of pages to get in the response.
- resultsPerPage: Specify the number of entries to be displayed in a single page.
- Status: Specify the status of the subscriptions to be retrieved in the response. Ex: ACTIVE, PAUSED, IN-PROGRESS, PROCESING, FAILED, CANCELED.
The successful response to this request will generate the webhook project list in a paginated format as per the parameters set in the request.
Search Webhooks Project
Use this endpoint to search specific webhook project details under your organization in paginated format.
The required input information for this request is:
- authorization: Specify the encrypted OAuth token used to authenticate your API requests. Use it in the authorization header of your API requests.
- searchText: Specify the string that needs to be searched to retrieve the webhook subscriptions.
- status: Specify the status of the webhook project to be retrieved in the response. Use this option to filter the webhook project based on their status. Ex: ACTIVE, PAUSED, IN-PROGRESS, PROCESSING, FAILED, CANCELED.
The successful response to this request will generate all the webhook project list in a paginated format as per the parameters set in the request.
Update Webhooks Project
Use this endpoint to update any webhook project details under your organization.
The input information for this request is:
- requestType: Specify the type of update request.
- ADD_ACCOUNTS: Use this option to add new accounts in the existing project if the organization is already associated with webhook project for all accounts.
- DELETE_ACCOUNTS: Use this option to delete any account from the project.
- UPDATE_ALL: Use this option for regular project updates.
Note: This is an optional element and UPDATE_ALL is selected by default, if not specified by the user. - category: Specify the category of the feature you want to update for the project. Example: RETRY_POLICY, PROOF_OF_DELIVERY etc.
- subCategories: Specify the individual features for the selected feature category. Example: BASIC_HRS, PPOD, SPOD, SHIP, TRAN etc.
The successful response to this request will return the subscription Id, an indicator if the project has been updated for all the accounts in the organization, and a timestamp for the updated project.
Retrieve Project Detail
Use this endpoint to retrieve the project details for a specified webhook project in a paginated format.
The required input information for this request is:
- authorization: Specify the authorization token.
- subscriptionId: Specify the subscription Id for the webhook project to retrieve the details.
The successful response to this request will generate the specified webhooks project details in a paginated format or will return an alert or error details in case of any failures.
Business Rules
- A maximum of 30,000 shipping account numbers can be associated with a webhook project in a given request.
Account Number Subscription API (API)
Retrieve Summary
Retrieves all subscriptions, in a paginatedd response, from an organization based on the user as long as they are an admin
query Parameters
pageNumber | integer Example: pageNumber=1 Describes the page number while retrieving the subscriptions |
resultsPerPage | integer Example: resultsPerPage=10 Describes the results per page while retrieving the subscriptions |
status | Array of strings Example: status=ACTIVE,FAILED A list that specifies the status(es) of the subscription and filters the response based on the status(es). Multiple statuses can be provided, and status can be in ACTIVE, PAUSED, SAVED, CANCELED, PROCESSING and/or FAILED. If no status provided, all subscriptions will be returned. |
header Parameters
X-locale | string Example: en_US ISO locale |
X-clientid | string Example: MAGS Registered client ids with FedEx API. i.e. MAGS, CAFE , INET, ISHP, etc. |
X-customer-transaction-id | string Example: 0e671149-016f-1000-941f-ef4dbabadd2e This transaction Id helps the customers to track the transaction with APIF. |
authorization | string Example: Bearer XXXXX This is the authorization token which authorize the user |
content-type required | string Example: application/json This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file. |
Responses
Success
Bad Request
Unauthorized
Forbidden
Not Found
Failure
Service Unavailable
Sandbox Server
Production Server
Request samples
- C#
- JAVA
- JAVASCRIPT
- PHP
- PYTHON
- RUST
- SWIFT
var client = new RestClient("https://apis-sandbox.fedex.com/webhook/v1/subscriptions/summaries"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); request.AddHeader("X-locale", "en_US"); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request);
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
- "output": {
- "totalResults": "30",
- "statusSummary": [
- {
- "status": "ACTIVE",
- "count": 13
- {
- "status": "FAILED",
- "count": 7
- {
- "status": "PROCESSING",
- "count": 5
- {
- "status": "PAUSED",
- "count": 5
- "subscriptionList": [
- {
- "id": 45888267,
- "lastModifiedDate": "2021-06-06T11:00:00.000Z",
- "name": "WebhookProject1234",
- "status": "ACTIVE",
- "tier": "BASIC",
- "countDownDateToDeletion": "2023-09-20",
- "billingAccountNumber": {
- "value": "123456789"
- "alerts": [
- {
- "code": "SUBSCRIPTION.DATA.NOTFOUND",
- "alertType": "WARNING",
- "parameterList": [
- {
- "value": "109847569",
- "key": "86ea9b69e068191a59f0e2721b8fbfee"
- "message": "Subscription data unavailable"
- "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
- "customerTransactionId": "AnyCo_order123456789"
Search webhook Projects
Retrieves all subscriptionsss, in a paginated response, based on a search string and based on the user as long as they are an admin
query Parameters
searchText required | string Example: searchText=Proj Specifies the text that needs to be searched to retrieve the subscriptions. Minimum 2 characters needs to be provided for search. |
status | Array of strings Example: status=ACTIVE,FAILED A list that specifies the status(es) of the subscription and filters the response based on the status(es). Multiple statuses can be provided, and status can be in ACTIVE, PAUSED, SAVED, CANCELED, PROCESSING and/or FAILED. If no status provided, all subscriptions will be returned. |
pageNumber | integer Example: pageNumber=1 Describes the page number while retrieving the subscriptions |
resultsPerPage | integer Example: resultsPerPage=10 Describes the results per page while retrieving the subscriptions |
header Parameters
X-locale | string Example: en_US ISO locale |
X-clientid | string Example: MAGS Registered client ids with FedEx API. i.e. MAGS, CAFE , INET, ISHP, etc. |
X-customer-transaction-id | string Example: 0e671149-016f-1000-941f-ef4dbabadd2e This transaction Id helps the customers to track the transaction with APIF. |
authorization | string Example: Bearer XXXXX This is the authorization token which authorize the user |
content-type required | string Example: application/json This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file. |
Responses
Success
Bad Request
Unauthorized
Forbidden
Not Found
Failure
Service Unavailable
Sandbox Server
Production Server
Request samples
- C#
- JAVA
- JAVASCRIPT
- PHP
- PYTHON
- RUST
- SWIFT
var client = new RestClient("https://apis-sandbox.fedex.com/webhook/v1/subscriptions/search"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); request.AddHeader("X-locale", "en_US"); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request);
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
- "output": {
- "totalResults": "20",
- "statusSummary": [
- {
- "count": 2,
- "status": "ACTIVE"
- "subscriptionsList": [
- {
- "id": 45888267,
- "lastModifiedDate": "2021-06-06T11:00:00.000Z",
- "name": "WebhookProject1234",
- "status": "ACTIVE",
- "tier": "BASIC",
- "countDownDateToDeletion": "2023-09-20",
- "billingAccountNumber": {
- "value": "123456789"
- "alerts": [
- {
- "code": "SUBSCRIPTION.DATA.NOTFOUND",
- "alertType": "WARNING",
- "parameterList": [
- {
- "value": "109847569",
- "key": "86ea9b69e068191a59f0e2721b8fbfee"
- "message": "Subscription data unavailable"
- "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
- "customerTransactionId": "AnyCo_order123456789"
Retrieve Project Detail
Retrieves the subscription details corresponding to the subscriptionId provided only for a admin of the organisation. Pagination support will enable client to request list of accounts in paginated manner.
query Parameters
subscriptionId required | integer Specifies the unique identifier for the subscription to be deleted. |
pageNumber | integer Example: pageNumber=1 Describes the page number while retrieving the subscriptions |
resultsPerPage | integer Example: resultsPerPage=10 Describes the results per page while retrieving the subscriptions |
header Parameters
X-locale | string Example: en_US ISO locale |
X-clientid | string Example: MAGS Registered client ids with FedEx API. i.e. MAGS, CAFE , INET, ISHP, etc. |
X-customer-transaction-id | string Example: 0e671149-016f-1000-941f-ef4dbabadd2e This transaction Id helps the customers to track the transaction with APIF. |
authorization | string Example: Bearer XXXXX This is the authorization token which authorize the user |
content-type required | string Example: application/json This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file. |
Responses
Success
Bad Request
Unauthorized
Forbidden
Not Found
Failure
Service Unavailable
Sandbox Server
Production Server
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
- "output": {
- "totalAccounts": 103,
- "subscription": {
- "accounts": [
- {
- "value": "123456789"
- "callbackData": {
- "name": "WebhookProject1234"
- "createdDate": "2021-06-06T11:00:00.000Z",
- "features": [
- {
- "category": "TRACKING_EVENTS",
- "subCategories": [
- "SHIP"
- "isSecurityTokenExists": true,
- "lastModifiedDate": "2021-06-06T11:00:00.000Z",
- "locale": "en_US",
- "notificationDetail": {
- "countryCode": "US",
- "emailAddresses": [
- "abc@fedex.com"
- "languageCode": "en"
- "responseType": "DETAILED",
- "status": "ACTIVE",
- "tier": "BASIC",
- "type": "TRACKING",
- "subType": "ACCOUNT",
- "countDownDateToDeletion": "2023-09-20",
- "billingAccountNumber": {
- "value": "123456789"
- "alerts": [
- {
- "code": "SUBSCRIPTION.DATA.NOTFOUND",
- "alertType": "WARNING",
- "parameterList": [
- {
- "value": "109847569",
- "key": "86ea9b69e068191a59f0e2721b8fbfee"
- "message": "Subscription data unavailable"
- "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
- "customerTransactionId": "AnyCo_order123456789"
Update Webhook Project
This endpoint allows you to update subscriptions
header Parameters
X-locale | string Example: en_US ISO locale |
X-clientid | string Example: MAGS Registered client ids with FedEx API. i.e. MAGS, CAFE , INET, ISHP, etc. |
X-customer-transaction-id | string Example: 0e671149-016f-1000-941f-ef4dbabadd2e This transaction Id helps the customers to track the transaction with APIF. |
authorization | string Example: Bearer XXXXX This is the authorization token which authorize the user |
content-type required | string Example: application/json This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file. |
Request Body schema: application/json
- UpdateSubscriptionInputVO
- MinimumSamplePayloadForUpdateSubscription
requestType | string Enum: "ADD_ACCOUNTS" "DELETE_ACCOUNTS" "UPDATE_ALL" This specifies the type of the request. Request type "ADD_ACCOUNTS" will be used to add new accounts in existing subscription when any organization has subscribed for all accounts. "DELETE_ACCOUNTS" will be used to delete account from the subscription. "UPDATE_ALL" is for regular subscription update. This is optional element and defaulted to "UPDATE_ALL" if not provided by client. |
subscriptionId | integer Specifies the unique identifier for subscription. This is required when request type is not provided or has value "UPDATE_ALL". |
subscription | object (SubscriptionDetails) Describes the information related to the subscription such as subscription type, response type, events and accounts |
fdplaAccepted | boolean If set to true, indicates FedEx developer Portal License agreement is accepted. This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT. |
softwareDistributionTermsAccepted | boolean If set to true, indicates the client agrees to not distribute or allow access to his solution.This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT. |
pricingAccepted | boolean If set to true, indicates the client agrees to the pricing information. |
Responses
Success
Bad Request
Unauthorized
Forbidden
Not Found
Failure
Service Unavailable
Sandbox Server
Production Server
Request samples
- Payload
- C#
- JAVA
- JAVASCRIPT
- PHP
- PYTHON
- RUST
- SWIFT
- "requestType": "ADD_ACCOUNTS",
- "subscriptionId": 123456,
- "subscription": {
- "accounts": [
- {
- "value": "123456789"
- "callbackData": {
- "name": "WebhookProject1234",
- "securityToken": "12D4567g90123456789012345"
- "features": [
- {
- "category": "TRACKING_EVENTS",
- "subCategories": [
- "SHIP"
- "notificationDetails": {
- "countryCode": "US",
- "emailAddresses": [
- "abc@fedex.com"
- "languageCode": "en"
- "responseType": "DETAILED",
- "tier": "BASIC",
- "type": "TRACKING",
- "subType": "ACCOUNT",
- "billingAccountNumber": {
- "value": "123456789"
- "fdplaAccepted": true,
- "softwareDistributionTermsAccepted": true,
- "pricingAccepted": true
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
- "output": {
- "subscriptionId": 0,
- "modifiedTimeStamp": "string",
- "subscribeAllAccounts": true,
- "subscriptionName": "Webhook name 1",
- "alerts": [
- {
- "code": "SUBSCRIPTION.DATA.NOTFOUND",
- "alertType": "WARNING",
- "parameterList": [
- {
- "value": "109847569",
- "key": "86ea9b69e068191a59f0e2721b8fbfee"
- "message": "Subscription data unavailable"
- "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
- "customerTransactionId": "AnyCo_order123456789"
Response