Use the B2B Gateway Get Control Number REST API to get the next control number for outbound EDI X12 and EDIFACT messages, including outgoing acknowledgments.
B2B Gateway increases the current control number for the partner that you specify in the request and the API returns the next number in the sequence. You can use the number that the API returns as the control number in the next outbound message you send to the same partner with a custom mapping.
Get Control Number REST API request
Use a GET request with an application/json content type to get the next control number for outbound EDI X12 and EDIFACT messages.
To get the next control number for a partner, use the following REST URL:
Tip: You can copy the values of <pod> and <baseUrl> from the B2B Gateway URL after you access it from the My Services page of Informatica Intelligent Cloud Services.
Request Syntax
To request the control number, use the following request syntax:
{ "partnerName":"<partner name>", "controlNumberType":"<type of control number>" }
Where:
•partner name is the name of the partner to get the control number from. The name must not contain angled brackets (<>), backslashes (\), or double quotes ("). If the defined partner name contains backslashes, add another backslash before each existing backslash (\\). If the defined partner name contains double quotes, add a backslash before each double quote (\").
•type of control number is the type of control number that the partner uses: Interchange for an interchange control number or Group for a group control number.
For example:
To get an interchange control number, use the following request syntax:
When you use the B2B Gateway Get Control Number REST API to get the next control number for a partner, B2B Gateway returns the next control number in the sequence.
When the request fails, the API returns an error code or a message that describes the cause of the failure.
Get Control Number REST API success response
When you use the B2B Gateway Get Control Number REST API to get the next control number for a partner, the success response includes the following information:
Property
Description
responseStatus
Status of the response: SUCCESS.
responseExtraMessage
Additional information, if applicable.
responseType
Type of response: /v1/partner/controlNumber/getNext.
controlNumber
The next control number in the sequence for the partner.
When the B2B Gateway Get Control Number REST API fails to get the next control number for a partner, the failure response includes the error code and a description of the cause of the failure.
A failure response can include one of the following messages:
Error code
Message
Reason for failure
400
Can't get the next control number because a sequence isn't defined for the type of control number that you requested.
The control number type specified in the request is either invalid or doesn't match the control number type that the partner uses.
404
The requested resource was not found: [The partner [<partner name>] does not exist.
A partner with the name specified in the request doesn't exist.
500
Can't get the next control number because the sequence reached the maximum number of digits. Reset the sequence in the partner message properties and try again.
The control number sequence for the partner reached the maximum number of digits. The allowed number of digits in control numbers is nine digits for EDI X12 messages and 14 digits for EDIFACT messages.
500
Can't get the next control number for this partner because the partner uses file event IDs and not sequences as control numbers.
The partner uses event IDs as control numbers in outbound messages. You can get the next control number only for partners that use sequence numbers as control numbers.
500
Can't get a control number because the partner flow uses custom files with custom mappings, which don't use control numbers.
The partner uses custom files with custom mappings. You can use the Get Control Number REST API only with partners that use EDI X12 or EDIFACT messages.