openapi: 3.0.3 info: version: 5.13.0 title: Pinterest Billing API description: This is the description of your API. contact: name: Pinterest, Inc. url: https://developers.pinterest.com/ license: name: MIT url: https://spdx.org/licenses/MIT termsOfService: https://developers.pinterest.com/terms/ servers: - url: https://api.pinterest.com/v5 tags: - name: Billing paths: /ad_accounts/{ad_account_id}/ads_credit/discounts: get: summary: Get ads credit discounts description: 'Returns the list of discounts applied to the account. This endpoint might not be available to all apps. Learn more.' operationId: ads_credits_discounts/get security: - pinterest_oauth2: - ads:read - billing:read x-ratelimit-category: ads_read x-sandbox: disabled tags: - Billing parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/query_bookmark' - $ref: '#/components/parameters/query_page_size' responses: '200': content: application/json: schema: allOf: - $ref: '#/components/schemas/Paginated' - type: object properties: items: type: array items: $ref: '#/components/schemas/AdsCreditDiscountsResponse' description: Success default: description: Unexpected error. content: application/json: schema: $ref: '#/components/schemas/Error' /ad_accounts/{ad_account_id}/ads_credit/redeem: post: summary: Redeem ad credits description: 'Redeem ads credit on behalf of the ad account id and apply it towards billing. This endpoint might not be available to all apps. Learn more.' tags: - Billing operationId: ads_credit/redeem security: - pinterest_oauth2: - ads:write - billing:write x-ratelimit-category: ads_write x-sandbox: disabled parameters: - $ref: '#/components/parameters/path_ad_account_id' requestBody: description: Redeem ad credits request. required: true content: application/json: schema: $ref: '#/components/schemas/AdsCreditRedeemRequest' responses: '200': description: Successfully redeemed ad credits. content: application/json: schema: $ref: '#/components/schemas/AdsCreditRedeemResponse' '400': description: Error thrown when unable to redeem offer code. content: application/json: schema: $ref: '#/components/schemas/Error' examples: ValidationError: value: code: 15 message: Unable to redeem offer code. Try again later. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /ad_accounts/{ad_account_id}/billing_profiles: get: summary: Get billing profiles description: 'Get billing profiles in the advertiser account. This endpoint might not be available to all apps. Learn more.' operationId: billing_profiles/get security: - pinterest_oauth2: - ads:read - billing:read x-ratelimit-category: ads_read x-sandbox: disabled tags: - Billing parameters: - $ref: '#/components/parameters/path_ad_account_id' - description: Return active billing profiles, if false return all billing profiles. in: query name: is_active required: true schema: type: boolean - $ref: '#/components/parameters/query_bookmark' - $ref: '#/components/parameters/query_page_size' responses: '200': content: application/json: schema: allOf: - $ref: '#/components/schemas/Paginated' - type: object properties: items: type: array items: $ref: '#/components/schemas/BillingProfilesResponse' description: Success default: description: Unexpected error. content: application/json: schema: $ref: '#/components/schemas/Error' /ad_accounts/{ad_account_id}/ssio/accounts: get: summary: Get Salesforce account details including bill-to information. description: 'Get Salesforce account details including bill-to information to be used in insertion orders process for ad_account_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_accounts/get security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' responses: '200': content: application/json: schema: $ref: '#/components/schemas/SSIOAccountResponse' description: Success '400': description: Invalid request parameter. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request parameter. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing /ad_accounts/{ad_account_id}/ssio/insertion_orders: post: summary: Create insertion order through SSIO. description: 'Create insertion order through SSIO for ad_account_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_insertion_order/create security: - pinterest_oauth2: - ads:write x-ratelimit-category: ads_write x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/SSIOCreateInsertionOrderRequest' description: Order line to create. required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SSIOCreateInsertionOrderResponse' description: Success '400': description: Invalid request. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing patch: summary: Edit insertion order through SSIO. description: 'Edit insertion order through SSIO for ad_account_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_insertion_order/edit security: - pinterest_oauth2: - ads:write x-ratelimit-category: ads_write x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/SSIOEditInsertionOrderRequest' description: Order line to create. required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SSIOEditInsertionOrderResponse' description: Success '400': description: Invalid request. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing /ad_accounts/{ad_account_id}/ssio/insertion_orders/status: get: summary: Get insertion order status by ad account id. description: 'Get insertion order status for account id ad_account_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_insertion_orders_status/get_by_ad_account security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/query_bookmark' - $ref: '#/components/parameters/query_page_size' responses: '200': content: application/json: schema: allOf: - $ref: '#/components/schemas/Paginated' - type: object properties: items: description: Insertion orders status by ad acount id items: $ref: '#/components/schemas/SSIOInsertionOrderStatus' description: Success '400': description: Invalid request parameter. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request parameter. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing /ad_accounts/{ad_account_id}/ssio/insertion_orders/{pin_order_id}/status: get: summary: Get insertion order status by pin order id. description: 'Get insertion order status for pin order id pin_order_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_insertion_orders_status/get_by_pin_order_id security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/path_pin_order_id' responses: '200': content: application/json: schema: $ref: '#/components/schemas/SSIOInsertionOrderStatusResponse' description: Success '400': description: Invalid request parameter. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request parameter. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing /ad_accounts/{ad_account_id}/ssio/order_lines: get: summary: Get Salesforce order lines by ad account id. description: 'Get Salesforce order lines for account id ad_account_id. - The token''s user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via Business Access: Admin, Finance, Campaign.' operationId: ssio_order_lines/get_by_ad_account security: - pinterest_oauth2: - ads:read x-ratelimit-category: ads_read x-sandbox: enabled parameters: - $ref: '#/components/parameters/path_ad_account_id' - $ref: '#/components/parameters/query_bookmark' - $ref: '#/components/parameters/query_page_size' - $ref: '#/components/parameters/query_pin_order_id' responses: '200': content: application/json: schema: allOf: - $ref: '#/components/schemas/Paginated' - type: object properties: items: description: SSIO order lines by ad acount id items: $ref: '#/components/schemas/SSIOOrderLine' description: Success '400': description: Invalid request parameter. content: application/json: schema: $ref: '#/components/schemas/Error' example: code: 400 message: Invalid request parameter. default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Billing components: parameters: path_ad_account_id: name: ad_account_id description: Unique identifier of an ad account. in: path required: true schema: type: string pattern: ^\d+$ maxLength: 18 path_pin_order_id: description: The pin order id associated with the ssio insertion order in: path name: pin_order_id required: true schema: type: string example: 0Q01N0000015hekSVDFDC query_page_size: name: page_size description: Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. in: query required: false schema: type: integer minimum: 1 maximum: 250 default: 25 query_bookmark: name: bookmark description: Cursor used to fetch the next page of items in: query required: false schema: type: string query_pin_order_id: description: The pin order id associated with the ssio insertino order in: query name: pin_order_id required: false schema: type: string example: 0Q01N0000015hekSVDFDC schemas: BillingProfilesResponse: type: object properties: id: description: Billing ID. type: string pattern: ^\d+$ example: '12312451231' card_type: description: Type of the card. type: string enum: - UNKNOWN - VISA - MASTERCARD - AMERICAN_EXPRESS - DISCOVER - ELO example: VISA status: description: Status of the billing. type: string enum: - UNSPECIFIED - VALID - INVALID - PENDING - DELETED - SECONDARY - PENDING_SECONDARY example: INVALID advertiser_id: description: Advertiser ID of the billing. type: string pattern: ^\d+$ example: '12312451231' payment_method_brand: description: Brand of the payment method. type: string enum: - UNKNOWN - VISA - MASTERCARD - AMERICAN_EXPRESS - DISCOVER - SOFORT - DINERS_CLUB - ELO - CARTE_BANCAIRE example: VISA Error: title: Error type: object properties: code: type: integer message: type: string required: - code - message SSIOInsertionOrderCommon: type: object properties: start_date: description: 'Starting date of time period. Format: YYYY-MM-DD' type: string pattern: ^(\d{4})-(\d{2})-(\d{2})$ example: '2020-12-20' end_date: description: 'End date of time period. Format: YYYY-MM-DD' type: string pattern: ^(\d{4})-(\d{2})-(\d{2})$ example: '2020-12-20' po_number: description: The po number type: string budget_amount: type: number description: If Budget order line, the budget amount. example: 5000000 billing_contact_firstname: description: The billing contact first name type: string billing_contact_lastname: description: The billing contact last name type: string billing_contact_email: description: The billing contact email example: test@example type: string media_contact_firstname: description: The media contact first name type: string media_contact_lastname: description: The media contact last name type: string media_contact_email: description: The media contact email example: test@example type: string agency_link: description: URL link for agency type: string user_email: description: The email of user submitting the insertion order example: test@example type: string AdsCreditDiscountsResponse: type: object properties: active: description: True if the offer code is currently active. type: boolean example: true advertiser_id: description: Advertiser ID the offer was applied to. type: string pattern: ^\d+$ example: '12312451231' discountType: description: The type of discount of this credit type: string nullable: true enum: - COUPON - CREDIT - COUPON_APPLIED - CREDIT_APPLIED - MARKETING_OFFER_CREDIT - MARKETING_OFFER_CREDIT_APPLIED - GOODWILL_CREDIT - GOODWILL_CREDIT_APPLIED - INTERNAL_CREDIT - INTERNAL_CREDIT_APPLIED - PREPAID_CREDIT - PREPAID_CREDIT_APPLIED - SALES_INCENTIVE_CREDIT - SALES_INCENTIVE_CREDIT_APPLIED - CREDIT_EXPIRED - FUTURE_CREDIT - REFERRAL_CREDIT - INVOICE_SALES_INCENTIVE_CREDIT - INVOICE_SALES_INCENTIVE_CREDIT_APPLIED - PREPAID_CREDIT_REFUND - null discountInMicroCurrency: description: The discount applied in the offers currency value. type: number nullable: true example: 125000000 discountCurrency: type: string nullable: true description: Currency value for the discount. example: USD title: description: Human readable title of the offer code. type: string nullable: true example: Ads Credits remainingDiscountInMicroCurrency: type: number nullable: true description: The credits left to spend. example: 125000000 SSIOAccountPMPName: type: object properties: name: description: Display name example: Bidalgo type: string id: description: Salesforce id for PMP example: 0011N00001LW2aSQAT type: string SSIOAccountResponse: type: object properties: eligible: description: Advertiser eligible to create order lines example: true type: boolean can_edit: description: Advertiser eligible to update order lines example: true type: boolean billto_infos: type: array description: An array of Salesforce account information that includes address, io terms, etc. items: $ref: '#/components/schemas/SSIOAccountItem' currency: type: string example: USD pmp_names: type: array items: $ref: '#/components/schemas/SSIOAccountPMPName' error: description: Error indicator from Salesforce which could be "No Error" example: No Error type: string SSIOCreateInsertionOrderResponse: type: object properties: pin_order_id: description: Salesforce order id type: string SSIOInsertionOrderStatus: type: object properties: pin_order_id: description: Salesforce order id example: 0Q01N0000015hekSAB type: string status: description: Salesforce insertion order status example: Approved type: string creation_time: description: Salesforce insertion order creation time example: '2017-06-21T23:11:11.000Z' type: string nullable: true SSIOCreateInsertionOrderRequest: type: object allOf: - $ref: '#/components/schemas/SSIOInsertionOrderCommon' - type: object required: - order_line_type - start_date - po_number - pmp_id - order_name - media_contact_firstname - media_contact_lastname - media_contact_email - currency_info - billto_company_id - billto_business_address_id - billto_billing_address_id - billing_contact_firstname - billing_contact_lastname - billing_contact_email - accepted_terms_id properties: accepted_terms_time: description: The UTC timestamp (to the nearest sec) of when terms were accepted type: integer pmp_id: description: The pmp id type: string order_name: description: The order name type: string order_line_type: type: string description: Type can be Budget or Perpetual enum: - BUDGET - PERPETUALS accepted_terms_id: description: The SFDC id for the terms type: string billto_company_id: description: The bill-to company id type: string billto_business_address_id: description: The bill-to business address id type: string billto_billing_address_id: description: The bill-to billing address id type: string estimated_monthly_spend: description: If Ongoing (perpetual) order line, the estimated monthly spend type: number currency_info: $ref: '#/components/schemas/Currency' SSIOOrderLine: type: object properties: salesforce_order_line_id: description: OrderLineId in SFDC type: string nullable: true ads_manager_order_line_id: description: Ads manager OrderLineId type: string nullable: true pin_order_id: description: The pin order id associated with the order line in SFDC type: string nullable: true last_modified_date_time: description: Last modified date. example: '2020-10-06T13:07:04.000Z' type: string pattern: ^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$ nullable: true start_date: description: Start date of the order line. example: '2018-03-01' type: string format: date nullable: true end_date: description: End date of the order line. example: '2020-10-05' type: string format: date nullable: true bill_to_company_name: description: Bill To Company name example: Home Depot Inc. type: string nullable: true billing_contact_firstname: description: Billing contact first name example: Mary type: string nullable: true billing_contact_lastname: description: Billing contact last name example: Smith type: string nullable: true billing_contact_email: description: Billing contact email example: mail@test.com type: string nullable: true media_contact_email: description: Billing media email example: mail@test.com type: string nullable: true media_contact_firstname: description: Billing contact first name example: John type: string nullable: true media_contact_lastname: description: Billing contact first name example: Doe type: string nullable: true currency_info: $ref: '#/components/schemas/Currency' nullable: true agency_link: description: Agency link example: '' type: string nullable: true po_number: description: The po number type: string nullable: true order_name: description: The order name type: string nullable: true pmp_name: description: The Pinterest marketing partner name type: string nullable: true accepted_terms_id: description: The SFDC id for the terms type: string nullable: true accepted_terms_time: description: The UTC timestamp (to the nearest sec) of when terms were accepted example: '2020-10-06T13:07:04.000Z' type: string pattern: ^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$ nullable: true budget_amount: type: number description: If Budget order line, the budget amount. example: 5000000 nullable: true estimated_monthly_spend: description: If Ongoing (perpetual) order line, the estimated monthly spend type: number nullable: true Paginated: type: object properties: items: type: array items: type: object bookmark: type: string nullable: true required: - items Currency: type: string description: Currency Codes from ISO 4217 example: USD enum: - UNK - USD - GBP - CAD - EUR - AUD - NZD - SEK - ILS - CHF - HKD - JPY - SGD - KRW - NOK - DKK - PLN - RON - HUF - CZK - BRL - MXN - ARS - CLP - COP SSIOInsertionOrderStatusResponse: allOf: - $ref: '#/components/schemas/SSIOInsertionOrderStatus' - type: object AdsCreditRedeemResponse: type: object properties: success: description: Returns true if the offer code was successfully applied(validateOnly=false) or can be applied(validateOnly=true). type: boolean example: false errorCode: description: Error code type if error occurs type: integer nullable: true example: 2708 errorMessage: description: Reason for failure type: string nullable: true example: The offer has already been redeemed by this advertiser SSIOAccountAddress: type: object properties: display: description: Address display example: 475 Brannan Street, San Francisco, CA 94103 type: string purpose: description: Purpose for which the address is used, usually Billing or Businness example: Billing type: string address_id: description: Salesforce id for address example: a1C1N000004MUrLUAW type: string order_legal_entity: description: Legal entity for this insertion order example: PIN US OU type: string SSIOEditInsertionOrderRequest: type: object allOf: - $ref: '#/components/schemas/SSIOInsertionOrderCommon' - type: object properties: oracle_line_id: description: LineId in the Oracle DB type: string salesforce_order_id: description: OrderId in SFDC type: string salesforce_order_line_id: description: OrderLineId in SFDC type: string ads_manager_order_line_id: description: Ads manager OrderLineId type: string AdsCreditRedeemRequest: type: object required: - offerCodeHash - validateOnly properties: offerCodeHash: description: Takes in a SHA256 hash of the offerCode. example: 138e9e0ff7e38cf511b880975eb574c09aa9d5e1657590ab0431040da68caa67 type: string pattern: ^[a-z0-9]*$ validateOnly: description: If true, only validate if we can redeem offer code. Otherwise it will actually apply the offer code to the account example: true type: boolean SSIOAccountItem: type: object properties: id: description: Salesforce id for billto_info example: 0011N00001LW8kAQAT type: string io_terms_id: description: Salesforce id for IO Terms and Conditions example: a2S1N000000bKHgUAM type: string io_terms: description: Salesforce text for IO Terms and Conditions example: The IO is governed by the terms available at https://business.pinterest.com/en/pinterest-advertising-services-agreement/. If a budget is listed on this IO, the parties agree that Advertiser (or if applicable, its Agency) may apply any of the budget to any auction bid type or ad product. Price will be determined by auction closing price, plus any applicable non-auction fees. The terms of the Agreement supersede any terms on this IO. ANY ADDITIONAL TERMS AND CONDITIONS ON THIS IO ARE NULL AND VOID. type: string us_terms_id: description: Salesforce id for US Terms and Conditions example: a2S1N000000bKIOUA2 type: string us_terms: description: Salesforce text for US Terms and Conditions example: This Insertion Order ("IO") is subject to the Pinterest Addendum To IAB Standard Terms and Conditions for Internet Advertising For Media Buys One Year or Less (Version 3.0), as executed by Pinterest, Inc. and GroupM Worldwide LLC on May 7, 2014 and Amendment No. 1 to Pinterest Addendum to IAB Standard Terms and Conditions for Internet Advertising For Media Buys One Year or Less (Version 3.0) as executed by Pinterest, Inc. and GroupM Worldwide LLC on August 20, 2015. The parties agree that Agency may apply any of the budget listed on this IO to any auction bid type or ad product. Price will be determined by auction closing price, plus any applicable non-auction fees.The terms of the Addendum supersede any terms on this IO. ANY ADDITIONAL TERMS AND CONDITIONS ON THIS IO ARE NULL AND VOID. type: string row_terms_id: description: Salesforce id for Rest of the World Terms and Conditions example: a2S1N000000bKHhUAM type: string row_terms: description: Salesforce text for Rest of the World Terms and Conditions example: "The IO is governed by the terms available at\r\nhttps://business.pinterest.com/en-gb/pinterest-advertising-services-agreement" type: string io_type: description: Insertion Order Type - Pinterest Paper or Agency Paper example: Pinterest Paper type: string addresses: description: Address information that is associated with this account. type: array items: $ref: '#/components/schemas/SSIOAccountAddress' SSIOEditInsertionOrderResponse: type: object properties: pin_order_id: description: Salesforce order id type: string securitySchemes: pinterest_oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://www.pinterest.com/oauth/ tokenUrl: https://api.pinterest.com/v5/oauth/token scopes: ads:read: See all of your advertising data, including ads, ad groups, campaigns etc. ads:write: Create, update, or delete ads, ad groups, campaigns etc. billing:read: See all of your billing data, billing profile, etc. billing:write: Create, update, or delete billing data, billing profiles, etc. biz_access:read: See business access data biz_access:write: Create, update, or delete business access data boards:read: See your public boards, including group boards you join boards:read_secret: See your secret boards boards:write: Create, update, or delete your public boards boards:write_secret: Create, update, or delete your secret boards catalogs:read: See all of your catalogs data catalogs:write: Create, update, or delete your catalogs data pins:read: See your public Pins pins:read_secret: See your secret Pins pins:write: Create, update, or delete your public Pins pins:write_secret: Create, update, or delete your secret Pins user_accounts:read: See your user accounts and followers user_accounts:write: Update your user accounts and followers conversion_token: type: http scheme: bearer description: This security scheme only applies to the conversion events endpoint (POST /ad_accounts/{ad_account_id}/events). This endpoint requires a bearer token generated via Ads Manager (ads.pinterest.com). basic: type: http scheme: basic x-tagGroups: - name: Pin and Boards tags: - pins - boards - media - aggregated_comments - aggregated_pin_data - user_account - name: Campaign Management tags: - ad_accounts - campaigns - ad_groups - ads - product_group_promotions - bulk - name: Targeting tags: - audiences - customer_lists - keywords - targeting_template - audience_insights - audience_sharing - name: Ad Formats tags: - lead_forms - lead_ads - leads_export - name: Billing tags: - billing - order_lines - terms_of_service - name: Business Access tags: - business_access_assets - business_access_invite - business_access_relationships - name: Conversions tags: - conversion_events - conversion_tags - name: Others tags: - integrations - oauth - resources - search - terms - name: Shopping tags: - catalogs - name: Deprecated tags: - product_groups