HomeiOS Developmentphp - Implement AppstoreConnect API POST Request subscriptionPromotionalOffers

php – Implement AppstoreConnect API POST Request subscriptionPromotionalOffers


Sadly, the TSI Group will not be prepared to assist me. Possibly somebody right here is ready to assist. 🙂

I am attempting to create a subscriptionPromotionalOffer for the AppstoreConnect API in PHP.

I am utilizing the newest app_store_connect_api_2.3_openapi.json and I generated the PHP API with openapi-generator-cli-6.6.0.

API Doc: https://developer.apple.com/documentation/appstoreconnectapi/create_a_promotional_offer

Request url: https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers

I am sending the next payload:

{ "information":{ "sort":"subscriptionPromotionalOffers", "attributes":{ "identify":"TEST_SUBSCRIPTION_NAME", "offerCode":"TEST_SUBSCRIPTION_CODE", "length":"ONE_YEAR", "offerMode":"PAY_UP_FRONT", "numberOfPeriods":1 }, "relationships":{ "subscription":{ "information":{ "sort":"subscriptions", "id":"1575201034" } }, "costs":{ "information":[ { "type":"subscriptionPromotionalOfferPrices", "id":"eyJzIjoiMTU3NTIwMTAzNCIsInQiOiJVU0EiLCJwIjoiMTAyMTIifQ" } ] } } } }

I am getting the next error:

409 Battle response: { "errors":[ { "id":"79b54fc7-0e8d-4228-99ab-4937551b5303", "status":"409", "code":"ENTITY_ERROR.RELATIONSHIP.INVALID", "title":"The provided entity includes a relationship with an invalid value", "detail":"Missing a required include subscriptionPricePoint", "source":{ "pointer":"/data/relationships/prices" } } ] }

I believe the error is a improper id for subscriptionPromotionalOfferPrices which I do not perceive.

I`m saving all ids for all costs for all pricePoints for all subscriptions in my native db and attempt to use these ids for the subscriptionPromotionalOfferPrices. I additionally tried to supply the id for every nation. If I do that, I get the identical error for every id for every nation. The offered id eyJzIjoiMTU3NTIwMTAzNCIsInQiOiJVU0EiLCJwIjoiMTAyMTIifQ references to 26.99$ value for the USA subscriptionPricePoint.

Can somebody present me a working instance for this request?

If the id is improper, can somebody inform me: The right way to question the best ids for every nation for every subscription?

I already tried https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers/{id}/costs and https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers/{id}

to fetch info for an current Promotional Supply, however I used to be not capable of fetch significant information from that endpoints.

I will modify all costs for an current subscription through API, so I am positive the IDs I take advantage of are legitimate subscriptionPricePoint ids for every nation.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments